/* ============================================================================
   shared/stack-list.css — the SHARED ordered-stack surface.

   One treatment for every ordered list of registry-drawn cards in the editor:
   the particle module stack, the post-process effect stack, the field layer
   stack, the pipeline layer list. Peers that look different promise they are
   different (design-pattern-consistency.md), so the row anatomy, the reorder
   affordance and the state set are defined ONCE here.

   Row anatomy, in order:  [grip] [chevron] name [value] [eye] [solo] [trash]
   Only the CONTENT varies per host; never the treatment.

   Tokens only — the host page defines the SPEC §2 palette.
   ========================================================================== */
/* Root is `.slist`, NOT `.sl`: the inspector's editor fields already use `sl` as
   the slider-input class, and a bare `.sl { display:flex }` here would restyle
   every slider inside an expanded row. Every other class is `sl-` prefixed, so
   only the root needed the distinct name. */
.slist { display: flex; flex-direction: column; }

/* ---- group heading (a stage / a category). Hosts with one flat list omit it. -- */
.sl-grp { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
  padding: 9px 10px 3px; display: flex; align-items: center; gap: 6px; }
.sl-grp .sl-count { color: var(--faint); font-family: Consolas, monospace; }
/* THE ADD CHIP IS AN ATOM, not a piece of the group header. Its appearance was scoped to `.sl-grp`
   because that was the only place it had ever been used — so the moment a second surface wanted the
   same verb ("add to this list", on the Rig workspace's Skeleton pane) the scope meant it rendered
   completely unstyled there. That is the fork this rule set exists to prevent, arriving as an
   OMISSION rather than a copy: the pressure at that point is to write a local `.j-add`, and then
   there are two add chips. Only the layout that genuinely belongs to the group stays in the group. */
.sl-add { color: var(--muted); cursor: pointer; font-size: 11px;
  border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: var(--chip); }
.sl-add:hover { color: var(--accent-text); border-color: var(--accent); }
/* visibly disabled, with the reason on hover — never a dead control (`ui-and-authoring-docs.md` §3) */
.sl-add.is-disabled { opacity: .4; cursor: not-allowed; }
.sl-add.is-disabled:hover { color: var(--muted); border-color: var(--line); }
.sl-grp .sl-add { margin-left: auto; }

/* ---- the row ------------------------------------------------------------- */
/* `--sl-depth` is how deep this row sits in a NESTED stack (a field layer group holding
   layers, holding a subgroup). Flat stacks never set it, so they render exactly as before;
   a nested one indents by the same step the outliner uses, because indentation IS the
   parenting there too (hierarchy-standard §1). The indent goes on padding rather than
   margin so the row's full width stays a hit target at every depth. */
.sl-row { display: flex; align-items: center; gap: 6px; height: 26px;
  padding: 0 8px 0 calc(4px + var(--sl-depth, 0) * 14px);
  border-radius: 6px; margin: 1px 6px; background: var(--card); color: var(--text2);
  font-size: 12px; user-select: none; }
.sl-row:hover { background: var(--hover); }
/* the optional result swatch — a card-radius chip at the row's own rhythm, sized so it reads as
   a sample rather than as a status dot (which is what `.sw` at 9px means everywhere else) */
.sl-thumb { width: 16px; height: 16px; border-radius: 4px; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); background-size: cover; }
/* compositing: the well is present (so it is not UNSET) and recedes until M arrives.
   Opacity, not a second fill — a grey square here would look like covering-nothing. */
.sl-thumb.is-pending { opacity: .45; }
.sl-row.sel { background: var(--accent-sel); box-shadow: inset 2px 0 0 var(--accent); }
.sl-row.off { opacity: .45; }
.sl-row.dragging { opacity: .85; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
/* the row the drag would drop onto — set by StackList.reorderable on any surface
   that uses it, so the drag reads the same in the layer tree as in a flat stack */
.sl-row.droptarget, .lyr.droptarget { box-shadow: inset 0 2px 0 var(--accent); }
.lyr.dragging { opacity: .85; }
.sl-row.dim { opacity: .3; }                     /* another row is soloed */
/* `inactive` = the row exists but is not participating in THIS context (a layer
   the selected pass does not draw). Distinct from `off` (deliberately bypassed)
   and from `dim` (something else is soloed) — three different reasons a row can
   recede, so three treatments rather than one overloaded fade. */
.sl-row.inactive { opacity: .55; background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.sl-row.inactive .sl-grip { visibility: hidden; }

.sl-grip { cursor: grab; color: var(--faint); font-size: 11px; width: 12px; text-align: center; flex: 0 0 12px; }
.sl-grip:active { cursor: grabbing; }
.sl-chev { color: var(--faint); width: 12px; flex: 0 0 12px; text-align: center; cursor: pointer; font-size: 9px; }
.sl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
/* ---- the optional second line (row.sub) ------------------------------------
   A row that carries a status line grows to two lines; one that does not is
   untouched, which is what keeps every existing host rendering exactly as it
   did. The sub line recedes to the muted tone — it is provenance and health,
   not the row's identity, so it must not compete with the name
   (`ui-and-authoring-docs` §2: emphasis follows importance). */
.sl-namewrap { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; cursor: pointer; }
.sl-namewrap .sl-name { flex: 0 0 auto; }
.sl-sub { font: 10px/1.25 Consolas, monospace; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-row.twoline { height: auto; min-height: 38px; padding-top: 3px; padding-bottom: 3px; align-items: center; }
/* TONE — the host's health for this row. Two values, both already in the system's
   vocabulary, so a stale pass and a failed bake read the same everywhere. Colour is
   never the only carrier: the sub line spells the condition out in words. */
.sl-row.tone-warn   .sl-sub { color: var(--warn); }
.sl-row.tone-danger .sl-sub { color: var(--danger, #EF6A7A); }
.sl-row.tone-danger { box-shadow: inset 2px 0 0 var(--danger, #EF6A7A); }
.sl-row.tone-warn:not(.sel) { box-shadow: inset 2px 0 0 var(--warn); }
/* selection still wins the left edge — it is the stronger, more transient state */
.sl-row.sel { box-shadow: inset 2px 0 0 var(--accent); }
.sl-val { font-family: Consolas, monospace; font-size: 10.5px; color: var(--muted); flex: 0 0 auto;
  max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-btn { flex: 0 0 auto; width: 16px; text-align: center; color: var(--faint); cursor: pointer; font-size: 11px; }
.sl-btn:hover { color: var(--text2); }
.sl-btn.on { color: var(--accent-text); }
.sl-btn.rm:hover { color: var(--danger); }
.sl-btn.dive { color: var(--accent-text); }

/* ---- the expanded body (a row's own parameters) -------------------------- */
/* the body follows its row's depth, so an expanded nested layer's parameters stay under it */
.sl-body { margin: 1px 6px 4px calc(6px + var(--sl-depth, 0) * 14px); padding: 6px 8px; background: var(--well); border-radius: 6px; }
.sl-f { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 11.5px; }
.sl-f label { flex: 1; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* THE CONTROLS THEMSELVES ARE ATOMS (components.css): `.rng` + `.val`, `.inp`,
   `.selin`, `.chk`, `.swatch`. This file owns only how they SIT in a field row —
   their widths and the gaps between them. It used to restyle each one under an
   `sl-` name, which is how a stack's slider drifted from every other slider in
   the editor; the host page loads components.css and only the layout lives here. */
.sl-f .rng { flex: 1.1; min-width: 0; }
.sl-f .val { flex: 0 0 46px; text-align: right; }
.sl-f .inp { flex: 0 0 62px; height: 22px; text-align: right; padding: 0 5px; }
.sl-f .selin { flex: 0 0 96px; height: 22px; padding: 0 6px; font-size: 11px; }
.sl-f .swatch { flex: 0 0 116px; }
.sl-f .crv { flex: 0 0 150px; height: 24px; }
.sl-note { font-size: 10.5px; color: var(--faint); padding: 2px 2px 4px; }

/* ---- empty state — designed, never a blank void ------------------------- */
.sl-empty { color: var(--faint); font-size: 11.5px; padding: 10px 12px; line-height: 1.5; }

/* ---- the add menu: shared chrome, host-supplied items -------------------
   Every host adds to its stack the same way (searchable list at the group's ＋),
   so the chrome lives here; only the item list differs per domain. */
.sl-menu { position: absolute; z-index: 40; width: 232px; max-height: 288px; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px;
  box-shadow: 0 14px 36px rgba(0,0,0,.55); }
.sl-menu input { width: 100%; background: var(--well); border: 1px solid var(--line); border-radius: 7px;
  color: var(--ink); font: 12px inherit; padding: 4px 8px; margin-bottom: 4px; outline: none; }
.sl-menu input:focus { border-color: var(--accent); }
.sl-mitem { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 8px; border-radius: 6px; background: var(--card); color: var(--text2);
  font-size: 11.5px; cursor: pointer; margin: 2px 0; }
.sl-mitem:hover, .sl-mitem.hot { background: var(--hover); color: var(--accent-text); }
.sl-mitem .sl-mnote { color: var(--faint); font-size: 10px; font-family: Consolas, monospace; }
.sl-mnone { color: var(--faint); font-size: 11px; padding: 6px 8px; }
