/* ============================================================== themes ====

   Every color in the tool comes from one of the tokens below, and a theme is
   nothing but a different set of values for them. Adding a theme means adding
   a block here and an entry in preview/themes.js — no rules elsewhere change.

   The ladder that matters, darkest to lightest:

     --bg        behind everything
     --panel     the panel and bars
     --panel-2   controls inset into a panel: fields, dropdowns, wells
     --line      borders
     --line-strong  a border under the pointer

   --stage is the odd one out and cannot follow that ladder. Pure white fill and
   pure black stroke both have to read against it, so it has to sit in the
   MIDDLE of the range whatever else the theme does — including in a light
   theme, where everything around it is pale.
   ========================================================================= */

/* Slate Navy — the blue one, hand-tuned by Breece, and the palette a browser
   host opens on. It lives on the bare :root rather than behind a
   [data-theme] block, which is why its id is still 'default' in themes.js. */
:root {
  --bg: #101218;
  /* The Test Drive toolbar's active and hovered square (2026-09-21): a step below --bg. */
  --tool-active: #08090c;
  --panel: #171a22;
  --panel-2: #1d212b;
  --line: #262b37;
  --line-soft: #1f2430;
  --line-strong: #3a4152;

  /* The icon stage sits well above the panel in value, so pure black stroke
     and pure white fill both read against it. Biased toward the accent's hue
     rather than a neutral grey, so the stage belongs to the same palette as
     the panel instead of looking like a hole cut in it.

     Hand-tuned by Breece — these are judged by eye, not derived. The minor
     grid sits around 56% of the stage brightness and the major near 14%, so
     the major lines carry the structure and the minor ones stay quiet.
     Adjust by looking, not by recomputing a ratio. */
  --stage: #4b5a7f;
  --stage-grid-minor: #2b303d;
  --stage-grid-major: #0b0c0f;

  --text: #dfe3ea;
  --dim: #8b93a3;
  --code: #b6c0d0;

  --accent: #6ea8fe;
  /* Backing for a pressed toolbar button: the accent at low saturation, so it
     reads as "on" without competing with the artwork. */
  --accent-soft: #22304a;
  --accent-hover: #2a3c5c;
  /* The link cap across the hands (C2 of the Sync Chip Study): the glyph and
     its soft cap. Aliased to the accent here; a theme whose accent sits too
     close to its fields redefines these two alone (the After Effects darks,
     Breece, 2026-09-10: "notably less contrast"). */
  --link: var(--accent);
  --link-soft: var(--accent-soft);
  /* Text ON the accent — a selected number, a filled button. */
  --on-accent: #0f1117;

  --scroll-thumb: #39414f;
  --scroll-thumb-hover: #4b556a;


  /* The one "look at this" color each theme defines. Aliased rather than
     duplicated: custom properties resolve where they are USED, so every theme
     that redefines --hotspot redefines this with it, and the value has already
     been through the contrast pass. */
  --warn: var(--hotspot);

  --stage-label: #79affe;
  --control-border: #5e6b88;
  --hotspot: #ff8a9b;
}

/* --- After Effects 'Darkest' --------------------------------------------- */
[data-theme="ae-darkest"] {
  --bg: #141414;
  --tool-active: #0a0a0a;
  --panel: #1e1e1e;
  --panel-2: #272727;
  --line: #363636;
  --line-soft: #232323;
  --line-strong: #4a4a4a;

  --stage: #5b5b5b;
  --stage-grid-minor: #3d3d3d;
  --stage-grid-major: #101010;

  --text: #d8d8d8;
  --dim: #949494;
  --code: #bdbdbd;

  --accent: #4d8fd6;
  --accent-soft: #1e3a52;
  --accent-hover: #27455f;
  --link: #8fc2f7;                      /* brighter than the accent: 7:1 on the field */
  --link-soft: rgba(77, 143, 214, .16); /* a tint of the field, not a fill */
  --on-accent: #0d0d0d;

  --scroll-thumb: #424242;
  --scroll-thumb-hover: #565656;

  --stage-label: #84b2e3;
  --control-border: #707070;
  --hotspot: #ff8c9d;
}

/* --- After Effects 'Dark' ------------------------------------------------ */
[data-theme="ae-dark"] {
  --bg: #232323;
  --tool-active: #171717;
  --panel: #2e2e2e;
  --panel-2: #383838;
  --line: #484848;
  --line-soft: #333333;
  --line-strong: #5c5c5c;

  --stage: #5e5e5e;
  --stage-grid-minor: #4c4c4c;
  --stage-grid-major: #1a1a1a;

  --text: #e2e2e2;
  --dim: #a2a2a2;
  --code: #c8c8c8;

  --accent: #5b9ee0;
  --accent-soft: #2b4a66;
  --accent-hover: #345a7c;
  --link: #9ccbf8;
  --link-soft: rgba(91, 158, 224, .16);
  --on-accent: #10171d;

  --scroll-thumb: #565656;
  --scroll-thumb-hover: #6b6b6b;

  --stage-label: #85b7e8;
  --control-border: #818181;
  --hotspot: #ff92a2;
}

/* --- After Effects 'Light' ----------------------------------------------- */
/* The stage stays mid-grey here. Everything else inverts, but white fill still
   has to read on it, so it cannot follow the panel up into the pale end. */
[data-theme="ae-light"] {
  --bg: #c8c8c8;
  --tool-active: #b2b2b2;
  --panel: #d8d8d8;
  --panel-2: #e6e6e6;
  --line: #b4b4b4;
  --line-soft: #cfcfcf;
  --line-strong: #949494;

  --stage: #8f8f8f;
  --stage-grid-minor: #7d7d7d;
  --stage-grid-major: #3a3a3a;

  --text: #1c1c1c;
  --dim: #5d5d5d;
  --code: #2e2e2e;

  --accent: #105cb7;
  --accent-soft: #cfe0f7;
  --accent-hover: #bcd4f3;
  --on-accent: #ffffff;

  --scroll-thumb: #a8a8a8;
  --scroll-thumb-hover: #8c8c8c;

  --stage-label: #0c4284;
  --control-border: #797979;
  --hotspot: #8c0015;
}

/* --- Breece Waffles Dark -------------------------------------------------- */
/* Void as the panel rather than the page behind it, so the whole ladder drops
   a rung. That pushes the ground to Black — the one swatch below Void — and
   promotes Void Highlight and Griddle Steel into the roles Griddle Steel and
   the field border held before. Same palette, shifted down, not a second set of
   colors invented to fill the gap.

   --stage barely moves. It is fixed by what has to read against it, not by how
   dark the chrome around it is, so a darker theme cannot pull it down with the
   rest without breaking the one thing it is for. */
[data-theme="bw-dark"] {
  --bg: #000000;            /* Black */
  --tool-active: #000000;   /* nothing is darker; still below the strip's BW Void */
  --panel: #0c0a14;         /* BW Void */
  --panel-2: #221c2c;       /* BW Void Highlight */
  --line: #282940;          /* BW Griddle Steel */
  --line-soft: #17131f;
  --line-strong: #373144;   /* the field border from the site */

  --stage: #5b538c;
  --stage-grid-minor: #332f52;
  --stage-grid-major: #0c0a14;   /* Void again, so the major lines are the brand's own black */

  --text: #ececf7;          /* BW Disclaimer Offwhite */
  --dim: #7f82b9;           /* BW Twilight */
  --code: #b0b0dd;          /* BW Twilight Snow */

  --accent: #ffa012;        /* BW Waffle Gold */
  --accent-soft: #3a2a0d;
  --accent-hover: #4f380f;
  --on-accent: #0c0a14;     /* Void, matching this variant's ground */

  --scroll-thumb: #37314e;
  --scroll-thumb-hover: #453f63;

  --stage-label: #ffa012;
  --control-border: #62649c;
  --hotspot: #ff8a9b;
}

/* --- Breece Waffles ------------------------------------------------------ */
/* Straight from the brand palette. The names in comments are his, so a value
   can be traced back to the swatch it came from rather than looking arbitrary.
   Hierarchy follows breecewaffles.com: Eclipse Jam is the page ground and Void
   is reserved for the darkest layer, with Waffle Gold as the only accent. */
[data-theme="bw"] {
  --bg: #0c0a14;            /* BW Void */
  --tool-active: #05040a;
  --panel: #1d152d;         /* BW Eclipse Jam */
  --panel-2: #282940;       /* BW Griddle Steel */
  --line: #373144;          /* the field border from the site */
  --line-soft: #221c2c;     /* BW Void Highlight */
  --line-strong: #4c4560;

  --stage: #5a5488;
  --stage-grid-minor: #383357;
  --stage-grid-major: #14101f;

  --text: #ececf7;          /* BW Disclaimer Offwhite */
  --dim: #8c8ec0;           /* BW Twilight */
  --code: #b0b0dd;          /* BW Twilight Snow */

  --accent: #ffa012;        /* BW Waffle Gold */
  --accent-soft: #43300f;
  --accent-hover: #5a3f11;
  --on-accent: #1d152d;     /* Eclipse Jam, so gold stays legible under text */

  --scroll-thumb: #3d3757;
  --scroll-thumb-hover: #55507a;

  --stage-label: #ffa012;
  --control-border: #7a6d96;
  --hotspot: #ff8a9b;
}

/* ============================================================== metrics ====

   The panel's vertical rhythm, in one place because every value here is a
   VISUAL one — Breece's to tune by eye, and tuning one should be one edit
   rather than a hunt through the sheet. Set on the bare :root and NOT inside
   a theme block: a theme changes colors, never spacing.

   The numbers are his, from the Section Header Study's variation I
   (docs/reports/section-header-study.html) plus the three spacing notes he
   sent after picking it.
   ========================================================================= */
:root {
  /* A slider's name row to its track. 3px read as cramped beside the
     screenshot he sent; 8px, the study's value, read as too loose in the tool
     ("reduce the gap between the labels and their tracks by 4 pixels",
     2026-09-06). */
  --param-label-gap: 4px;
  /* The min/max line under a slider, relative to the range input's box; negative
     pulls it up into the input's own padding, tight under the track. */
  --range-ends-gap: 0px;

  /* Above a MAJOR section header, and above the first one in a pane — which
     sits right under the tab strip and needs less separation. */
  --sec-gap-major: 20px;
  --sec-gap-major-first: 12px;

  /* Around a MINOR sub-head (All Icons, Wait Pinwheel Only, Presets). More
     above than below, so the head binds to what it introduces. */
  --sec-gap-minor: 18px;
  --sec-gap-minor-below: 9px;
  --sec-gap-minor-first: 4px;

  /* Expand all / Collapse all: about 6px less than a header would get, above
     and below. It belongs to the PANE, not to the section under it. */
  --sec-all-gap: 14px;

  /* The header row itself. */
  --sec-title-size: 11.5px;
  --sec-title-weight: 600;
  --sec-title-tracking: .1em;
  --sec-count-size: 11px;
  --sec-chev-size: 8px;
  --sec-chev-stroke: 1.5px;
}

* { box-sizing: border-box; }

/* ---------- scrollbars ---------- */

/* The default Windows scrollbar is a bright slab that reads as a seam down the
   side of every dark panel. These sit on the surface they belong to and only
   come forward under the pointer.

   Both syntaxes: the standard properties are what Firefox honours, the WebKit
   pseudo-elements are what Chromium honours and they allow the finer control,
   so they are set second and win where both apply. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 6px;
  /* A transparent border with background-clip is the only way to inset a
     WebKit thumb; padding does nothing to it. */
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: content-box; }
::-webkit-scrollbar-thumb:active { background: var(--accent); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* The shell never scrolls as a page. The panel and the stage each scroll
   inside themselves, so any overflow that reaches the root is a layout fault
   rather than something to page through — and once the scrollbars below are
   given a width, the platform stops drawing them as overlays and starts
   reserving 10px of layout for them, which put a bar down the far right of the
   whole tool. Saying so explicitly is what the shell meant all along. */
html, body { overflow: hidden; }

body {
  margin: 0;
  height: 100vh;
  /* Out of flow, pinned to the viewport. `overflow: hidden` above stops the
     root scrolling by wheel or key, but NOT by script — and the root really did
     have 390px of scrollable height, which is the overflow that went untraced
     for weeks. Nothing in the tool scrolls the root deliberately; the danger is
     the browser doing it, which it will when focus lands on something it thinks
     needs revealing. The whole app would slide up and expose bare page
     underneath.

     Taking body out of flow leaves the root with no in-flow content at all, so
     it has nothing to overflow. Measured after: scrollHeight 545 against a
     clientHeight of 545, and scrollTop refuses to move. The grid and both
     columns are unchanged, and the panel still scrolls on its own. */
  position: fixed;
  inset: 0;
  display: grid;
  /* The panel's width is a stored preference, written to this variable. The
     middle column is the drag handle: a real column rather than a strip
     floating over the border, so it cannot sit on top of the panel's own
     scrollbar and steal presses meant for it. */
  /* The stored width is in the PANEL's pixels, so the column is that times the
     UI Scale: the panel grows with its contents rather than squeezing a larger
     text into the same strip of screen (u-uiscale). */
  grid-template-columns: calc(var(--panel-w, 320px) * var(--ui-scale, 1)) 10px 1fr;
  /* The row has to be told it is exactly the body's height AND allowed to be
     smaller than its content. A grid row defaults to auto, which grows to fit
     the tallest item — so the panel stretched to its full content height, its
     own overflow-y never had anything to scroll, and the whole document grew a
     scrollbar instead. minmax(0, 1fr) pins the row and lets the panel shrink
     below its content, which is what puts the scrollbar back inside it. */
  grid-template-rows: minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

/* UI SCALE (u-uiscale; Breece, 2026-09-18): the panels grow, the drawing does
   not. The stylesheet is written in pixels, so one root font-size could not
   do it; `zoom` scales text, icons, padding and hit areas together, and runs
   in the Chromium 99 of the After Effects panel.

   On the UI ROOTS, never on body: .stage-inner (the drawing and the Test Drive
   world) stays outside it, so the viewport's own zoom and its pan and wheel
   math never meet a second factor. The toolbar over the viewport is UI and
   takes it. The floating layers zoom only while they hang off the body - the
   ⓘ popover moves INTO an open sheet, and zooming it there would square the
   scale. The zoom menu and the Preferences popover live inside bars that
   already carry it. --ui-scale is written by preview.js from the preference.

   A SHEET ZOOMS ITS CONTENTS, NOT ITSELF. Its height cap is in viewport
   units, and zoom multiplies those too: a zoomed Advanced Export Settings at
   120% came out a fifth taller than the window, top and bottom cut off. So
   the <dialog> keeps the window's units and only its width is scaled (in
   .sheet below); what is inside it, the ⓘ popover included, takes the zoom. */
.panel,
.stage-bar,
.readout,
.td-toolbar,
dialog.sheet > *,
body > .toast,
body > .info-pop,
body > .picker,
body > .icon-picker-pop,
body > .label-menu {
  zoom: var(--ui-scale, 1);
}

/* ---------- tabs ---------- */

/* A TAB STRIP, sized to its labels — not the segmented control this used to be.

   The old comment argued that folder tabs need a wide header to attach to, and
   that a segment filling the panel reads as the switch it is. That was true of
   THREE tabs. It stops being true at five: equal columns give each tab 42px at
   the panel's 260px minimum, and "Customize" alone needs 54. The control ran
   out of room, and a switch with five positions was never going to read as
   navigation anyway.

   Content-width columns fit what equal ones cannot — the five labels total
   218px of text against a 222px strip at the minimum width — and the active
   tab is marked by an underline sitting on the strip's own base line, which is
   the one shape everybody already reads as "tab".

   It scrolls sideways rather than truncating. A label cut to "Custom..." is a
   worse failure than one that needs a nudge to reach: the ellipsis hides which
   tab it is, and there is no way to find out. */
.tabs {
  display: flex;
  /* WRAP, don't clip (u-mtj9ly12, TG4): five tabs outgrew the narrow panel
     and Export could not be clicked without widening it. Tabs that fall to
     a new row share that row evenly — flex-grow on every tab makes each
     row's tabs split its width, however many rows the width asks for. */
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 0;
  /* The base line the active underline sits on, so the strip reads as one
     edge with a mark on it rather than as detached buttons. */
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 1 1 auto;
  text-align: center;
  background: none;
  border: 0;
  color: var(--dim);
  padding: 7px 10px;
  font-size: 11.5px; font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  /* Reserve the underline's space on every tab so selecting one does not
     move the others by 2px. */
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover { color: var(--text); }

/* Two signals: the underline carries the position, the brighter text carries
   the state. No background — a filled tab competes with the accent used on
   real controls below it.

   AND NO BOLD, which was the first draft. Content-width columns mean a heavier
   label is a WIDER label, so selecting a tab moved its neighbours: measured at
   up to 4px of jitter every time the active tab changed. The fixes are all
   worse than the problem — reserving the bold width needs the label duplicated
   into a data attribute, where it can drift out of step with the text beside
   it. Colour and an underline are what tab strips actually use. */
.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Locked while nothing is enabled (u-truedeselect): dimmed, the cursor says
   no, and the line under the bar says why. */
.tab[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.tab[aria-disabled="true"]:hover { color: var(--dim); }
.tabs-note { margin: 6px 0 0; padding: 0 2px; font-size: 11px; line-height: 1.4; color: var(--dim); }
.tabs-note[hidden] { display: none; }

/* ---------- panel views ---------- */

.panel-view { display: block; }
.panel-view[hidden] { display: none; }

.panel-note {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.5;
}
.panel-note[hidden] { display: none; }

/* PASTE (u-pastedata, 2026-09-29): the field the Paste button opens where the
   clipboard cannot be read, and what the paste did - or why it would not. */
.paste-field { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.paste-field[hidden] { display: none; }
.paste-field textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  font: 11px/1.4 ui-monospace, Consolas, monospace;
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--control-border); border-radius: 4px; padding: 5px 7px;
}
.paste-field textarea:focus { outline: none; border-color: var(--accent); }
.paste-field-row { display: flex; gap: 6px; }
.paste-note { margin-top: 8px; color: var(--text); }
.paste-note.is-bad { color: var(--warn, #e0a24a); }

.panel-foot {
  margin: 12px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.5;
}

/* ---------- selection tree ---------- */

.selection-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* Select All / Unselect All, the tree's first row (u-choosepresets). Two
   equal columns across the full width rather than a pair of small buttons in
   the section header: they act on everything below them, so they sit above
   everything below them, at the width of the thing they act on. */
.sel-all-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 6px, the Import buttons' own gap (Breece, 2026-09-30: match the Presets / Import spacing). */
  gap: 6px;
}

.sel-all-row .mini { justify-content: center; }
/* Delete All (Start Fresh) (2026-09-30): the whole width under Enable / Disable, red on hover like the trash. */
/* 6px under Enable / Disable, like the Import row under Presets: the tree's own 8px gap, less 2. */
.sel-delete-row { margin-top: -2px; display: flex; flex-direction: column; gap: 6px; }
.sel-delete-row .mini { width: 100%; justify-content: center; }
.sel-delete-row .mini:disabled { opacity: .45; cursor: default; color: var(--dim); border-color: var(--line); background: none; }
.sel-delete-row .mini:hover, .sel-delete-yes:hover { color: #e5484d; border-color: #e5484d; background: rgba(229, 72, 77, .12); }

/* The categories' Expand / Collapse all (u-chooseexpand, 2026-09-25): the
   .sec-all pair, right-aligned under Select / Deselect and pulled close to
   the list it folds. His values to tune: the margins below sit on top of the
   tree's 8px gap, so this reads 6px above and 4px below. */
.selection-tree > .sel-fold-row { margin: -2px 0 -4px; }

.sel-cat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

/* The card head is the category's <summary> now (u-accordionheaders): the same
   tinted band, with the count that a closed section carries and the same
   chevron every other header in the tool draws. It keeps the card shape rather
   than adopting the bare .sec-head row, because the card is what says these
   are one tier down from Icon Selection, which they are inside. */
.sel-cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.sel-cat-head::-webkit-details-marker { display: none; }
.sel-cat[open] > .sel-cat-head { border-bottom: 1px solid var(--line); }
.sel-cat-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The name takes the slack, so the count sits at the right and the chevron
   holds the end of the row whether the count is showing or not. */
.sel-cat-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text);
  margin-right: auto;
}

.sel-cat-count { color: var(--dim); font-size: 11px; }
.sel-cat[open] > .sel-cat-head .sel-cat-count { display: none; }

.sel-cat > .body { padding: 0; }

/* The category's "+" left the head with everything else that was a button in
   a header. A row of its own at the top of the body, on the card's padding. */
.sel-cat > .body > .actions {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

/* A category with nothing enabled is itself disabled — there is no separate
   flag for it, so the label just reports what its icons add up to. */
.sel-cat.is-off .sel-cat-name { color: var(--dim); }
/* An EMPTY category (2026-09-17): listed so its "+" is reachable, quieter than
   one that is merely switched off, and its count reads "empty". */
.sel-cat.is-empty .sel-cat-name { color: var(--dim); font-style: italic; }
.sel-cat.is-empty .sel-cat-count { font-style: italic; }
.sel-empty { margin: 0; padding: 6px 10px 10px; color: var(--dim); font-size: 12px; }

.sel-icons { display: flex; flex-direction: column; }

.sel-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  /* 18px at the left, not 26: the grip sits in the indent now (u-reorderroster),
     8px in from the head's - his value to tune. */
  padding: 7px 10px 7px 18px;
  cursor: pointer;
  border-top: 1px solid var(--line-soft);
}

.sel-icon:first-child { border-top: 0; }
.sel-icon:hover { background: var(--panel-2); }
.sel-icon-name { font-size: 12px; }
.sel-icon.is-off .sel-icon-name { color: var(--dim); }

/* The default-state drawing at the row's edge (u-mti5tgbb), replacing the
   old pixel-dimensions readout. A fixed square box; the viewBox letterboxes
   each icon into it at its own aspect. */
.sel-icon-thumb {
  width: 26px;
  height: 26px;
  flex: none;
}

.sel-icon.is-off .sel-icon-thumb { opacity: .35; }

/* The Import From File / Import From Layer glyphs, up from the .mini's 14
   (Breece, 2026-09-30: "need to be scaled up"); his value to tune. */
#fileImportOpen .ui-icon, #importOpen .ui-icon, #addRigOpen .ui-icon, #bakeIcon .ui-icon { width: 18px; height: 18px; stroke-width: 1.8; }
/* Bake / Revert spans the Customize column like Modify Existing Rig on Setup (his note, 2026-10-18). */
.bake-row { display: flex; margin-top: 6px; }
.bake-row > #bakeIcon { flex: 1 1 auto; }
.bake-row > #bakeIcon[hidden] { display: none; }
/* What a bake would not keep (2026-10-19). His values to tune. */
.bake-warn { margin-top: 8px; padding: 9px 11px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent-soft); color: var(--text); font-size: 12px; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.bake-warn[hidden] { display: none; }
.bake-warn p { margin: 0; }
.bake-warn ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.bake-warn .bake-warn-note { color: var(--dim); }
.bake-warn-actions { display: flex; gap: 8px; justify-content: flex-end; }
/* The layers glyph sat a little high beside its word (his note); one pixel down -
   as a nudge, not a margin, so the button keeps the same height as its neighbor.
   Modify Existing Rig's glyph (2026-10-17) takes the same size and nudge, so the
   button under the two imports stands as tall as they do (his note). */
#importOpen .ui-icon, #addRigOpen .ui-icon { position: relative; top: 1px; }

/* THE REORDER GRIP (u-reorderroster, 2026-09-30): six dots at the left of
   every category head and icon row; the pointer becomes a hand over it.
   Dim until hovered, so the list reads as it did; an empty category's is
   off. touch-action none, so a drag is a drag on a touch screen too. */
.sel-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  /* 20 x 24 with an 18px glyph since 2026-09-30 (was 16 x 20, 14px): his
     "bigger and a little taller"; the glyph's rows spread to match. */
  width: 20px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--dim);
  opacity: .55;
  cursor: grab;
  touch-action: none;
}
.sel-grip:hover, .sel-grip:focus-visible { opacity: 1; color: var(--text); }
.sel-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sel-grip:disabled { opacity: .2; cursor: default; }
.sel-grip .ui-icon { width: 18px; height: 18px; }

/* While a grip is held: the hand closes everywhere, nothing selects, the
   row in hand fades, and a line says where it will land. */
body.reordering, body.reordering * { cursor: grabbing !important; user-select: none; }
.sel-icon.is-dragging, .sel-cat.is-dragging { opacity: .4; }
.sel-icon.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.sel-icon.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.sel-cat.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.sel-cat.drop-after { box-shadow: 0 2px 0 var(--accent); }
.sel-cat.drop-into > .sel-cat-head { box-shadow: inset 0 0 0 2px var(--accent); }

.selection-tree input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin: 0;
  flex: 0 0 auto;
}

/* PART - a category with some icons on (his pick from the Checkbox Study,
   2026-09-25: B, Mid Grey, chosen over C a minute later - with two notes:
   OFF stays the native empty box, and ON keeps the native box and tick). A
   category box is checked AND indeterminate (preview.js sets both), and
   only here the native paint is dropped: a fill in the theme's own mid grey
   (--dim, the tone its quiet text already uses), so PART claims nothing of
   the accent and ON stays the only colored box in the list; the dash in
   the color text wears on the accent. Chromium 99 draws pseudo-elements on
   an appearance:none checkbox. Focus, Space and the screen reader's
   "mixed" stay the input's own. */
.selection-tree input[type="checkbox"]:indeterminate {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  box-sizing: border-box;
  border: 1px solid var(--dim);
  border-radius: 2px;
  background: var(--dim);
  cursor: pointer;
}
.selection-tree input[type="checkbox"]:indeterminate::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 5px;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: var(--on-accent);
}
.selection-tree input[type="checkbox"]:indeterminate:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.selection-tree input:disabled { cursor: not-allowed; }


/* ---------- export ---------- */

.export-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* Checkbox on the left, ⓘ pushed to the right edge. The button sits at the end
   of the row rather than tight against the label so the two options' buttons
   line up with each other — a ragged column of ⓘs reads as decoration, an
   aligned one reads as a control. */
/* A dimmed Advanced Settings row: the toggle exists but has nothing to
   govern until its controls are included on the main Export tab. ONE ROW:
   the terse note sits right-aligned with the standard ⓘ beside it, and
   the dimming is by COLOR rather than opacity so the ⓘ stays crisp and
   clickable. */
#advancedBody .check {
  display: flex;
  align-items: center;
  gap: 6px;
}
#advancedBody .check.dim { color: var(--dim); }
#advancedBody .check.dim input { opacity: .5; }
#advancedBody .dim-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}

/* The per-property link across the hands (Breece: C2 of the Sync Chip Study
   on 2026-09-10, B2 the next morning - "after a good night's sleep"). A
   chain link in a 20px GUTTER of its own to the right of the row: the row's
   content - label, dial, field, the slider and its end labels, a dropdown -
   stops 26px short of the panel's edge, and the link stands in the gutter
   beside the label row, so it aligns to nothing the row carries and every
   link down the panel sits at one x. The gutter is held on EVERY row of a
   hand's sections, link or none (Stagger Fingers, Rotate Thumb), so the
   fields keep one right edge. Joined and FILLED in the link color while the
   value is shared by all three hands (his "louder", 2026-09-10); parted and
   dim while it is this hand's own. */
.gutter .param, .gutter .row { position: relative; padding-right: 26px; }
.sync-link {
  position: absolute;
  right: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--dim);
  cursor: pointer;
}
/* On a plain row (a dropdown) the row is taller than the link: centre it. */
.row > .sync-link { top: 50%; transform: translateY(-50%); }
.sync-link .ui-icon { width: 14px; height: 14px; }
.sync-link:hover { color: var(--text); background: var(--line); }
/* On: the glyph in the link color on its soft cap - not filled. The fill was
   for the cap inside the field (C2); out in a gutter of its own the link
   "does not need to be as loud" (Breece, 2026-09-11). */
.sync-link.on { color: var(--link); background: var(--link-soft); }
.sync-link.on:hover { color: var(--link); background: var(--accent-hover); }
.sync-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.export-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

/* Where the rig lands: one compact row per setting, label left, control
   right — the same rhythm the Customize pane's rows keep. */
.export-place {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.place-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.place-field > span {
  flex: 0 0 auto;
  min-width: 82px;
  color: var(--dim);
  font-size: 12px;
}
.place-field > input,
.place-field > select {
  flex: 1;
  min-width: 0;
}

/* The text field, After Effects style: an inset well — the ground color,
   one step darker than the panel-2 the dropdowns sit on — with the same
   stroked border the other controls carry, and the accent on focus the way
   AE outlines its name fields. */
.place-field > input[type="text"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 5px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
}
.place-field > input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.place-field > input[type="text"]::placeholder {
  color: var(--dim);
}

.export-opt .check { margin: 0; }
/* An option the rig cannot use right now (Preview All with one icon): dimmed,
   not hidden - the person should see it exists and read why it is off. */
.export-opt.is-unavailable { opacity: 0.5; }
/* An Override color while its dropdown says otherwise (Jose's session,
   js1-overridecolors): in sight, grayed, inert. His value to tune. */
.is-waiting { opacity: 0.45; }
.is-waiting, .is-waiting * { cursor: default; }
.export-opt.is-unavailable .check { cursor: default; }
/* The note under such an option: the accent, so it reads as a heads-up rather
   than the quiet grey of a cost line or the warn color of a real problem. */
.opt-consequence.notice { color: var(--accent); }

/* Sized explicitly so the indent below can be derived rather than guessed.
   A UA checkbox is 13px in Chrome and not in every browser, and the
   description under it has to start at the same x as the label's text. */
.export-opt input {
  accent-color: var(--accent);
  width: 13px;
  height: 13px;
  margin: 0;
  flex: none;
}

/* What the CURRENT choice means: one line, always visible, changing with the
   toggle. Indented to the checkbox's text so it reads as belonging to the
   option rather than to the pane. */
.opt-consequence {
  /* 13px checkbox + the .check row's 7px gap: the description lines up with
     the label's text, not with the checkbox. */
  margin: 3px 0 0 20px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.45;
}

/* Quiet, but in the accent so it reads as the tool's own advice rather than
   part of the option's name. */
.recommended {
  color: var(--accent);
  font-size: 11px;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--dim);
  cursor: pointer;
}

.info-btn:hover { color: var(--text); }
.info-btn[aria-expanded="true"] { color: var(--accent); }
.info-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.info-btn .ui-icon { width: 15px; height: 15px; }

/* ---------- the ⓘ popover ---------- */

.info-pop {
  position: fixed;
  z-index: 40;
  width: 250px;
  padding: 10px 12px;
  display: block;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.5;
}

/* The class sets display, which outranks the UA stylesheet's [hidden] — without
   this the popover stays on screen while every check on it reports "hidden".
   That exact bug has shipped twice in this file. */
.info-pop[hidden] { display: none; }

.info-pop p { margin: 0; }
.info-pop p + p { margin-top: 8px; }

/* A drawing inside the (i) (u-previewlayoutscope): the Preview All layout's
   thumbnail, on the viewport's own color so the icons read as they do there.
   Sized by its width/height attributes; max-width only guards a narrow pop. */
.info-pop .info-figure { margin: 8px 0; }

/* Stroke Placement, drawn (preview.js strokePlacementFigure, 2026-10-19): On
   Path and Outside side by side on the viewport's color, the cursor black on
   white. His values to tune: the faint half, the dots, the sizes. */
.placement-fig { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 6px; }
.placement-fig figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; background: var(--stage, var(--panel-2)); border: 1px solid var(--line); border-radius: 6px; }
.placement-fig svg { display: block; width: 100%; height: 118px; overflow: hidden; border-radius: 4px; }
.placement-fig figcaption { color: var(--text); font-size: 11px; font-weight: 600; }
.placement-fig .pf-fill { fill: #fff; }
.placement-fig .pf-stroke { stroke: #111; }
.placement-fig .pf-hidden { opacity: .22; }
.placement-fig .pf-path { stroke: var(--accent); stroke-width: 1; }
.placement-fig .pf-dot { fill: var(--accent); }
.info-pop .placement-key { font-size: 11px; }
.info-pop .preview-layout-thumb {
  display: block;
  max-width: 100%;
  height: auto;
  background: var(--stage);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.info-pop .info-figure figcaption {
  margin-top: 4px;
  font-size: 10.5px;
}

@media (prefers-reduced-motion: no-preference) {
  .info-pop:not([hidden]) { animation: picker-in 110ms ease-out; }
}

/* The size and the run instructions, side by side with the ⓘ that explains
   how to run it. Baseline-aligned: the button is small and the text wraps to
   several lines, so centring would float it against the middle of a paragraph. */
.export-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

/* A heading INSIDE a section, dividing controls by how far they reach. Quieter
   than .group-label — it is a qualifier on the section above it, not a section
   of its own, and reading as one would make the panel feel deeper than it is. */
.sub-label {
  display: block;
  margin: 0;
  color: var(--dim);
  /* Same size and tracking as a section title (Breece, 2026-09-05): the two
     tiers differ by color alone - white for a section, dim for a sub-head. */
  font-size: var(--sec-title-size);
  letter-spacing: var(--sec-title-tracking);
  text-transform: uppercase;
}

.export-actions {
  display: flex;
  flex-wrap: wrap; /* five buttons since Export As SVG (2026-09-30) */
  gap: 6px;
  align-items: center;
  margin-top: 14px;
}

/* Create Rig is the whole point when After Effects is on the machine, so it
   takes the accent and the others step back to mini. When it is not, it is
   hidden and Save is the only thing there — a disabled primary button reads as
   something broken rather than something absent. */
.primary {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 11.5px; font-family: inherit;
  cursor: pointer;
}

.primary:hover { background: var(--accent-hover); }
.primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.primary[disabled] { opacity: 0.55; cursor: progress; }

/* Speaks for a run that already happened, so it is quiet until there is
   something to say. The border carries the outcome; the text carries the
   detail, because color alone cannot be the only signal. */
.run-status {
  margin-top: 10px;
  padding: 7px 9px;
  border-left: 2px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--dim);
  font-size: 11px;
  line-height: 1.45;
}

.run-status[data-outcome="ok"] { border-left-color: var(--accent); color: var(--text); }
.run-status[data-outcome="failed"] { border-left-color: var(--warn); color: var(--text); }
.run-status b { color: var(--text); font-weight: 600; }




/* ---------- panel ---------- */

.panel {
  background: var(--panel);
  /* The divider moved to .resize-handle, which is the element that now draws
     it — two lines side by side would read as a 2px border. */
  overflow-y: auto;
  /* Same reason: a grid item will not shrink below its content without this. */
  min-height: 0;
  /* Still no top padding, and now for the only reason left: a sticky child is
     constrained by its scroll container's PADDING box, so padding-top would
     park the tab strip below the top and leave a strip above it for content to
     slide through. The title used to carry that space; the tab strip now sits
     flush at the top, which is what a plugin panel looks like. */
  /* 10px, not 16 (Breece, 2026-09-11: cut the side padding by three quarters,
     "a bit too much" at 4, "almost enough" at 8 - 10 it is) - the link gutter
     on the hands' rows took the room. */
  padding: 0 10px 40px;
  min-width: 0;
}

/* Drag to set the panel width; double-click to put it back.

   A GRAB HANDLE, not a rule. A 1px line down the full height of the window is a
   lot of ink to spend saying "this edge moves", and the panel and stage already
   sit on different backgrounds, so the boundary reads without one. Instead the
   column is empty until the pointer is near it, and then a short pill fades in
   at the vertical middle — the same idea as the divider in Claude's own app.

   The gutter is always 10px, rather than growing on hover. A column that
   changes width would shove the stage sideways as the pointer approached it,
   which is motion nobody asked for, and it would fight the drag that is about
   to start in the opposite direction. */
.resize-handle {
  position: relative;
  background: var(--bg);
  cursor: col-resize;
  /* The panel and stage are both scroll containers; this is neither, and a
     stray selection while dragging looks like a bug. */
  user-select: none;
  touch-action: none;
}

.resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 36px;
  margin: -18px 0 0 -2px;
  border-radius: 2px;
  background: var(--line-strong);
  opacity: 0;
  /* The DELAY is only on the way in. Brushing past on the way to the stage
     should not light it up, but once it is showing it should not lag behind
     the pointer leaving either. */
  transition: opacity 110ms ease, background-color 110ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .resize-handle::before { transition: none; }
}

.resize-handle:hover::before {
  opacity: 1;
  transition-delay: 250ms;
}

/* Once it is a real interaction there is nothing to wait for: no delay, and it
   takes the accent so the thing being dragged is unmistakable. */
.resize-handle.dragging::before,
.resize-handle:focus-visible::before {
  opacity: 1;
  background: var(--accent);
  transition-delay: 0s;
}

/* The pill IS the focus ring — an outline around a 10px column would draw a
   tall thin box with nothing in it. */
.resize-handle:focus-visible { outline: none; }

/* While a drag is live the pointer may travel over the stage, the panel, or
   off the window entirely. Anything that reacts to a hover on the way past
   would flicker, and a text caret over the SVG contradicts what is happening. */
body.resizing { cursor: col-resize; }
body.resizing * { pointer-events: none; user-select: none; }

/* The tabs never scroll away. The title above them does — it is an identity
   label, not a control, and pinning it would cost the panel 40px of height
   permanently to keep something nobody needs to reach. */
.panel-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
  padding: 10px 0;
  /* Full-bleed backing: the panel's 10px side padding would otherwise leave two
     strips where scrolled content slides past the edge of this one. The strip
     keeps its own 16px inset, so the tabs sit where they did. */
  margin: 0 -10px;
  padding-left: 16px;
  padding-right: 16px;
  border-bottom: 1px solid var(--line);
}


/* The first group in a tab sits right under the tab strip, so it does not need
   the separation that groups need from each other. */
.group { margin-top: 18px; }
.panel-view > .group:first-child { margin-top: 16px; }
.panel-view > .group-head:first-child { margin-top: 16px; }
.panel-view > .group-label:first-child { display: block; margin-top: 16px; }

/* A .group can be hidden from JS (#shapeGroup, #transformGroup, #substateGroup),
   and something below sets a display on a selector that names .group — which
   would outrank the UA stylesheet's [hidden] and leave a "hidden" section on
   screen. See tools/check-hidden.mjs; this trap has landed four times. */
.group[hidden] { display: none; }

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* The headers that do NOT fold - Active Icon (a selector, not a section) and
   the single-section panes' titles - wear the section title's treatment
   anyway (Breece, 2026-09-05): same size, weight, tracking and the bright
   --text, so every header in the panel is one voice. */
.group-label {
  display: block;
  font-size: var(--sec-title-size);
  font-weight: var(--sec-title-weight);
  text-transform: uppercase;
  letter-spacing: var(--sec-title-tracking);
  color: var(--text);
  margin-bottom: 8px;
}

.group-head .group-label { margin-bottom: 0; }
/* An animation card's title sits INSIDE the Click Animations section, so it
   is the sub-head tier: the title's size, the sub-head's dim regular voice. */
[data-section="click-animations"] .group-head .group-label { color: var(--dim); font-weight: 400; }
.group-actions { display: flex; gap: 6px; }

/* ------------------------------------------------- section headers (fold)

   u-accordionheaders, variation I of the Section Header Study — Breece's pick,
   2026-09-05. Every section in the panel is a <details data-section>; the row
   is TITLE (caps, tracked, in --text rather than --dim), the count a closed
   section carries, a hairline to the row's end, and the chevron.

   .group-label above is what a NON-folding heading still uses: Active Icon,
   which is a selector rather than a section, and the two pane titles. The two
   tiers are one voice at two sizes.

   Every measurement here is a token in the metrics block at the top. */

/* The gap is the summary's margin, so a hidden section takes no space at all
   and the first visible one still opens with the right air above it. */
details.group { margin: 0; }

.sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: var(--sec-gap-major) 0 0;
  font-size: var(--sec-title-size);
  font-weight: var(--sec-title-weight);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Chromium draws its own triangle unless both of these say otherwise. */
.sec-head::-webkit-details-marker { display: none; }

.sec-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sec-title {
  text-transform: uppercase;
  letter-spacing: var(--sec-title-tracking);
}

/* The viewport's Play Animations toggle, twinned in the Animation section's
   header (Breece, 2026-09-24): a small square right of the title, pressed
   the way the bar's buttons are pressed. Inside a <summary>, so it is a
   real button the click handler keeps from folding the section. */
.sec-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: -2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--dim);
  cursor: pointer;
  flex: none;
}
.sec-play .ui-icon { width: 11px; height: 11px; }
.sec-play:hover { color: var(--text); border-color: var(--line-strong); }
.sec-play[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.sec-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sec-play[hidden] { display: none; }

/* The rule IS the layout: flex:1 takes exactly what is left between the title
   and the chevron, whatever the title's length. */
.sec-rule { flex: 1; height: 1px; background: var(--line); }
.sec-head:hover .sec-rule { background: var(--line-strong); }

/* What a CLOSED section holds, so a folded pane still says what is in it.
   Tabular, so a column of them does not jitter as the numbers change. */
.sec-count {
  font-size: var(--sec-count-size);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: auto;
}

details[open] > summary .sec-count { display: none; }

.sec-chev {
  width: var(--sec-chev-size);
  height: var(--sec-chev-size);
  border-right: var(--sec-chev-stroke) solid currentColor;
  border-bottom: var(--sec-chev-stroke) solid currentColor;
  transform: rotate(-45deg) translateY(1px);
  transition: transform 140ms ease;
  flex: none;
  margin-left: 2px;
}

/* Every summary in the panel draws this chevron, .sel-cat-head included, so
   the turn is written against the tag rather than against one class. */
details[open] > summary .sec-chev { transform: rotate(45deg) translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .sec-chev { transition: none; }
}

details.group > .body { padding: 8px 0 6px; }

/* The section's own buttons — Randomize, Reset, a category's + — as the body's
   first row. They used to sit in the header, which a disclosure cannot have:
   a button inside a button is not a thing the platform allows. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 12px;
}

/* Expand all / Collapse all: the PANE's controls, so they are quieter than a
   section header and pulled tighter than one (his note). */
.sec-all {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin: var(--sec-all-gap) 0 0;
}

.sec-all button {
  font-family: inherit;
  font-size: var(--sec-count-size);
  color: var(--dim);
  background: none;
  border: 0;
  padding: 1px 6px;
  cursor: pointer;
  border-radius: 3px;
}

.sec-all button:hover { color: var(--text); background: var(--panel-2); }
.sec-all button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* A pane's first section, and the one that follows the Expand / Collapse row.
   Written in this order because the two selectors weigh the same and the
   later one has to win where both apply. */
.panel-view > details.group:first-of-type > .sec-head { margin-top: var(--sec-gap-major-first); }
.panel-view > .sec-all + details.group > .sec-head { margin-top: var(--sec-all-gap); }

select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 5px;
  padding: 6px 8px;
  font: inherit;
}

/* ---------- sliders ---------- */

.param { margin-bottom: 11px; }

/* The gap between a slider's name row and its track. Breece's note on the
   picked header study: 3px read as cramped beside the screenshot he sent. */
.param-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--param-label-gap);
}

/* One size for the name of a field — and for the hex, which sits in the same
   optical row as one and looked like a footnote beside it. Kept as a single
   rule so the two cannot drift apart again. */
.param-top label,
.row label,
.hex { font-size: 12px; }

/* One bordered control made of three parts, so the arrows read as belonging to
   the number rather than sitting beside it. */
.num-field {
  display: inline-flex;
  align-items: stretch;
  background: var(--panel-2);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  overflow: hidden;
}

.num-field:focus-within { border-color: var(--accent); }

.param-top .num-input {
  /* Five characters is the longest value a slider ever shows - "100.2", "-12.5"
     - so the field is sized to five plus its padding (Breece, 2026-09-07:
     "a little narrower"). Was 52px. */
  width: calc(5ch + 6px);
  text-align: center;
  background: none;
  border: 0;
  color: var(--text);
  font: 11.5px ui-monospace, Consolas, monospace;
  padding: 2px 2px;
  /* The native spinners are replaced by the arrows either side, and they only
     appear on hover anyway — which makes the field twitch as the pointer
     crosses it. */
  appearance: textfield;
  -moz-appearance: textfield;
}

.param-top .num-input:focus { outline: none; }

.param-top .num-input::-webkit-outer-spin-button,
.param-top .num-input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

/* The accent at full strength. --accent-soft is a backing color for a pressed
   button; against the field's own dark background it was very nearly invisible,
   which defeats the point of selecting the number in the first place. */
.num-input::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.num-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  background: none;
  border: 0;
  color: var(--dim);
  cursor: pointer;
  padding: 0;
}

.num-step:hover { background: var(--line); color: var(--text); }
.num-step:active { background: var(--accent-soft); color: var(--text); }
.num-step .ui-icon { width: 10px; height: 10px; }

input[type="range"] {
  /* Block, not inline-block: an inline input sits in a line box whose strut
     adds a few pixels under it, and the min/max line's negative margin was
     eating that strut instead of closing on the track. */
  display: block;
  width: 100%;
  accent-color: var(--accent);
  margin: 0;
}

/* The label row's right-hand cluster: the angle glyph (degrees only) just
   left of the number field, outside it, centred on the field's height
   (Breece, 2026-09-07, option D of the Angle Control Study). */
/* align-self: center, because the row aligns its items by BASELINE and an svg
   has none - the browser synthesises one from its bottom edge, which dragged
   the label down and grew the row by 5px. Centred, the row stays 20px like
   every other slider's. */
.param-right { display: inline-flex; align-items: center; align-self: center; gap: 6px; }

/* The label with its optional (i): inline, so the button rides the text. */
.param-name { display: inline-flex; align-items: center; gap: 4px; }
.param-name .info-btn { flex: none; }

/* Drawn 22px tall but laid out as 20px - the number field's height - so the
   label row stays as tall as every other slider's and the track sits the same
   4px below it (Breece, 2026-09-07: "closer to the bar like regular sliders"). */
.angle-glyph { display: block; flex: none; cursor: grab; touch-action: none; margin: -1px 0; }
.angle-glyph:active { cursor: grabbing; }
.angle-glyph .ag-face { fill: var(--panel-2); stroke: var(--control-border); stroke-width: 1; }
.angle-glyph .ag-allowed { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .6; }
.angle-glyph .ag-needle { stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; }
.angle-glyph .ag-hub { fill: var(--dim); }

/* Min and max under every slider's track (Breece, 2026-09-07); the Settings
   dropdown "Slider ranges" hides them all with one class on the body. */
.range-ends {
  display: flex;
  justify-content: space-between;
  /* Pulled up into the range input's own bottom padding so the two numbers
     sit tight under the track (Breece, 2026-09-07: "much tighter"). A visual
     value, his to tune. */
  margin-top: var(--range-ends-gap);
  font: 10.5px ui-monospace, Consolas, monospace; /* his: "up just a tad" */
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  line-height: 1;
}
/* Hidden (Customization Slider Labels off): the numbers and words go, the
   snap marks' little ticks stay - and the row takes NO height, for the
   slim view hiding them is for (Breece, 2026-10-02). */
body.hide-ranges .range-ends { height: 0; margin-top: 0; }
body.hide-ranges .range-ends > span:not(.range-mark) { visibility: hidden; }
body.hide-ranges .range-mark { color: transparent; }

/* A named value along a slider: a tick under the track and its word, centred
   on where the thumb sits for that value (Wing Shape, 2026-09-07). Lives in
   the ends row so the same Settings dropdown shows and hides it. */
.range-ends { position: relative; }
.range-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding-top: 3px;
  color: var(--dim);
  white-space: nowrap;
}
.range-mark::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -1px;
  width: 1px;
  height: 3px;
  background: var(--dim);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.toast {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 20;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 11px;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 120ms ease-out; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* A class rule beats the UA stylesheet's [hidden], so a hidden .row would
   otherwise still be display:flex and stay on screen. */
.row[hidden],
.check[hidden],
.param[hidden] { display: none; }

.color-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tabular figures and a fixed width so three color rows line up their hex
   columns, which is the whole reason for showing the value rather than just
   the swatch. */
/* Typed as well as read, so it is styled as the field it is — but quietly,
   because a color row already has a swatch and a button competing for
   attention and a third bordered box would win an argument it should not be
   in. The border only appears when it is being used. */
.hex {
  width: 74px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  color: var(--dim);
  font-family: ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: right;
  text-transform: uppercase;
}

.hex:hover { border-color: var(--line-strong); }

.hex:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--text);
  background: var(--panel-2);
}

/* The BUTTON is the color — a real button now, not an <input type="color">.
   That input brought the browser's own dialog with it, which cannot be themed,
   padded or rounded, and carried an eyedropper icon we could neither match nor
   replace. See preview/color-picker.js. */
.color-btn {
  width: 34px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  cursor: pointer;
}

.color-btn:hover { border-color: var(--accent); }
.color-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.color-btn[aria-expanded="true"] { border-color: var(--accent); }

/* ---------- the picker ---------- */

/* A class rule setting `display` OUTRANKS the UA stylesheet's [hidden], so
   setting the attribute hid nothing: the popover kept its grid display and went
   on painting at full size. Every check read hidden === true and every one of
   them was meaningless. Same trap as .row[hidden] earlier in this file, same
   fix — and the lesson is to look at the screen, not at the attribute. */
.picker[hidden] { display: none; }

.picker {
  position: fixed;
  z-index: 40;
  width: 208px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 16px;
  gap: 9px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

@media (prefers-reduced-motion: no-preference) {
  .picker:not([hidden]) { animation: picker-in 110ms ease-out; }
}
@keyframes picker-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

/* Saturation across, value down, over the current hue. Three stacked gradients
   rather than a canvas: no pixel buffer to keep in step with the theme, and it
   stays crisp at any zoom. */
.picker-square {
  position: relative;
  height: 128px;
  border-radius: 5px;
  border: 1px solid var(--line);
  cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent),
    var(--hue, #f00);
}

.picker-hue {
  position: relative;
  height: 128px;
  width: 100%;
  border-radius: 5px;
  border: 1px solid var(--line);
  cursor: ns-resize;
  touch-action: none;
  background: linear-gradient(to bottom,
    #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
}

/* One handle style for both, so they read as the same kind of thing. White ring
   over a dark one, which stays visible on every hue and on black and white
   alike — a single-color ring disappears somewhere. */
.picker-square i,
.picker-hue i {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .35);
  pointer-events: none;
}

.picker-hue i { left: 50%; height: 8px; width: calc(100% + 4px); margin: -4px 0 0 0;
                left: -2px; border-radius: 4px; }

.picker-square:focus-visible,
.picker-hue:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.picker-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }

.picker-swatch {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--control-border);
  border-radius: 4px;
}

.picker-hex {
  flex: 1 1 auto;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  font: 400 11.5px ui-monospace, Consolas, monospace;
  text-transform: uppercase;
}

.picker-hex:focus { outline: none; border-color: var(--accent); }

.dropper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--dim);
  cursor: pointer;
}

.dropper:hover { color: var(--text); border-color: var(--control-border); }
.dropper:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dropper .ui-icon { width: 14px; height: 14px; }
/* The class sets display, which outranks the UA stylesheet's [hidden] - so the
   panel's eyedroppers, hidden by canPickFromScreen(), stayed on screen (Breece,
   2026-09-07). Same rule the rows and popovers already needed. */
.dropper[hidden] { display: none; }

/* A button that carries a word AND a mark. The icon trails the text because
   the text is what identifies the action; the mark only confirms it. */
/* The presets bar (u-mti3oo8o): a select and four small actions, wrapping
   when the panel is narrow. The note under it reports what a load did —
   skipped icons, an upgrade — in one line, and hides when there is nothing
   to say. */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 8px;
}
.preset-bar select { flex: 1 1 8rem; min-width: 6rem; }
.preset-actions { display: flex; gap: 4px; flex: none; }
.preset-note { margin-top: 0; }

/* The import sheet: a message, then either two big choices or a checklist
   of what the layer holds — each row an icon drawn small, its name, a box —
   and the Replace / Add as new pair under it. */
/* The same inset as the other sheets' bodies (#shortcutsBody, .advanced-body):
   the lead line used to sit hard against the edge (Breece, 2026-09-07). */
/* A column, so the icon list can give way first when the panel is short
   (Breece, 2026-09-24): everything else keeps its height, the list shrinks
   to about three and a half rows, and only past that does the body scroll. */
.import-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 16px; min-width: 0; }
.import-body > * { min-width: 0; flex: none; }
.import-msg { margin: 0; color: var(--dim); font-size: 13px; }
/* Link to this layer (js1-livelink, 2026-10-17): under the two Load choices, off by default. */
.import-link { margin: 0; font-size: 12.5px; color: var(--dim); align-items: flex-start; }
.import-link input { margin-top: 2px; }
.import-msg.is-warn { color: var(--accent); }
/* The loading bar (preview/load-progress.js, 2026-10-19): filled as it counts,
   a sliding band while After Effects reads. His values to tune. */
.load-progress { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--dim); }
.load-progress[hidden] { display: none; }
.load-progress-text { font-variant-numeric: tabular-nums; }
.load-progress-track { position: relative; height: 6px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.load-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 3px; transition: width .12s linear; }
.load-progress.is-waiting .load-progress-fill { width: 30%; animation: load-slide 1.3s ease-in-out infinite; }
@keyframes load-slide { from { left: -30%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .load-progress.is-waiting .load-progress-fill { animation: none; left: 0; width: 100%; opacity: .45; } }
.path-import-hint { margin: -4px 0 0; font-size: 12px; }
.import-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.import-choices button { flex: 1 1 10rem; white-space: normal; }
/* minmax(0, 1fr) and min-width: 0, because a grid item and a <select> both
   refuse to shrink below their content unless told, and the rows spilled past
   the sheet the moment a glyph joined them (2026-09-09). */
.import-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; overflow: auto; }
.import-list > * { min-width: 0; }

/* THE SCROLL FRAME around the icon list (Breece, 2026-09-24). The list takes
   whatever height the sheet has left and gives it back down to about 3.5
   rows (a row is 30px, the gap 4) before the body has to scroll. Two inner
   shadows say there is more: the top one fades in as the first row scrolls
   out of view, full once it is gone; the bottom one fades out over the last
   row. 24px tall at 22% black (Breece, 2026-09-24: 1.5x the height, half
   the opacity, a whole row rather than half)
   (preview.js scrollShadows writes --shade-top / --shade-bottom on scroll). */
.import-body > .scroll-frame { flex: 1 1 auto; min-height: calc(3.5 * 34px); position: relative; display: flex; flex-direction: column; min-width: 0; }
/* position: relative so a positioned descendant (the Customize pane's sr-only
   labels, once it is embedded in the Add to Existing Rig sheet) scrolls with
   the list instead of stretching the frame - which made the sheet's body
   scroll as well: "a weird double-scroll" (Breece, 2026-10-16). */
.scroll-frame > .import-list { flex: 1 1 auto; min-height: 0; position: relative; }
.scroll-frame > .scroll-shade {
  position: absolute; left: 0; right: 0; height: 24px; pointer-events: none;
  opacity: 0; transition: opacity 120ms ease-out; border-radius: 6px;
}
.scroll-frame > .scroll-shade.is-top { top: 0; background: linear-gradient(rgba(0, 0, 0, .22), rgba(0, 0, 0, 0)); opacity: var(--shade-top, 0); }
.scroll-frame > .scroll-shade.is-bottom { bottom: 0; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .22)); opacity: var(--shade-bottom, 0); }
@media (prefers-reduced-motion: reduce) { .scroll-frame > .scroll-shade { transition: none; } }
.import-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; min-width: 0; }
/* The per-row toggle (option C of the Custom Import Toggle Study, Breece
   2026-09-09): between the checkbox and the thumbnail. Lit = reading the
   rig's post-export edits; slashed = ignoring them; faint and inert = none. */
.import-tg { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--accent); cursor: pointer; }
.import-tg .ui-icon { width: 14px; height: 14px; }
.import-tg:hover { border-color: var(--line-strong); background: var(--panel); }
.import-tg:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.import-tg.is-off { color: var(--dim); }
.import-tg.is-none { color: var(--line-strong); cursor: default; }
.import-tg.is-none:hover { border-color: transparent; background: none; }
.import-thumb-slot { display: inline-flex; flex: none; width: 22px; height: 22px; }
.import-general { border-bottom: 1px solid var(--line-soft); margin-bottom: 2px; padding-bottom: 7px; border-radius: 6px 6px 0 0; }
.import-general b { font-weight: 600; }
.import-general-note { color: var(--dim); }
.import-row:hover { background: var(--panel-2); }
.import-row .import-thumb { width: 22px; height: 22px; flex: none; }
/* The sheet's buttons read at the lead line's size, text centred - the
   .mini is an inline-flex, so it needs justify-content, not text-align. */
.import-body button { font-size: 13px; }
.import-choices button, .import-actions button { justify-content: center; text-align: center; }

/* Custom Import (Breece's mockup, 2026-09-08). The subtitle rides the sheet's
   title after a bullet; the two "where from" rows are a label column and a
   left-aligned value column in the accent; three bulk buttons share the
   width; each row ends in a select whose border says what it will do (green
   adds, accent replaces) or the word Ignore when the row is off; the Import
   button dims when nothing is checked. */
.sheet-sub { color: var(--dim); font-weight: 400; }
.sheet-sub::before { content: '\2022'; margin: 0 8px; color: var(--dim); }
/* minmax(0, 1fr), not 1fr: a 1fr column will not shrink below its content,
   and the nowrap values were pushing the whole sheet wider than a narrow
   panel (Breece, 2026-09-12). The count and edits rows wrap; names ellipsize. */
.import-info { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; font-size: 12.5px; margin: 0; }  /* the dl's own 1em margins doubled the gap under it (Breece, 2026-09-12) */
.import-info dt { margin: 0; color: var(--dim); }
.import-info dd { margin: 0; color: var(--accent); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-info dd span { color: var(--dim); }
/* Dormant icons (Breece, 2026-09-12): the disclaimer, an accent-tinted box
   between the edits row and the bulk buttons, with the toggle under its
   text; a dormant row, once shown, reads as such. */
/* A dim ground under the accent border - the tinted fill read as "a very
   oversized button" (Breece, 2026-09-12). */
.import-dormant { border: 1px solid var(--accent); background: var(--panel-2); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; color: var(--text); }
/* The class rule on .import-row beats the UA's [hidden], so a hidden dormant
   row stayed on screen (the same trap .row had). */
.import-row[hidden] { display: none; }
/* An accordion (round 3): the summary is the icon and one line; open, the
   paragraph below it in the text column. */
.import-dormant summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; min-width: 0; }
.import-dormant summary::-webkit-details-marker { display: none; }
.import-dormant summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(45deg); margin: -3px 4px 0 0; flex: none; transition: transform 120ms; }
.import-dormant-line { flex: 1 1 auto; }
.import-dormant[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.import-dormant-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-dormant-line b { color: var(--accent); font-weight: 600; }
.import-dormant-icon { color: var(--accent); display: inline-flex; flex: none; }
.import-dormant-icon .ui-icon { width: 20px; height: 20px; }
.import-dormant p { margin: 6px 0 0 30px; }
/* The toggle on the summary line, before the chevron: a checkbox in a
   button-shaped label, grey until checked, blue when it is. */
.import-dormant .import-dormant-toggle { display: inline-flex; align-items: center; align-self: center; gap: 6px; height: 22px; line-height: 1; padding: 0 8px; cursor: pointer; flex: none; margin-left: auto; white-space: nowrap; }
.import-dormant .import-dormant-toggle input { margin: 0; width: 12px; height: 12px; accent-color: var(--accent); }
.import-dormant .import-dormant-toggle.mini { border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel-2); color: var(--dim); font-size: 11.5px; }
.import-dormant-choices { margin-top: 10px; }
.import-row.is-dormant { opacity: .65; border: 1px dashed var(--line-strong); }
.import-row.is-dormant:hover { opacity: 1; }
.import-dormant-tag { margin-left: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; }
.import-bulk { display: flex; gap: 8px; flex-wrap: wrap; }
.import-bulk button { flex: 1 1 8rem; justify-content: center; text-align: center; }
.import-row .import-name { flex: 1; font-size: 13px; }
.import-action { width: auto; max-width: 60%; min-width: 0; flex: 0 1 auto; margin-left: auto; padding: 4px 6px; font-size: 12px; text-overflow: ellipsis; }
.import-action[data-mode="add"] { border-color: var(--import-add, #3fa86a); color: var(--text); }
.import-action[data-mode="replace"] { border-color: var(--accent); color: var(--text); }
.import-ignore { margin-left: auto; color: var(--dim); font-size: 12px; padding-right: 6px; }
.import-actions button[disabled] { opacity: 0.5; cursor: default; }
.import-info dd.import-count { color: var(--text); white-space: normal; }

.import-row .import-name { flex: 1; font-size: 13px; }
.import-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.preset-note.is-warn { color: var(--accent); }

/* HIDDEN MEANS HIDDEN (his catch, launch day 2026-10-28: the dev-only Export Live buttons showed
   in the shipped panel). display: inline-flex outranks the browser's own [hidden] rule, so every
   .mini button that starts hidden - the live shape buttons, the Preset Manager's To Layer and
   Replace, the feedback window's email fallback - showed regardless. */
.mini[hidden] { display: none; }

.mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* The Rig Preset Manager foot's Load (a .primary, not a .mini): its glyph to the
   left of the word like its neighbours' (his note, 2026-10-19). */
.preset-foot .primary.has-glyph { display: inline-flex; align-items: center; gap: 5px; }
.preset-foot .primary.has-glyph[hidden] { display: none; }
.preset-foot .primary.has-glyph .ui-icon { width: 14px; height: 14px; stroke-width: 2.2; flex: none; }

/* The Rig Preset Manager toolbar: 14 -> 17px, +20%(his pick from the Glyph Size Study, 2026-09-29; the line weight grows with the glyph). */
#presetToolbar .mini .ui-icon { width: 17px; height: 17px; }

.mini .ui-icon {
  /* 14px, on the text's own centre line, and the set's 1.6 stroke thickened
     to 2.2 for the size - at 11px and a pixel high the Reset arrow was a thin
     speck sitting above the word (Breece, 2026-09-16). */
  width: 14px;
  height: 14px;
  margin-top: 0;
  stroke-width: 2.2;
  flex: none;
}

/* The heading of a run of style controls, with its own reset on the right. */
/* Spaced like the section head it mirrors, NOT like the bare label it started
   as. 2px underneath was right for a 9.5px word on its own; the row is 23px
   tall now that it carries a Reset, and at 2px the button crowded the first
   control instead of belonging to the heading. Measured against the Shape
   head, which is the same height and sits 8px clear of its first control.

   More above than below, so the heading binds to the group it introduces
   rather than floating between two of them. */
.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: var(--sec-gap-minor) 0 var(--sec-gap-minor-below);
}

.sub-head:first-child { margin-top: var(--sec-gap-minor-first); }

/* A subsection that carries a Reset stacks: the title on its line, the
   button on the next, left - the same edge Randomize and Reset sit on in the
   Shape section (Breece, 2026-09-16: "extra separation from the property
   controls"). */
.sub-head.has-reset {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* A switch LOCKED on because it is the last of its group still on
   (Precision's Draw Arm / Draw Circle / Draw Dot, Breece 2026-09-15): grey,
   still checked, and the title says why. */
.check.is-locked { cursor: default; color: var(--dim); }
.check.is-locked input { accent-color: var(--dim); opacity: 0.6; cursor: default; }

.mini {
  background: var(--panel-2);
  color: var(--dim);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px; font-family: inherit;
  cursor: pointer;
}

.mini:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- stage ---------- */

.stage {
  display: grid;
  /* header bar, canvas, readout */
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
}

/* No padding: the canvas runs to the edge of the stage, so the grid fills the
   whole area and nothing clips before the boundary. Framing margin is handled
   in world units by frameBounds(), not by CSS insetting the viewport. */
.stage-inner {
  background: var(--stage);
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#canvas { width: 100%; height: 100%; }
/* THE LINKED LAYER's Apply (js1-livelink, 2026-10-17): the viewport's bottom
   right, over the artwork, greyed until there is something to apply; the
   unlink beside it. preview.js lifts it above the Interact tab's shelf. */
.apply-linked-wrap { position: absolute; right: 12px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 4px; }
.apply-linked-wrap[hidden] { display: none; }
.apply-linked { padding: 6px 12px; font-size: 12px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.apply-linked[disabled] { opacity: .55; cursor: default; font-weight: 500; }
.apply-unlink { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel); color: var(--dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.apply-unlink:hover { color: var(--text); border-color: var(--accent); }
.apply-unlink .ui-icon { width: 13px; height: 13px; }
.apply-linked-wrap.is-stale .apply-linked { border-color: var(--accent); opacity: 1; }
/* The Export tab's own line for the link (his answer, 2026-10-17), under Update Selected Rig. */
.export-linked { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--dim); }
.export-linked[hidden] { display: none; }
.export-linked-words { flex: 1 1 auto; min-width: 0; }
.export-linked-words b { color: var(--text); font-weight: 600; }
.export-linked .mini { justify-content: center; }

/* The viewport with nothing enabled (u-truedeselect): one quiet line over
   the grid, out of the pointer's way. */
.stage-empty {
  position: absolute; inset: 0; margin: 0; padding: 16px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--dim); font-size: 13px; pointer-events: none;
}
.stage-empty[hidden] { display: none; }

/* ---------- readout ---------- */

/* One line now: the customization-data disclosure moved to the bottom of the
   Customize pane, where it sits with the settings it describes instead of
   costing the stage a permanent row. */
.readout {
  border-top: 1px solid var(--line);
  background: var(--panel);
  /* 7px rather than the 10px this row carried as text alone: the zoom pill is
     taller than a line of stats, so the old padding grew the bar by six
     pixels of viewport. A VISUAL VALUE — Breece's to tune. */
  padding: 7px 16px;
  /* The zoom control sits at the left end of this row, so the bar is a flex
     line now rather than a block holding one child. */
  display: flex;
  align-items: center;
  gap: 16px;
}

.stats {
  display: flex;
  gap: 20px;
  align-items: baseline;
  color: var(--dim);
  font-size: 11.5px;
  /* Take the rest of the bar, so the hint's margin-left:auto still reaches
     the right edge now that something sits to the left of the stats. */
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- the zoom control ----------

   Three segments in one bordered pill — the Task Board's shape, in the tool's
   own tokens. One control rather than three neighbours, because minus, the
   number and plus are one idea; and at the LEFT of the bottom bar, which is
   where the After Effects comp viewer keeps its magnification. */
.zoom {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  background: var(--panel-2);
  /* The segments' hover fills stop at the pill's rounded corners. */
  overflow: hidden;
}

.zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 11.5px; font-family: inherit;
  padding: 3px 7px;
  cursor: pointer;
}

.zoom-btn:hover:not(:disabled) { color: var(--text); background: var(--panel); }
.zoom-btn:disabled { opacity: .38; cursor: default; }

/* Inset, because an outline outside the segment would be clipped by the
   pill's own overflow: hidden. */
.zoom-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Tabular figures and a floor under the width, so spinning the wheel through
   100% -> 6400% cannot make the pill breathe in and out or shove the stats
   sideways. VISUAL VALUE (the width): Breece's to tune. */
.zoom-value {
  min-width: 52px;
  border-left: 1px solid var(--control-border);
  border-right: 1px solid var(--control-border);
  color: var(--text);
  font-family: ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* FIXED, and positioned by popover.js: the pill sits on the bottom edge of
   the window, so the menu has to be free to open upward. */
.zoom-menu {
  position: fixed;
  z-index: 30;
  min-width: 152px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 5px;
  display: flex;
  flex-direction: column;
}

/* The class sets a display, so it needs its own guard or [hidden] would do
   nothing to it — see tools/check-hidden.mjs. */
.zoom-menu[hidden] { display: none; }

.zoom-menu .popover-head { margin: 5px 7px 3px; }
.zoom-menu .popover-head:first-child { margin-top: 1px; }

.zoom-item {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--dim);
  font-size: 12px; font-family: inherit;
  text-align: left;
  padding: 4px 8px;
  cursor: pointer;
}

.zoom-item:hover { background: var(--panel); color: var(--text); }
.zoom-item[aria-checked="true"] { color: var(--text); }

.zoom-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* The tick keeps its column whether or not it is showing, so the labels line
   up down the menu instead of shifting as the choice moves. */
.zoom-item::before {
  content: '\2713';
  width: 10px;
  flex: 0 0 10px;
  visibility: hidden;
}

.zoom-item[aria-checked="true"]::before { visibility: visible; }

/* A property label's right-click menu (u-propreset, Breece, 2026-09-18):
   the zoom menu's look, hung from the label by label-menu.js. Its items are
   commands, not choices, so no tick column; one that has nothing to do right
   now - Reset on a property already at its default - is shown greyed rather
   than left out, so the menu is the same menu on every row. */
.label-menu .zoom-item::before { content: none; }
/* A menu of choices keeps the tick column (the frame rates, 2026-10-05). */
.label-menu.is-choices .zoom-item::before { content: '✓'; }
.label-menu .zoom-item:disabled { opacity: .45; cursor: default; background: none; color: var(--dim); }
/* THE VIEWPORTS' RIGHT-CLICK MENU (decisions §205): the label menu at the pointer,
   with a title row, dividers and ticked choices among the commands. */
/* The title white and bold, like the tabs' section titles, so it never reads as a command (his note, decisions §208). */
.label-menu .menu-head { padding: 4px 8px 3px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.label-menu .menu-head:not(:first-child) { margin-top: 2px; }
.label-menu .menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.label-menu .zoom-item.is-choice::before { content: '✓'; }
/* Inside the Interact viewport (testdrive-tab.js): the UI Scale as on the page, just
   under the drawn cursor (z-index 5) so it draws above them, and no real cursor. */
.testdrive-stage > .label-menu, .testdrive-stage > .icon-picker-pop { zoom: var(--ui-scale, 1); z-index: 4; }
.testdrive-stage > .label-menu, .testdrive-stage > .label-menu *, .testdrive-stage > .icon-picker-pop, .testdrive-stage > .icon-picker-pop * { cursor: none !important; }
.icon-picker-title { padding: 2px 4px 6px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }

/* The one-property Reset (u-propreset): the section Reset's arrow, no word,
   after the label and its (i). [hidden] at the default - the builder's call -
   and invisible until the row is hovered otherwise, so the glyph appears only
   where a value was changed, and only when the pointer is there to use it. */
.prop-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--dim);
  cursor: pointer;
  /* Transparent, not visibility: hidden - a hidden element is not hit, so a
     pointer arriving straight onto the glyph's spot hovered the label
     beneath it and the glyph's tooltip never came. */
  opacity: 0;
}
.prop-reset[hidden] { display: none; }
.prop-reset .ui-icon { width: 13px; height: 13px; stroke-width: 2.2; }
.param:hover .prop-reset,
.row:hover .prop-reset,
.check:hover .prop-reset { opacity: 1; }
.prop-reset:hover { color: var(--text); background: var(--line); }

.stats b { color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.stats .hint { margin-left: auto; }

/* The readout was a <details> long before the panel folded, so it did not need
   wrapping in a second one — it needed the section convention put ON it
   (u-accordionheaders). Its own summary styling and its private turning marker
   are gone; .sec-head above is the whole header now, and Copy moved down into
   the body's action row where it cannot toggle the disclosure. */
.out pre { margin-top: 0; }
.out .panel-note { margin-top: 6px; }

pre {
  margin: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
  max-height: 128px;
  overflow: auto;
  font: 11px/1.45 ui-monospace, Consolas, monospace;
  color: var(--code);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- view interaction ---------- */

/* Panning is only offered when the view is actually the user's to move. */
#canvas.pannable { cursor: grab; touch-action: none; }
#canvas.pannable.grabbing { cursor: grabbing; }

#canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Inline dropdown inside an Appearance row, sized to sit beside its label. */
.inline-select {
  width: auto;
  min-width: 96px;
  padding: 4px 6px;
  font-size: 12px;
}

/* Grid lines are styled here rather than as presentation attributes, so they
   stay tied to the stage tokens. var() does not work in an SVG attribute. */
.grid-minor { stroke: var(--stage-grid-minor); }
.grid-major { stroke: var(--stage-grid-major); }

/* ---------- preview all ---------- */

/* Category headings live in world units so they pan and zoom with the layout. */
.cat-label {
  /* Its own token, not the accent. The accent is chosen to read on a PANEL, and
     these labels sit on the stage, which is a different surface entirely — in
     the light theme the two need to be near-opposite. */
  fill: var(--stage-label);
  font: 500 4px ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cell-active {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  rx: 1;
}

.cell-hotspot { fill: var(--hotspot); }

/* The substate family border (TG4): a second border in a different style
   around every substate of the active icon — dashed and lighter, so the
   solid selection ring on the current substate still reads as THE selection. */
.cell-substates {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  opacity: .65;
  vector-effect: non-scaling-stroke;
  rx: 2;
}

/* The origin crosshair. Styled here rather than with presentation attributes
   in the markup, because var() does not work in an SVG attribute. */
.hotspot-mark {
  fill: none;
  stroke: var(--hotspot);
  stroke-width: 0.12;
}

/* A disabled icon still draws — the whole point of All Icons is to see what
   exists — but it reads as unavailable and refuses the pointer. Opacity alone
   carries it: dimming the artwork keeps its shape legible, where greying the
   fill would misrepresent the colors it is actually set to. */
.cell-off { opacity: .28; }

/* pointer-events stays on the hit pad so the tooltip still appears; the click
   handler is simply not attached. Without this the cursor would promise a
   selection the cell will not make. */
.cell-hit-off { fill: transparent; cursor: not-allowed; }

/* Faded to the same degree as the artwork above it, so a whole switched-off
   category recedes as one block rather than a dim row under a bright heading. */
.cat-label-off { opacity: .4; }

/* Invisible, but it makes the whole cell a click target rather than only the
   artwork, which is fiddly to hit on a thin icon. */
.cell-hit { fill: transparent; cursor: pointer; }

/* ---------- stage header bar ---------- */

/* Mirrors the readout bar along the bottom, so the stage is a self-contained
   unit: view controls sit on the thing they control, never scroll away with
   the panel, and never overlay the artwork the way a floating toolbar would. */
/* Two tracks. The wrapping controls are one flex item; the preferences button
   is another, and it never wraps — so it keeps the top right corner no matter
   how many rows the controls need. align-items: flex-start is what pins it to
   the TOP of a bar that has grown taller, rather than centring it against all
   the rows at once. */
.stage-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

/* Wrap rather than shrink. A control that slid off the edge was simply gone,
   and the whole point of carrying text labels is that they stay readable at
   any width. A second row costs a few pixels of height; a lost button costs
   the feature. This is also what makes an always-show-text preference
   viable — nothing has to collapse to survive a narrow window. */
.bar-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

/* The class sets display, which outranks the UA stylesheet’s [hidden]. Without
   this, hiding a bar group sets the attribute and changes nothing on screen —
   and every check that reads .hidden agrees it worked. FOURTH time in this
   file; see .row, .check, .param and .info-pop above. */
.bar-group[hidden] { display: none; }

/* The bar's one separator, used everywhere a cluster ends: after the scope
   dropdown, and before Live Fit — which is a mode that takes the view away
   from you, not a fourth overlay drawn on top of it.

   Whitespace rather than a drawn rule, because the bar wraps. A rule left
   trailing at the end of a row is a line pointing at nothing, and measured
   across 460-1240px that happened over most of the narrow range. A gap in the
   same position is invisible, which is the whole trick.

   A fixed gap, not a spring. Growing to fill pinned the toggles to the right
   edge, which left the dropdown stranded beside a lane of empty bar as soon as
   the toggles wrapped away to their own row. Holding a constant width instead
   keeps the two clusters adjacent at every size — "what am I looking at" next
   to "how am I looking at it" — and the bar breaks only when a row is
   genuinely full. It also never indents a wrapped row the way a margin on the
   following group would, because a trailing gap is invisible. */
.bar-gap { flex: 0 0 10px; }

/* The container exists for JS to mount into and for nothing else — its children
   lay out as if they were written directly in the bar. */
.bar-contents { display: contents; }

/* ---------- icons and the zoom cluster ---------- */

/* currentColor throughout the artwork, so one icon follows its button through
   idle, hover and pressed instead of needing a copy per state. */
.ui-icon {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
}

/* Square, so an icon-only button does not read as a text button with the text
   missing. Padding is set to match .bar-btn's height exactly. */
.bar-icon-btn {
  padding: 1px;
  width: 25px;
  height: 25px;
  justify-content: center;
}

/* The viewport bar and the zoom: 15 -> 20px, +35% (his pick from the Glyph Size Study, 2026-09-29; the line weight grows with the glyph). The buttons
   keep their size; the padding gives way. */
.stage-bar .ui-icon, .zoom-btn .ui-icon { width: 20px; height: 20px; }
/* The gear out of its box (Breece, 2026-09-30): a bare icon button, its glyph
   +50% on the bar's 20px; the bar's other buttons keep their boxes. */
/* His second look (2026-09-30): the glyph halfway back (25px), a lighter line
   (1.3 on the set's 1.6), and no more room at its sides than above and
   below - the button is exactly its glyph. */
#prefsBtn { width: auto; height: auto; padding: 0; gap: 0; border: 0; background: none; margin-top: 2px; margin-right: -5px; }
#prefsBtn:hover { background: none; color: var(--text); }
#prefsBtn .ui-icon { width: 25px; height: 25px; stroke-width: 1.3; }
#zoomOut, #zoomIn { padding: 1px 5px; }

.bar-btn:disabled,
.bar-action:disabled {
  opacity: .38;
  cursor: default;
}

.bar-btn:disabled:hover {
  color: var(--dim);
  border-color: var(--line);
}

/* ---------- preferences menu ---------- */

.bar-menu {
  position: relative;
  flex: 0 0 auto;
  display: flex;
}

/* Off-screen ruler used to measure option text. pre keeps the spaces in
   "Live Fit Active" from collapsing, which would under-measure it. */
.text-ruler {
  position: absolute;
  left: -9999px;
  top: 0;
  visibility: hidden;
  white-space: pre;
}

/* Right-aligned to the button so the panel cannot hang off the edge of a
   narrow stage, which left-aligning would do the moment the bar wraps. */
/* ---------- the shortcuts sheet ---------- */

/* A native <dialog>, so showModal() brings the backdrop, the focus trap and
   Escape with it. Centring is the platform's default for a modal dialog; the
   margin auto is only there because the UA stylesheet's is easy to lose. */
.sheet {
  /* Scaled here rather than by zoom - see UI SCALE near the top. */
  width: calc(460px * var(--ui-scale, 1));
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 64px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
  /* The DIALOG never scrolls - its body does. A scrolling dialog ran its
     scrollbar track up behind the sticky head, "a tell-tale sign that this
     was vibe-coded" (Breece, 2026-09-24): the track now starts under the
     head, which stays put because it is outside the scroller, not because
     it is sticky. [open] because display would otherwise undo the UA's
     display:none on a closed dialog. */
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet > * { flex: none; }
.sheet > .sheet-scroll,
.sheet > #shortcutsBody,
.sheet > .advanced-body,
.sheet > .import-body { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* The shadow under a fixed head once its body has scrolled (Breece,
   2026-09-24; the Shortcuts and Advanced Export Settings sheets): the same
   24px at 22% as the import list's, hung from the head so it stays put,
   its opacity written to --shade-top by preview.js headShadow. */
.has-shade { position: relative; }
.has-shade::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 24px;
  pointer-events: none; background: linear-gradient(rgba(0, 0, 0, .22), rgba(0, 0, 0, 0));
  opacity: var(--shade-top, 0); transition: opacity 120ms ease-out;
}
@media (prefers-reduced-motion: reduce) { .has-shade::after { transition: none; } }
/* Its twin over a fixed FOOT while there is more below (the Rig Preset
   Manager, 2026-09-28), its opacity in --shade-bottom. */
.has-shade-below { position: relative; }
.has-shade-below::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px;
  pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .22));
  opacity: var(--shade-bottom, 0); transition: opacity 120ms ease-out;
}
@media (prefers-reduced-motion: reduce) { .has-shade-below::before { transition: none; } }

/* Dark enough to take the tool out of play, not so dark it is gone. */
.sheet::backdrop {
  background: rgba(0, 0, 0, .55);
}

@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in 140ms ease-out; }
  .sheet[open]::backdrop { animation: fade-in 140ms ease-out; }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(6px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* The title and the way out stay reachable in a long list: the head is a
   fixed row of the sheet's column and the body scrolls beneath it. */
.sheet-head {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
}

.sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--dim);
  cursor: pointer;
}

.sheet-close:hover { color: var(--text); border-color: var(--line-strong); }
.sheet-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 13 -> 18px, +35% (his pick from the Glyph Size Study, 2026-09-29; the line weight grows with the glyph). */
.sheet-close .ui-icon { width: 18px; height: 18px; }

#shortcutsBody { padding: 4px 16px 16px; }

.sheet-group {
  margin: 16px 0 6px;
  color: var(--dim);
  font-size: var(--sec-title-size); /* the sub-head tier, same as .sub-label */
  font-weight: 600;
  letter-spacing: var(--sec-title-tracking);
  text-transform: uppercase;
}

.sheet-note {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.5;
}

/* Two columns: the keys, then what they do. A grid rather than a table so the
   key column sizes itself to the widest chord and every row still lines up. */
.keys {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: baseline;
  gap: 6px 14px;
  margin: 0;
}

.keys dt {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-self: end;
}

.keys dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 2px 6px;
  border: 1px solid var(--control-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

.key-plus { color: var(--dim); font-size: 10px; }

/* An action, not a setting — so it reads as a button rather than as another
   row of the preferences above it. */
.pref-action {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.pref-action:hover { border-color: var(--control-border); background: var(--panel-2); }
/* Their glyphs (Breece, 2026-10-02: Custom Themes a painter's palette,
   Shortcuts a keyboard, Reload the Reset arrow) at the Setup rows' larger
   18px - the Cursor Rig Presets button's size. */
.pref-action.has-glyph { display: flex; align-items: center; gap: 8px; }
.has-glyph[hidden] { display: none; }
.pref-action .ui-icon { width: 18px; height: 18px; flex: none; color: var(--dim); }
.pref-action:hover .ui-icon { color: var(--text); }
/* A checkbox and its words, with an "i" just to the right of the words
   (Customization Slider Labels, 2026-10-02). */
.pref-check-row { display: flex; align-items: center; gap: 6px; }
.pref-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); cursor: pointer; }
.pref-check input { accent-color: var(--accent); margin: 0; }
/* A section's contents, indented a little under its head (Breece,
   2026-10-05). The License section builds its own box (license-ui.js), so
   it takes the same indent with its head pulled back out. */
.pref-section { display: flex; flex-direction: column; gap: 8px; padding-left: 8px; }
.license-prefs { padding-left: 8px; }
.license-prefs > .popover-head { margin-left: -8px; }
/* THE MENU'S SPACING (Breece, 2026-10-05): a head sits close over its first
   item - License's 6px is the measure - a section's items stay fairly tight,
   and a little more room parts one section from the next head. */
#prefsPanel { gap: 16px; }
.pref-block { display: flex; flex-direction: column; gap: 6px; }
.pref-block-feedback .pref-section { gap: 6px; }
/* Custom Themes: just the palette in a square at the end of the Theme row,
   the height of the dropdown beside it (30px measured). */
.pref-icon-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--control-border); border-radius: 4px;
  background: var(--panel); color: var(--dim);
  cursor: pointer;
}
.pref-icon-btn[hidden] { display: none; }
.pref-icon-btn .ui-icon { width: 16px; height: 16px; }
.pref-icon-btn:hover { border-color: var(--accent); color: var(--text); }
.pref-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* A dropdown with its name at its left, in the checkboxes' words style
   (Theme and UI Scale, 2026-10-05); one label width so the two line up. */
.pref-field { display: flex; align-items: center; gap: 8px; }
.pref-field-label { flex: none; min-width: 52px; font-size: 12px; color: var(--text); }
.pref-field .pref-select { flex: 1 1 auto; width: auto; min-width: 0; }
/* A section head with an "i" at the right of its row (Your Name). */
.pref-head-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pref-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 268px;
  max-width: calc(100vw - 24px);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popover[hidden] { display: none; }

.popover-head {
  margin: 0;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--dim);
}

.pref-select {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 12px; font-family: inherit;
}

/* Your Name (rp-authors, 2026-09-29): a text field the shape of .pref-select. */
.pref-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 12px; font-family: inherit;
}
.pref-input:focus { outline: none; border-color: var(--accent); }

/* THE LICENSE (a-licensing, 2026-09-29): a key field and Activate on one
   line, in the Preferences and in the sheet the export buttons open. */
.license-prefs { display: flex; flex-direction: column; gap: 6px; }
.license-key { display: flex; gap: 6px; align-items: center; }
.license-key input { flex: 1 1 auto; min-width: 0; }
.license-key .pref-button { width: auto; flex: none; }
.license-sheet { width: calc(360px * var(--ui-scale, 1)); }
.license-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; font-size: 12px; }
.license-lede { margin: 0; color: var(--text); line-height: 1.45; }
.license-buy { color: var(--accent); font-size: 12px; }
/* Remove License and Remove Everywhere side by side; the inline confirm (§245). */
.license-buttons { display: flex; gap: 6px; }
.license-buttons[hidden] { display: none; }
.license-buttons .pref-button { flex: 1 1 0; }
.license-confirm { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.license-confirm-text { flex: 1 1 100%; line-height: 1.4; }
.license-confirm .pref-button { width: auto; flex: none; }
.license-danger { border-color: var(--warn); color: var(--warn); }

/* A plain button in the Preferences popover - the spin measurement
   (2026-09-22). Same shape as .pref-select above it. */
.pref-button {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 12px; font-family: inherit;
  cursor: pointer;
}
.pref-button:hover:not(:disabled) { border-color: var(--accent); }
.pref-button:disabled { opacity: .6; cursor: default; }

.pref-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--dim);
}

.pref-note:empty { display: none; }

.pref-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pref-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  cursor: pointer;
}

.pref-row input {
  accent-color: var(--accent);
  margin: 2px 0 0;
}

.pref-text { display: flex; flex-direction: column; gap: 2px; }
.pref-name { font-size: 12px; color: var(--text); }

.pref-note {
  font-size: 11px;
  line-height: 1.45;
  color: var(--dim);
}

/* Reachable by a screen reader, invisible to everyone else. The icon buttons
   carry no text, and a title attribute alone is not a reliable name. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bar-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--dim);
  white-space: nowrap;
}

.bar-select {
  /* Never shrink: squeezing is what pushed controls off the edge. Wrap instead. */
  flex: 0 0 auto;
  /* No min-width floor. A select already sizes itself to its widest option, so
     a floor on top of that only ever makes it wider than its contents need —
     which is exactly what it was doing. Let the longest label set the width. */
  width: auto;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
  /* The width is set from the selected option, so it changes when the choice
     does. Easing it stops the neighbours from appearing to jump. */
  transition: width 120ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .bar-select { transition: none; }
}

/* One button style for both the toggles and the plain actions, so a pressed
   toggle and an idle action are obviously the same family. */
.bar-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  color: var(--dim);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 11.5px; font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.bar-btn:hover { color: var(--text); border-color: var(--line-strong); }

.bar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Pressed state carries the accent, so what is on reads at a glance rather
   than needing the label to be parsed. */
.bar-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

/* An ACTION, not a state. Recenter fires and is done — it is never "on", so a
   box that exists to show an on/off fill would be lying about what it is. It
   gets no resting border or background and only lights up under the pointer.
   The transparent border keeps its metrics identical to .bar-btn, so text
   baselines and heights still line up across the row. */
.bar-action {
  flex: 0 0 auto;
  /* The borderless style already says "different kind of thing"; this is only
     here to stop it touching Live Fit. */
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--dim);
  padding: 4px 9px;
  font-size: 11.5px; font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.bar-action:hover { color: var(--text); background: var(--panel-2); }
.bar-action:active { background: var(--line); }

.bar-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}



/* ============================================================ narrow layout

   THE FIRST WIDTH BREAKPOINT THIS FILE HAS EVER HAD. Until now every @media
   here was prefers-reduced-motion or a theme, because the tool only ever ran
   in a browser window somebody had sized for it. Two hosts changed that: a CEP
   panel gets docked wherever there is room, and a web page gets phones.

   720px, and measured rather than picked: the control column is 320 and the
   stage stops being able to show an icon at a useful size below about 400.
   Under that the two cannot sit side by side, so they stack instead — controls
   first, since they are what someone came to touch, with the stage below at
   full width.

   Captured at 420 before this existed: the tab label truncated to "Custom...",
   the stage bar on three rows, an icon clipped by a 150px stage, and
   "CUSTOMIZATION DATA" running off the right edge. */
@media (max-width: 720px) {
  body {
    /* One column, three rows: STAGE, handle, panel.

       The stage goes on top because it is the thing being looked at, and a
       drawing pushed below a column of sliders is a drawing nobody sees. The
       source order is panel-handle-stage, which is right for the wide layout
       and for reading order, so the rows are assigned explicitly rather than
       by reordering the markup. */
    grid-template-columns: 1fr;
    /* The panel row yields to a SHORT viewport (a phone held sideways):
       without the min(), a stored 300px panel plus the stage's 180px floor
       wants 490px of a 375px body, and the body's overflow: hidden silently
       cuts the panel's bottom off — controls that exist but cannot be
       reached. 190px = the stage floor plus the handle. */
    grid-template-rows: minmax(180px, 1fr) 10px
      min(calc(var(--panel-h, 300px) * var(--ui-scale, 1)), calc(100vh - 190px));
  }

  .stage { grid-row: 1; }
  .resize-handle { grid-row: 2; }
  .panel { grid-row: 3; }

  /* The separator still separates — it just runs the other way. Same element,
     same drag, same double-click to reset; only the axis changes. */
  .resize-handle { cursor: row-resize; }
  .resize-handle::before {
    width: 36px;
    height: 4px;
    margin: -2px 0 0 -18px;
  }

  .panel {
    /* The height is the person's now, exactly as the width is in the wide
       layout, so nothing caps it here. */
    border-top: 1px solid var(--line);
  }

  /* The stage bar sets flex-wrap: nowrap so its controls stay on one line.
     There is no line to stay on here, so let it wrap — but the preferences
     button must not wrap WITH it. Left in the flow it landed on a third row
     at the far left, and its popover anchors right:0 to the button, which put
     the popover at left: -231 — off the window, and clipped dead by body's
     overflow:hidden. Taken out of the flow it cannot wrap at all, and the
     popover opens from the top right where there is room for it. */
  .stage-bar {
    flex-wrap: wrap;
    row-gap: 6px;
    position: relative;
    /* Room reserved so wrapped controls never run underneath the button. */
    padding-right: 46px;
  }

  .bar-menu {
    position: absolute;
    top: 7px;
    right: 12px;
  }

  /* The pan-and-zoom hint is the longest thing in the readout and the least
     useful on a small host — it describes gestures for a mouse. Dropping it
     is what stops the readout running to three lines. */
  .hint { display: none; }
}

/* No second breakpoint for the tab strip, and that is a measurement rather
   than an omission. The three tabs need 40, 71 and 47 pixels of text; three
   equal columns therefore fit in about 240px of strip, which is narrower than
   any panel this tool is usable in. Stacking them at 460 — which an earlier
   pass here did — spent three rows of height to solve a problem that does not
   arise. */

/* ------------------------------------------------------ advanced settings

   The Export tab's per-icon settings sheet. Same <dialog class="sheet"> bones
   as Shortcuts; what is new is the category head: the icon's name with a rule
   drawn from the end of the name to the sheet's right edge, so each icon's
   settings read as a labelled section rather than a run-on list. */
/* The Advanced Settings button: the last row of Export Settings, centered and
   alone on its row (Breece, 2026-09-06). */
.advanced-row { display: flex; justify-content: center; margin-top: 14px; }
/* The whole column (Breece, 2026-09-07), not a pill in the middle of it. */
.advanced-row .advanced-open { flex: 1; justify-content: center; }

/* THE LIST SCROLLS, NOT THE SHEET (Breece, 2026-09-16): a section per icon in
   the rig, plus one per hand set, can outrun any window. The dialog is a
   column - head, the Expand / Collapse row, then the list - and only the list
   scrolls, so the title, the way out and those two buttons stay put however
   long it gets. The height cap on .sheet keeps it inside the window; the
   scroll appears the moment the content passes it. */
/* [open] IS LOAD-BEARING. A closed <dialog> is hidden by the UA's own
   `dialog:not([open]) { display: none }`, which an id rule outranks - so a
   bare `display: flex` here left the sheet painted after it closed, with the
   panel live behind it and the X apparently doing nothing, and opening it
   again stacked a real modal on the ghost (Breece, 2026-09-16). Guarded by a
   test now: a display on a dialog itself must say [open]. */
#advancedSettings[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#advancedBody {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The sheet's own Expand / Collapse row: the panes' control, in the sheet's
   gutter, under the sticky head. */
/* In the head, between the title and the close button, above the head's
   line (Breece, 2026-09-24, from four options: a second fixed row under the
   rule read oddly). The auto margin pushes the pair to the right; the close
   button follows it. */
.sheet-head .sheet-all {
  flex: none;
  padding: 0;
  margin: 0 0 0 auto;
}

.advanced-body { padding: 4px 16px 16px; }

/* The category heads were the one place in the tool that already drew a name
   with a rule running off it — which is where the section convention came
   from. They are now the convention itself: the same <details class="group">
   with the same .sec-head, so the sheet reads as more of the panel rather than
   as a cousin of it (u-accordionheaders, Breece's own suggestion). */
.advanced-body > details.group:first-of-type > .sec-head { margin-top: 4px; }

.advanced-body .check { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.advanced-body .opt-consequence { margin: 2px 0 0 24px; }

/* ------------------------------------------------------------- test drive
   The playground overlay (u-mti6u692). It covers the stage while its tab is
   active; cursor: none hands the pointer to the drawn icon, whose hotspot
   rides the real position. Every hideable element here carries a [hidden]
   guard, because a class that sets display outranks the UA stylesheet and
   that bug has landed four times already. */
.stage-inner { position: relative; }

/* TRANSPARENT, not painted with the viewport color. It used to carry its own
   `background: var(--stage)`, which is the same color .stage-inner already
   paints behind it — so nothing looked different, and the grid underneath was
   covered by an opaque sheet. That is why the grid was missing on this tab
   while its toggle read on (u-testdrivezoom). The icons and their anchor marks
   are hidden instead, by #canvas.testdriving below, so what shows through is
   the grid alone. */
.testdrive-stage {
  position: absolute;
  inset: 0;
  cursor: none;
  overflow: hidden;
  z-index: 3;
}

/* The viewport's own drawing, while the playground is over it. */
/* Show / Hide Substates in the viewport (js1-substatebutton): a small pill at
   a constant screen size under its icon. His values to tune. */
/* Which substates the rig carries (decisions §165): a checkbox per Type under
   the dropdown; in Show All, the left-out ones dimmed and labelled. His values. */
.substate-pick { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; }
.substate-pick-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.substate-pick-list { display: flex; flex-direction: column; gap: 2px; padding-left: 8px; }
.substate-pick-row { font-size: 12px; }
#shapes > g.cell-out, #canvas g.cell-out { opacity: .35; }
.sub-label-out { opacity: .55; }
.substate-btn { cursor: pointer; }
/* The bridge over the gap to the icon only carries the hover: never painted. */
.substate-btn .substate-bridge, .substate-btn:hover .substate-bridge, .substate-btn:focus-visible .substate-bridge { fill: transparent; stroke: none; }
/* Under an icon that is not the active one, only while it is hovered (or the pill focused). */
.substate-btn.is-hover-only { display: none; }
#shapes > g:hover > .substate-btn.is-hover-only, .substate-btn.is-hover-only:focus-within { display: inline; }
.substate-btn .substate-pill { fill: var(--panel-2); stroke: var(--line-strong); stroke-width: 1; }
.substate-btn text { fill: var(--text); font: 600 11px/1 system-ui, sans-serif; pointer-events: none; }
.substate-btn:hover .substate-pill, .substate-btn:focus-visible .substate-pill { fill: var(--accent); stroke: var(--accent); }
.substate-btn:hover text, .substate-btn:focus-visible text { fill: var(--on-accent); }
.substate-btn:focus { outline: none; }

/* DEV MODE (preview/dev-mode.js; development builds only). */
/* Test Drive Everywhere: the real cursor hidden, the tool’s icon worn - over the dialogs
   too, since 2026-10-16: the drawn cursor moves into an open dialog’s top layer
   (dev-mode.js hostFor), where the sheets’ UI Scale zoom must not reach it. */
html.dev-td-everywhere, html.dev-td-everywhere * { cursor: none !important; }
/* A modal's darkened area is its ::backdrop, which * never matches - and in Chromium 99
   it does not inherit the dialog's cursor - so the real cursor showed there beside the
   drawn one (his note, 2026-10-20; decisions §199). */
html.dev-td-everywhere dialog::backdrop, html.dev-td-everywhere ::backdrop { cursor: none !important; }
/* Its own layer: a move is a compositor transform, no repaint (decisions §199). */
.dev-cursor { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 2147483647; overflow: visible; will-change: transform; transform-origin: 32px 32px; }
/* Promo Video Mode's Text Selector inverts what is under it, as Windows draws its I-beam (dev-mode.js drawRole, 2026-10-20). */
.dev-cursor.is-invert { mix-blend-mode: difference; }
.dev-cursor.is-invert [fill]:not([fill="none"]) { fill: #fff !important; }
.dev-cursor.is-invert [stroke]:not([stroke="none"]) { stroke: #fff !important; }
/* The icon picker's menu moves into a sheet the same way (icon-picker.js open, 2026-10-17). */
dialog.sheet > .icon-picker-pop, dialog > .icon-picker-pop,
dialog.sheet > .dev-cursor, dialog > .dev-cursor, dialog.sheet > .dev-select-pop, dialog > .dev-select-pop { zoom: 1; margin: 0; }
/* Promo Video Mode’s stand-in for a plain dropdown’s list (dev-mode.js openPop): the
   native list opens in a window of the OS’s, above the drawn cursor; this one is in the
   page. Sized in screen pixels by the script, so no zoom here. */
.dev-select-pop { position: fixed; z-index: 2147483000; zoom: 1; margin: 0; overflow-y: auto; padding: 3px 0; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); font-family: inherit; line-height: 1.35; }
.dev-select-opt { padding: 3px 10px; white-space: nowrap; cursor: default; }
.dev-select-opt.is-indented { padding-left: 20px; }
.dev-select-opt.is-active { background: var(--accent); color: var(--on-accent); }
.dev-select-opt[aria-disabled="true"] { opacity: .45; }
.dev-select-group { padding: 4px 10px 2px; font-weight: 700; color: var(--dim, var(--text)); }
.dev-sheet-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; min-width: 300px; max-width: 380px; }
.dev-note { margin: -4px 0 4px; }
.dev-size { margin: 0; font-size: 13px; color: var(--dim); }
.dev-size b { color: var(--text); font-variant-numeric: tabular-nums; }
/* Promo Video Mode's Cursor Sizes (dev-mode.js sizeRow, decisions §219): label, slider, the value - a press puts it back to 100%. */
.dev-range { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.dev-range-label { grid-column: 1 / -1; font-size: 13px; }
.dev-range input { width: 100%; }
.dev-range-out { min-width: 46px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: none; color: var(--dim); font: inherit; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; cursor: pointer; }
.dev-range-out:hover { color: var(--text); border-color: var(--accent); }

#canvas.testdriving #shapes,
#canvas.testdriving #overlay,
#canvas.testdriving #hotspot { display: none; }

.testdrive-stage[hidden] { display: none; }

/* THE SHELF (decisions §163): a strip along the bottom of the scene with the
   included Pointers, Hands, Selectors, Transformers and the Magnifying Glass.
   Over the grid, under the ridden cursor; the pop rings may spill past a
   cell. His values to tune: the inset, the gaps, the fill. */
.td-shelf {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 10px 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
}
.td-shelf[hidden] { display: none; }
/* The icons, then the Hide button centred below them (decisions §203); collapsed, the
   strip shrinks to the button alone, centred at the bottom where the button already was. */
.td-shelf { flex-direction: column; align-items: center; gap: 8px; }
.td-shelf-icons { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 10px 18px; }
.td-shelf-icons[hidden] { display: none; }
.td-shelf-toggle { display: inline-flex; align-items: center; gap: 6px; }
.td-shelf-toggle .ui-icon { width: 14px; height: 14px; flex: none; }
.td-shelf.is-collapsed { left: 50%; right: auto; transform: translateX(-50%); padding: 6px; }
.td-shelf-cell { flex: none; overflow: visible; }

/* The world layer: its transform is the view (translate to the world origin's
   screen position, scale by the zoom), set by testdrive-tab.js on every
   applyView. Children are positioned in world units by JS. */
.td-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  /* NO will-change (Breece, 2026-10-16: "the interactive elements all look
     really blurry when you zoom in"). will-change: transform made Chromium
     keep this layer as a bitmap painted at one scale and stretch it; without
     it the text and borders - already vectors - are drawn again at each zoom. */
}

/* The button's word and Drag Me's are not text to select - a drag over empty
   viewport highlighted "Button" (his note, 2026-10-02). Highlight Me still selects. */
.td-button, .td-drag { user-select: none; -webkit-user-select: none; }
/* The Button's bump on a press (decisions §206): in, then a touch past, then home. His values to tune. */
.td-button.is-bumped { animation: td-bump 220ms ease-out; }
@keyframes td-bump { 0% { transform: scale(1); } 35% { transform: scale(.94); } 70% { transform: scale(1.03); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .td-button.is-bumped { animation: none; } }
/* Drag Me's and Transform Me's Reset, centred under the piece once it has moved (decisions §206). */
.td-reset-piece { position: absolute; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; cursor: none; white-space: nowrap; }
.td-reset-piece[hidden] { display: none; }
.td-reset-piece .ui-icon { width: 13px; height: 13px; flex: none; }

.td-button {
  position: absolute;
  padding: 12px 26px;
  border: 2px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  font: 600 15px/1 inherit;
  font-family: inherit;
  cursor: none;
}

.td-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.td-text {
  position: absolute;
  margin: 0;
  white-space: nowrap;
  color: var(--text);
  font-size: 17px;
  cursor: none;
  user-select: text;
}

.td-text::selection { background: var(--accent); color: var(--on-accent); }

.td-drag {
  position: absolute;
  padding: 18px 22px;
  white-space: nowrap;
  border: 2px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--panel);
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  cursor: none;
  user-select: none;
  touch-action: none;
}

.td-drag:hover { border-color: var(--accent); color: var(--text); }

/* td-newelements (2026-10-18): the pieces for the icons the playground could not
   show yet. World units, like the others. All visual values his to tune. */
[data-td-el][hidden] { display: none; }

/* A disabled button: no hover, grayed - the Forbidden icon answers it. */
.td-button.td-disabled,
.td-button.td-disabled:hover {
  background: var(--panel);
  border-color: var(--line);
  border-style: solid;
  color: var(--dim);
  opacity: .6;
}

/* A help link: the pointer wearing the Question Mark badge answers it. */
.td-help {
  position: absolute;
  white-space: nowrap;
  color: var(--link, var(--accent));
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
}

/* The Transform box. The outer box reaches ROTATE_REACH (td-transform.js) past
   the drawn one, so a press just outside it still lands here and rotates. */
.td-transform {
  position: absolute;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transform-origin: 50% 50%;
}
.td-transform-box {
  position: absolute;
  inset: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  background: rgba(127, 127, 127, .08);
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
}
.td-transform-box i {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -4px 0 0 -4px;
  background: var(--panel);
  border: 1px solid var(--accent);
}
.td-transform-box .tl { left: 0; top: 0; }
.td-transform-box .tc { left: 50%; top: 0; }
.td-transform-box .tr { left: 100%; top: 0; }
.td-transform-box .ml { left: 0; top: 50%; }
.td-transform-box .mr { left: 100%; top: 50%; }
.td-transform-box .bl { left: 0; top: 100%; }
.td-transform-box .bc { left: 50%; top: 100%; }
.td-transform-box .br { left: 100%; top: 100%; }

/* Two tiny loading windows, one Windows-like and one Mac-like. The bar never
   fills; a highlight sweeps along it (Windows) or it breathes (Mac). */
.td-win {
  position: absolute;
  width: 168px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.td-win-windows { border-radius: 6px; }
.td-win-mac { border-radius: 9px; }
.td-win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
}
.td-win-windows .td-win-title { flex: 1; }
.td-win-ctrls { display: flex; gap: 9px; color: var(--dim); font-size: 10px; line-height: 1; }
.td-win-ctrls i { font-style: normal; }
.td-win-mac .td-win-title { flex: 1; text-align: center; margin-right: 42px; font-weight: 600; }
.td-win-dots { display: flex; gap: 5px; }
.td-win-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.td-win-dots i:nth-child(2) { background: #febc2e; }
.td-win-dots i:nth-child(3) { background: #28c840; }
.td-win-body { padding: 14px 12px 15px; }
.td-progress {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.td-win-mac .td-progress { height: 6px; border-radius: 3px; border: 0; }
.td-progress span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 42%;
  overflow: hidden;
}
.td-win-windows .td-progress span { background: #06b025; }
.td-win-mac .td-progress span { background: #0a84ff; border-radius: 3px; animation: td-breathe 2.4s ease-in-out infinite; }
.td-win-windows .td-progress span::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: td-sweep 2.2s linear infinite;
}
@keyframes td-sweep { from { left: -40%; } to { left: 100%; } }
@keyframes td-breathe { 50% { opacity: .62; } }
@media (prefers-reduced-motion: reduce) {
  .td-win-windows .td-progress span::after, .td-win-mac .td-progress span { animation: none; }
}

.td-cursor {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 5;
  /* Moved by transform on its own layer: no layout or repaint per move (decisions §199). */
  will-change: transform;
  /* A large Circle Pop can outgrow the 64-unit viewBox; clipping it at the
     svg edge would square off the ring mid-bloom. */
  overflow: visible;
}

.td-cursor[hidden] { display: none; }

/* The Test Drive toolbar (2026-09-21): Adobe's left-hand strip. The active
   tool's square is DARKER than the strip; each glyph is the tool's own
   cursor painted flat - its fill-role parts a medium theme color, its
   stroke-role parts (outline, and the Magnifier's lens) the button's own
   background, so the outline reads as a cut and follows the darker square.
   testdrive-tab.js draws them with two sentinel colors these rules repaint. */
.td-toolbar {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: default;
}
.td-toolbar[hidden] { display: none; }
.td-tool {
  --td-tool-bg: var(--panel);
  --td-glyph: var(--dim);
  width: 30px;
  height: 30px;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: var(--td-tool-bg);
  display: grid;
  place-items: center;
  cursor: default;
}
/* Hover and active are ONE color (Breece, 2026-09-21), darker than --bg. */
.td-tool:hover,
.td-tool[aria-pressed="true"] { --td-tool-bg: var(--tool-active); }
.td-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.td-tool svg { width: 22px; height: 22px; overflow: visible; display: block; }
.td-tool svg [fill]:not([fill="none"]) { fill: var(--td-glyph); }
.td-tool svg [fill="#fe0002"]:not([fill="none"]) { fill: var(--td-tool-bg); }
.td-tool svg [stroke]:not([stroke="none"]) { stroke: var(--td-tool-bg); }
.td-tool svg [stroke="#fe0001"]:not([stroke="none"]) { stroke: var(--td-glyph); }

/* THE PATH EDITOR'S PALETTE (Task Group 10, u-editorpalette, 2026-10-17): the same
   toolbar at the viewport's left, on Customize while a Custom Cursor is selected.
   Its tools are ui-icons glyphs in currentColor, dimmed while they wait for the editor. */
.ed-tool { color: var(--td-glyph); }
.ed-tool .ui-icon { width: 19px; height: 19px; display: block; }
.ed-tool[disabled] { opacity: .45; cursor: default; }
.ed-tool[disabled]:hover { --td-tool-bg: var(--panel); }
.ed-tool[aria-pressed="true"] { color: var(--text); }
/* EDIT MODE'S CURSORS (Task Group 12): the left button edits, so the pan's grab hand stays for Space and
   the middle button; the drawing tools take a crosshair. */
#canvas.path-editing.pannable { cursor: default; }
#canvas.path-editing[data-ed-tool="pen"], #canvas.path-editing[data-ed-tool="addPoint"], #canvas.path-editing[data-ed-tool="deletePoint"], #canvas.path-editing[data-ed-tool="convert"] { cursor: crosshair; }
#canvas.path-editing.ed-space { cursor: grab; }
/* The transform box's cursors (move, the grips, the rotate arrows) over the
   whole box - icon cells and their hit pads included (his note, 2026-10-19). */
#canvas.path-editing[data-ed-cursor="1"], #canvas.path-editing[data-ed-cursor="1"] * { cursor: var(--ed-cursor) !important; }
#canvas.path-editing.grabbing { cursor: grabbing; }

/* The pane's mapping rows. */
.td-intro, .td-note { color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.td-note { margin-top: 14px; }

/* The pane's Reset (td-resetcontrols), on its own line above the rows. */
.td-actions { margin: 12px 0 0; }
.td-rows { display: grid; gap: 8px; margin-top: 12px; }

/* A row's label and its one-property reset glyph, as in Customize. */
.td-label { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.td-row:hover .prop-reset { opacity: 1; }

.td-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  font-size: 13px;
}

.td-row select {
  min-width: 150px;
  padding: 5px 8px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
}

/* The version line pinned at the settings menu's bottom (u-mti60tko). */
.pref-version {
  margin: -2px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  /* At the right, to stand out a little (Breece, 2026-10-05). */
  text-align: right;
}
/* His website at the left of the version's row (2026-10-07). */
/* Side by side when they fit; the version drops under, still at the right, when they do not. */
.pref-version-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.pref-version-row > span { white-space: nowrap; margin-left: auto; }
.pref-site { color: var(--dim); text-decoration: none; }
.pref-site:hover, .pref-site:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* The eye on Show All Substates: bigger than the Reset arrow the .mini rule
   sizes for, and sitting on the text's own centre line rather than lifted -
   at 11px and a pixel high it read as a speck (Breece, 2026-09-16). */
#showAllSubstates .ui-icon {
  width: 16px;
  height: 16px;
  margin-top: 0;
  flex: none;
}

/* The Show All Substates toggle reads as pressed while the stage shows the
   contact sheet. */
.mini.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* --------------------------------------------------- animation tab (TG3) */

/* One card per animation, the kickoff-approved shape. The include row and
   cost line reuse the Export tab's classes on purpose — one look for "does
   this go in the rig, and what does it cost" wherever it appears. */
.anim-card { margin-bottom: 16px; }
/* A BOX PER CARD (his pick, 2026-10-05: "The subsection headers don't look
   like section headers when they are both open"): each animation a softly
   filled, rounded box - the head at its top, a rule under it while open,
   its settings inside - so where one ends is never a question. The head's
   own rule gives way to plain space inside the box. */
.anim-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; margin: 0 0 14px; }
/* Not accordions since 2026-10-05 (his note: the carets fell out of the boxes
   on a narrow panel): the head is a plain row - the title whole, what the rig
   gets shortening with an ellipsis, Preview at the right, always inside. */
.anim-card > .anim-head { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.anim-card > .anim-head .sec-title { flex: none; color: var(--text); white-space: nowrap; }
.anim-card > .anim-head .anim-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.anim-card > .anim-body { padding: 10px 0 8px; }
.anim-card .anim-mode { margin-top: 0; }
/* "Plays at every layer marker in After Effects." under Animation in Rig,
   while it says 100% Expressions (decisions §164). His values to tune. */
.anim-marker-note { margin: -4px 0 10px; font-size: 11.5px; color: var(--dim); }
.anim-marker-note[hidden] { display: none; }
.anim-card .export-opt { margin-top: 2px; }
.anim-card .opt-consequence { margin-bottom: 10px; }
.anim-params { margin-top: 2px; }

/* The web demo's export disclaimer (u-mti697rj): a box stroked in the
   current theme's accent, per Breece's task text. [hidden] guard because
   display outranks the hidden attribute. */
.demo-disclaimer {
  margin: 10px 0;
  padding: 9px 12px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
}
.demo-disclaimer[hidden] { display: none; }
/* Its link to the store, on a line of its own under his words (2026-10-07). */
.demo-buy { display: block; margin-top: 4px; color: var(--accent); text-underline-offset: 2px; }
.demo-terms .store-link { color: var(--accent); text-underline-offset: 2px; }


/* ------------------------------------------------ icon picker (TG4) */

/* Dormant: the name on the left, the selected icon's drawing on the right —
   Breece's spec. Styled like a select so it reads as a control. */
.icon-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 120px;
  padding: 3px 6px 3px 8px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.icon-picker:hover { border-color: var(--accent); }
.icon-picker[aria-expanded="true"] { border-color: var(--accent); }
.icon-picker-thumb { display: inline-flex; width: 22px; height: 22px; flex: none; }
.icon-picker-thumb-svg { width: 22px; height: 22px; }

/* As wide as its grid, no wider (u-pickerwidth, 2026-09-25): no minimum
   width - the old 180px held room for a fourth column - and max-content so
   the fixed layer shrinks to what it holds. */
.icon-picker-pop {
  position: fixed;
  z-index: 60;
  width: max-content;
  max-width: 300px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.icon-picker-pop[hidden] { display: none; }
/* An empty menu says why (the per-icon preset menu with nothing saved yet). */
.icon-picker-empty { margin: 0; padding: 8px 10px; color: var(--dim); font-size: 12px; max-width: 220px; line-height: 1.4; }

/* THE PER-ICON PRESET ROW (u-iconpresets, 2026-09-30), at the top of the
   Shape section: the word, the picker taking the slack, the dots menu. */
.icon-preset-row { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.icon-preset-label { font-size: 12px; color: var(--dim); flex: none; }
.icon-preset-slot { display: flex; flex: 1 1 auto; min-width: 0; }
.icon-preset-slot .icon-picker { flex: 1 1 auto; min-width: 0; }
.icon-preset-picker.is-none .icon-picker-name { color: var(--dim); font-style: italic; }
.icon-preset-more { flex: none; width: 26px; padding: 0; justify-content: center; }
.icon-preset-more .ui-icon { width: 16px; height: 16px; }
.icon-preset-field { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 12px; }
.icon-preset-field .pref-input { flex: 1 1 auto; }
.icon-picker-head {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 2px 6px;
}
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 38px);
  gap: 4px;
}
.icon-picker-item {
  width: 38px;
  height: 38px;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.icon-picker-item:hover { border-color: var(--accent); }
.icon-picker-item.is-current { border-color: var(--accent); background: var(--accent-soft, var(--panel-2)); }
.icon-picker-item-svg { width: 100%; height: 100%; display: block; }
.icon-picker-more { margin: 8px 0 0; width: 100%; }
.icon-picker-all { margin-top: 8px; }
.icon-picker-all[hidden] { display: none; }

/* The Choose tree's add and trash controls (u-mti6h40p), with the hover
   colors Breece asked for (u-mtjanf53): trash reads red, add reads green,
   across every theme — so the constants are fixed, not theme tokens. */
.sel-add {
  margin-left: 6px;
  min-width: 22px;
  padding: 0 6px;
  line-height: 18px;
  font-size: 14px;
}
.sel-add:hover { color: #3fb950; border-color: #3fb950; }
.sel-trash {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--dim);
  cursor: pointer;
}
.sel-trash:hover { color: #e5484d; background: rgba(229, 72, 77, .12); }
.sel-trash:disabled { opacity: .3; cursor: not-allowed; }
/* 14 -> 19px, +35% (his pick from the Glyph Size Study, 2026-09-29; the line weight grows with the glyph). */
.sel-trash svg { width: 19px; height: 19px; }
/* Duplicate, just left of the trash (u-duplicateicon, 2026-09-25): the
   trash's shape, and the accent on hover - it adds, it does not remove. His
   values to tune: the -4px pulls the pair to 4px apart inside the row's 8px
   gap; the hover is the theme's accent on its soft fill. */
.sel-copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: -4px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--dim);
  cursor: pointer;
}
/* Green, like the + above it: it creates (Breece, 2026-09-25). */
.sel-copy:hover { color: #3fb950; background: rgba(63, 185, 80, .12); }
.sel-copy svg { width: 19px; height: 19px; }
/* Add to the selected rig (ur-quickadd, 2026-10-16): the row's first glyph,
   the same shape as its neighbors, green on hover since it creates too. */
.sel-torig { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: -4px; padding: 0; background: none; border: 0; border-radius: 4px; color: var(--dim); cursor: pointer; }
.sel-torig:hover { color: #3fb950; background: rgba(63, 185, 80, .12); }
.sel-torig:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sel-torig[hidden] { display: none; }
.sel-torig svg { width: 19px; height: 19px; }
/* The one substate a split icon keeps, beside its name (js1-substateicons, 2026-10-17). */
/* Rename in place (u-renameicons, 2026-10-17): the row's name as a field. */
.sel-rename { width: 100%; min-width: 0; font: inherit; font-size: 12px; padding: 1px 4px; border: 1px solid var(--accent); border-radius: 3px; background: var(--panel); color: var(--text); }
.sel-sub { margin-left: 6px; font-size: 10px; letter-spacing: .02em; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 5px; vertical-align: 1px; white-space: nowrap; }
.substate-split { margin-left: auto; padding: 2px 8px; font-size: 11px; }
.substate-split[hidden] { display: none; }
/* The same quick add on every export option row, Setup's mirror and the
   Export tab alike (his note, 2026-10-16): the feature onto the selected rig. */
.opt-torig { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; background: none; border: 0; border-radius: 4px; color: var(--dim); cursor: pointer; margin-left: auto; }
.opt-torig:hover { color: #3fb950; background: rgba(63, 185, 80, .12); }
.opt-torig:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.opt-torig[hidden] { display: none; }
.opt-torig svg { width: 19px; height: 19px; }
/* Right-aligned beside the ⓘ (his note, 2026-10-17): the ⓘ's own auto margin
   was splitting the row's free space with the glyph's, which floated mid-row. */
.export-opt .opt-torig ~ .info-btn, .export-opt .opt-torig ~ .opt-chev { margin-left: 0; }
/* Presets, left of Duplicate (Breece, 2026-10-15, from Jose's session;
   decisions §163): the same shape as its neighbors, the accent on hover -
   it changes the look, it neither adds nor removes. */
.sel-presets {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: -4px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--dim);
  cursor: pointer;
}
.sel-presets:hover, .sel-presets[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft, rgba(110, 168, 254, .12)); }
.sel-presets svg { width: 19px; height: 19px; }
/* The slot carries the thumb to the right of the name, just left of the trash (Breece, 2026-09-08). */
.sel-thumb-slot { display: inline-flex; margin-left: auto; }

/* Hidden guards for the flex bars: display on the class would otherwise
   beat the [hidden] attribute (the suite checks every hidden element). */
.preset-bar[hidden] { display: none; }
.preset-note[hidden] { display: none; }

/* "Report a bug", just above the version line in the settings menu. A link
   rather than a .pref-action button: it leaves the tool, and a button that
   leaves is a small lie about what is going to happen (b-bugreport). */
.prefs-link {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}

.prefs-link:hover { text-decoration: underline; }

/* FEEDBACK/BUG REPORTS (fb-decide, 2026-09-30): the gear menu's line - the
   form, a slash and the bug as glyphs set as close as they go, the bug
   tilted 12°, grey until hovered; no box; the words in the accent, underlined
   on hover (his design, after the one-glyph studies). His values to tune:
   the 18px glyphs (+20% on the menu's 15), the slash's -5px sides, the 12°. */
.pref-feedback {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.pref-feedback .ui-icon { width: 18px; height: 18px; color: var(--accent); flex: none; }
.pref-feedback .pref-feedback-slash { margin: 0 -5px; }
/* The form glyph's outline starts 3px inside its box: pulled back so it lines
   up with the checkbox below it (Breece, 2026-10-05, measured in the menu). */
.pref-feedback .pref-feedback-form { margin-left: -3px; }
.pref-feedback .pref-feedback-bug { transform: rotate(12deg); }
.pref-feedback .pref-feedback-text { margin-left: 7px; }
.pref-feedback:hover .pref-feedback-text { text-decoration: underline; }
.pref-feedback:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.feedback-sheet { width: min(460px, 92vw); }
.feedback-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.feedback-kinds { display: flex; gap: 6px; }
.feedback-kind[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.feedback-text {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.45;
}
.feedback-text:focus { outline: none; border-color: var(--accent); }
.feedback-field { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.feedback-field > span { white-space: nowrap; }
.feedback-field .pref-input { flex: 1 1 auto; }
.feedback-check { font-size: 12px; }
/* Files and screenshots (decisions §199): the button and its hint, then one row per file. */
.feedback-files { display: flex; flex-direction: column; gap: 6px; }
.feedback-files-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feedback-files-row .has-glyph { display: inline-flex; align-items: center; gap: 6px; }
.feedback-files-row .ui-icon { width: 15px; height: 15px; flex: none; }
.feedback-files-hint { color: var(--dim); font-size: 11.5px; }
.feedback-file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.feedback-file-list[hidden], .feedback-files-total[hidden] { display: none; }
.feedback-file-list li { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 8px; border: 1px solid var(--control-border); border-radius: 5px; font-size: 12px; }
.feedback-file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-file-size { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feedback-file-remove { flex: none; display: inline-flex; padding: 2px; border: 0; background: none; color: var(--dim); cursor: pointer; border-radius: 4px; }
.feedback-file-remove:hover, .feedback-file-remove:focus-visible { color: var(--text); background: var(--control-bg, rgba(127,127,127,.15)); }
.feedback-file-remove .ui-icon { width: 13px; height: 13px; }
.feedback-files-total { margin: 0; color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
/* A drag over the window: the whole body says it will take the files. */
.feedback-sheet.is-dropping .feedback-body { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: 8px; }

/* The web demo's first-visit agreement (2026-10-07). */
.demo-terms-link { margin: 0 0 12px; font-size: 12px; }
.demo-terms-link a { color: var(--accent); text-underline-offset: 2px; }
.demo-terms-check { margin-bottom: 14px; font-size: 12px; }
.demo-terms .primary[disabled] { cursor: default; }
.feedback-also { margin: 0; color: var(--dim); font-size: 11.5px; line-height: 1.45; }
.feedback-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.feedback-actions .primary:disabled { opacity: .6; cursor: default; }
/* The Send buttons' paper airplane, sized with the tool's other button glyphs (his value to tune). */
.feedback-send { display: inline-flex; align-items: center; gap: 7px; }
.feedback-send .ui-icon { width: 17px; height: 17px; flex: none; }
/* "Email it instead" waits, hidden, for the relay to be out of reach: .mini sets display, so the attribute needs its guard. */
.feedback-actions .mini[hidden] { display: none; }
.prefs-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The Play animations toggle vanishes on the Animation and Test Drive tabs,
   which force it on (u-tg5anim). .bar-btn is a flex item, so the class would
   beat the [hidden] attribute without this. */
.bar-btn[hidden] { display: none; }

/* ---------- the Export tab's totals (u-mtl03a2r) ---------- */

/* ONE pill over the whole rig, with the per-icon breakdown behind a native
   <details> — the same disclosure as .out above, so the marker, the turn and
   the keyboard behaviour are already familiar. The wrapper row exists to hold
   the pill and its ⓘ side by side while the breakdown drops below both. */
.export-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}

.export-summary-row > .export-summary {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
}

.totals { width: 100%; }

/* Two rows: the marker and the title on the first, the pill on its own row
   under the title (Breece, 2026-09-08 - the pills were wrapping mid-sentence
   beside their titles at the panel's width). A grid, so the pill lines up
   under the title's left edge, not under the marker. */
.totals > summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
  row-gap: 5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.totals > summary::-webkit-details-marker { display: none; }

/* Our own marker, so it themes and turns with the disclosure. */
.totals > summary::before {
  content: '';
  grid-row: 1;
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-left-color: var(--dim);
  transition: transform 120ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .totals > summary::before { transition: none; }
}

.totals[open] > summary::before { transform: rotate(90deg) translateX(-1px); }
.totals > summary:hover .totals-pill { color: var(--text); border-color: var(--dim); }
.totals > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* A BLOCK, not an inline-flex like .chip was: the pill is a flex item of the
   <summary>, and a flex container trims the whitespace at the edges of its
   anonymous text items — "14icons ·39parts" instead of "14 icons · 39 parts".
   Plain inline layout inside keeps the spaces the sentence is written with. */
.totals-pill {
  display: block;
  grid-column: 2;
  justify-self: start;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--dim);
}

.totals-pill b { color: var(--text); font-family: ui-monospace, Consolas, monospace; }

/* THE GAUGE - his pick from the Complexity Gauge Study (2026-09-25: B, the
   Five-Segment Bar): five small segments after the number, one more lit
   every 75 and all five from 300 (export-tab.js lights them). Each lit
   segment keeps its own fixed hue, green to red, like a meter; an unlit one
   is an empty outline, so the bar reads by count with the color taken
   away. Coarse on purpose: the total is a bench estimate, not a promise.
   The light themes take a darker, more saturated pair. */
.cx-bar {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
  vertical-align: -1px;
}
.cx-bar i {
  width: 4px;
  height: 9px;
  border-radius: 1px;
  border: 1px solid var(--control-border);
}
.cx-bar i:nth-child(1) { --seg-hue: 120; }
.cx-bar i:nth-child(2) { --seg-hue: 90; }
.cx-bar i:nth-child(3) { --seg-hue: 60; }
.cx-bar i:nth-child(4) { --seg-hue: 30; }
.cx-bar i:nth-child(5) { --seg-hue: 0; }
.cx-bar i.is-lit {
  background: hsl(var(--seg-hue) 80% 60%);
  border-color: transparent;
}
[data-theme="ae-light"] .cx-bar i.is-lit,
[data-theme="bw"] .cx-bar i.is-lit {
  background: hsl(var(--seg-hue) 90% 28%);
}
/* The pill's title (Shape Spec / Complexity Spec): the sub-head tier, before the pill. */
.totals-title { color: var(--dim); font-size: var(--sec-title-size); font-weight: 600; letter-spacing: var(--sec-title-tracking); text-transform: uppercase; grid-column: 2; grid-row: 1; }
.totals.complexity { margin-top: 10px; }
.cx-views { display: flex; gap: 6px; margin: 0 0 4px; }
.cx-rows { display: grid; gap: 3px; }
.totals-count { color: var(--dim); }

/* Indented under the marker, so the rows read as the pill's contents rather
   than as a second list. */
.totals-breakdown {
  display: grid;
  gap: 3px;
  margin: 8px 0 0 12px;
}

.totals-row { font-size: 11px; color: var(--dim); }
.totals-row b { color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.totals-name { color: var(--text); }

/* Both notes are asides on a figure, so both stay quieter than the figure. */
.totals-max,
.totals-extra { color: var(--dim); }

/* A TURNING ICON'S GROUP. It carried `will-change: transform` for a day
   (2026-09-22) on the theory that the grid was being repainted with it; his
   measurements killed that theory, and a composited layer is a suspect in
   what replaced it - the panel reporting a 0 x 0 box for a group whose icon
   filled the screen, and the engine declining to animate it. No hint now:
   the class is here for the measurement to find, nothing more. */

/* ---------- Appearance's sub-groups as accordions (2026-09-25) ---------- */

/* The two tiers differ by color alone, as the sub-heads always did: a dim
   title on a nested section, white on a top one. */
.sub-group { margin: var(--sec-gap-minor) 0 0; }
.sub-group > .sec-head .sec-title { color: var(--dim); }
.sub-group > .body { padding: 6px 0 2px; }
.sub-group > .body > .actions { margin-bottom: 6px; }

/* ---------- property locks (u-randomlocks, 2026-09-25) ---------- */

/* A locked row: dimmed, and its inputs take no pointer - the keyboard's
   edits are refused by the panel itself (apply). The (i) and the label's
   menu stay live, because the menu is where Unlock is. */
.is-locked-prop { opacity: .5; }
.is-locked-prop input, .is-locked-prop select, .is-locked-prop .stepper, .is-locked-prop .nudge, .is-locked-prop .color-btn, .is-locked-prop .dropper { pointer-events: none; }
.is-locked-prop .param-name, .is-locked-prop label { opacity: 1; }

/* A slider a lock just stopped: a short flash on its name (reconcile's held). */
.is-held .param-name, .is-held > label { color: var(--accent); transition: color .15s; }

/* The Locks button lit while the section holds a lock. */
/* Lit by its padlock alone (Breece, 2026-09-25: the whole button in the accent
   was impossible to read). */
.locks-btn.has-locks .ui-icon { color: var(--accent); }

.lock-body { padding: 4px 16px 16px; }
.lock-lede { margin: 8px 0 12px; color: var(--dim); font-size: 12px; line-height: 1.45; }
.lock-list { display: flex; flex-direction: column; }
.lock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.lock-row:first-child { border-top: 0; }
.lock-row .lock-name { flex: 1 1 auto; }
.lock-row.is-locked .lock-name { color: var(--accent); }
.lock-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; padding: 0; border: 1px solid var(--control-border); border-radius: 4px; background: var(--panel-2); color: var(--dim); cursor: pointer; }
.lock-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.lock-toggle .ui-icon { width: 14px; height: 14px; }
.lock-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lock-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Rig Presets: the Setup rows, the manager, the Save dialog (Task Group 8, 2026-09-25) ---------- */

/* "Rig Preset: Pro (built-in, modified)" - the loaded preset in place of the
   old Presets sub-head, the qualifier in the dim color. */
.preset-line { margin: 2px 0 8px; font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; }
.preset-line-name { color: var(--text); font-weight: 600; }
.preset-line-note { color: var(--dim); }

/* The manager and Import From Layer, each a full-width row (his layout). */
.preset-rows { display: flex; flex-direction: column; gap: 6px; }
/* The top three buttons as one box (2026-10-18): the Setup tip's Show me outlines it. */
.preset-load-group { display: flex; flex-direction: column; gap: 6px; border-radius: 8px; }
.preset-rows > div[hidden] { display: none; }
/* The two imports share a row when there is room (Breece, 2026-09-28) and
   stack when there is not: each wants about 130px. */
.preset-import-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-import-row > * { flex: 1 1 130px; min-width: 0; }
/* The Import From Layer button sits in a bar of its own; as a flex item it keeps the
   same height as Import From File (Breece, 2026-10-16: the two were a half-pixel apart,
   one on a line box, one not). */
.preset-import-row > div { display: flex; }
.preset-import-row > div[hidden] { display: none; }
.preset-import-row .preset-wide { width: 100%; }
/* The note under the two rows (saved, loaded, imported) needs air. */
.preset-rows + .preset-note { margin-top: 6px; }
.preset-wide { width: 100%; justify-content: center; }
/* Cursor Rig Presets, the tab's front door: bigger text and glyph (Breece,
   2026-09-28). HIS VALUES TO TUNE. */
.preset-hero { font-size: 13.5px; font-weight: 600; padding-top: 6px; padding-bottom: 6px; }
.preset-hero .ui-icon { width: 18px; height: 18px; }
/* Cursor Rig Presets in the Export button's blue (Breece, 2026-10-16: "make the
   Cursor Rig Presets button blue like the Export Rig to Layer button"): the
   same accent fill, border and hover as .primary. */
#presetManagerOpen { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
#presetManagerOpen:hover { background: var(--accent-hover); }

/* The manager: wider than the other sheets, to hold two cards a row.
   HIS VALUES TO TUNE: the width, the card's minimum width, the gap. */
/* 700px: the seven labelled buttons and the views on one row (2026-09-28), four cards a row. */
.preset-sheet { width: calc(700px * var(--ui-scale, 1)); }
/* UPDATE SELECTED RIG - the comparison window (Task Group 11, 2026-10-16): the two rigs
   drawn side by side over Custom Import’s rows; a segmented Keep the rig’s / Use the
   tool’s per difference. */
.update-sheet { width: calc(640px * var(--ui-scale, 1)); }
.update-strips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.update-strip { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.update-strip-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.update-strip-row { display: flex; flex-wrap: wrap; gap: 4px; min-height: 44px; padding: 6px; border-radius: 6px; background: var(--card-art, rgba(150, 150, 150, .18)); }
.update-strip-empty { color: var(--dim); font-size: 12px; align-self: center; }
.update-cell { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.update-cell svg { width: 100%; height: 100%; overflow: visible; }
.update-cell.is-blank { border: 1px dashed var(--line-strong); border-radius: 4px; }
.import-thumb-slot .update-cell { width: 22px; height: 22px; }
.update-sec { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-top: 6px; padding: 0 6px; }
.update-sec[hidden] { display: none; }
.update-keep, .update-item, .update-dormant { cursor: default; }
.update-paste { display: flex; flex-direction: column; gap: 4px; }
.update-paste .import-msg { margin: 0; }
.update-item .import-name { flex: 1 1 auto; }
.update-tag { margin-left: 6px; font-size: 10px; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 0 6px; }
.update-seg { display: inline-flex; flex: none; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.update-seg button { border: 0; background: var(--panel-2); color: var(--dim); font: inherit; font-size: 12px; padding: 3px 9px; cursor: pointer; }
.update-seg button + button { border-left: 1px solid var(--line-strong); }
.update-seg button.is-on { background: var(--accent); color: var(--on-accent); }
.update-foot { display: flex; flex-direction: column; gap: 8px; }
.update-summary { color: var(--text); }
.update-nodiff[hidden] { display: none; }
/* The List needs less room (Breece, 2026-09-28: "trim 25% of the width").
   HIS VALUE TO TUNE. */
.preset-sheet.is-list { width: calc(470px * var(--ui-scale, 1)); }
/* Icon-only once the labelled buttons would wrap (preset-manager.js fitToolbar). */
.preset-toolbar.is-compact .btn-label { display: none; }
.preset-toolbar.is-compact .mini.has-glyph { padding-left: 6px; padding-right: 6px; }
.preset-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 16px 10px; border-bottom: 1px solid var(--line); }
/* The two views at the right end of the toolbar, icon-only (2026-09-28). */
.preset-views { margin-left: auto; display: inline-flex; gap: 4px; }
.preset-view { width: 26px; height: 24px; padding: 0; justify-content: center; }
.preset-view .ui-icon { width: 15px; height: 15px; }
.preset-view[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.preset-toolbar .mini[disabled], .preset-foot .mini[disabled] { opacity: .45; cursor: not-allowed; }
/* Duplicate green and Delete red on hover, as the Setup rows' are (Breece, 2026-09-30). */
#pmDuplicate:hover:not([disabled]), .preset-details-tool.is-duplicate:hover:not([disabled]) { color: #3fb950; border-color: #3fb950; background: rgba(63, 185, 80, .12); }
#pmDelete:hover:not([disabled]), .preset-details-tool.is-delete:hover:not([disabled]) { color: #e5484d; border-color: #e5484d; background: rgba(229, 72, 77, .12); }
/* Details' tools greyed on a built-in, as the manager's are (decisions §209). */
.preset-details-tools .mini[disabled] { opacity: .45; cursor: not-allowed; }
/* The find row: search, sort, filter (2026-09-28). */
.preset-find { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
/* The search field, an empty magnifier inside it at the right (Breece,
   2026-09-29); the magnifier steps aside for the field's own clear button
   once there is text. */
.preset-find .preset-search-wrap { position: relative; display: flex; flex: 1 1 160px; min-width: 0; }
.preset-find .preset-search { flex: 1 1 auto; min-width: 0; padding-right: 26px; }
.preset-search-glyph { position: absolute; right: 7px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; color: var(--dim); pointer-events: none; display: flex; }
.preset-search-glyph .ui-icon { width: 15px; height: 15px; }
.preset-search:not(:placeholder-shown) + .preset-search-glyph { display: none; }
/* The accent filter: a swatch for each accent the presets carry (and No
   accent, when some have none); one pressed filters, pressed again clears. */
.preset-accent-find { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.preset-accent-find[hidden] { display: none; }
/* Off: an empty ring in the accent; on: the circle filled (Breece,
   2026-09-29 - not the dialog's white border). No accent: a ring with a
   slash, filled grey when on. */
.preset-accent-find .preset-swatch { width: 16px; height: 16px; background: transparent; border: 2px solid var(--swatch); box-shadow: none; }
.preset-accent-find .preset-swatch[aria-pressed="true"] { background: var(--swatch); border-color: var(--swatch); }
.preset-accent-find .preset-swatch.is-none { --swatch: var(--dim); background: linear-gradient(135deg, transparent 44%, var(--dim) 44% 56%, transparent 56%); }
.preset-accent-find .preset-swatch.is-none[aria-pressed="true"] { background: linear-gradient(135deg, var(--dim) 44%, var(--panel-2) 44% 56%, var(--dim) 56%); }
.preset-find select { flex: 0 1 auto; max-width: 190px; }
.preset-empty { grid-column: 1 / -1; margin: 18px 0; text-align: center; color: var(--dim); font-size: 12px; }
.preset-body { padding: 12px 16px; }
.preset-cards { display: grid; gap: 10px; outline: none; }
.preset-cards:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

/* THE CARDS AND ROWS (Breece's mockups, 2026-09-28) - the Card Grid View and
   the List View, one set of parts (preset-manager.js buildCard). HIS VALUES
   TO TUNE: every size and grey below. The card's accent, when it has one,
   paints the border and the name; its pattern is drawn in the art box. */
/* The cards widen to fill the row (Breece, 2026-09-28: a capped, centred grid
   "looks like a mistake"); their art keeps its shape as they do. */
/* Each card its own height (Breece, 2026-10-16: the LOADED strip "should just extend the height of the card its on"): no stretching to the row. */
.preset-cards[data-view="grid"] { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; align-items: start; }
.preset-cards[data-view="list"] { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.preset-card {
  --card-accent: var(--line-strong);
  /* The pattern ink: a grey here, the accent at 22% when the card has one
     (preset-manager.js sets it - Chromium 99 in the panel has no color-mix). */
  --card-ink: rgba(255, 255, 255, .16);
  --card-bg: var(--panel-2);
  --card-art: rgba(150, 150, 150, .42);
  position: relative;
  /* THE ACCENT, QUIETER (Breece, 2026-10-16, his pick from the Card Accent Study:
     "faded border" + "on hover only"): the ring at 40% at rest, the whole
     accent on hover. No accent: the grey line, as before. */
  border: 1px solid var(--card-ring, var(--card-accent));
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  min-width: 0;
}
/* Hovered: a soft outer glow tinted toward the accent, the border kept
   (Breece, 2026-09-28; preset-card.js cardGlow). */
.preset-card:hover { box-shadow: 0 0 14px 1px var(--card-glow, rgba(255, 255, 255, .24)); border-color: var(--card-accent); }
/* THE CORNERS, A TOUCH HEAVIER (his note: the accent stroke "appears to get
   slightly thinner at the rounded corners. It’s always felt like that"): a
   hairline just inside each curve, masked to the four corners, so the
   antialiased bend reads as thick as the straight runs. His value to tune. */
.preset-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 0.6px solid var(--card-ring, var(--card-accent));
  border-radius: 7px;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) top left / 7px 7px no-repeat,
    linear-gradient(#000 0 0) top right / 7px 7px no-repeat,
    linear-gradient(#000 0 0) bottom left / 7px 7px no-repeat,
    linear-gradient(#000 0 0) bottom right / 7px 7px no-repeat;
}
.preset-card:hover::before { border-color: var(--card-accent); }
/* SELECTED (Breece, 2026-09-29: the blue outline "is overpowering. Maybe the
   blue border could just appear on the corners? Maybe it could be white as
   well to differentiate it from cards with a blue accent"): four rounded
   corner brackets just outside the card, in the text color - white on the
   dark themes. A ring round the card masked down to its four corners, so
   the brackets keep the card's curve. It tilts with the card. HIS VALUES TO
   TUNE: the gap (inset), the arm (the mask squares), the weight. */
.preset-card[aria-selected="true"]::after {
  content: '';
  position: absolute;
  inset: -5px;
  z-index: 6;
  border: 2px solid var(--text);
  border-radius: 12px;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) top left / 16px 16px no-repeat,
    linear-gradient(#000 0 0) top right / 16px 16px no-repeat,
    linear-gradient(#000 0 0) bottom left / 16px 16px no-repeat,
    linear-gradient(#000 0 0) bottom right / 16px 16px no-repeat;
}

/* The art: a grey box, the preview icons in it, the card's pattern over its fill. */
.preset-card-art {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  background-color: var(--card-art);
  border-radius: 6px;
  overflow: hidden;
}
/* The pattern on the whole card, the art box, or both (Breece, 2026-09-28:
   "I'd like the backgrounds to still affect the whole card"). */
.preset-card:not(.has-fx)[data-bg="dots"]:not([data-pattern-on="art"]), .preset-card:not(.has-fx)[data-bg="dots"][data-pattern-on="art"] .preset-card-art { background-image: radial-gradient(var(--card-ink) 1.2px, transparent 1.4px); background-size: 10px 10px; }
.preset-card:not(.has-fx)[data-bg="grid"]:not([data-pattern-on="art"]), .preset-card:not(.has-fx)[data-bg="grid"][data-pattern-on="art"] .preset-card-art { background-image: linear-gradient(var(--card-ink) 1px, transparent 1px), linear-gradient(90deg, var(--card-ink) 1px, transparent 1px); background-size: 12px 12px; }
.preset-card:not(.has-fx)[data-bg="diagonal"]:not([data-pattern-on="art"]), .preset-card:not(.has-fx)[data-bg="diagonal"][data-pattern-on="art"] .preset-card-art { background-image: repeating-linear-gradient(45deg, var(--card-ink) 0 1px, transparent 1px 8px); }
/* PATTERN ON, CARD (his fix, 2026-09-28): the card's pattern with the art box
   masking it out - the card's own color under the art's grey. BOTH is the
   card's pattern showing through the grey; ART BOX the art's alone. */
.preset-card[data-pattern-on="card"] .preset-card-art { background-image: linear-gradient(var(--card-art), var(--card-art)); background-color: var(--card-bg); }
/* THE EFFECTS IN THE TOOL (rp-cardfx, 2026-09-29): every card carries the
   effects' layers (card-fx.js, card-fx.css), which draw all eleven patterns -
   so the four rules above stand down on a card that has them. The icons and
   the LOADED banner sit over the foil, as in the study; a comic layout keeps
   its paper under the effects' art-box mask. */
.preset-card.has-fx .preset-card-art-inner { z-index: 1; }
.preset-card.has-fx .preset-card-loaded { z-index: 2; }

/* THE LAYOUT (rp-layouts, 2026-09-28): the icons placed in the art by the
   card's layout - preset-manager.js drawArt. The inner box is the art less
   its padding; a comic layout sits on paper with its panels inked. */
.preset-card-art-inner { position: absolute; inset: 6px 8px; }
.preset-card[data-view="list"] .preset-card-art-inner { inset: 3px 4px; }
.preset-card-icon { position: absolute; overflow: visible; }
.preset-card-clip { position: absolute; inset: 0; }
/* THE CORNERS (rp-artframes, 2026-10-16; preset-manager.js drawArt): the art box is
   clipped to its outline, so a comic’s panels are pieces of it - their paper and
   ink retired - reaching the box’s edges. The inset panel: the outline drawn a
   little way in, darker, its strength the Art Box Fill’s (--card-inset). */
.preset-card-art.is-comic .preset-card-art-inner { inset: 0; }
.preset-card-art-inset { position: absolute; inset: 0; background: var(--card-inset, rgba(40, 44, 54, .35)); pointer-events: none; }
.preset-card-thumb { flex: 0 1 auto; min-width: 0; }

.preset-card-name { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-card-stats { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.preset-card-count { font-weight: 600; }
.preset-card-cx { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.preset-card-cx b { color: var(--text); font-weight: 700; }
.preset-card-cx .cx-bar { margin-left: 0; vertical-align: 0; }
.preset-card-dot { margin: 0 2px; }
.preset-card-note { margin: 0; font-size: 11.5px; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.preset-card-note[hidden] { display: none; }
/* In the grid every card holds two lines of note, written or not, so the cards
   stand level (Breece, 2026-10-17: "tall enough to hold two lines of description
   copy regardless of how much description copy they have"); the single-card
   details view is untouched. */
.preset-cards .preset-card[data-view="grid"] .preset-card-note { min-height: calc(2 * 1.3em); }
.preset-cards .preset-card[data-view="grid"] .preset-card-note[hidden] { display: block; }
.preset-card-foot { display: flex; align-items: center; gap: 5px; min-height: 18px; }
.preset-card-gap { flex: 1 1 auto; }
.preset-card-date { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
/* His waffle in his own gold, #ffa012 (Breece, 2026-10-16; LOGO_BW_2025_Gold_v01), not the theme's text color. */
.preset-card-logo { display: inline-flex; color: #ffa012; }
.preset-card-logo .brand-mark { width: 14px; height: 14px; display: block; }
.preset-card-marks { display: flex; gap: 4px; flex: none; }
.preset-card-mark { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--dim); padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); white-space: nowrap; }
.preset-card-mark .ui-icon { width: 11px; height: 11px; stroke-width: 2.2; }
/* LOADED: a strip along the bottom of the card, edge to edge inside its border,
   the card taller for it (Breece, 2026-10-16: "easier to see"; it sat on the
   art box from 2026-09-28). The negative margins undo the card's padding.
   HIS VALUES TO TUNE. */
.preset-card-art { position: relative; }
.preset-card-loaded { position: relative; z-index: 2; display: block; background: var(--accent); color: var(--on-accent); font: 700 10.5px/18px 'Segoe UI', system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.preset-card[data-view="grid"] .preset-card-loaded { margin: 2px -7px -7px; border-radius: 0 0 7px 7px; }
.preset-card[data-view="list"] .preset-card-loaded { grid-column: 1 / -1; margin: -6px -8px -4px -4px; border-radius: 0 0 7px 7px; font-size: 9.5px; line-height: 15px; }

/* THE CARD GRID: the name on its own line over the art, cut with an ellipsis
   (the folder tab that cut into the art is gone - Breece, 2026-09-28: "a fun
   idea but it also looks like a mistake"). The art keeps its mockup shape -
   124 x 80, measured off his Card Grid mockup (2026-09-28: "match my mockups
   more closely") - however wide the card grows. */
.preset-card[data-view="grid"] { display: flex; flex-direction: column; gap: 5px; padding: 6px 7px 7px; }
.preset-card[data-view="grid"] .preset-card-art { aspect-ratio: 124 / 80; padding: 6px 8px; }
.preset-card[data-view="grid"] .preset-card-name { font-size: 12px; line-height: 16px; }
.preset-card[data-view="grid"] .preset-card-foot { margin-top: auto; padding-top: 6px; }

/* THE LIST: the art at the left, the name and note, then the stats over the
   foot at the right. */
.preset-card[data-view="list"] { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; }
.preset-card[data-view="list"] .preset-card-art { height: 42px; padding: 4px 5px; }
.preset-card[data-view="list"] .preset-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.preset-card[data-view="list"] .preset-card-name { font-size: 12.5px; }
.preset-card[data-view="list"] .preset-card-note { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-card[data-view="list"] .preset-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.preset-card[data-view="list"] .preset-card-cx { margin-left: 0; }
.preset-card[data-view="list"] .preset-card-count::after { content: none; }

/* THE DETAILS CARD: the grid card, larger, with its Complexity at both ends. */
.preset-card.is-detail { width: 210px; cursor: default; }
.preset-card.is-detail .preset-card-name { font-size: 14px; line-height: 19px; }
.preset-card.is-detail .preset-card-stats, .preset-card-range { font-size: 11.5px; }
.preset-card-range { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); }
.preset-card-range .preset-card-cx { margin-left: 0; }

/* A PRESET'S DETAILS (Breece, 2026-09-28): the card and its facts on the
   left, the preset's icons as the viewport draws them on the right. */
.preset-details-sheet { width: calc(760px * var(--ui-scale, 1)); }
/* A SHORT WINDOW (his bug, 2026-10-21: the bottom buttons "get lost behind the image and the left pane"):
   the body shrinks - one row that may squeeze to nothing, the left pane scrolling, what is left clipped -
   so the bottom bar always shows. */
.preset-details-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
/* Up and down only (his note, 2026-10-21: a vertical scrollbar brought a horizontal one for nothing - it
   took its width from content that already wraps); the gutter is kept from the start so nothing is clipped. */
.preset-details-left { padding: 16px 18px; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 14px; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.preset-details-facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; font-size: 11.5px; max-width: 210px; }
.preset-details-facts dt { color: var(--dim); }
.preset-details-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
/* A preset's authors (rp-authors, 2026-09-29): the credit, and the clock
   that opens every author when there are more than two. */
.preset-details-authors { display: flex; align-items: flex-start; gap: 6px; }
.preset-history-btn { flex: none; display: inline-flex; padding: 1px; margin-top: -1px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--dim); cursor: pointer; }
.preset-history-btn:hover { color: var(--text); border-color: var(--control-border); }
.preset-history-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.preset-history-btn .ui-icon { width: 14px; height: 14px; }
.preset-history-sheet { width: calc(340px * var(--ui-scale, 1)); }
.preset-history { list-style: none; margin: 0; padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; counter-reset: author; }
.preset-history-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; counter-increment: author; }
.preset-history-row::before { content: counter(author); min-width: 16px; color: var(--dim); font-variant-numeric: tabular-nums; }
.preset-history-name { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.preset-history-mark { font-size: 10px; color: var(--dim); padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 999px; }
.preset-history-date { margin-left: auto; font-size: 11px; color: var(--dim); white-space: nowrap; }
.preset-details-view { background: var(--stage); min-height: min(320px, 40vh); display: flex; padding: 14px; }
.preset-details-svg { width: 100%; height: 100%; min-height: 290px; }
.preset-details-cat { fill: var(--stage-label); font: 700 3.6px/1 'Segoe UI', system-ui, sans-serif; letter-spacing: .06em; }
/* The Details' pages (2026-10-19): Instagram's way - dots always, arrows on their
   own side or near them. His values to tune: sizes, the dark disc, the reach. */
.preset-details-view { position: relative; flex-direction: column; }
.pd-title { flex: none; text-align: center; color: var(--stage-label); font: 600 11px/1.2 'Segoe UI', system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; margin: -4px 0 6px; }
.pd-stage { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }
.preset-details-view.has-pages .pd-stage { padding-bottom: 16px; }
.pd-arrow { position: absolute; top: 50%; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .15s ease; display: grid; place-items: center; }
.pd-arrow::before { content: ''; width: 8px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; }
.pd-arrow.is-prev { left: 10px; }
.pd-arrow.is-prev::before { transform: translateX(2px) rotate(135deg); }
.pd-arrow.is-next { right: 10px; }
.pd-arrow.is-next::before { transform: translateX(-2px) rotate(-45deg); }
.pd-arrow.is-shown { opacity: 1; pointer-events: auto; }
.pd-arrow:hover { background: rgba(0, 0, 0, .75); }
.pd-arrow:focus-visible { opacity: 1; pointer-events: auto; outline: 2px solid var(--accent); outline-offset: 2px; }
.pd-arrow[disabled] { display: none; }
.pd-dots { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 6px; }
.pd-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--stage-label, #fff); opacity: .4; cursor: pointer; }
.pd-dot.is-on { opacity: 1; }
.pd-dot:hover { opacity: .75; }
.pd-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pd-arrow { transition: none; } }

/* Bottom right: Import Whole Preset and Custom Import, a line on the left. */
/* The bottom bars: every label on one line, the buttons wrapping into more rows when the window narrows (decisions §209). */
.preset-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.preset-foot > button { white-space: nowrap; flex: none; }
/* Details' tools, left of the X; a message pill over the window in place of the old status line. */
.preset-details-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.preset-details-tools > button { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; padding: 4px 6px; }
.preset-details-tools .ui-icon { width: 15px; height: 15px; }
.pm-say { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); max-width: 80%; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--text); font-size: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); z-index: 3; pointer-events: none; text-align: center; }
.pm-say[hidden] { display: none; }
/* Quick export in Details (decisions §163): under the facts, the card's width. */
.preset-details-tolayer { align-self: stretch; max-width: 210px; justify-content: center; }

/* The Save and Edit Card dialog, TWO PANES (Breece, 2026-09-28): the card at
   its default size on the left with a margin all round, the options on the
   right in their own scroller - the change is seen as it is made. */
.preset-card-sheet { width: calc(580px * var(--ui-scale, 1)); }
.sheet > .preset-card-body { overflow: hidden; }
.preset-card-body { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 0; padding: 0; }
.preset-card-preview { padding: 16px 18px; border-right: 1px solid var(--line); background: var(--panel); display: flex; align-items: flex-start; justify-content: center; }
.preset-card-preview .preset-card { width: 141px; cursor: default; }
.preset-card-fields { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 16px; overflow: auto; min-height: 0; }
.preset-field { display: flex; flex-direction: column; gap: 5px; }
.preset-field[hidden] { display: none; }
/* The card's effects in the dialog (rp-cardfx, 2026-09-29): the foil, the
   Effect Color and Crystal Seed when the foil takes them, and the three
   switches. */
.preset-fx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.preset-fx-row .check { display: inline-flex; align-items: center; gap: 6px; }
.preset-fx-hex { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.preset-seed { width: 76px; }
.preset-field-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.preset-field-hint { font-size: 10.5px; color: var(--dim); margin: 0; }
/* The Supporter gate's note in the card dialog, and its way in (2026-09-29). */
.preset-fx-become { color: var(--accent); white-space: nowrap; }
.preset-field-hint[hidden] { display: none; }
.preset-input { font: inherit; font-size: 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--control-border); border-radius: 4px; padding: 5px 7px; }
.preset-input:focus { outline: none; border-color: var(--accent); }
/* The layout picker and the numbered slots (2026-09-28). */
.preset-layout { position: relative; }
.preset-layout-btn { display: flex; align-items: center; gap: 8px; width: 100%; font: inherit; font-size: 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--control-border); border-radius: 6px; padding: 4px 10px 4px 4px; cursor: pointer; text-align: left; }
.preset-layout-btn:hover:not(:disabled) { border-color: var(--text); }
/* Locked by the Supporter gate (2026-09-29): shown, not changeable. */
.preset-layout-btn:disabled { opacity: .55; cursor: default; }
.preset-layout-count { margin-left: auto; color: var(--dim); font-size: 11px; }
.preset-layout-art { position: relative; width: 62px; aspect-ratio: 124 / 80; flex: none; border-radius: 4px; }
.preset-layout-art .preset-card-art-inner { inset: 3px 4px; }
.preset-layout-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 300px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 4px; padding: 8px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); }
.preset-layout-pop[hidden] { display: none; }
.preset-layout-fam { grid-column: 1 / -1; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-top: 2px; }
.preset-layout-opt { display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; font-size: 10.5px; color: var(--text); background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px; cursor: pointer; }
.preset-layout-opt:hover { background: var(--panel-2); }
.preset-layout-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.preset-layout-opt .preset-layout-art { width: 72px; }
/* THE TILE PICKERS (Breece, 2026-09-29: previews of each background and
   each foil "in rounded squares inside their respective dropdowns"): a tiny
   card with the effects' layers on it (preset-manager.js tile); a foil tile
   over a grey square for the art box. HIS VALUES TO TUNE: the sizes. */
.preset-fx-tile {
  --card-ink: rgba(255, 255, 255, .16);
  position: relative;
  flex: none;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--card-bg, var(--panel-2));
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.preset-fx-tile-art { position: absolute; inset: 22%; border-radius: 3px; background: var(--card-art, rgba(150, 150, 150, .42)); }
/* A Corners tile: the art box in that shape, drawn as an SVG (preset-manager.js tile; 2026-10-16). */
.preset-corner-tile { position: absolute; inset: 0; width: 100%; height: 100%; }
.preset-corner-tile path { fill: rgba(150, 150, 150, .55); }
.preset-layout-pop.is-tiles { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
.preset-layout-opt .preset-fx-tile { width: 48px; height: 48px; border-radius: 10px; }
.preset-slots { display: grid; gap: 4px; }
.preset-slot { display: flex; align-items: center; gap: 6px; }
/* A slot's substate, beside its icon (2026-10-16): narrower than the icon's picker. */
.preset-slot .preset-slot-state { flex: 0 1 42%; min-width: 0; }
.preset-slot select { flex: 1 1 auto; min-width: 0; }
.preset-slot-num { width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 9.5px; font-weight: 700; line-height: 16px; text-align: center; }
/* Tags, as chips in a field (2026-09-28). */
.preset-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 28px; padding: 3px 5px; background: var(--panel-2); border: 1px solid var(--control-border); border-radius: 4px; cursor: text; }
.preset-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; padding: 1px 2px 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--text); }
.preset-tag-x { display: inline-flex; padding: 1px; border: 0; background: none; color: var(--dim); cursor: pointer; border-radius: 50%; }
.preset-tag-x:hover { color: var(--text); }
.preset-tag-x .ui-icon { width: 11px; height: 11px; }
.preset-tag-input { flex: 1 1 60px; min-width: 60px; font: inherit; font-size: 12px; color: var(--text); background: none; border: 0; outline: none; padding: 2px; }
.preset-fill { display: flex; align-items: center; gap: 8px; }
.preset-fill input { flex: 1 1 auto; }
.preset-fill-out { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.preset-picks { display: flex; flex-wrap: wrap; gap: 4px; }
.preset-pick { width: 38px; height: 38px; padding: 4px; background: var(--panel-2); border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.preset-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.preset-pick[disabled] { opacity: .35; cursor: not-allowed; }
.preset-pick-thumb { width: 100%; height: 100%; display: block; }
.preset-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: var(--swatch); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.preset-swatch.is-none { background: linear-gradient(135deg, transparent 45%, var(--dim) 45% 55%, transparent 55%), var(--panel-2); }
.preset-swatch[aria-pressed="true"] { border-color: var(--text); }
/* The Supporter's custom accent (2026-10-16): a color wheel until a color is picked, then that color. */
.preset-swatch.is-custom { background: conic-gradient(#ff5252, #ffa012, #ffe14d, #4cd964, #4aa8ff, #9b6bff, #ff5252); }
/* Always the rainbow (Breece, 2026-10-16: the accent's custom circle "use a rainbow just like the custom art box fill circle"); a picked custom color is a dot in its middle. */
.preset-swatch.is-custom.has-color { background: radial-gradient(circle, var(--swatch) 0 42%, transparent 45%), conic-gradient(#ff5252, #ffa012, #ffe14d, #4cd964, #4aa8ff, #9b6bff, #ff5252); }
/* The art box's default grey swatch, and the column holding the swatches over the strength slider (2026-10-16). */
.preset-swatch.is-grey { background: rgb(150, 150, 150); }
.preset-art-fill { display: flex; flex-direction: column; gap: 8px; }
/* The darkest art fills sit on the dialog's own dark, so their swatches carry a faint light ring. */
.preset-art-fill .preset-swatch { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.preset-segs { display: flex; flex-wrap: wrap; gap: 4px; }
.preset-seg[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

/* ---------- Badge Icons, the Setup section (Task Group 9, 2026-09-25) ---------- */

/* Set apart from the categories (his "sort of visually separate"): a gap and a
   dashed edge - the categories are solid. HIS VALUES TO TUNE. */
.sel-badges { margin-top: 14px; border-style: dashed; }
.sel-badges > .body > .actions { display: flex; align-items: center; gap: 6px; }
.sel-badge { cursor: default; }
.sel-badge .sel-thumb-slot { margin-left: auto; }
.sel-badge-off { color: var(--dim); font-style: italic; font-size: 11px; }
.badge-size { width: 52px; font: inherit; font-size: 11.5px; color: var(--text); background: var(--panel-2); border: 1px solid var(--control-border); border-radius: 4px; padding: 2px 4px; text-align: right; }
.badge-size:focus { outline: none; border-color: var(--accent); }
.badge-size-unit { font-size: 11px; color: var(--dim); margin-left: -4px; }

/* ---------- Badge Placement on the Customize tab (Task Group 9, 2026-09-25) ---------- */
.badge-preview-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 8px; }
.badge-preview-row label { font-size: 12px; color: var(--text); }
.badge-note { margin: 0 0 8px; }
.badge-note[hidden] { display: none; }
/* A line in place of the controls while the Preview badge is None (2026-09-25). */
.badge-pick-hint { margin: 0 0 4px; }

/* ====================================================== custom themes ====

   u-customthemes (2026-09-30): the Custom Themes sheet, its cards - each a
   tiny abstract app in the theme's own colors (theme-manager.js themeArt,
   inline styles so the art never reads the page's theme) - and the editor.
   HIS VALUES TO TUNE: the card and art sizes, the art's proportions.
   ========================================================================= */
.theme-sheet { width: calc(640px * var(--ui-scale, 1)); }
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px 16px 16px; }
.theme-card { position: relative; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); padding: 6px; cursor: pointer; min-width: 0; }
.theme-card:hover { border-color: var(--control-border); }
.theme-card[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-card-name { margin-top: 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The Built-In pill at the BOTTOM right of the art, where it is seen at a glance (Breece, 2026-10-02). */
.theme-card-builtin { position: absolute; top: 72px; right: 10px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border-radius: 3px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; pointer-events: none; }
.theme-card-builtin .ui-icon { width: 9px; height: 9px; }
.theme-art { position: relative; height: 84px; border-radius: 5px; overflow: hidden; display: flex; flex-direction: column; }
.theme-art-blank { align-items: center; justify-content: center; background: var(--panel); color: var(--dim); font-size: 11px; }
.theme-art-top { display: flex; align-items: flex-end; gap: 6px; height: 16px; padding: 0 8px; flex: none; }
.theme-art-tab { position: relative; width: 14px; height: 3px; border-radius: 2px; margin-bottom: 5px; }
.theme-art-tab-line { position: absolute; left: -2px; right: -2px; bottom: -5px; height: 2px; }
.theme-art-body { display: flex; flex: 1 1 auto; min-height: 0; }
.theme-art-panel { width: 46%; flex: none; padding: 7px 7px 0; display: flex; flex-direction: column; gap: 7px; box-sizing: border-box; }
.theme-art-row { display: flex; flex-direction: column; gap: 3px; }
.theme-art-label { width: 40%; height: 2px; border-radius: 1px; }
.theme-art-track { position: relative; height: 5px; border-radius: 3px; box-sizing: border-box; }
.theme-art-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.theme-art-thumb { position: absolute; top: -2px; width: 7px; height: 7px; border-radius: 50%; }
.theme-art-button { margin-top: auto; margin-bottom: 7px; height: 11px; border-radius: 3px; display: flex; align-items: center; justify-content: center; }
.theme-art-button-text { width: 40%; height: 2px; border-radius: 1px; opacity: .9; }
.theme-art-stage { flex: 1 1 auto; position: relative; }
.theme-art-pointer { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); }
.theme-foot { padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.theme-foot-note { margin: 0; color: var(--dim); font-size: 11.5px; min-height: 1.4em; }
.theme-edit-sheet { width: calc(520px * var(--ui-scale, 1)); }
.theme-edit-body { padding: 4px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 14px; align-items: start; }
.theme-edit-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.theme-edit-fields .lock-lede { margin: 8px 0 2px; }
.theme-field { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.theme-field > span { width: 96px; flex: none; color: var(--dim); line-height: 1.25; }
/* Back to following the Main Color: only while the viewport has a color of its own. */
.theme-stage-reset { display: inline-grid; place-items: center; width: 24px; height: 22px; padding: 0; }
.theme-stage-reset[hidden] { display: none; }
.theme-field .pref-input, .theme-field .pref-select { flex: 1 1 auto; min-width: 0; }
.theme-field .hex { width: 78px; }
.theme-edit-notes { margin: 0; padding-left: 18px; color: var(--dim); font-size: 11.5px; line-height: 1.5; }
.theme-edit-notes[hidden] { display: none; }
.theme-edit-preview { padding-top: 32px; }
.theme-edit-preview .theme-art { height: 100px; border: 1px solid var(--line-strong); }
.theme-edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
@media (max-width: 560px) { .theme-edit-body { grid-template-columns: minmax(0, 1fr); } .theme-edit-preview { padding-top: 0; } }
/* The gear menu's Custom Themes button: a class sets its display, so [hidden] needs its own rule. */
.pref-action[hidden] { display: none; }

/* Export As SVG (u-vectorexport, 2026-09-30): the sheet's two rows. */
.svg-field { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 12px; }
.svg-field > span { flex: none; color: var(--dim); }
.svg-field .pref-select { flex: 1 1 auto; min-width: 0; }
.svg-check { margin: 0 0 4px; }
#svgNote { margin: 4px 0 12px; }
#svgNote.is-bad { color: var(--warn); }

/* Shape Handles, the prototype (shape-handles.js, 2026-09-30; a dev switch). */
.shape-handle { cursor: grab; }
#canvas.over-handle { cursor: grab; }
#canvas.dragging-handle, #canvas.dragging-handle .shape-handle { cursor: grabbing; }
.shape-handle-tip { font-family: system-ui, sans-serif; font-weight: 600; fill: var(--text); paint-order: stroke; stroke: var(--panel); stroke-linejoin: round; pointer-events: none; }

/* ======================================================= the curve editor ====

   an-curveeditor (his spec, decisions §118; his answers, §127): one graph
   per click animation, chips to switch the active curve, the presets and
   Duration below. preview/curve-editor.js and preview/animation-tab.js.
   HIS VALUES TO TUNE: the graph's colors, the key and handle sizes.
   ========================================================================= */
.anim-top { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 10px 0 4px; font-size: 12px; }
/* THE ONE-GRAPH REWORK (his notes, 2026-10-05): Preview All large and full
   width at the top, the checkbox under it, a little room, then the graph. */
#animationGraph { margin-top: 18px; }
#animationCards { margin-top: 14px; }
/* THE PILLS INSIDE THE BOX (his pick, 2026-10-05): a strip at the box's top,
   one row - the selected pill named, the rest dots - and the names toggle at
   its top right; with names on, the short names wrap. */
.curve-strip { display: flex; align-items: flex-start; gap: 6px; padding: 6px 6px 5px 8px; border-bottom: 1px solid var(--line); }
.curve-strip[hidden] { display: none; }
.curve-strip .curve-chips { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
.curve-strip .curve-chips.show-names { flex-wrap: wrap; }
.curve-chip.is-dot { padding: 2px 5px; }
/* THE CHANGE OF PROPERTY, ANIMATED (his note, 2026-10-05): the name sits in
   a clipping span whose width the editor sets in px - the old pill's shrinks
   and clips its name, the new one's grows and reveals it; the pill's padding
   and the gap after the dot ease with it. A pill made this paint does not
   ease (is-fresh), and reduced motion turns the ease off. */
.curve-strip .curve-chip { flex: none; gap: 0; transition: padding .22s ease, border-color .22s ease, color .22s ease; }
.curve-chip-name { flex: none; display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; margin-left: 5px; transition: width .22s ease, margin-left .22s ease; }
.curve-chip.is-dot .curve-chip-name { margin-left: 0; }
.curve-chip.is-fresh, .curve-chip.is-fresh .curve-chip-name { transition: none; }
@media (prefers-reduced-motion: reduce) { .curve-chip, .curve-chip-name { transition: none; } }
.curve-names-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--dim); cursor: pointer; }
.curve-names-toggle .ui-icon { width: 14px; height: 14px; }
.curve-names-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.curve-names-toggle[aria-pressed="true"] { color: var(--text); background: var(--accent-soft); }
.curve-names-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.curve-preset-row { margin: 2px 0 2px; }
.curve-preset-thumb { overflow: visible; }
.anim-timing { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.anim-rate-pick { flex: none; width: 22px; padding: 0; justify-content: center; align-self: stretch; }
.anim-rate-pick .ui-icon { width: 12px; height: 12px; }
.param-field-only .param-top { margin-bottom: 0; }
/* The "i" on the Click Animations head (his words, 2026-10-05). */
.sec-info { display: inline-flex; align-items: center; flex: none; }
.sec-info:empty { display: none; }
.anim-rate-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
/* The play triangle on Preview and Preview All (his note, 2026-10-01). */
.anim-play .ui-icon { width: 11px; height: 11px; }
.anim-play[hidden] { display: none; }
.anim-head .anim-play { flex: none; }
.anim-sum { font-size: var(--sec-count-size); color: var(--dim); white-space: nowrap; }
.anim-rest[hidden] { display: none; }
.anim-rest { display: flex; flex-direction: column; gap: 6px; }
.anim-duration { margin-top: 6px; }
.anim-rate { display: inline-flex; align-items: center; gap: 6px; }
.anim-rate-label, .anim-rate-unit { color: var(--dim); }
.anim-rate-input { width: 64px; }
.link-button { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.link-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-button[hidden] { display: none; }
.anim-mode { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; font-size: 12px; }
.anim-mode-label { color: var(--dim); white-space: nowrap; }
.anim-mode-select { flex: 1 1 auto; min-width: 0; }
.curve-editor { display: flex; flex-direction: column; gap: 4px; }
.curve-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.curve-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--dim); font: inherit; font-size: 11.5px; cursor: pointer; }
.curve-chip-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--chip); box-sizing: border-box; }
.curve-chip[aria-pressed="true"] { color: var(--text); border-color: var(--chip); }
.curve-chip[aria-pressed="true"] .curve-chip-dot { background: var(--chip); }
.curve-chip:hover { color: var(--text); }
.curve-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.curve-graph-wrap { position: relative; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 6px; }
.curve-graph-wrap:focus-within { border-color: var(--accent); }
.curve-graph { display: block; width: 100%; touch-action: none; user-select: none; outline: none; }

.curve-grid-minor { stroke: var(--line); stroke-width: 1; opacity: .5; }
.curve-grid-major { stroke: var(--line); stroke-width: 1; }
.curve-rest { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
/* The size of the numbers under the sliders (.range-ends; his note, 2026-10-01). */
.curve-label { font: 10.5px ui-monospace, Consolas, monospace; fill: var(--dim); pointer-events: none; }
/* The Min / Max labels are the fields (his note, 2026-10-01): a hit area over each. */
/* No underline (his note, 2026-10-02: the numbers were hard to read under it); the hover tint says it edits. */
.curve-label.is-edit { fill: var(--text); }
.curve-range-hit { fill: transparent; cursor: text; }
.curve-range-hit:hover { fill: var(--accent-soft); }
.curve-range-input { position: absolute; z-index: 3; width: 58px; height: 20px; padding: 0 3px; font-size: 11px; }
.curve-range-input[hidden] { display: none; }
.curve-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.curve-line.is-dim { stroke-width: 1.5; opacity: .35; }
.curve-hit { fill: none; stroke: transparent; stroke-width: 10; cursor: pointer; pointer-events: stroke; }
.curve-hit.is-active { cursor: ns-resize; }
.curve-key { fill: var(--panel-2); stroke-width: 2; cursor: grab; }
.curve-key.is-selected { fill: var(--text); }
.curve-handle { fill: var(--panel-2); stroke-width: 1.5; cursor: move; }
.curve-handle.is-folded { stroke-dasharray: 2 2; }
.curve-handle-line { stroke-width: 1; opacity: .7; }
.curve-playhead { stroke: var(--hotspot); stroke-width: 1.5; pointer-events: none; }
.curve-stretch { height: 7px; margin: 0 30%; border-radius: 4px; background: var(--line); cursor: ns-resize; touch-action: none; }
.curve-stretch:hover { background: var(--control-border); }
/* The selected key's fields, inside the graph's box under the frame numbers,
   tinted with the active curve's color (his call, 2026-10-01). */
.curve-key-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 10px 8px; border-top: 1px solid var(--line); font-size: 11.5px; }
.curve-key-field { display: inline-flex; align-items: center; gap: 6px; color: var(--curve, var(--dim)); }
.curve-key-field::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--curve, var(--dim)); }
.curve-key-field + .curve-key-field::before { display: none; }
.curve-key-input { width: 84px; border-color: var(--curve, var(--line-strong)); }
.curve-key-input:disabled { opacity: .45; }
/* "Pick a key" (2026-10-05): in the text color, so through the faded field it reads as a dim hint; the fields are 84px so it clears the spin arrows the browser keeps room for. */
.curve-key-input::placeholder { color: var(--text); opacity: 1; font-size: 11px; }
.curve-key-fields.is-empty .curve-key-field { color: var(--dim); }
.curve-key-hint { color: var(--dim); font-size: 11px; }
.curve-key-hint[hidden] { display: none; }
.anim-presets { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.anim-preset { padding-left: 8px; padding-right: 8px; }
.anim-seconds { margin-top: 0; }
.anim-note { margin-top: 2px; }

/* ------------------------------------------------------------------ */
/* EXPORT A SCRIPTUI PANEL (u-scriptuipanels; decisions §132-§134).    */
/* ------------------------------------------------------------------ */

/* The Rig Preset Manager choosing presets for a panel: a bar in place of the
   toolbar, the manager's own buttons away, each chosen card numbered. */
.preset-choose-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.preset-choose-bar[hidden] { display: none; }
.preset-choose-bar > span { margin-right: auto; font-size: 12px; }
.preset-sheet.is-choosing .preset-toolbar,
.preset-sheet.is-choosing .preset-foot > button { display: none; }
.preset-card.is-chosen { box-shadow: 0 0 0 2px var(--accent); }
.preset-card-pick { position: absolute; top: 6px; right: 6px; z-index: 4; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--panel); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }

/* The sheet, TWO PANES like the Edit Preset Card window (his note): the
   panel's preview on the left, just as wide as its buttons need and never
   more than about half; the settings on the right in their own scroller.
   The preview keeps the left side down to a narrow window, wrapping its
   buttons, and only stacks on a very narrow one. */
.panel-sheet { width: calc(760px * var(--ui-scale, 1)); }
.sheet > .panel-sheet-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.panel-sheet-body { display: grid; grid-template-columns: fit-content(52%) minmax(0, 1fr); }
.panel-sheet-preview { display: flex; flex-direction: column; gap: 8px; min-width: 150px; padding: 14px 16px; border-right: 1px solid var(--line); background: var(--panel); overflow: auto; }
.panel-sheet-fields { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 12px 16px 16px; overflow: auto; }
.panel-sheet-settings { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 460px) {
  .panel-sheet-body { grid-template-columns: minmax(0, 1fr); overflow: auto; }
  .panel-sheet-preview { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-sheet-fields { overflow: visible; }
}
.panel-menu-line { margin: 0; font-size: 11px; color: var(--dim); }
/* The words under and over the preview wrap to it: only the panel sets the column's width. */
.panel-sheet-preview > p { width: 0; min-width: 100%; }
.panel-menu-line b { color: var(--text); font-weight: 600; }
.panel-install { padding: 8px 10px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); font-size: 11.5px; }
.panel-install[hidden] { display: none; }
.panel-install-title { margin: 0; font-weight: 600; }
.panel-install ol { margin: 4px 0 0; padding-left: 18px; }
.panel-install li { margin-bottom: 4px; }
.panel-install code { font-size: 10.5px; word-break: break-all; }

/* The docked panel as After Effects draws it: AE's own grays in either
   theme - it is a picture of AE. Just big enough for its buttons (the tab
   and the foot do not widen it), wrapping them when its column is narrow. */
.sui {
  --sui-bg: #232323; --sui-btn: #383838; --sui-line: #4a4a4a; --sui-hover: #444444;
  width: max-content; min-width: 140px; max-width: 100%;
  background: var(--sui-bg); border: 1px solid #0f0f0f; border-radius: 3px;
  color: #bdbdbd; font: 12px/1.3 "Segoe UI", system-ui, sans-serif;
}
.sui-tabs { display: flex; width: 0; min-width: 100%; height: 24px; background: #1b1b1b; border-bottom: 1px solid #0f0f0f; }
.sui-tab { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 0 10px; border-top: 2px solid #2d8ceb; background: var(--sui-bg); color: #e6e6e6; white-space: nowrap; overflow: hidden; }
.sui-tab-name { overflow: hidden; text-overflow: ellipsis; }
.sui-tab-menu { color: #7a7a7a; }
.sui-body { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
.sui-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 8px; font: inherit; color: inherit; background: var(--sui-btn); border: 1px solid var(--sui-line); border-radius: 2px; cursor: pointer; }
.sui-btn:hover { background: var(--sui-hover); color: #ececec; }
.sui-btn:active { background: #2b4157; border-color: #2d8ceb; }
.sui[data-frame="outline"] .sui-btn { background: transparent; }
.sui[data-frame="bare"] .sui-btn { background: transparent; border-color: transparent; }
.sui[data-frame="outline"] .sui-btn:hover,
.sui[data-frame="bare"] .sui-btn:hover { background: var(--sui-hover); border-color: var(--sui-line); }
.sui-icons { display: inline-flex; align-items: center; gap: 3px; }
.sui-icons svg, .sui-chip svg { display: block; overflow: visible; }
.sui-label { white-space: nowrap; }
.sui-foot { display: flex; align-items: center; gap: 6px; width: 0; min-width: 100%; padding: 0 6px 6px 8px; box-sizing: border-box; }
.sui-made { min-width: 0; margin-right: auto; color: #5d5d5d; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sui-size { flex: none; padding: 1px 6px; font: 11px "Segoe UI", system-ui, sans-serif; color: #bdbdbd; background: #2c2c2c; border: 1px solid #4a4a4a; border-radius: 3px; cursor: pointer; }
.sui-size:hover { background: #3a3a3a; }

/* The settings. */
.sui-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .sui-two { grid-template-columns: minmax(0, 1fr); } }
.sui-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.sui-seg .mini[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.sui-paint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sui-swatch { width: 26px; height: 22px; padding: 0; background: none; border: 1px solid var(--control-border); border-radius: 4px; cursor: pointer; }
.sui-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.sui-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--panel-2); }
.sui-row + .sui-row { border-top: 1px solid var(--line); }
.sui-row-head { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sui-row-name { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sui-row-count { margin: 0 auto 0 6px; color: var(--dim); font-size: 11px; white-space: nowrap; }
.sui-icon-btn { display: inline-grid; place-items: center; width: 22px; height: 20px; padding: 0; font-size: 9px; line-height: 1; }
.sui-icon-btn .ui-icon { width: 12px; height: 12px; }
.sui-row-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sui-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sui-chips.is-muted { opacity: .4; pointer-events: none; }
/* A mid grey under the chips, so a black cursor and a white one both read. */
.sui-chip { display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; background: #6a6e77; border: 1px solid var(--control-border); border-radius: 5px; opacity: .55; cursor: pointer; }
.sui-chip[aria-pressed="true"] { opacity: 1; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sui-add { padding: 8px 10px; border-top: 1px solid var(--line); background: var(--panel); }
.sui-list > .sui-add:first-child { border-top: 0; }
.sui-add-btn { color: var(--accent); border-style: dashed; }
.sui-add-menu { display: flex; flex-direction: column; margin-top: 6px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 6px; }
.sui-add-menu[hidden] { display: none; }
.sui-add-item { padding: 5px 8px; text-align: left; font: inherit; font-size: 12px; color: var(--text); background: none; border: 0; border-radius: 4px; cursor: pointer; }
.sui-add-item:hover, .sui-add-item:focus-visible { background: var(--accent-soft); }

/* About disabled icons (2026-10-02): a quiet row at the top of Icon Selection, its words in an i at the right. */
.about-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 8px; font-size: 11.5px; color: var(--dim); }

/* Test Drive's interactions come and go (2026-10-02): a remove X on each row but
   the Default pointer's, and + Add Interaction under the last. */
.td-remove { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; flex: none; }
.td-remove .ui-icon { width: 12px; height: 12px; }
.td-add { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.td-add-btn { align-self: flex-start; color: var(--accent); border-style: dashed; }
.td-add-menu { display: flex; flex-direction: column; padding: 4px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 6px; }
.td-add-menu[hidden] { display: none; }
.td-add-item { padding: 5px 8px; text-align: left; font: inherit; font-size: 12px; color: var(--text); background: none; border: 0; border-radius: 4px; cursor: pointer; }
.td-add-item:hover, .td-add-item:focus-visible { background: var(--accent-soft); }

/* THE EXPORT TAB, his Early Access notes (2026-10-02). */
/* The specs, one block just above the buttons; the pills across the tab. */
.export-specs { display: flex; flex-direction: column; gap: 6px; }
#panel-export details[data-section="export-specs"] { margin-top: 12px; }
.export-specs .export-summary-row { margin-top: 0; }
.export-specs .totals > summary .totals-pill { grid-column: 1 / -1; justify-self: stretch; }
/* The buttons: Export Rig to Layer across the tab; a row of two; Save as Rig Preset apart. */
.export-actions { flex-direction: column; align-items: stretch; }
.export-actions .export-wide { width: 100%; justify-content: center; text-align: center; }
/* Where the rig lands, by the button (decisions §163): a quiet line; "Change"
   in the accent; the placement fields glow when it takes you there. His
   values to tune. */
.export-where { align-self: center; margin: -2px 0 2px; padding: 2px 6px; background: none; border: 0; border-radius: 4px; color: var(--dim); font: inherit; font-size: 12px; text-align: center; cursor: pointer; }
.export-where-change { color: var(--accent); }
.export-where:hover .export-where-change { text-decoration: underline; }
.export-place.is-pointed { border-radius: 6px; box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .3s ease; }
.export-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* One line each; side by side while both fit, stacked when the panel is too narrow. */
.export-row > button { flex: 1 1 0; justify-content: center; text-align: center; white-space: nowrap; }
.export-row-apart { margin-top: 8px; }
/* An Include row's chevron, at its end; the line it folds. */
.opt-chev { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; margin-left: 2px; border: 0; background: none; color: var(--dim); cursor: pointer; flex: none; }
.opt-chev:hover { color: var(--text); }
.opt-chev .ui-icon { width: 13px; height: 13px; transition: transform 120ms ease; }
.opt-chev[aria-expanded="true"] .ui-icon { transform: rotate(90deg); }
.opt-chev:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.opt-consequence.is-tucked { display: none; }
@media (prefers-reduced-motion: reduce) { .opt-chev .ui-icon { transition: none; } }
/* Advanced Export Settings with its glyph. */
.advanced-open.has-glyph { display: inline-flex; align-items: center; gap: 6px; }

/* His notes on the Early Access build (2026-10-02). */
/* Test Drive: each box sits at the right, just left of its trash; the Default
   pointer row keeps a trash-wide space so every box lines up. */
.td-row > .td-label { margin-right: auto; }
.td-remove-space { width: 22px; flex: none; }
.td-remove .ui-icon { width: 13px; height: 13px; }
/* Export Settings: each i at the right of its row, just before the caret. */
.export-opt > .info-btn { margin-left: auto; }

/* A tool whose interaction is removed leaves the toolbar (2026-10-02). */
.td-tool[hidden] { display: none; }

/* THE PATHS SHEET (Task Group 10; preview/path-import-sheet.js, 2026-10-17): a
   shape layer that is not a rig, or an SVG file, read as Custom Cursors. It
   paints into the Load dialog: a Group By switch, a row per cursor (a
   checkbox, the cursor drawn, its name, its points), one Category, the paint. */
.path-import-groupby { display: flex; align-items: center; gap: 10px; font-size: 12.5px; flex-wrap: wrap; }
.path-import-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2, var(--panel)); }
.path-import-seg .mini { border: 0; border-radius: 5px; background: transparent; }
.path-import-seg .mini[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.path-import-list { gap: 2px; }
.path-import-item { cursor: default; }
.path-import-item.is-dormant { opacity: .55; }
.path-import-item .path-import-name { flex: 1 1 auto; min-width: 0; font-size: 12.5px; padding: 3px 6px; }
.path-import-item .path-import-name.is-clash { border-color: var(--accent); }
.path-import-fields { display: flex; flex-direction: column; gap: 8px; }
.path-import-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.path-import-label { color: var(--dim); min-width: 64px; }
.path-import-count { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; flex: none; }
.path-import-note { font-size: 11.5px; }
.path-import-colors { margin: 0; font-size: 12.5px; }
.path-import-colors[hidden] { display: none; }
.path-import-row .pref-select { width: auto; flex: 1 1 auto; }

/* ADD TO EXISTING RIG (Task Group 11, ur-wizard, 2026-10-16; preview/add-to-rig-sheet.js):
   one sheet, a page strip, three pages each with a big Leave As-Is, and a summary of
   four tiles. The rows are Custom Import's rows; the strip and the tiles are its own. */
.addrig-sheet { width: calc(560px * var(--ui-scale, 1)); }
.addrig-body { display: flex; flex-direction: column; gap: 10px; }
.addrig-steps { display: flex; gap: 4px; }
.addrig-step { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--dim); font: inherit; font-size: 11.5px; cursor: default; min-width: 0; }
.addrig-step.is-done { cursor: pointer; color: var(--text); }
.addrig-step.is-done:hover { border-color: var(--line-strong); }
.addrig-step.is-current { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.addrig-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.addrig-step-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-strong); font-size: 10.5px; font-variant-numeric: tabular-nums; flex: none; }
.addrig-step.is-current .addrig-step-num { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.addrig-step-num .ui-icon { width: 11px; height: 11px; }
.addrig-step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addrig-page-title { margin: 0; font-size: 14px; font-weight: 600; }
.addrig-list { gap: 2px; }
.addrig-cat { font-size: 11.5px; color: var(--dim); padding: 6px 6px 2px; }
.addrig-row { padding: 3px 6px; }
/* Chromium 99 (the AE panel) has no color-mix: the add green at 12% and 18%, written out. */
.addrig-row.is-on { background: rgba(63, 168, 106, .12); }
.addrig-row.is-on:hover { background: rgba(63, 168, 106, .18); }
.addrig-tag { font-size: 10.5px; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 6px; white-space: nowrap; }
.addrig-tag[hidden], .addrig-count[hidden], .addrig-minus[hidden] { display: none; }
/* "new" on a Customize row (the order folded into Customize, 2026-10-17): the add green. */
.addrig-tag.is-new { margin-left: 6px; color: var(--import-add, #3fa86a); border-color: var(--import-add, #3fa86a); }
.addrig-count { font-size: 11.5px; font-weight: 600; color: var(--import-add, #3fa86a); font-variant-numeric: tabular-nums; margin-left: auto; }
.addrig-minus { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; flex: none; }
.addrig-minus:hover { border-color: var(--accent); }
.addrig-row .addrig-add { flex: none; border-color: var(--import-add, #3fa86a); color: var(--text); padding: 2px 8px; font-size: 12px; }
/* Removing (his ask, 2026-10-17): a Remove beside + Add on every on-the-rig row,
   its count in the accent, a put-back arrow; the orphaned keys' choice under it. */
.addrig-row .addrig-remove { flex: none; border-color: var(--accent); color: var(--text); padding: 2px 8px; font-size: 12px; }
.addrig-row.is-removing { background: var(--accent-soft); }
.addrig-rcount { font-size: 11.5px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.addrig-rcount[hidden], .addrig-unremove[hidden], .addrig-remove[hidden] { display: none; }
.addrig-unremove { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; line-height: 1; cursor: pointer; flex: none; }
.addrig-unremove:hover { border-color: var(--accent); }
.addrig-orphan { display: flex; align-items: center; gap: 8px; padding: 2px 6px 4px 36px; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.addrig-orphan[hidden] { display: none; }
.addrig-orphan .pref-select { width: auto; }
/* THE ORDER PAGE (his ask, 2026-10-17): the states numbered as the dropdown
   will list them, grouped by category; grips to drag, arrows to step, the
   category heads with arrows of their own. */
.addrig-order-cat { display: flex; align-items: center; gap: 4px; padding: 8px 6px 2px; font-size: 11.5px; color: var(--dim); }
.addrig-order-catname { flex: 1 1 auto; }
.addrig-move { width: 22px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.addrig-move:hover { color: var(--text); border-color: var(--line-strong); background: var(--panel); }
.addrig-move:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.addrig-move:disabled { opacity: .25; cursor: default; border-color: transparent; background: none; }
.addrig-move .ui-icon { width: 14px; height: 14px; }
.addrig-order-row { padding: 2px 6px; }
.addrig-order-row .sel-grip { cursor: grab; }
.addrig-order-row.is-dragging { opacity: .5; background: var(--panel-2); }
/* Where a dragged icon will land (2026-10-19): the Setup tab's accent line. */
.addrig-order-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.addrig-order-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.addrig-order-cat.drop-into { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; }
.addrig-order-cat.is-empty { opacity: .75; }
.addrig-order-empty { margin-left: 8px; font-size: 11px; font-style: italic; }
.addrig-order-num { flex: none; min-width: 1.6em; text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--dim); padding-right: 4px; }
.addrig-order-row .import-name { flex: 1 1 auto; }
.addrig-row:not(.is-on) .addrig-count + .addrig-minus + .addrig-add { margin-left: auto; }
.addrig-feature input { margin: 0 2px 0 0; }
.addrig-feature.is-on { background: var(--accent-soft); }
.addrig-line { min-height: 1.2em; }
.addrig-icon-row .import-action { max-width: 44%; }
/* Page 2's preset menu is the Customize pane's picker with previews (his ask, 2026-10-17). */
.addrig-icon-row .addrig-preset { flex: 0 1 46%; min-width: 0; margin-left: auto; }
.addrig-anim-row input { margin: 0 2px 0 0; }
.addrig-shared { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 6px 6px 2px; }
.addrig-shared[hidden] { display: none; }
.addrig-shared-row { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.addrig-shared-label { color: var(--dim); white-space: nowrap; }
.addrig-shared-unit { color: var(--dim); }
.addrig-frames { width: 4.5em; background: var(--panel); color: var(--text); border: 1px solid var(--control-border); border-radius: 4px; padding: 4px 6px; font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; }
.addrig-shared-row .pref-select { width: auto; }
.addrig-tune { align-self: flex-start; margin: 4px 6px 0; }
/* THE PANE WINDOW (Breece, 2026-10-17: "the customization options could open
   in a new popup window that closes when you click Done"): a second sheet over
   the wizard. Its head keeps the icon in view, drawn large and redrawn as the
   sliders move (his note of 2026-10-16), with the name and Done; its body is
   the one scroller, holding the real sections moved in. */
.addrig-pane-sheet { width: calc(500px * var(--ui-scale, 1)); }
.addrig-pane-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-strong); background: var(--panel-2); }
.addrig-pane-body { padding-top: 10px; gap: 8px; }
.addrig-pane-body > details.group { margin: 0; }
.addrig-embed-icon { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--card-art, rgba(150, 150, 150, .18)); }
.addrig-embed-icon[hidden] { display: none; }
.addrig-embed-icon .update-cell { width: 48px; height: 48px; }
.addrig-embed-words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--dim); }
.addrig-embed-words b { font-size: 14px; color: var(--text); }
.addrig-pane-head .addrig-embed-done { flex: none; padding: 7px 18px; font-size: 13px; }
/* The big Leave As-Is: the way past a page in one gesture (his words). */
.addrig-foot { display: flex; align-items: center; gap: 8px; }
.addrig-foot-gap { flex: 1 1 auto; }
.addrig-foot .mini, .addrig-foot .primary { justify-content: center; text-align: center; }
.addrig-skip { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 18px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel-2); color: var(--text); cursor: pointer; }
.addrig-skip:hover { border-color: var(--accent); }
.addrig-skip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.addrig-foot .primary { padding: 7px 18px; font-size: 13px; }
/* The summary: tiles, not a paragraph (his answer) - and since 2026-10-17
   three views of the same facts, by type (default), by change, or a table,
   each tile's lines in one grammar: Adding / Removing / Changing / Keeping. */
.addrig-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.addrig-summary-label { font-size: 12px; color: var(--dim); }
.addrig-views button { padding: 3px 10px; }
.addrig-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.addrig-tile { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.addrig-tile.is-add { border-color: var(--import-add, #3fa86a); }
.addrig-tile.is-remove { border-color: var(--accent); }
.addrig-tile-eyebrow { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.addrig-tile-big { font-size: 17px; font-weight: 600; line-height: 1.2; margin-bottom: 2px; }
.addrig-tile.is-add .addrig-tile-big { color: var(--import-add, #3fa86a); }
.addrig-tile.is-remove .addrig-tile-big { color: var(--accent); }
.addrig-line { font-size: 12px; color: var(--dim); overflow-wrap: anywhere; display: flex; gap: 6px; align-items: baseline; }
.addrig-line-verb { flex: none; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; min-width: 5.2em; }
.addrig-line.is-adding .addrig-line-verb { color: var(--import-add, #3fa86a); }
.addrig-line.is-removing .addrig-line-verb { color: var(--accent); }
.addrig-line.is-changing .addrig-line-verb { color: var(--text); }
.addrig-line.is-adding .addrig-line-items, .addrig-line.is-removing .addrig-line-items, .addrig-line.is-changing .addrig-line-items { color: var(--text); }
.addrig-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
/* Four equal verb columns (table-layout: fixed), the type column 22%; a title
   never wraps - the glyph stands alone with the title in its tooltip once the
   sheet is narrow (is-narrow, set by a ResizeObserver; his notes, 2026-10-17). */
.addrig-table { border-collapse: collapse; width: 100%; font-size: 12px; table-layout: fixed; }
.addrig-table th, .addrig-table td { padding: 6px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.addrig-table thead th:first-child { width: 22%; }
.addrig-table tbody tr:last-child th, .addrig-table tbody tr:last-child td { border-bottom: 0; }
.addrig-table thead th { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); font-weight: 500; white-space: nowrap; }
.addrig-table thead th .ui-icon { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; stroke-width: 2; }
.addrig-table-wrap.is-narrow .addrig-th-word { display: none; }
.addrig-table-wrap.is-narrow thead th .ui-icon { margin-right: 0; width: 15px; height: 15px; }
.addrig-table thead th.is-adding { color: var(--import-add, #3fa86a); }
.addrig-table thead th.is-removing { color: var(--accent); }
.addrig-table tbody th { font-weight: 600; color: var(--text); white-space: nowrap; }
.addrig-table td.is-empty { color: var(--line-strong); }
.addrig-table td.is-keeping { color: var(--dim); }
.addrig-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.addrig-keep { margin: 0; }
.addrig-note { font-size: 12px; }
@media (max-width: 520px) { .addrig-tiles { grid-template-columns: 1fr; } .addrig-step-name { display: none; } }


/* ============================================================ first-time help

   js1-infobuttons and js1-duration (Breece, 2026-10-17; docs/reports/
   first-time-help-pitch.html). Before the touch block, which stays last. */

/* THE ESSENTIALS: one quiet line each, where it changes what you do. */
.essential-note { margin: 0 0 8px; }
.about-row + .essential-note { margin-top: -4px; }
[data-helper-id="export-intro"] + .essential-note { margin: 6px 0 0; }

/* THE (i) IN THE RULE TIER: larger, the accent ring at rest - the only way to
   a fact that matters. Every other (i) stays quiet (.info-btn above). */
.info-btn.info-btn-rule { color: var(--accent); }
.info-btn.info-btn-rule .ui-icon { width: 18px; height: 18px; stroke-width: 2; }
.info-btn.info-btn-rule:hover { color: var(--accent-hover, var(--accent)); }
.anim-mode-name { display: inline-flex; align-items: center; gap: 2px; flex: none; }

/* FIRST-RUN TIPS (preview/first-run-tips.js): a card at the top of the tab. */
.tip-card {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--panel-2, var(--panel));
  font-size: 12px;
  line-height: 1.5;
}
.tip-card .tip-text { margin: 0; color: var(--text); }
.tip-card .tip-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

/* "Show me": the control the tip names, outlined for two seconds. */
.tip-flash {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--accent-soft);
}
@media (prefers-reduced-motion: no-preference) {
  .tip-flash { animation: tip-flash 2s ease-out forwards; }
}
@keyframes tip-flash {
  0%, 60% { outline-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
  100% { outline-color: transparent; box-shadow: 0 0 0 5px transparent; }
}

/* THE DURATION LINE and the section's Preview the click. */
.anim-preview-row { display: flex; margin: 4px 0 2px; }


/* ============================================================ touch screens

   THE PHONE PLAN, PHASES 1 AND 2 (approved 2026-10-07; m-touchbasics,
   m-viewport). <html data-touch> is set by preview.js where the main pointer
   is a finger - never in the After Effects panel - so nothing here reaches a
   mouse. The DESIGN stays the desktop's (his answer: the left / right arrow
   steppers, not - / +); only the sizes grow toward a finger's 44px, and
   nothing important waits for a hover a finger cannot make. */

/* Sliders: the row owns the finger (makeSlider), so the track takes none;
   up and down scroll the page, sideways slides. The track is drawn here at a
   finger's size, filled to --fill, the thumb THUMB_TOUCH_PX (26) wide. */
[data-touch] .param { --thumb: 26px; touch-action: pan-y; margin-bottom: 14px; }
[data-touch] input[type="range"] {
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  height: 30px;
  background: transparent;
}
[data-touch] input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) calc(var(--fill, 0) * 100%), var(--line-strong) 0);
}
[data-touch] input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
[data-touch] input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-strong); }
[data-touch] input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
[data-touch] input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); }
[data-touch] .param.is-sliding input[type="range"]::-webkit-slider-thumb { transform: scale(1.15); }

/* The number field and its arrows, finger-sized; 16px text, under which a
   phone's browser zooms the page when the field is tapped. */
[data-touch] .num-step { width: 32px; }
[data-touch] .num-step .ui-icon { width: 13px; height: 13px; }
[data-touch] .param-top .num-input { width: calc(5ch + 10px); font-size: 16px; padding: 5px 2px; }
[data-touch] input[type="text"], [data-touch] input[type="search"], [data-touch] input:not([type]),
[data-touch] textarea, [data-touch] select { font-size: 16px; }
[data-touch] .param-top { align-items: center; }

/* Reset shows whenever the value differs - no hover to wait for - with a
   finger-sized target around its glyph, and the changed property's name
   takes the accent, so what was changed reads at a glance. */
[data-touch] .prop-reset { opacity: 1; width: 30px; height: 30px; color: var(--accent); }
[data-touch] .prop-reset .ui-icon { width: 15px; height: 15px; }
[data-touch] .param.is-changed .param-name label,
[data-touch] .check.is-changed,
[data-touch] .row.is-changed label { color: var(--accent); }

/* The rest of the small targets. */
[data-touch] .info-btn { width: 30px; height: 30px; }
[data-touch] .check { min-height: 36px; gap: 10px; font-size: 13px; }
[data-touch] .check input[type="checkbox"] { width: 18px; height: 18px; flex: none; }
[data-touch] .sec-head { min-height: 44px; }
[data-touch] .mini { min-height: 34px; }
[data-touch] .tab { padding-top: 11px; padding-bottom: 11px; font-size: 13px; }

/* The viewport takes every finger: a pinch zooms the drawing, not the page
   (initPan). */
/* On the drawing's own boxes too: touch-action stops at the nearest scroll
   container, and the stage's clipped inner box is one - the stage's alone
   left Test Drive's playground at auto. The toolbar keeps its own sideways
   scroll (it is its own scroller). */
[data-touch] .stage, [data-touch] .stage-inner, [data-touch] #canvas, [data-touch] #testdriveStage { touch-action: none; }

/* PHASE 3, A PHONE (m-layout): a touch screen in the stacked layout. The
   viewport on top at --phone-stage (the separator snaps between a quarter,
   38% and 55% - preview.js PHONE_STAGE_SNAPS), the controls one scroll below,
   and the tabs a bar along the bottom in thumb reach (his answer). The
   viewport's toolbar keeps every control on one row that scrolls sideways,
   and the sheets rise from the bottom at full width. */
@media (max-width: 720px) {
  [data-touch] body { grid-template-rows: minmax(200px, var(--phone-stage, 46%)) 18px minmax(0, 1fr); }
  [data-touch] .resize-handle { touch-action: none; }
  [data-touch] .resize-handle::before { width: 44px; height: 5px; margin: -2.5px 0 0 -22px; opacity: .7; }
  [data-touch] .panel { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  [data-touch] .panel-sticky {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    margin: 0;
    padding: 0 6px env(safe-area-inset-bottom, 0px);
    border-bottom: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, .28);
  }
  [data-touch] .tabs { flex-wrap: nowrap; gap: 0; border-bottom: 0; }
  [data-touch] .tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 15px 2px 13px;
    font-size: 12.5px;
    border-bottom: 0;
    border-top: 2px solid transparent;
    margin: -1px 0 0;
  }
  [data-touch] .tab[aria-selected="true"] { border-top-color: var(--accent); }
  [data-touch] .bar-main { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  [data-touch] .bar-main::-webkit-scrollbar { display: none; }
  [data-touch] .bar-label { display: none; }
  [data-touch] dialog.sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: 88%;
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
    border-width: 1px 0 0;
  }
}

/* PHASE 4, CUSTOMIZE ON A PHONE (m-customize; his answer: B on phones, A on
   tablets, the desktop's own design). The tab's sliders are compact rows -
   the name, the value, a chevron - and a tap lifts the slider itself into
   the drawer along the bottom (preview.js initPhoneDrawer). Everything else
   in the tab (checkboxes, menus, colors) stays as it is, finger-sized. */
@media (max-width: 720px) {
  [data-touch] .bar-main > * { flex: none; }
  [data-touch] #panel-customize .param:not(.param-field-only) {
    margin: 0;
    padding: 4px 0;
    min-height: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    touch-action: auto;
  }
  [data-touch] #panel-customize .param:not(.param-field-only) > input[type="range"],
  [data-touch] #panel-customize .param:not(.param-field-only) > .range-ends,
  [data-touch] #panel-customize .param:not(.param-field-only) .num-step,
  [data-touch] #panel-customize .param:not(.param-field-only) .angle-glyph { display: none; }
  [data-touch] #panel-customize .param:not(.param-field-only) .param-top { margin: 0; }
  [data-touch] #panel-customize .param:not(.param-field-only) .num-field { border-color: transparent; background: none; }
  [data-touch] #panel-customize .param:not(.param-field-only) .num-input { pointer-events: none; width: auto; min-width: 4ch; text-align: right; color: var(--dim); font-size: 15px; }
  [data-touch] #panel-customize .param.is-changed:not(.param-field-only) .num-input { color: var(--accent); }
  [data-touch] #panel-customize .param:not(.param-field-only) .param-right::after {
    content: '';
    width: 7px;
    height: 7px;
    margin: 0 4px 0 2px;
    border-right: 1.5px solid var(--dim);
    border-top: 1.5px solid var(--dim);
    transform: rotate(45deg);
  }
  [data-touch] .phone-slot { min-height: 46px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }

  [data-touch] .phone-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(46px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    padding: 10px 14px 14px;
    background: var(--panel);
    border-top: 1px solid var(--line-strong);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .45);
  }
  [data-touch] .phone-drawer[hidden] { display: none; }
  [data-touch] .pd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  [data-touch] .pd-title { flex: 1; text-align: center; font-size: 14px; font-weight: 600; color: var(--text); }
  [data-touch] .pd-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--control-border);
    border-radius: 6px;
    background: var(--panel-2);
    color: var(--text);
  }
  [data-touch] .pd-nav:disabled { opacity: .35; }
  [data-touch] .pd-nav .ui-icon { width: 15px; height: 15px; }
  [data-touch] .pd-body .param { margin: 4px 0 6px; }
  /* The drawer's title names it; the label's Reset and (i) stay beside the field. */
  [data-touch] .pd-body .param-name label { display: none; }
  [data-touch] .pd-body .param-top { min-height: 40px; }
  [data-touch] .pd-done { width: 100%; min-height: 44px; margin-top: 4px; }
  /* Room under the list for the drawer, so the last rows can still be reached. */
  [data-touch] body.phone-drawer-open .panel { padding-bottom: calc(300px + env(safe-area-inset-bottom, 0px)); }
}

/* PHASE 5, THE OTHER TABS (m-othertabs): the curve editor's keys and handles
   grow for a finger (a circle's r is a CSS property; the handles and the
   edge keys scale about their own centers). */
[data-touch] circle.curve-key { r: 8px; }
[data-touch] .curve-handle, [data-touch] path.curve-key { transform-box: fill-box; transform-origin: center; transform: scale(1.7); }

/* UNDO / REDO (his note from his phone, 2026-10-07): on every touch screen,
   in the toolbar; a mouse has Ctrl+Z, so they are hidden there. */
.undo-group { display: none; gap: 4px; }
[data-touch] .undo-group { display: inline-flex; }
[data-touch] .undo-group .bar-btn { min-width: 40px; min-height: 36px; justify-content: center; }
[data-touch] .undo-group .bar-btn:disabled { opacity: .35; cursor: default; }

/* THE VIEW BUTTONS' ROW (his note, 2026-10-07): on a phone they leave the
   toolbar for a row of their own at the bottom of the viewport, just above
   the zoom controls (preview.js initViewRow). Empty, and gone, elsewhere. */
.view-row { display: none; }
@media (max-width: 720px) {
  [data-touch] .stage { grid-template-rows: auto 1fr auto auto; }
  [data-touch] .view-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
  [data-touch] .view-row .bar-btn { min-width: 44px; min-height: 36px; justify-content: center; }
  /* The glyphs grow with their buttons (his note, 2026-10-07: "now that
     their buttons have grown"). */
  [data-touch] .view-row .bar-btn .ui-icon { width: 21px; height: 21px; }
  /* No Align menu on a phone (his note, the same look: "It takes up a lot of
     space and adds little"); the alignment stays what it was. */
  [data-touch] #alignGroup { display: none; }
}
