/* ─────────────────────────────────────────────────────────────────
   Adjacency · Parti Creator — the v10 · Apparat BEACHHEAD.

   The first live v10 surface inside the app. To keep
   the paradigm shift contained and leak-proof, the v10 grammar is declared
   on the `.adj-parti` SCOPE — NOT on :root — so none of it touches the rest
   of the app. Tokens + primitive treatments are derived from
   css/arrange-v10-apparat.css (the canonical system); when the whole app
   adopts v10 this island merges into it. Grammar: three peer primitives —
   cut (depression), puck (raised operable), zone (tonal region) — under one
   light source (above-front), color = state only (oxide enamels).
   ───────────────────────────────────────────────────────────────── */

.adj-parti {
  /* Field + ink (scoped — do not promote to :root) */
  --p-field: #fbfaf6;
  --p-field-2: #f3f1ec;
  --p-field-3: #ebe9e2;
  --p-ink: #1c1b18;
  --p-ink-2: #4a4842;
  --p-ink-3: #8a877f;
  --p-rule: rgba(20, 18, 14, 0.16);
  --p-rule-soft: rgba(20, 18, 14, 0.08);
  /* Cut depth — inset shadow only, interior stays field color */
  --p-cut-rim: rgba(0, 0, 0, 0.22);
  --p-cut-rim-light: rgba(255, 255, 255, 0.55);
  /* Oxide enamels — state only */
  --p-cobalt: #3a4f72;   /* informs  → priority   */
  --p-vermilion: #9c4338;/* warns    → required    */
  --p-emerald: #3b6850;  /* confirms → active      */
  --p-amethyst: #5e4670; /* categorizes → zones    */
  --p-gold: #957532;
  --p-trace: #f6edd2;
  --p-cobalt-soft: rgba(58, 79, 114, 0.12);
  --p-vermilion-soft: rgba(156, 67, 56, 0.12);
  --p-amethyst-soft: rgba(94, 70, 112, 0.12);

  background: var(--p-field-2);
  color: var(--p-ink);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 220px;
  gap: 14px;
  font-family: "Inter", "Helvetica Neue", Helvetica, system-ui, sans-serif;
  align-items: start;
}

/* The Parti is paper-like, not permanently light. Its contrast follows the
   app theme while retaining the same ink/trace hierarchy. */
body:not(.light-theme) .adj-parti {
  --p-field: #17191b;
  --p-field-2: #101214;
  --p-field-3: #222529;
  --p-ink: #f1f0eb;
  --p-ink-2: #c9c7bf;
  --p-ink-3: #929590;
  --p-rule: rgba(255, 255, 255, 0.18);
  --p-rule-soft: rgba(255, 255, 255, 0.08);
  --p-cut-rim: rgba(0, 0, 0, 0.58);
  --p-cut-rim-light: rgba(255, 255, 255, 0.09);
  --p-cobalt: #89a9d6;
  --p-vermilion: #df796d;
  --p-emerald: #79ad8d;
  --p-amethyst: #aa8fc0;
  --p-gold: #c3a65f;
  --p-trace: #332f24;
  --p-cobalt-soft: rgba(137, 169, 214, 0.16);
  --p-vermilion-soft: rgba(223, 121, 109, 0.15);
  --p-amethyst-soft: rgba(170, 143, 192, 0.16);
}

/* Paper — the calm working surface a level above the field */
.adj-parti__paper {
  background: var(--p-field);
  border: 1px solid var(--p-rule-soft);
  border-radius: 8px;
  padding: 12px;
}
.adj-parti__title { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--p-ink-2); margin: 0 0 10px; border-bottom: 1px solid var(--p-rule-soft); padding-bottom: 4px; }
.adj-parti__hint { font-size: 11px; line-height: 1.5; color: var(--p-ink-3); margin: 8px 0 0; }

/* ── Tool rail: Type-A pucks (operate from a cut address) ── */
.adj-parti__tools { display: flex; flex-direction: column; gap: 6px; }
.adj-parti-puck {
  appearance: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 12px; color: var(--p-ink);
  background: linear-gradient(var(--p-field), var(--p-field-2));
  border: 1px solid var(--p-rule);
  border-radius: 7px; padding: 8px 10px;
  box-shadow: 0 1px 0 var(--p-cut-rim-light) inset, 0 1px 2px rgba(0,0,0,0.12);
  display: flex; align-items: center; gap: 8px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.adj-parti-puck:hover { transform: translateY(-1px); }
.adj-parti-puck:active { transform: translateY(0); box-shadow: 0 1px 1px rgba(0,0,0,0.18) inset; }
.adj-parti-puck.is-active {
  border-color: var(--p-cobalt);
  box-shadow: 0 0 0 2px var(--p-cobalt-soft), 0 1px 0 var(--p-cut-rim-light) inset;
}
.adj-parti-puck__glyph { width: 16px; height: 16px; flex: none; opacity: 0.8; }

/* ── The sheet rail: the trace stack on the desk ──────────────────
   One torn tab per sheet of trace. The working sheet reads as canary
   yellow trace held down with tape; the base chip toggles the underlay
   (site plot / the solved scheme) ghosting through. */
.pf-sheets { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end; margin-bottom: 8px; }
.pf-sheet-tab {
  appearance: none; cursor: pointer; font: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--p-ink-2); background: var(--p-field);
  border: 1px solid var(--p-rule); border-bottom-color: var(--p-rule-soft);
  padding: 5px 10px 6px; position: relative;
  border-radius: 5px 5px 2px 2px;
  transform: rotate(var(--pf-rot, 0deg));
  transform-origin: 50% 100%;
  /* the torn top edge of a sheet pulled off the roll */
  clip-path: polygon(0 22%, 7% 8%, 18% 16%, 33% 4%, 49% 12%, 64% 2%, 79% 12%, 91% 6%, 100% 18%, 100% 100%, 0 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 120ms ease;
}
.pf-sheet-tab:hover { transform: rotate(var(--pf-rot, 0deg)) translateY(-1px); }
.pf-sheet-tab.is-active {
  background: var(--p-trace); /* canary trace, theme-adjusted */
  border-color: var(--p-gold); color: var(--p-ink);
  box-shadow: 0 0 0 2px rgba(149, 117, 50, 0.14), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.pf-sheet-tab.is-base {
  clip-path: none; border-radius: 6px; font-weight: 500; color: var(--p-ink-3);
  border-style: dashed;
}
.pf-sheet-tab.is-base.is-on { color: var(--p-cobalt); border-color: var(--p-cobalt); border-style: solid; }
.pf-sheet-tab.is-pull { clip-path: none; border-radius: 6px; border-style: dashed; color: var(--p-cobalt); }
.pf-sheet-tab.is-pull:hover { border-style: solid; }
.pf-sheet-tab.is-tear { clip-path: none; border-radius: 6px; border-style: dashed; color: var(--p-ink-3); margin-left: auto; }
.pf-sheet-tab.is-tear:hover { color: var(--p-vermilion); border-color: var(--p-vermilion); border-style: solid; }

/* ── Canvas (SVG field) ── */
.adj-parti__stage { position: relative; }
.adj-parti-svg { width: 100%; height: auto; display: block; border-radius: 6px; background: var(--p-field); border: 1px solid var(--p-rule-soft); touch-action: none; }
.adj-parti-svg[data-phase="sketch"] { cursor: crosshair; }
.adj-parti-svg .pf-capture { cursor: crosshair; }
/* Freehand marks — the loose, non-executable remainder */
.adj-parti-svg .pf-stroke { pointer-events: none; }
.adj-parti-svg .pf-stroke--pen { stroke: var(--p-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.adj-parti-svg .pf-stroke--pencil { stroke: var(--p-ink-3); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.adj-parti-svg .pf-stroke--marker { fill: var(--p-amethyst-soft); stroke: var(--p-amethyst); stroke-width: 1; stroke-opacity: 0.55; }
.adj-parti-svg .pf-stroke--hatch { stroke: var(--p-amethyst); stroke-width: 0.8; stroke-opacity: 0.6; }
.adj-parti-svg .pf-stroke--path { stroke: var(--p-cobalt); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.adj-parti-svg .pf-stroke--court { stroke: var(--p-gold); stroke-width: 1.6; stroke-linejoin: round; }
.adj-parti-svg .pf-stroke--threshold { stroke: var(--p-emerald); stroke-width: 2.2; stroke-linecap: round; }
.adj-parti-svg .pf-stroke--service { stroke: var(--p-vermilion); stroke-width: 1.8; stroke-linecap: round; }
.adj-parti-svg .pf-stroke--pin { stroke: var(--p-cobalt); stroke-width: 2.4; stroke-linecap: round; }
.adj-parti-svg .pf-stroke--gradient { stroke: var(--p-ink-3); stroke-width: 1.4; stroke-dasharray: 1 3; stroke-linecap: round; }
.adj-parti-svg .pf-stroke.is-dim { opacity: 0.25; }
.adj-parti-svg .pf-stroke.is-highlighted { filter: drop-shadow(0 0 2px var(--p-cobalt)); }
.adj-parti-svg .pf-live { pointer-events: none; stroke: var(--p-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.adj-parti-svg .pf-live.pf-stroke--pencil { stroke: var(--p-ink-3); stroke-width: 1.2; }
.adj-parti-svg .pf-live.pf-stroke--marker { fill: var(--p-amethyst-soft); stroke: var(--p-amethyst); stroke-width: 1; }
.adj-parti-svg .pf-live.pf-stroke--hatch { stroke: var(--p-amethyst); stroke-width: 0.8; }
.adj-parti-svg .pf-live.pf-stroke--path { stroke: var(--p-cobalt); stroke-width: 2; }
.adj-parti-svg .pf-live.pf-stroke--court { stroke: var(--p-gold); stroke-width: 1.6; }
.adj-parti-svg .pf-live.pf-stroke--threshold { stroke: var(--p-emerald); stroke-width: 2.2; }
.adj-parti-svg .pf-live.pf-stroke--service { stroke: var(--p-vermilion); stroke-width: 1.8; }
.adj-parti-svg .pf-live.pf-stroke--pin { stroke: var(--p-cobalt); stroke-width: 2.4; }
.adj-parti-svg .pf-live.pf-stroke--gradient { stroke: var(--p-ink-3); stroke-width: 1.4; stroke-dasharray: 1 3; }
.adj-parti-svg .pf-grid { stroke: var(--p-rule-soft); stroke-width: 0.5; }
.adj-parti-svg .pf-plot { fill: none; stroke: var(--p-rule); stroke-width: 1; }
/* Zone — flat tonal region, no depth, no border (v10) */
.adj-parti-svg .pf-zone { fill: var(--p-amethyst-soft); }
.adj-parti-svg .pf-court { fill: var(--p-field-3); }
/* Cut — corridor channel; interior = field, depth via inset rim filter */
.adj-parti-svg .pf-cut { fill: var(--p-field-3); stroke: var(--p-cut-rim); stroke-width: 0.6; filter: url(#pf-inset); }
.adj-parti-svg .pf-cut.is-primary { stroke: var(--p-cut-rim); stroke-width: 1; }
/* Puck — raised token with top highlight / bottom shadow */
.adj-parti-svg .pf-puck { filter: url(#pf-raise); }
.adj-parti-svg .pf-puck-face { fill: var(--p-field); stroke: var(--p-rule); stroke-width: 0.6; }
/* State rings (force = oxide) */
.adj-parti-svg .is-priority { stroke: var(--p-cobalt); }
.adj-parti-svg .is-required { stroke: var(--p-vermilion); }
/* A joint whose corridor got deleted/re-read out from under it — same
   vermilion "needs attention" the force ring already uses elsewhere. */
.adj-parti-svg .pf-puck.is-orphaned .pf-puck-face { stroke: var(--p-vermilion); stroke-width: 1; }
.adj-parti-svg .pf-label { fill: var(--p-ink-2); font-size: 4px; font-family: inherit; }
.adj-parti-svg .pf-edge-active { stroke: var(--p-emerald); stroke-width: 2; }
/* Ink-it "seats": permanent ink presses down and stops dead — no bounce,
   no overshoot past rest, the opposite motion vocabulary from a reading's
   drift-and-settle. Reused verbatim for the joint puck (item 7). */
@keyframes pfCutCarve { from { filter: none; } to { filter: url(#pf-inset); } }
.adj-parti-svg .pf-cut.is-just-inked, .adj-parti-svg .pf-zone.is-just-inked, .adj-parti-svg .pf-court.is-just-inked {
  animation: pfCutCarve 260ms cubic-bezier(.2, .8, .4, 1);
}
@keyframes pfPuckSeat { from { transform: scale(1.3); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.adj-parti-svg .pf-puck.is-just-inked { animation: pfPuckSeat 220ms cubic-bezier(.2, .8, .4, 1); transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) {
  .adj-parti-svg .pf-cut.is-just-inked, .adj-parti-svg .pf-zone.is-just-inked,
  .adj-parti-svg .pf-court.is-just-inked, .adj-parti-svg .pf-puck.is-just-inked { animation: none; }
}

/* ── The trace stack, rendered ────────────────────────────────────
   Canary tint = the working sheet itself; tape holds it down; the
   sheets below onion-skin through it; the scheme ghost is the plan
   slid under the whole stack. */
.adj-parti-svg .pf-tint { fill: #e8c766; fill-opacity: 0.055; pointer-events: none; }
.adj-parti-svg .pf-tape { fill: var(--p-gold); fill-opacity: 0.26; stroke: var(--p-gold); stroke-opacity: 0.18; stroke-width: 0.4; pointer-events: none; }
.adj-parti-svg .pf-under { pointer-events: none; filter: saturate(0.6); }
.adj-parti-svg .pf-ghost { pointer-events: none; opacity: 0.5; }
.adj-parti-svg .pf-ghost-room { fill: var(--p-field-3); stroke: var(--p-rule-soft); stroke-width: 0.5; }
.adj-parti-svg .pf-ghost-circ { fill: var(--p-cobalt-soft); stroke: none; }
/* The live sketch ghost — same three-state vocabulary as a hand-drawn mark,
   applied per room instead of per stroke. Ink = settled/confident (most
   present), pencil = still resettling/under tension (dashed, fainter, same
   grammar as .is-ghosted), held = a requirement the preview can't satisfy
   (vermilion, same "needs attention" oxide as an orphaned joint). */
.adj-parti-svg .pf-live-ghost { pointer-events: none; opacity: var(--pf-room-opacity, 0.45); transition: opacity 140ms ease; }
.adj-parti-svg .pf-live-room { fill: var(--p-field-3); stroke: var(--p-rule-soft); stroke-width: 0.6; }
.adj-parti-svg .pf-live-room.is-ink { opacity: 0.62; }
.adj-parti-svg .pf-live-room.is-pencil { opacity: 0.4; stroke-dasharray: 3 2; }
.adj-parti-svg .pf-live-room.is-held { opacity: 0.28; stroke: var(--p-vermilion); stroke-dasharray: 1 2; }
.adj-parti-svg .pf-scene-logic { pointer-events: none; opacity: var(--pf-reading-opacity, 1); transition: opacity 180ms ease; }
.adj-parti-svg .pf-scene-path {
  fill: none; stroke: var(--p-cobalt); stroke-width: 8; stroke-linecap: round;
  stroke-linejoin: round; opacity: 0.09;
}
.adj-parti-svg .pf-scene-path.is-primary { stroke-width: 12; opacity: 0.12; }
.adj-parti-svg .pf-scene-region { stroke-width: 1.2; opacity: 0.22; }
.adj-parti-svg .pf-scene-region.is-court { fill: var(--p-gold-soft); stroke: var(--p-gold); }
.adj-parti-svg .pf-scene-region.is-zone { fill: var(--p-amethyst-soft); stroke: var(--p-amethyst); stroke-dasharray: 3 2; }
.adj-parti-svg .pf-scene-logic.is-forming .pf-scene-path,
.adj-parti-svg[data-scene-state="forming"] .pf-live { stroke-dasharray: 4 2; }
.adj-parti-svg .pf-scene-logic.is-stable .pf-scene-path { opacity: 0.16; }
.adj-parti-svg .pf-scene-logic.is-open .pf-scene-path { stroke-dasharray: 5 3; opacity: 0.12; }
.adj-parti-svg .pf-scene-band { stroke: var(--p-cobalt); stroke-opacity: 0.08; stroke-linecap: square; }
.adj-parti-svg .pf-scene-junction { fill: var(--p-field); stroke: var(--p-cobalt); stroke-width: 0.9; }
.adj-parti-svg .pf-stroke:not(.is-dim) { opacity: var(--pf-trace-opacity, 1); transition: opacity 140ms ease; }
.adj-parti-svg .pf-under { opacity: var(--pf-trace-opacity, 1); }
.adj-parti-svg .pf-lasso { stroke: var(--p-gold); stroke-width: 1.2; stroke-dasharray: 4 3; fill: rgba(149, 117, 50, 0.06); }
.adj-parti-svg .pf-stroke.is-held { opacity: 0.45; }
/* Compound-group "gather": member strokes pulse once when a chain of
   separate strokes first resolves into one shared reading. */
@keyframes pfMarkPulse { 50% { filter: drop-shadow(0 0 3px var(--p-cobalt)); } }
.adj-parti-svg .pf-stroke.is-just-read { animation: pfMarkPulse 800ms ease-in-out; }
@media (prefers-reduced-motion: reduce) { .adj-parti-svg .pf-stroke.is-just-read { animation: none; } }
/* Inferred ink (text → parti) is pencil until confirmed */
.adj-parti-svg .is-ghosted { stroke-dasharray: 4 3; opacity: 0.8; }

/* The card footer: one line of notation derived from the ink */
.pf-notation {
  margin: 8px 0 0; font-size: 11px; letter-spacing: 0.02em;
  font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  color: var(--p-ink-2);
  border-top: 1px solid var(--p-rule-soft); padding-top: 7px;
}
.pf-status { color: var(--p-emerald); font-weight: 600; }

/* A first-time user has no reason to know why some marks look thin/faded/
   raised without watching the feature get built — one static caption. */
.pf-legend { opacity: 0.85; }

/* ── The reading: inferred = fluid (dashed cobalt), unread = offer,
   held = remainder at full dignity ── */
.pf-scene-reading {
  position: relative; overflow: hidden;
  border: 1px solid var(--p-rule-soft); border-radius: 9px;
  background: linear-gradient(145deg, var(--p-field), var(--p-field-2));
  padding: 12px 13px 11px; margin-bottom: 12px;
  box-shadow: 0 1px 0 var(--p-cut-rim-light) inset;
}
.pf-morph {
  display: grid; grid-template-columns: auto minmax(90px, 1fr) auto auto;
  gap: 7px; align-items: center; margin: 7px 0 8px;
  color: var(--p-ink-3); font-size: 9.5px; letter-spacing: 0.03em;
}
.pf-morph input { width: 100%; accent-color: var(--p-cobalt); }
.pf-morph output { min-width: 30px; text-align: right; color: var(--p-ink-2); font-variant-numeric: tabular-nums; }
.pf-scene-reading.is-forming { border-color: color-mix(in srgb, var(--p-cobalt) 52%, var(--p-rule-soft)); }
.pf-scene-reading.is-stable { border-color: color-mix(in srgb, var(--p-emerald) 52%, var(--p-rule-soft)); }
.pf-scene-reading.is-open { border-color: color-mix(in srgb, var(--p-gold) 52%, var(--p-rule-soft)); }
.pf-scene-reading__eyebrow {
  display: block; margin-bottom: 5px; color: var(--p-ink-3);
  font-size: 9px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
}
.pf-scene-reading strong { display: block; color: var(--p-ink); font-size: 15px; line-height: 1.3; font-weight: 560; }
.pf-scene-reading p { margin: 6px 0 0; color: var(--p-ink-2); font-size: 11.5px; line-height: 1.45; }
.pf-scene-reading__pulse { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--p-ink-3); font-size: 9.5px; }
.pf-scene-reading__pulse i { width: 6px; height: 6px; border-radius: 50%; background: var(--p-rule); }
.pf-scene-reading.is-forming .pf-scene-reading__pulse i { background: var(--p-cobalt); animation: pfSceneBreathe 1.3s ease-in-out infinite; }
.pf-scene-reading.is-stable .pf-scene-reading__pulse i { background: var(--p-emerald); }
.pf-scene-reading.is-open .pf-scene-reading__pulse i { background: var(--p-gold); }
@keyframes pfSceneBreathe { 50% { opacity: 0.35; transform: scale(0.72); } }
@media (prefers-reduced-motion: reduce) { .pf-scene-reading.is-forming .pf-scene-reading__pulse i { animation: none; } }

/* Legacy chip rules remain for older saved markup during migration; the
   current renderer no longer emits per-mark confirmation chips. */
.pf-chips {
  /* A busy sketch (or a rectangle re-drawn as separate strokes a few times)
     can produce a long chip list — cap it so the reading pane never pushes
     the rest of the right column out of reach. */
  max-height: 420px;
  overflow-y: auto;
}
.pf-held-nudge {
  font-size: 11px; color: var(--p-ink-3); margin: 0 0 6px; padding: 0 2px;
}
.pf-chip {
  border: 1px solid var(--p-rule); border-radius: 7px;
  background: var(--p-field); padding: 8px 10px; margin-bottom: 6px;
  font-size: 12px; line-height: 1.45; color: var(--p-ink);
}
.pf-chip__who {
  display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 2px; color: var(--p-ink-3);
}
.pf-chip.is-inferred { border-style: dashed; border-color: var(--p-cobalt); }
.pf-chip.is-inferred .pf-chip__who { color: var(--p-cobalt); }
/* Tentative (confidence < 0.65, the same threshold that flips the "reads
   as" / "could be" wording) reads as dotted — a step less sure than the
   dashed default. */
.pf-chip.is-inferred.is-tentative { border-style: dotted; }
.pf-chip.is-unread { border-style: dashed; }
.pf-chip.is-held { background: var(--p-field-2); color: var(--p-ink-2); }
.pf-chip.is-held .pf-chip__who { color: var(--p-gold); }
.pf-chip__count { color: var(--p-cobalt); font-weight: 700; }
.pf-chip__acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pf-chip__acts button {
  appearance: none; cursor: pointer; font: inherit; font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--p-cobalt); background: var(--p-field); color: var(--p-cobalt);
}
.pf-chip__acts button:hover { background: var(--p-cobalt); color: #fff; }
/* Primary reading action: solid and unmissable when a legacy chip is shown. */
.pf-chip__acts button.is-primary { background: var(--p-cobalt); color: #fff; }
.pf-chip__acts button.is-primary:hover { background: #2d3f5c; }
/* Alternate (reclassify): outline only, same weight as primary otherwise —
   a live action, not a dismissal, so it must not look like Hold. */
.pf-chip__acts button.is-alt { font-weight: 600; }
.pf-chip__acts button.is-alt:hover { background: var(--p-cobalt-soft); color: var(--p-cobalt); }
/* Hold/Unhold: quietest action, pushed to the far right so it never
   competes visually with the primary reading or its alternates. */
.pf-chip__acts button.is-quiet { border-color: var(--p-rule); color: var(--p-ink-3); font-weight: 500; margin-left: auto; }
.pf-chip__acts button.is-quiet:hover { background: var(--p-field-2); color: var(--p-ink-2); }

/* ── Reading motion: provisional drifts and settles (soft ease); ink
   presses down and stops dead (fast-out, no bounce) — never the reverse. ── */
@keyframes pfChipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pfChipSettle { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 2px var(--p-cobalt-soft); } }
.pf-chip.is-fresh { animation: pfChipIn 180ms ease-out; }
.pf-chip.is-settling { animation: pfChipSettle 500ms ease-in-out; }
@media (prefers-reduced-motion: reduce) {
  .pf-chip.is-fresh, .pf-chip.is-settling { animation: none; }
}

/* ── Element list: cuts holding each confirmed projection ── */
.adj-parti__list { display: flex; flex-direction: column; gap: 6px; }
.adj-parti-row {
  background: var(--p-field-2);
  border: 1px solid var(--p-rule-soft);
  border-radius: 6px; padding: 7px 8px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06) inset;
}
.adj-parti-row.is-selected { box-shadow: 0 0 0 1.5px var(--p-cobalt) inset; }
.adj-parti-row.is-orphaned { border-color: var(--p-vermilion); }
.adj-parti-row.is-orphaned .adj-parti-row__meta { color: var(--p-vermilion); }
@keyframes pfRowSeat {
  from { transform: scale(1.02); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
  to { transform: scale(1); box-shadow: 0 1px 2px rgba(0,0,0,0.06) inset; }
}
.adj-parti-row.is-just-inked { animation: pfRowSeat 220ms cubic-bezier(.2, .8, .4, 1); }
@media (prefers-reduced-motion: reduce) { .adj-parti-row.is-just-inked { animation: none; } }
.adj-parti-row__name { font-size: 12px; font-weight: 500; }
.adj-parti-row__meta { font-size: 10px; color: var(--p-ink-3); }
.adj-parti-row > div { min-width: 0; }
.adj-parti-row > div:last-child { flex-wrap: wrap; justify-content: flex-end; }
.adj-parti-row__name,
.adj-parti-row__meta { overflow-wrap: anywhere; }
.adj-parti-seg { display: inline-flex; border: 1px solid var(--p-rule); border-radius: 5px; overflow: hidden; }
.adj-parti-seg button { appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 10px; padding: 3px 6px; background: var(--p-field); color: var(--p-ink-3); }
.adj-parti-seg button.is-on { color: #fff; }
.adj-parti-seg button.is-on[data-force="priority"] { background: var(--p-cobalt); }
.adj-parti-seg button.is-on[data-force="required"] { background: var(--p-vermilion); }
.adj-parti-seg button.is-on[data-force="consider"] { background: var(--p-ink-3); }
.adj-parti-mini { appearance: none; cursor: pointer; font: inherit; font-size: 10px; padding: 3px 6px; border: 1px solid var(--p-rule); border-radius: 5px; background: var(--p-field); color: var(--p-ink-2); }
.adj-parti-mini:hover { border-color: var(--p-cobalt); color: var(--p-cobalt); }
.adj-parti-row__del { appearance: none; border: 0; background: transparent; color: var(--p-ink-3); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.adj-parti-row__del:hover { color: var(--p-vermilion); }
.adj-parti-row select { font: inherit; font-size: 11px; border: 1px solid var(--p-rule); border-radius: 4px; background: var(--p-field); color: var(--p-ink); padding: 2px 4px; max-width: 100%; }

/* Activate — Type-B puck (persistent state, state ring) */
.adj-parti__activate {
  appearance: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
  width: 100%; margin-top: 8px; padding: 9px; border-radius: 7px;
  border: 1px solid var(--p-rule); background: var(--p-field); color: var(--p-ink);
  box-shadow: 0 1px 0 var(--p-cut-rim-light) inset, 0 1px 2px rgba(0,0,0,0.12);
}
.adj-parti__activate.is-on { background: var(--p-emerald); color: #fff; border-color: var(--p-emerald); box-shadow: 0 0 0 2px rgba(59,104,80,0.18); }
.adj-parti__empty { font-size: 11px; color: var(--p-ink-3); padding: 8px; text-align: center; }

/* Text → parti composer */
.adj-parti-t2p { background: var(--p-field-2); border: 1px solid var(--p-rule-soft); border-radius: 7px; padding: 10px; margin-bottom: 10px; }
.adj-parti-t2p__prompt { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 12px; border: 1px solid var(--p-rule); border-radius: 6px; padding: 7px; background: var(--p-field); color: var(--p-ink); margin-bottom: 8px; }
.adj-parti-t2p__cfg { margin-top: 8px; font-size: 11px; color: var(--p-ink-2); }
.adj-parti-t2p__cfg summary { cursor: pointer; color: var(--p-ink-3); }
.adj-parti-t2p__cfg label { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 10px; color: var(--p-ink-3); }
.adj-parti-t2p__cfg input { font: inherit; font-size: 11px; border: 1px solid var(--p-rule); border-radius: 5px; padding: 4px 6px; background: var(--p-field); color: var(--p-ink); }

/* Folded-in site pickers (arrival/service/north), scoped to the Parti field. */
.adj-parti__site { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.adj-parti .adj-site-pick { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; }
.adj-parti .adj-site-pick > span { font-size: 11px; color: var(--p-ink-2); }
.adj-parti .adj-seg { display: inline-flex; border: 1px solid var(--p-rule); border-radius: 6px; overflow: hidden; }
.adj-parti .adj-seg button { appearance: none; border: 0; border-left: 1px solid var(--p-rule-soft); cursor: pointer; font: inherit; font-size: 10px; padding: 4px 7px; background: var(--p-field); color: var(--p-ink-3); }
.adj-parti .adj-seg button:first-child { border-left: 0; }
.adj-parti .adj-seg button.is-active { background: var(--p-cobalt); color: #fff; }

@media (max-width: 880px) { .adj-parti { grid-template-columns: 1fr; } }

/* ── Drafting-table placement ─────────────────────────────────────
   In the input drawer the island stacks single-column: the tool rail
   becomes a wrapping row of pucks, the sheet fills the drawer width,
   and the reading (chips + ink) follows beneath. Declared last so it
   wins over the base three-column grid above. */
.adj-parti--drawer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}
.adj-parti--drawer .adj-parti__tools {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
.adj-parti--drawer .adj-parti__tools .adj-parti__title {
  width: 100%;
}
.adj-parti--drawer .adj-parti__tools .adj-parti__hint {
  width: 100%;
  margin-top: 4px;
}
.adj-parti--drawer .adj-parti-svg {
  width: 100%;
}
