/* Model & Print viewer styles. Every colour, font and size is a token on
   :root; the 3D stage (viewer3d.js, cardview.js, guide.js) and the overhang
   legend read the same tokens, so a palette change is one edit here.
   Colours are the brand's Cobalt night (docs/brand/final/tokens.json): dark
   leads; the library, guide, article and queue pages (body.guide) take the
   light set further down, their 3D views stay dark. */
/* The brand's letters, bundled (SIL OFL 1.1; the licences sit beside the
   files): subset WOFF, no download at run time. Sora is one 600 face - the
   name and headings are always 600, whatever weight a rule asks for. */
@font-face { font-family: "Sora"; src: url(fonts/Sora-600.woff) format("woff");
             font-weight: 500 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-var.woff) format("woff");
             font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/GeistMono-var.woff) format("woff");
             font-weight: 400 600; font-style: normal; font-display: swap; }
:root {
  /* the brand: cobalt for buttons and the mark, periwinkle for links and
     what is active, ice the one pop (progress, ready) */
  --cobalt: #5163F7; --periwinkle: #A3AFFF; --ice: #7FE0FF;
  --glow: rgba(81, 99, 247, .18);
  /* surfaces + lines: night, panel, raised, input */
  --bg0: #0B0D17; --bg1: #121627; --bg2: #1A1F35; --bg3: #20263F;
  --line: #262C47; --line2: #323A5A;
  /* text (every one AA on every surface above) */
  --tx0: #fff; --tx1: #E8EBF7; --tx2: #A0A8C3; --tx3: #8A92B0;
  /* accent (selection, focus, active, the primary button) = cobalt */
  --acc: var(--cobalt); --acc-bg: #232A5E; --acc-text: #fff; --acc-hi: #7D8CFF;
  /* highlight (links, what is active, region selection, journey stage) = periwinkle */
  --hi: var(--periwinkle); --hi-bg: #1B2046; --hi-line: #3D4890; --hi-text: #A3AFFF;
  --hi-dim: #7F8AD0; --hi-text-hi: #E3E7FF; --hi-sub: #8D98DA;
  /* measuring (dimension lines, their labels and drag handles): stays teal */
  --ms: #2EC8B6; --ms-bg: #0E2B2C; --ms-line: #24786E; --ms-text: #6FD7C6;
  --ms-text-hi: #D9FFF8; --ms-sub: #5FA89C;
  /* status families: bg / line / text - the meanings never change */
  --good: #46D08F; --good-bg: #0F2A24; --good-line: #1F5A45;
  --good-line-hi: #2A7A5A; --good-text: #C2F0D8;
  --warn: #F2B24A; --warn-bg: #2C2414; --warn-line: #4D4026;
  --warn-line-hi: #6E5A2E; --warn-text: #F4D9A0; --warn-link: #F8E7BE;
  --bad: #F06565; --bad-bg: #36171F; --bad-text: #F5A5A5; --bad-text-hi: #FADADA;
  --info-bg: #1A2045; --info-line: #34408A; --info-text: #A3AFFF;
  --info-bg2: #161B36; --info-line2: #2A3266;
  /* the 3D stage (viewer3d.js, cardview.js, guide.js): night with a cobalt
     glow under the model, a quiet grid, a steel-periwinkle model */
  --stage-bg: #0B0D17; --stage-glow: rgba(91, 108, 255, .16);
  --grid-a: #2C3456; --grid-b: #1C2140; --box-line: #323A5A;
  /* the server's model pictures are drawn on OpenSCAD's Tomorrow Night
     (#1D1F21): a picture's frame is that colour, so it has no seam */
  --thumb-png: #1D1F21;
  --model: #92A9CC; --cap: #E0A458; --meas-line: #E5533F; --ghost: #E0604D;
  /* overhang heatmap (also read by the 3D painter): amber and red, never cobalt */
  --oh-ok: #AAB6C6; --oh-warn: #F2B24A; --oh-bad: #E5533F;
  /* overlays */
  --label-bg: #0B0D17; --label-bg-a: #0B0D17ee; --toast-bg: #0B0D17f0;
  --backdrop: #0009; --img-bg: #fff;
  --shadow: 0 8px 24px #0007;
  /* shape + layout */
  --r: 8px; --r-lg: 12px;
  --nav-w: 0px; --top-h: 54px; --strip-h: 0px; --dock-w: 348px; --rail-w: 76px; --tab-h: 0px;
  /* type scale + the three families (viewer/fonts/, SIL OFL 1.1): Sora for
     the name and headings, Inter for text, Geist Mono for numbers */
  --fs-3xs: 9px; --fs-2xs: 10px; --fs-xs: 11px; --fs-s: 12px; --fs-m: 13px;
  --fs-ml: 14px; --fs-l: 15px; --fs-xl: 20px; --fs-2xl: 26px;
  --font-head: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-text: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --head-ls: -0.03em;
  /* v6 phase accents: each phase of the journey reads distinctly, all in
     the brand's one family. Scope = periwinkle (conversation), Concepts =
     violet (the board), Project = cobalt (the workshop). body.phase-* maps
     --phase onto one. */
  --ph-scope: var(--hi); --ph-scope-bg: var(--hi-bg); --ph-scope-line: var(--hi-line);
  --ph-concepts: #B48CF2; --ph-concepts-bg: #251C42; --ph-concepts-line: #56468A;
  --ph-project: var(--acc-hi); --ph-project-bg: var(--acc-bg); --ph-project-line: #4352B8;
  --phase: var(--ph-project); --phase-bg: var(--ph-project-bg);
  --phase-line: var(--ph-project-line);
  --board-strip: 148px;
}
/* The light set (tokens.json "light"): the pages people read - the library,
   the print guides, the know-how articles, the print queue, and the website
   exported from them. Their 3D view and the pictures of models stay on the
   dark set (the re-scope below), as they are in the app. */
body.guide {
  --bg0: #F5F6FB; --bg1: #FFFFFF; --bg2: #EEF0F7; --bg3: #E8EBF4;
  --line: #E2E5F0; --line2: #CDD2E3;
  --tx0: #0B0D17; --tx1: #141824; --tx2: #4F566B; --tx3: #5D6479;
  --acc: #3348E0; --acc-bg: #E3E7FF; --acc-text: #fff; --acc-hi: #3348E0;
  --hi: #3348E0; --hi-bg: #EEF0FF; --hi-line: #B9C1F5; --hi-text: #2A3AC4;
  --hi-dim: #4A57BD; --hi-text-hi: #1E2BA8; --hi-sub: #4F5BB8;
  --good: #12703F; --good-bg: #E3F6EC; --good-line: #A9DEC1;
  --good-line-hi: #6CC59A; --good-text: #0F5E3A;
  --warn: #8F5600; --warn-bg: #FFF4DD; --warn-line: #F0D59A;
  --warn-line-hi: #E2B85C; --warn-text: #7A4A00; --warn-link: #6B4000;
  --bad: #B42A28; --bad-bg: #FDECEC; --bad-text: #A12424; --bad-text-hi: #7D1A1A;
  --info-bg: #EEF0FF; --info-line: #B9C1F5; --info-text: #2A3AC4;
  --info-bg2: #F3F4FF; --info-line2: #CED4FA;
  --label-bg: #FFFFFF; --label-bg-a: #FFFFFFee; --toast-bg: #FFFFFFf5;
  --shadow: 0 8px 24px #1418241f;
}
body.guide .gStage, body.guide .gPieceImg, body.guide .lCardImg, body.guide .qImg {
  --bg0: #0B0D17; --bg1: #121627; --bg2: #1A1F35; --bg3: #20263F;
  --line: #262C47; --line2: #323A5A;
  --tx0: #fff; --tx1: #E8EBF7; --tx2: #A0A8C3; --tx3: #8A92B0;
  --hi-line: #3D4890; --label-bg-a: #0B0D17ee;
  --warn-bg: #2C2414; --warn-line-hi: #6E5A2E; --warn-text: #F4D9A0;
}
body.phase-scope { --phase: var(--ph-scope); --phase-bg: var(--ph-scope-bg);
                   --phase-line: var(--ph-scope-line); }
body.phase-concepts { --phase: var(--ph-concepts); --phase-bg: var(--ph-concepts-bg);
                      --phase-line: var(--ph-concepts-line); }
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; background: var(--bg0);
             font: var(--fs-m)/1.5 var(--font-text);
             color: var(--tx1); }
::selection { background: var(--acc-bg); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
kbd { font: var(--fs-2xs) var(--mono); background: var(--bg0);
      padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line);
      color: var(--tx3); }
button, select, input[type=text], input[type=search], input[type=number], input:not([type]), textarea {
  background: var(--bg3); color: var(--tx1); border: 1px solid var(--line);
  border-radius: var(--r); padding: 5px 11px; font: inherit;
  font-size: var(--fs-s); }
button { cursor: pointer; transition: border-color .12s, background .12s; }
button:hover:not(:disabled) { border-color: var(--line2); }
button.on { background: var(--acc-bg); border-color: var(--acc); color: var(--tx0); }
button:disabled { opacity: .38; cursor: default; }
button.primary { background: var(--acc); border-color: var(--acc);
                 color: var(--acc-text); font-weight: 600;
                 box-shadow: 0 6px 18px -8px var(--acc); }
button.primary:hover:not(:disabled) { border-color: var(--hi); }
/* one visible focus ring everywhere (keyboard only) */
:focus-visible { outline: 2px solid var(--acc-hi); outline-offset: 1px; }
input[type=range] { accent-color: var(--acc); }
input[type=number], #stats, .inhint, .vpill, .mLab, #hLabel, #rstat {
  font-variant-numeric: tabular-nums; }
/* letters: Sora 600 on the name and headings, Geist Mono where numbers line
   up (sizes, grams, times, the checks' measured lines); Inter for the rest */
h1, h2, h3, .railTitle, .bpTitle, #msTitle, #editTitle,
#buildSteps .bsHead {
  font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; }
h1, .bpTitle { letter-spacing: var(--head-ls); }
#stats, .ptStats, .mLab, #hLabel .main,
#inspect .inFacts, .refFacts, kbd {
  font-family: var(--mono); letter-spacing: 0; }
/* visually hidden but read by screen readers (never font-size:0) */
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0;
      margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
      border: 0; }

#top { position: fixed; top: 0; left: calc(var(--rail-w) + var(--nav-w)); right: 0;
       height: var(--top-h); display: flex; align-items: center; gap: 12px;
       padding: 0 14px; background: color-mix(in srgb, var(--bg1) 90%, transparent);
       backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
       z-index: 16; }   /* over the pieces strip (15): its menus and the name's card hang over it */
/* Stage insets: where the canvas starts and ends. Declared on <body> so the
   per-phase / per-width overrides of --nav-w and --dock-w flow through. */
body { --stage-l: calc(var(--rail-w) + var(--nav-w)); --stage-r: 0px;
       --work-t: calc(var(--top-h) + var(--strip-h));
       --tb-row: 30px; --tb-bottom: 14px;
       --toolbar-h: calc(var(--tb-row) + 14px); }
/* Inspect open: its tray is a second row above the views (L1 step 6) */
body.inspectOn { --toolbar-h: calc(2 * var(--tb-row) + 16px); }
body.docked { --stage-r: var(--dock-w); }
/* the Print sheet is a side sheet: the stage and its chrome (the print question,
   the toolbar, the caption) sit beside it, never under it (L1) */
@media (min-width: 601px) { body.printOn { --stage-r: min(520px, 100vw); } }
#stage { position: fixed; top: var(--work-t); left: var(--stage-l);
         right: var(--stage-r); bottom: 0; }
body.docked #top { right: var(--dock-w); }
/* shared text utilities (stop re-solving truncation per component) */
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
           overflow: hidden; }
svg.ico { width: 16px; height: 16px; flex: none; }
#stage canvas { display: block; }
#stageFlash { position: fixed; inset: 0; pointer-events: none; z-index: 13;
              opacity: 0; border: 2px solid var(--good); }
#stageFlash.go { animation: sflash .7s ease-out; }
@keyframes sflash { 0% { opacity: .8; } 100% { opacity: 0; } }

/* the name: the brand's logo (docs/brand/final/logo-dark.svg) inline, its
   accessible name on the svg; no line under it here (that is Home's) */
#brand { display: flex; align-items: center; width: 100%; min-height: 50px;
         padding: 13px 16px 12px; border: 0; border-bottom: 1px solid var(--line);
         border-radius: 0; background: none; text-align: left; color: var(--tx1); }
#brand:hover { background: var(--bg2); }
#brand .brandLogo { display: block; flex: none; height: 22px; width: auto; }
/* current-project panel: the sidebar shows ONE project; browse lives on Home */
.proj { margin: 1px 8px; }
.phead { display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 2px; font-weight: 600; font-size: var(--fs-s);
  color: var(--tx1); }
.phead .gear { margin-left: auto; color: var(--hi); font-size: var(--fs-xs);
               opacity: .7; }
.grp { margin: 7px 0 2px 26px; color: var(--tx3); font-size: var(--fs-2xs);
       text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.item { display: flex; align-items: center; gap: 8px; width: calc(100% - 26px);
        margin-left: 18px; padding: 4px 8px; border: 0; background: none;
        border-radius: var(--r); color: var(--tx2); text-align: left;
        font-size: var(--fs-s); position: relative; }
.item:hover { background: var(--bg2); color: var(--tx1); }
.item.active { background: var(--bg3); color: var(--tx0); }
.item.active::before { content: ""; position: absolute; left: -7px;
  top: 20%; bottom: 20%; width: 3px; border-radius: 2px; background: var(--acc); }
.item .thumb { flex: none; width: 30px; height: 30px; border-radius: 6px;
               background: var(--bg0); object-fit: cover;
               border: 1px solid var(--line); }
/* a row with a trailing action (saved version + delete) is a flex pair of
   SIBLING buttons, never a button nested in a button */
.itemRow { display: flex; align-items: center; margin-left: 18px;
           width: calc(100% - 26px); position: relative; border-radius: var(--r); }
.itemRow .item { margin-left: 0; width: auto; flex: 1; min-width: 0; }
.itemRow:hover { background: var(--bg2); }
.itemRow:hover .item { background: none; }
.tag { margin-left: auto; font-size: var(--fs-3xs); padding: 1px 6px;
       border-radius: 7px; background: var(--warn-bg); color: var(--warn);
       border: 1px solid var(--warn-line); }
/* v3 IA: category headers, design cards, print plan, verify badges */
.cat { margin: 12px 14px 3px; color: var(--tx3); font-size: var(--fs-2xs);
       text-transform: uppercase; letter-spacing: 1.1px; font-weight: 700; }
.pblurb { margin: 1px 10px 4px 28px; color: var(--tx3);
          font-size: var(--fs-xs); line-height: 1.35; }
.vdot { flex: none; min-width: 16px; text-align: center; font-size: var(--fs-s);
        font-weight: 700; line-height: 1; color: var(--tx3); }
.vdot.ready { color: var(--good); }
.vdot.supports, .vdot.stale { color: var(--warn); }
.vdot.fail { color: var(--bad); }
.vdot.hold { color: var(--warn); }
.item .vdot { margin-left: auto; }
.item .dmeta { display: flex; flex-direction: column; min-width: 0; }
.item .dthin { flex-basis: 100%; color: var(--tx2); font-size: var(--fs-2xs); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.hasThin { flex-wrap: wrap; }
.item .dsub { color: var(--tx3); font-size: var(--fs-2xs); white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }
/* print-plan step: a row container; the step's own button, checkbox and
   Slice button are siblings inside it */
.step { display: flex; align-items: center; gap: 6px;
        width: calc(100% - 26px); margin-left: 18px; padding: 3px 8px;
        border-radius: var(--r); color: var(--tx2); font-size: var(--fs-xs);
        position: relative; cursor: pointer; }
.step:hover { background: var(--bg2); color: var(--tx1); }
.step .stepGo { display: flex; align-items: center; gap: 6px; flex: 1;
                min-width: 0; padding: 0; border: 0; background: none;
                color: inherit; font-size: inherit; text-align: left; }
.step .n { color: var(--tx3); flex: none; width: 13px; }
.step .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .tag { margin-left: 0; flex: none; }
.chip2 { flex: none; font-size: var(--fs-3xs); padding: 0 5px; border-radius: 6px;
         border: 1px solid var(--line2); color: var(--tx3); }
.chip2.mat { color: var(--hi); border-color: var(--hi); opacity: .8; }
.sliceMini { margin-left: auto; flex: none; border: 1px solid var(--line2);
             background: none; color: var(--tx2); border-radius: 6px;
             font-size: var(--fs-3xs); padding: 1px 7px; }
.sliceMini:hover { border-color: var(--acc); color: var(--tx1); }
.sliceMini:disabled { opacity: .35; }
.delX { margin-left: auto; flex: none; border: 0; background: none;
        color: var(--tx3); font-size: var(--fs-xs); padding: 0 6px; }
.delX:hover { color: var(--bad); }
#libLink { display: flex; align-items: center; gap: 8px; margin: 6px 10px 0;
           padding: 7px 10px; border-radius: var(--r); border: 1px solid var(--line);
           color: var(--tx1); text-decoration: none; font-weight: 600;
           white-space: nowrap; min-width: 0; }
#libLink:hover { border-color: var(--acc); color: var(--tx0); }
#libLink svg { flex: none; }
#libLink .libSub { margin-left: auto; color: var(--tx3); font-weight: 400;
                   font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; }
#newProj { margin: 6px 10px; width: calc(100% - 20px); padding: 7px;
           background: none; border: 1px dashed var(--line2); color: var(--tx2); }
#newProj:hover { border-color: var(--acc); color: var(--tx1); }
/* "PrintCraft was updated - restart to use it" (js/update.js) */
#updRow { position: fixed; z-index: 44; left: calc(var(--rail-w) + 12px);
          bottom: calc(var(--tab-h) + 12px); width: min(320px, calc(100vw - var(--rail-w) - 24px));
          box-shadow: var(--shadow); padding: 8px 10px; border-radius: var(--r);
          background: var(--warn-bg); border: 1px solid var(--warn-line);
          color: var(--warn-text); font-size: var(--fs-xs); line-height: 1.35;
          display: grid; grid-template-columns: auto minmax(0, 1fr);
          gap: 6px 8px; align-items: start; }
#updRow[hidden] { display: none; }
#updRow .updMark { color: var(--warn); margin-top: 1px; }
#updText { overflow-wrap: anywhere; }
#updGo { grid-column: 2; justify-self: start; padding: 3px 10px;
         font-size: var(--fs-xs); }
#updGo[hidden] { display: none; }
#navFoot { padding: 10px 14px; border-top: 1px solid var(--line);
           display: flex; align-items: center; gap: 8px; color: var(--tx3);
           font-size: var(--fs-xs); }
#srvDot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad);
          flex: none; }
#srvDot.up { background: var(--good); }
#statline { margin-left: auto; color: var(--tx3); font-size: var(--fs-2xs);
            font-variant-numeric: tabular-nums; white-space: nowrap; }
/* the footer's parts keep one line each: the AI-use line takes a row of its
   own once it grows, never squeezing the server word or Rescan (R7) */
#navFoot { flex-wrap: wrap; row-gap: 4px; }
#navFoot #srvText { white-space: nowrap; }
#navFoot #refresh { margin-left: auto; white-space: nowrap; flex: none; }
#navFoot #statline { order: 5; flex: 1 1 100%; margin-left: 0; min-width: 0;
                     overflow: hidden; text-overflow: ellipsis; }
/* Settings: the filament on hand, a row each */
.filRow { display: flex; gap: 6px; align-items: center; }
.filRow input { flex: 1; min-width: 0; }
.filRow .filX { flex: none; padding: 2px 8px; }
#refresh { padding: 2px 9px; font-size: var(--fs-xs); flex: none; }

/* the header (L1 step 3): "Projects ›" + the name, ONE status, then More and Print */
#crumbWrap { min-width: 0; flex: 1; display: flex; align-items: center; gap: 4px;
             position: relative; }
.crumbUp { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 2px;
           border: 0; background: none; color: var(--tx3); font-size: var(--fs-s); font-weight: 500; }
.crumbUp:hover { color: var(--tx1); background: none; }
.crumbUp .ico { width: 14px; height: 14px; }
body.drafting .crumbUp, body.homed .crumbUp, body.projectsOn .crumbUp { display: none; }
/* the sizes, weight and time: a card under the name on hover or focus */
#crumbWrap #stats { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
          width: max-content; max-width: min(520px, calc(100vw - var(--rail-w) - 32px));
          padding: 8px 12px; border-radius: var(--r); white-space: normal; overflow: visible;
          color: var(--tx1); background: var(--bg2); border: 1px solid var(--line2);
          box-shadow: var(--shadow); line-height: 1.5; }
#crumbWrap:hover #stats:not(:empty), #crumb:focus-visible ~ #stats:not(:empty) { display: block; }
#actions { margin-left: auto; display: flex; gap: 7px; align-items: center;
           flex-shrink: 0; }
/* the build status says something only while it runs (or just ended) */
#rstat:not(.pending):not(.rendering):not(.working):not(.updated):not(.failed) { display: none; }
/* "More": the three dots; the word shows while it prepares a file */
#download.more { padding: 6px 9px; }
#download.more .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
                      white-space: nowrap; }
#download.more[aria-busy="true"] .lbl { position: static; width: auto; height: auto; clip: auto; }
/* which way round the model is shown, quiet, at the top of the stage */
#stageTop #pose { flex: none; padding: 6px 12px; font-size: var(--fs-xs); font-weight: 600;
                  color: var(--tx2); border: 1px solid var(--line2);
                  background: color-mix(in srgb, var(--bg1) 88%, transparent); backdrop-filter: blur(8px); }
#stageTop #pose.tgl { cursor: pointer; }
#stageTop #pose.tgl:hover { color: var(--tx0); border-color: var(--hi-line); filter: none; }
/* header buttons with a drawn icon + a word; narrow widths keep the icon
   (the word stays readable to screen readers via .lbl hiding below) */
button.ib { display: inline-flex; align-items: center; gap: 6px; }
button.ib .ico { width: 16px; height: 16px; flex: none; }
/* quiet utilities: no box until you point at them */
button.quiet { background: none; border-color: transparent; color: var(--tx2); }
button.quiet:hover:not(:disabled) { background: var(--bg3); border-color: var(--line); color: var(--tx1); }
#crumb { font-size: var(--fs-ml); font-weight: 600; white-space: nowrap;
         overflow: hidden; text-overflow: ellipsis; }
#crumb .sep { color: var(--tx3); font-weight: 400; margin: 0 6px; }
#pendSlice { margin: 6px 0 0; color: var(--tx1); font-size: var(--fs-xs); }
#pendSlice[hidden] { display: none; }
#stats { color: var(--tx3); font-size: var(--fs-xs); white-space: nowrap;
         overflow: hidden; text-overflow: ellipsis; }
.chip { padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs);
        white-space: nowrap; border: 1px solid transparent; }
.chip.print { background: var(--good-bg); color: var(--good);
              border-color: var(--good-line); }
.chip.installed { background: var(--info-bg); color: var(--info-text);
                  border-color: var(--info-line); }
button.chip:not(.tgl) { cursor: default; }
.chip.tgl:hover { filter: brightness(1.3); }
#rstat { display: flex; align-items: center; gap: 6px; color: var(--tx3);
         font-size: var(--fs-xs); flex-shrink: 0; }
#rstat .dot { width: 7px; height: 7px; border-radius: 50%;
              background: var(--tx3); }
#rstat.pending .dot { background: var(--warn); }
#rstat.rendering .dot { background: var(--ice);
                        animation: pulse 1s ease-in-out infinite; }
#rstat.working .dot { background: var(--ice);
                      animation: pulse 1s ease-in-out infinite; }
#rstat.updated .dot { background: var(--good); }
#rstat.failed .dot { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }

/* Two rows, always: views, then inspection tools. Pinned to both stage
   insets and centred with auto margins - a left:50% + translate box
   shrink-wraps to (viewport - left) and slid under the dock. */
#toolbar { position: fixed; bottom: var(--tb-bottom);
           left: calc(var(--stage-l) + 8px); right: calc(var(--stage-r) + 8px);
           width: fit-content; max-width: calc(100vw - var(--stage-l) - var(--stage-r) - 16px);
           margin-inline: auto; z-index: 14; display: grid; row-gap: 2px;
           padding: 6px 9px;
           background: color-mix(in srgb, var(--bg1) 94%, transparent);
           border: 1px solid var(--line); border-radius: 14px;
           backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.tbRow { display: flex; align-items: center; justify-content: safe center; gap: 3px;
         height: var(--tb-row); white-space: nowrap; min-width: 0;
         overflow-x: auto; scrollbar-width: none; }
.tbRow::-webkit-scrollbar { display: none; }
#tools { order: -1; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
body:not(.inspectOn) #tools { display: none; }
#inspectBtn { display: inline-flex; align-items: center; gap: 2px; }
#inspectBtn .car { width: 13px; height: 13px; margin-left: 2px; opacity: .75; transform: rotate(180deg); }
#inspectBtn[aria-expanded="true"] .car { transform: none; }
#toolbar #inspectBtn.on { background: var(--bg3); color: var(--tx0); }
#inspectN { color: var(--hi-text); font-weight: 600; }
#toolbar #showChip { flex: none; margin-left: 2px; }
#toolbar #showPart { padding: 2px 4px; border-radius: 6px; font-size: var(--fs-xs); font-weight: 400;
                     background: var(--bg2); color: var(--tx1); border: 1px solid var(--line);
                     backdrop-filter: none; max-width: 220px; }
body.homed #toolbar, body.homed #stageTop { display: none; }
/* Projects and Settings are places of their own (L1): the stage's chrome waits under them */
body.projectsOn #toolbar, body.projectsOn #stageTop, body.projectsOn #viewCube, body.projectsOn #legend,
body.projectsOn #mHint, body.projectsOn #measureList, body.projectsOn #stageHint, body.projectsOn #mLabels,
body.projectsOn #likePanel, body.projectsOn #pieces,
body.settingsOn #toolbar, body.settingsOn #stageTop, body.settingsOn #viewCube, body.settingsOn #legend,
body.settingsOn #mHint, body.settingsOn #measureList, body.settingsOn #stageHint, body.settingsOn #mLabels,
body.settingsOn #likePanel { display: none !important; }
/* the header and the Edit panel of the project underneath are not reachable (nor focusable) while Settings covers them */
body.settingsOn #top, body.settingsOn #dock, body.settingsOn #pieces { visibility: hidden; }
#toolbar .div { width: 1px; height: 18px; background: var(--line);
                margin: 0 3px; flex: none; }
#toolbar button { padding: 4px 10px; font-size: var(--fs-xs); border: 0;
                  background: none; color: var(--tx2); flex: none; }
#toolbar button:disabled { opacity: .38; }
#toolbar button:hover:not(:disabled) { background: var(--bg3);
                                       color: var(--tx1); }
#toolbar button.on { background: var(--acc); color: var(--acc-text); }
#toolbar label { display: flex; align-items: center; gap: 7px; flex: none;
                 color: var(--tx3); font-size: var(--fs-xs); padding: 0 5px; }
input[type=range] { width: 110px; }
/* A6 S5: the section's side, its Flip and its filled face sit beside the slider */
#toolbar #clipAxis { flex: none; font-size: var(--fs-xs); padding: 2px 4px; background: var(--bg2);
                     color: var(--tx1); border: 1px solid var(--line); border-radius: 6px; }
#toolbar #clipCapL { cursor: pointer; }
#toolbar #clipCapL:has(:disabled) { opacity: .38; cursor: default; }

#dock { position: fixed; top: 0; right: 0; bottom: 0; width: var(--dock-w);
        z-index: 21; display: none; flex-direction: column;
        background: var(--bg1); border-left: 1px solid var(--line); }
body.docked #dock { display: flex; }
/* the Edit panel's head (L1 step 5): what you edit, History, Close - no tabs */
#dockTabs { display: flex; align-items: center; gap: 8px;
            height: var(--top-h); padding: 0 8px 0 16px;
            border-bottom: 1px solid var(--line); flex-shrink: 0; }
#dockClose { padding: 1px 9px; border: 0; background: none;
             color: var(--tx3); font-size: var(--fs-m); }
.dockPage { display: none; flex: 1; min-height: 0; flex-direction: column; }
.dockPage.active { display: flex; }
/* room for the sliders' footer (Keep / Discard) before the composer above */
#panel.dockPage.active { min-height: 210px; }

#pBody { overflow-y: auto; padding: 10px 16px 12px; flex: 1; min-height: 0; }
#tfNote { display: none; align-items: baseline; gap: 10px; margin: 4px 0 10px; padding: 8px 11px;
          border-radius: var(--r); background: var(--warn-bg);
          border: 1px solid var(--warn-line-hi); color: var(--warn-text);
          font-size: var(--fs-s); }
#tfNote .tfLabel { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden;
                   text-overflow: ellipsis; }
#tfNote.open { flex-wrap: wrap; }
#tfNote.open .tfLabel { flex: 1 1 100%; white-space: normal; overflow: visible; }
#tfNote .linkBtn { flex: none; white-space: nowrap; }
#tfNote .linkBtn[hidden] { display: none; }
.linkBtn { background: none; border: 0; padding: 0; font: inherit;
           color: var(--warn-link); text-decoration: underline; cursor: pointer; }
.sect { margin: 16px 0 6px; color: var(--tx3); font-size: var(--fs-2xs);
        text-transform: uppercase; letter-spacing: .8px; font-weight: 600;
        display: flex; align-items: center; gap: 8px; }
.sect::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#selRow { display: none; align-items: center; justify-content: space-between;
          gap: 8px; margin: 6px 0; }
#selRow label { color: var(--tx2); }
.krow { margin: 4px -8px; padding: 7px 9px 8px; border-radius: var(--r);
        border: 1px solid transparent; }
.krow:hover { background: var(--bg2); }
.krow.sel { background: var(--hi-bg); border-color: var(--hi-line); }
.krow.sel .klabel { color: var(--hi-text); }
.krow.sel .kunit, .krow.sel .inhint, .krow.sel .khelp { color: var(--tx2); }
.krow.dead { opacity: .4; }
.krow.bad input[type=number] { border-color: var(--bad); }
.kerr { margin: 3px 0 0 24px; font-size: var(--fs-xs); color: var(--bad-text); }
.kreach { margin: 3px 0 0 24px; font-size: var(--fs-xs); color: var(--warn-text); }
#markers { margin: 6px 0 0; padding-left: 18px; font-size: var(--fs-xs); color: var(--warn-text); }
#markers[hidden] { display: none; }
#markers li { margin: 3px 0; }
/* the print note (2026-10-27): after Print / Download, where a piece needs
   supports - a .menu box placed under the Print button, until closed */
#printNote { gap: 6px; padding: 10px 12px; max-width: min(360px, calc(100vw - 16px)); }
#printNote .pnHead { display: flex; align-items: flex-start; gap: 8px; }
#printNote .pnMark { flex: none; color: var(--warn); font-weight: 700; }
#printNote[data-state="bridged"] .pnMark { color: var(--tx2); }
#pnTitle { flex: 1; min-width: 0; color: var(--tx0); font-size: var(--fs-s); line-height: 1.4; }
#pnX { flex: none; padding: 0 6px; border: 0; background: none;
       color: var(--tx3); font-size: var(--fs-m); }
#pnWhat, #pnOpen { margin: 0; color: var(--tx2); font-size: var(--fs-xs);
                   line-height: 1.45; overflow-wrap: anywhere; }
#pnOpen[hidden] { display: none; }
#pnList { margin: 0; padding-left: 18px; font-size: var(--fs-xs); color: var(--warn-text); }
#pnList li { margin: 3px 0; }
#pnList:empty { display: none; }
/* the material: a choice against the advice keeps its warning (Stage M) */
#pnMat, .mwarn { margin: 0; color: var(--warn-text); font-size: var(--fs-xs);
                 line-height: 1.45; overflow-wrap: anywhere; }
.mwarn { padding: 4px 10px 6px; max-width: 320px; }
#pnMat[hidden], .mwarn[hidden], #matSec[hidden], #colSec[hidden] { display: none; }
/* T3: one row per colour - swatch, colour + part, filament slot, grams */
.colRows { list-style: none; margin: 0; padding: 2px 10px 4px; max-width: 320px; }
.colRows li { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs);
  color: var(--tx1); padding: 2px 0; min-width: 0; }
.colRows .cSw { flex: none; width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid var(--line, #8888); }
.colRows .cName { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.colRows .cSlot, .colRows .cG { flex: none; color: var(--tx2, inherit); }
#colWords { margin: 0; padding: 0 10px 6px; max-width: 320px; font-size: var(--fs-xs);
  color: var(--tx2, inherit); overflow-wrap: anywhere; }
#pnCol { margin: 0; color: var(--tx1); font-size: var(--fs-xs); line-height: 1.45;
         overflow-wrap: anywhere; }
#pnCol[hidden] { display: none; }
.khead { display: flex; align-items: center; gap: 8px; }
.eye { flex: none; width: 16px; text-align: center; font-size: var(--fs-2xs);
       color: var(--hi-dim); cursor: pointer; background: none; border: 0;
       padding: 0; border-radius: 4px; }
.eyePad { flex: none; width: 16px; }
.eye[hidden] { display: inline-block; visibility: hidden; }   /* keeps the row aligned */
.klabel { flex: 1; color: var(--tx2); font-size: var(--fs-s);
          line-height: 1.35; cursor: pointer; }
.khead input[type=number] { width: 70px; padding: 2px 7px;
                            text-align: right; }
.kunit { color: var(--tx3); font-size: var(--fs-xs); width: 42px; }
.krow input[type=range] { width: 100%; margin-top: 6px; height: 3px; }
.krow input[hidden] { display: none; }
/* a 0/1 knob is a switch (v9 Stage 2) */
.ksw { display: inline-flex; align-items: center; gap: 7px; flex: 0 1 auto; min-width: 0;
       cursor: pointer; color: var(--tx1); font-size: var(--fs-xs); }
.kswIn { appearance: none; -webkit-appearance: none; position: relative; flex: none;
         width: 30px; height: 17px; margin: 0; border-radius: 999px; cursor: pointer;
         background: var(--bg3); border: 1px solid var(--line2); }
.kswIn::before { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
                 border-radius: 50%; background: var(--tx2); transition: left .12s; }
.kswIn:checked { background: var(--acc-bg); border-color: var(--acc); }
.kswIn:checked::before { left: 15px; background: var(--acc); }
.kswIn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.kswWord { min-width: 0; overflow-wrap: anywhere; }
.inhint { color: var(--tx3); font-size: var(--fs-2xs); }
.khelp { margin: 3px 0 0 24px; color: var(--tx3); font-size: var(--fs-xs);
         line-height: 1.4; }
.moreBtn { display: flex; align-items: center; gap: 6px; width: 100%;
           margin: 14px 0 2px; padding: 5px 0; background: none; border: 0;
           color: var(--tx2); font-size: var(--fs-s); cursor: pointer;
           text-align: left; }
.moreBtn:hover { color: var(--tx1); }
.moreBtn .car { display: inline-block; transition: transform .15s;
                font-size: var(--fs-3xs); color: var(--tx3); }
.moreWrap { display: none; }
.moreWrap.open { display: block; }
.moreBtn.open .car { transform: rotate(90deg); }
.featRow { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.featRow .fl { flex: 1; color: var(--tx2); font-size: var(--fs-s); }
.featRow button { padding: 2px 9px; font-size: var(--fs-xs); }
/* the sliders' footer (pending bar, Keep, the report, the check's findings)
   scrolls when the dock is short of room, never runs off the window */
#pFoot { border-top: 1px solid var(--line); padding: 10px 16px 12px;
         flex: 0 1 auto; min-height: 0; overflow-y: auto; }
#autoRow { display: flex; align-items: center; gap: 7px; color: var(--tx2);
           font-size: var(--fs-s); margin-bottom: 8px; }
#pFoot .actions { display: flex; gap: 8px; }
#pFoot .actions button { flex: 1; }
#repPill { display: none; margin-top: 10px; font-weight: 600;
           font-size: var(--fs-s); padding: 4px 11px; border-radius: var(--r);
           border: 0; width: 100%; text-align: left;
           /* one line: "△ needs supports — otherwise fine (click for
              details)" wrapped in a 1024 px dock; the title has it all */
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* verdict colours: ONE definition for the render pill, chat pills and
   plan-preview gates */
#repPill.pass, .vpill.pass, .pvGate.pass { background: var(--good-bg); color: var(--good); }
#repPill.warn, .vpill.warn, .vpill.scope, .pvGate.warn { background: var(--warn-bg); color: var(--warn-text); }
#repPill.fail, .vpill.fail, .pvGate.fail { background: var(--bad-bg); color: var(--bad-text); }
#report { margin-top: 8px; padding: 9px; background: var(--bg0);
          border-radius: var(--r); font: var(--fs-xs)/1.55 var(--mono);
          white-space: pre-wrap; display: none; max-height: 150px;
          overflow-y: auto; color: var(--tx2); }
#saveRow { display: none; gap: 8px; margin-top: 10px; }
#saveRow input { flex: 1; min-width: 0; }

#chatHead { display: flex; align-items: center; gap: 8px;
            padding: 10px 16px 6px; }
#chatHead .sub2 { color: var(--tx3); font-size: var(--fs-xs); }
#chatHead button { margin-left: auto; padding: 1px 9px;
                   font-size: var(--fs-xs); }
#chatLog { flex: 1; overflow-y: auto; padding: 8px 16px; display: flex;
           flex-direction: column; gap: 9px; min-height: 120px; }
.msg { max-width: 90%; padding: 8px 12px; border-radius: var(--r-lg);
       font-size: var(--fs-s); line-height: 1.55; white-space: pre-wrap;
       word-break: break-word; }
.msg.u { align-self: flex-end; background: var(--acc-bg); color: var(--tx0);
         border-bottom-right-radius: 4px; }
.msg.a { align-self: flex-start; background: var(--bg3);
         border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; color: var(--tx3); font-size: var(--fs-xs);
           background: none; padding: 0 8px; text-align: center; }
.msg .live { color: var(--tx2); font-style: italic; }
.msg.a .vpill { display: inline-block; margin-top: 7px; padding: 2px 9px;
                border-radius: 7px; font-size: var(--fs-xs); font-weight: 600; }
.actList { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.actChip { padding: 1px 8px; border-radius: 7px; font-size: var(--fs-2xs);
           background: var(--info-bg2); color: var(--info-text);
           border: 1px solid var(--info-line2); }
.actChip.edit { background: var(--good-bg); color: var(--good);
                border-color: var(--good-line); }
.planBar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
           margin-top: 9px; }
.applyBtn { padding: 5px 12px; font-size: var(--fs-s); font-weight: 600;
            white-space: nowrap; }
.applyBtn:disabled { opacity: .55; }
.planNo { padding: 5px 12px; font-size: var(--fs-s); white-space: nowrap; }
.planNo:disabled { opacity: .55; }
.planHint { color: var(--tx3); font-size: var(--fs-xs); }
.msg.plan.aside { color: var(--tx3); }
.msg.plan.aside .planPrev { opacity: .55; }
.msg.sys.chg { color: var(--tx2); }
.msg.sys.scopeWarn { color: var(--warn-text); background: var(--warn-bg);
                     padding: 4px 10px; border-radius: 7px; text-align: left; }
.msg.sys.cost { font-variant-numeric: tabular-nums; opacity: .75;
                font-size: var(--fs-2xs); }
#chatCtx { display: none; margin: 0 16px 6px; padding: 4px 10px;
           border-radius: var(--r); background: var(--hi-bg); color: var(--hi-text);
           border: 1px solid var(--hi-line); font-size: var(--fs-xs);
           align-items: center; gap: 6px; }
#chatCtx button { padding: 0 5px; font-size: var(--fs-2xs); background: none;
                  border: 0; color: var(--hi-text); }
#chatBusy { display: none; align-items: center; gap: 8px;
            padding: 0 16px 8px; color: var(--tx2); font-size: var(--fs-xs); }
#chatBusy::before { content: ""; width: 11px; height: 11px;
                    border-radius: 50%; border: 2px solid var(--tx3);
                    border-top-color: var(--ice);
                    animation: sp .7s linear infinite; flex: none; }
#chatStop { margin-left: auto; padding: 1px 9px; font-size: var(--fs-xs); }
/* how long it has been at it and how long this kind of step usually takes:
   never the part that gets cut (the words of what it is doing do, on the bar) */
#chatBusyTime { flex: none; color: var(--tx3); white-space: nowrap; }
#chatBusyTime:empty { display: none; }
@media (max-width: 560px) {
  /* a phone: what it is doing and Stop on one line, the time under them */
  #chatBusy { flex-wrap: wrap; row-gap: 2px; }
  #chatBusyTxt { flex: 1 1 0; min-width: 0; }
  #chatBusyTime { order: 3; flex: 1 1 100%; white-space: normal; }
}
/* a step that failed: the status line under the log (the slim bar's first
   row on the board), and the same words at the button that started it */
#runFail { display: none; }
body.phase-concepts:not(.threadOpen) #runFail:not([hidden]) {
           display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
           padding: 7px 10px; border-radius: var(--r); background: var(--bad-bg);
           border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent); color: var(--tx0);
           font-size: var(--fs-s); line-height: 1.4; }
#runFailT { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* a step's result, in the same place as a failure and not one (arrival.js) */
#runDone { display: none; }
body.phase-concepts:not(.threadOpen) #runDone:not([hidden]) {
           display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px;
           padding: 7px 10px; border-radius: var(--r); background: var(--phase-bg);
           border: 1px solid var(--phase-line); color: var(--tx0);
           font-size: var(--fs-s); line-height: 1.4; }
body.phase-concepts:not(.threadOpen) #runDone[data-kind="none"]:not([hidden]) {
           background: var(--bg2); border-color: var(--line2); }
#runDoneMark { flex: none; display: flex; color: var(--phase); }
#runDoneMark:empty { display: none; }
#runDoneMark .ico { width: 16px; height: 16px; }
#runDoneT { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
#runDone[data-kind="changed"] #runDoneT { font-weight: 600; }
.rfBtns { display: flex; gap: 6px; flex: none; }
.rfBtns button { padding: 3px 10px; font-size: var(--fs-xs); white-space: nowrap; }
.msg.sys.runfail { align-self: flex-start; color: var(--tx0); background: var(--bad-bg);
                   padding: 7px 10px; border-radius: 7px; text-align: left;
                   font-size: var(--fs-s); white-space: normal; }
.msg.sys.runfail .rfGo, .msg.sys.runfail .rfHelp { margin-left: 10px; }
/* v10 R6/R4: where pressing it again today cannot help (the daily limit, no
   Claude Code) the way on is the button beside the words: the card and the
   brief draw no Try again there (aihelp.js canRetry) */
.rfHelp { padding: 3px 10px; font-size: var(--fs-xs); white-space: nowrap; flex: none; }
a.rfHelp { color: var(--hi); }
.runFailAt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px;
             padding: 8px 10px; border-radius: var(--r); background: var(--bad-bg);
             border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent); color: var(--tx0);
             font-size: var(--fs-s); line-height: 1.4; }
.rfWord { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.rfGo { padding: 4px 12px; font-size: var(--fs-s); white-space: nowrap; flex: none; }
.bdHead > .runFailAt { flex: 1 1 100%; margin-top: 2px; }
/* brought into view clear of the steer bar, which floats over the board */
.bcard .runFailAt { scroll-margin-bottom: calc(var(--steer-h, 60px) + 24px); }
#briefCTA > .runFailAt { margin-top: 0; }
#chatRow { display: flex; gap: 8px; padding: 10px 16px 12px;
           border-top: 1px solid var(--line); flex-shrink: 0; }
#chatIn { flex: 1; resize: none; min-height: 36px; max-height: 160px;
          padding: 8px 11px; min-width: 0; }
#chatSend { align-self: flex-end; }
.planPrev { margin-top: 9px; }
.pvPair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pvPair figure { margin: 0; }
.pvPair img { width: 100%; border-radius: 7px; border: 1px solid var(--line);
              background: var(--img-bg); display: block; }
.pvPair .figBtn { display: block; width: 100%; padding: 0; border: 0;
                  background: none; border-radius: 7px; }
.pvPair figcaption { text-align: center; color: var(--tx3);
                     font-size: var(--fs-xs); margin-top: 2px; }
.pvGate { display: inline-block; margin-top: 7px; padding: 2px 9px;
          border-radius: 7px; font-size: var(--fs-xs); font-weight: 600; }
.pvGate.sketch { background: var(--info-bg); color: var(--info-text);
                 border-color: var(--info-line); }
.cardTitle { font-weight: 600; }
.pvNone { margin-top: 7px; color: var(--tx3); font-size: var(--fs-xs);
          font-style: italic; }
.pvNone.blurb { font-style: normal; }
.pvNone.plain { font-style: normal; color: var(--warn-text); }
.pvFiles { margin-top: 5px; color: var(--tx3); font-size: var(--fs-xs); }
/* v9 1D: the change, measured; what lies outside the pick; the plan in 3D */
.pvChange { margin-top: 6px; color: var(--tx1); font-size: var(--fs-xs); }
.pvChange.subtle, .pvChange.none { color: var(--warn-text); }
.pvChange.err { color: var(--tx3); font-style: italic; }
.pv3d { margin-top: 7px; padding: 3px 10px; font-size: var(--fs-xs); }
.pvOutside { margin-top: 8px; padding: 6px 9px; border-radius: 7px;
             color: var(--warn-text); background: var(--warn-bg); font-size: var(--fs-xs); }
.pvOutside .linkBtn { font-size: var(--fs-xs); }
#onlyLbl { display: inline-flex; align-items: center; gap: 4px; flex: none;
           white-space: nowrap; font-size: var(--fs-2xs); }
#onlyLbl[hidden] { display: none; }
/* ============ v6 journey: three phases, three layouts =====================
   Scope    calm conversation column + live brief panel (no canvas, no sidebar)
   Concepts the board over the canvas + a bottom steer bar (chat collapsed)
   Project  the workshop: sidebar | canvas | dock (everything above this)
   The ONE #dock/#chat is re-placed per phase by CSS - never moved in the DOM. */

/* --- shared by both draft phases --- */
body.drafting #pieces, body.drafting #projStatus,
body.drafting #pose, body.drafting #rstat, body.drafting #actions > *,
body.drafting #dockTabs, body.drafting #chatHead, body.drafting #coach,
body.drafting #legend, body.drafting #mHint, body.drafting #askBar { display: none !important; }
body.drafting #chatPins, body.drafting #chatCtx { display: none !important; }
body.drafting #top, body.drafting #stage { right: 0; }
body.drafting button.primary { background: var(--phase-bg);
  border-color: var(--phase-line); color: var(--tx0); }
body.drafting button.primary:hover:not(:disabled) { border-color: var(--phase); }
body.drafting #dock { border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; }
body.drafting #chatIn:focus-visible { outline-color: var(--phase); }
/* a short conversation sits at the bottom, next to the composer, like any
   chat; a long one scrolls and stays pinned to its newest line (chat.js) */
body.drafting #chatLog > :first-child { margin-top: auto; }
body.drafting .msg { flex: none; }
.ctaTxt { color: var(--tx2); font-size: var(--fs-xs); }
.ctaSkip { background: none; border: 0; padding: 0; color: var(--tx3);
           text-decoration: underline; font-size: var(--fs-xs); }
.ctaSkip:hover:not(:disabled) { color: var(--tx1); }

/* --- the rail: ⌂ · title · Scope ── Concepts ── Project --- */
#phaseRail { display: flex; align-items: center; gap: 12px; min-width: 0;
             overflow: hidden; flex: 0 1 auto; }
body.drafting #phaseRail { flex: 1 1 auto; }
#railHome { flex: none; padding: 3px 10px; background: none; color: var(--tx2);
            border: 1px solid var(--line2); font-size: var(--fs-m); }
#railHome:hover { color: var(--tx0); border-color: var(--phase); }
.railTitle { font-weight: 650; font-size: var(--fs-ml); color: var(--tx0);
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
             min-width: 0; max-width: 30vw; }
.phSteps { display: flex; align-items: center; list-style: none; flex: none;
           margin: 0 auto; }
.ph { display: flex; align-items: center; gap: 6px; color: var(--tx3);
      font-size: var(--fs-s); white-space: nowrap; }
.ph + .ph::before { content: ""; width: 26px; height: 1px; margin: 0 10px;
                    background: var(--line2); }
.phDot { flex: none; width: 9px; height: 9px; border-radius: 50%;
         border: 1.5px solid var(--line2); }
.ph.done { color: var(--tx2); }
.ph.done .phDot { background: var(--good); border-color: var(--good); }
.ph.on { color: var(--tx0); font-weight: 650; }
.ph.on .phDot { background: var(--phase); border-color: var(--phase);
                box-shadow: 0 0 0 3px var(--phase-bg); }
.phSub { color: var(--phase); font-weight: 400; font-size: var(--fs-xs); }
#briefChip { flex: none; padding: 3px 11px; border-radius: 999px;
             font-size: var(--fs-xs); background: none; color: var(--tx2);
             border: 1px solid var(--line2); }
#briefChip:hover, #briefChip[aria-expanded="true"] { color: var(--tx0);
                                                    border-color: var(--phase); }

/* --- Scope: a notebook, not a workbench --- */
/* the conversation uses the room it has (2026-10-29, owner: "the
   conversation box isn't fully widescreen"): the column grows with the
   window, the brief keeps a readable width, a message keeps a readable
   line length inside it */
body.phase-scope { --scope-w: min(1760px, calc(100vw - var(--rail-w) - 48px));
                   --brief-w: clamp(340px, 24vw, 420px); }
body.phase-scope #stage { visibility: hidden; }
body.phase-scope #toolbar, body.phase-scope #crumbWrap,
body.phase-scope #briefChip { display: none; }
body.phase-scope #dock { top: calc(var(--top-h) + 18px); bottom: 18px;
  left: calc(var(--rail-w) + (100vw - var(--rail-w) - var(--scope-w)) / 2);
  width: calc(var(--scope-w) - var(--brief-w) - 24px); background: var(--bg1); }
body.phase-scope #briefPanel { display: flex; top: calc(var(--top-h) + 18px);
  bottom: 18px; right: calc((100vw - var(--rail-w) - var(--scope-w)) / 2); width: var(--brief-w); }
body.phase-scope #chatLog { padding: 24px 30px 12px; gap: 16px; }
body.phase-scope .msg { font-size: var(--fs-ml); line-height: 1.6; }
body.phase-scope .msg.a { background: none; padding: 0; max-width: min(100%, 980px); }
body.phase-scope .msg.u { background: var(--bg3); color: var(--tx1);
                          border: 1px solid var(--line2); }
body.phase-scope .msg.sys { font-size: var(--fs-s); }
body.phase-scope #chatRow { padding: 12px 22px 20px; border-top: 0; }
body.phase-scope #chatIn { font-size: var(--fs-ml); border-radius: 12px;
  padding: 11px 14px; background: var(--bg2); border-color: var(--line2); }
body.phase-scope #chatBusy { padding: 0 30px 6px; }
.msg.a.card { background: var(--bg2) !important; padding: 12px 14px !important;
              border: 1px solid var(--line); }
.msg.card details { margin-top: 6px; color: var(--tx2); font-size: var(--fs-s); }
.msg.card summary { cursor: pointer; color: var(--tx3); font-size: var(--fs-xs); }
.cardText { margin-top: 6px; white-space: pre-wrap; }

/* guided question cards */
.msg.qCard { background: var(--bg2) !important; border: 1px solid var(--phase-line);
             border-radius: 14px; padding: 14px 16px !important; max-width: 100%; }
.qQ { font-weight: 600; color: var(--tx0); margin-bottom: 10px; white-space: normal; }
.qOpts { display: flex; flex-wrap: wrap; gap: 8px; }
.qOpt { border-radius: 999px; padding: 6px 14px; background: var(--bg3);
        border: 1px solid var(--line2); color: var(--tx1); font-size: var(--fs-s); }
.qOpt:hover:not(:disabled) { border-color: var(--phase); }
.qOpt.def { border-color: var(--phase-line); }
.qPhoto .ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.qOpt.def::after { content: " · suggested"; color: var(--tx3); font-size: var(--fs-2xs); }
.qOpt.other { background: none; border-style: dashed; color: var(--tx2); }
.qOpt.picked { background: var(--phase-bg); border-color: var(--phase); color: var(--tx0); }
.qCard.done .qOpt:not(.picked) { opacity: .4; }
.qCard.done .qOpt:disabled { opacity: .4; }
.qCard.done .qOpt.picked:disabled { opacity: 1; }
.qPhoto { display: block; margin-top: 12px; padding: 7px 14px; border-radius: 10px;
          background: none; border: 1px dashed var(--phase-line); color: var(--tx1); }
.qPhoto:hover:not(:disabled) { border-color: var(--phase); }

/* the live brief */
#briefPanel { position: fixed; z-index: 21; display: none; flex-direction: column;
              background: var(--bg1); border: 1px solid var(--line2);
              border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.bpScroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 12px; }
.bpHead { display: flex; align-items: center; gap: 8px; color: var(--phase);
          font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: 1.1px;
          font-weight: 700; }
.bpProg { margin-left: auto; color: var(--tx3); letter-spacing: 0;
          text-transform: none; font-weight: 600; font-size: var(--fs-xs); }
.bpClose { display: none; padding: 0 6px; background: none; border: 0;
           color: var(--tx3); font-size: var(--fs-m); }
body.briefPop .bpClose { display: inline-block; }
.bpTitle { font-size: var(--fs-xl); font-weight: 650; color: var(--tx0);
           margin: 6px 0 12px; line-height: 1.25; overflow-wrap: anywhere; }
/* the brief's colours: each part in the person's words (Stage A) */
.bpCol .bpV { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.bpColItem { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.bpSw { flex: none; width: 11px; height: 11px; border-radius: 3px;
        border: 1px solid var(--line2); }
/* the brief's material: the pick, why, the person's choice (Stage M) */
.bpMat .bpV { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.bpMatSel { font-size: var(--fs-xs); padding: 1px 4px; max-width: 100%; }
.bpMatWhy { color: var(--tx2); overflow-wrap: anywhere; min-width: 0; }
.bpMatWarn { grid-column: 2 / -1; margin: 2px 0 0; color: var(--warn-text);
             font-size: var(--fs-xs); line-height: 1.4; overflow-wrap: anywhere; }
.bpRow { display: grid; grid-template-columns: 14px 96px minmax(0, 1fr); gap: 8px;
         padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-s); }
.bpMark { color: var(--tx3); }
.bpRow.on .bpMark { color: var(--good); }
.bpK { color: var(--tx3); }
.bpV { color: var(--tx3); font-style: italic; overflow-wrap: anywhere; }
.bpRow.on .bpV { color: var(--tx1); font-style: normal; }
.bpSec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.bpSec b { color: var(--tx3); font-size: var(--fs-2xs); text-transform: uppercase;
           letter-spacing: 1px; }
.bpSec ul { margin: 6px 0 0; padding-left: 18px; color: var(--tx2);
            font-size: var(--fs-s); }
.bpSec li { margin: 3px 0; }
/* references (refs.js): the brief's list and Home's - each one's job, where
   it came from, the file a link still waits for */
.bpRefs { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.refsHead { display: block; margin-bottom: 6px; color: var(--tx3);
            font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: 1px; }
.refList { list-style: none; margin: 0; padding: 0; display: flex;
           flex-direction: column; gap: 8px; }
.refRow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px;
          align-items: start; padding: 8px; border: 1px solid var(--line);
          border-radius: 10px; background: var(--bg2); text-align: left; }
.refThumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
            display: flex; align-items: center; justify-content: center;
            background: var(--bg3); color: var(--tx2); }
.refThumb img { width: 100%; height: 100%; object-fit: cover; }
.refThumb .ico { width: 22px; height: 22px; }
.refMain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.refName { color: var(--tx1); font-size: var(--fs-s); font-weight: 600;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refMeta, .refSrc { color: var(--tx3); font-size: var(--fs-xs); white-space: nowrap;
                    overflow: hidden; text-overflow: ellipsis; }
.refJobRow { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 0; }
.refJob { min-width: 0; max-width: 100%; padding: 3px 6px; font-size: var(--fs-xs);
          background: var(--bg1); color: var(--tx1); border: 1px solid var(--line2);
          border-radius: 6px; }
.refSug { flex: none; color: var(--phase); font-size: var(--fs-2xs); white-space: nowrap; }
.refNote { color: var(--tx3); font-size: var(--fs-2xs); line-height: 1.35; }
.refLic { color: var(--tx3); font-size: var(--fs-2xs); line-height: 1.35; }
.refLic[data-read="blocked"] { color: var(--warn-text); }
.refNeeds { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
            min-width: 0; margin-top: 4px; }
.refNeedsTxt { min-width: 0; color: var(--warn-text); font-size: var(--fs-xs);
               line-height: 1.35; }
.refAttach { flex: none; padding: 2px 8px; font-size: var(--fs-xs); white-space: nowrap; }
.refX { padding: 0 5px; background: none; border: 0; color: var(--tx3);
        font-size: var(--fs-m); }
.refX:hover { color: var(--tx1); }
.refBusy { margin: 6px 0 0; color: var(--tx3); font-size: var(--fs-xs); line-height: 1.35;
           overflow-wrap: anywhere; }
.refAdd { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.refAdd button { padding: 4px 8px; font-size: var(--fs-xs); white-space: nowrap; }
.refLinkBox { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.refLinkIn { flex: 1; min-width: 0; padding: 6px 10px; font-size: var(--fs-s);
             background: var(--bg1); color: var(--tx1); border: 1px solid var(--line2);
             border-radius: 8px; }
.refLinkGo { flex: none; padding: 5px 12px; font-size: var(--fs-xs); white-space: nowrap; }
.refLinkX { flex: none; padding: 0 6px; background: none; border: 0; color: var(--tx3); }
/* "How to photograph it" (refs.js photoCard, v10 A2) */
.photoCard { margin-top: 8px; border: 1px solid var(--line2); border-radius: 8px;
             background: var(--bg2); font-size: var(--fs-xs); color: var(--tx1); min-width: 0; }
.photoCard summary { cursor: pointer; padding: 5px 10px; color: var(--tx1); }
.photoCard[open] summary { color: var(--tx0); }
.pcSketchBox { padding: 2px 10px 0; color: var(--tx2); }
.pcSketch { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; }
.pcSketch .pcPaper { fill: var(--bg1); stroke: var(--tx2); }
.pcSketch .pcThing { fill: var(--phase-bg); stroke: var(--phase); }
.pcSteps { margin: 4px 10px 8px; padding-left: 18px; line-height: 1.45; }
.pcSteps li { margin: 2px 0; overflow-wrap: anywhere; }
.pcSteps b { color: var(--tx0); }
/* "Here's what I understood" (compose.js, Stage 4): a base + a picture on it */
.cpCard { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--phase);
          border-radius: 10px; background: var(--bg2); display: flex; flex-direction: column;
          gap: 6px; min-width: 0; }
.cpCard[data-state="problem"] { border-color: var(--warn-line-hi); }
.cpHead { color: var(--tx0); font-size: var(--fs-s); }
.cpLine, .cpNote, .cpWarn, .cpDone { margin: 0; font-size: var(--fs-xs); line-height: 1.45;
                                     color: var(--tx1); overflow-wrap: anywhere; }
.cpLine b { color: var(--tx0); }
.cpLine[data-k="trace"], .cpLine[data-k="share"], .cpNote { color: var(--tx2); }
.cpWarn { color: var(--warn-text); }
.cpDone { color: var(--good-text); }
.cpCtl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cpHow { display: flex; gap: 4px; flex-wrap: wrap; }
.cpOpt { padding: 2px 9px; font-size: var(--fs-xs); }
.cpOpt[aria-pressed="true"] { border-color: var(--phase); color: var(--tx0);
                              background: var(--phase-bg); }
.cpL { display: flex; align-items: center; gap: 4px; color: var(--tx2); font-size: var(--fs-xs); }
.cpFace, .cpSize { padding: 2px 6px; font-size: var(--fs-xs); background: var(--bg1);
                   color: var(--tx1); border: 1px solid var(--line2); border-radius: 6px; }
.cpSize { width: 54px; }
.cpImg { display: block; width: 100%; border-radius: 8px; background: var(--bg0); }
.cpBtns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cpBtns button { padding: 4px 12px; font-size: var(--fs-xs); }
/* a reference's numbers (Stage 2): each row says where it came from and
   whether it may set a size - a mark and the words */
.refFactsBox { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; min-width: 0; }
.refRead, .refUnitsQ { color: var(--tx3); font-size: var(--fs-2xs); line-height: 1.35; }
.refCheck { font-size: var(--fs-2xs); line-height: 1.35; color: var(--tx2); }
.refCheck[data-state="ok"] { color: var(--good-text); }
.refCheck[data-state="refused"], .refCheck[data-state="none"] { color: var(--warn-text); }
.refUnitsBox { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.refUnits { max-width: 100%; padding: 3px 6px; font-size: var(--fs-xs); background: var(--bg1);
            color: var(--tx1); border: 1px solid var(--warn-line-hi); border-radius: 6px; }
.refFacts { list-style: none; margin: 2px 0 0; padding: 0; display: flex;
            flex-direction: column; gap: 4px; }
.refFact { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 4px 6px;
           border-left: 2px solid var(--line2); background: var(--bg1); border-radius: 4px; }
.refFact[data-sets="yes"] { border-left-color: var(--good); }
.rfMain { font-size: var(--fs-xs); color: var(--tx1); overflow-wrap: anywhere; }
.rfWhat { font-weight: 600; }
.rfSrc { color: var(--tx3); font-size: var(--fs-2xs); overflow-wrap: anywhere; }
.rfSets { font-size: var(--fs-2xs); color: var(--tx2); }
.rfSets::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px;
                  border-radius: 50%; border: 1px solid var(--tx3); vertical-align: 0; }
.refFact[data-sets="yes"] .rfSets { color: var(--good-text); }
.refFact[data-sets="yes"] .rfSets::before { background: var(--good); border-color: var(--good); }
.rfAct { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 2px; }
.rfAct button { padding: 1px 7px; font-size: var(--fs-2xs); white-space: nowrap; }
.rfAct .rfX { background: none; border: 0; color: var(--tx3); padding: 0 4px; }
.refFactBtns { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.refFactBtns button { padding: 2px 8px; font-size: var(--fs-xs); white-space: nowrap; }
.refSizeForm { display: flex; flex-direction: column; gap: 4px; padding: 6px;
               border: 1px solid var(--line2); border-radius: 6px; background: var(--bg1); }
.rsHead { color: var(--tx2); font-size: var(--fs-2xs); }
.rsRow { display: grid; grid-template-columns: minmax(0, 1fr) 64px 56px; gap: 4px; }
.rsRow input, .rsRow select { min-width: 0; padding: 4px 6px; font-size: var(--fs-xs);
  background: var(--bg0); color: var(--tx1); border: 1px solid var(--line2); border-radius: 5px; }
.rsBtns { display: flex; gap: 6px; }
.rsBtns button { padding: 2px 10px; font-size: var(--fs-xs); }
/* measuring on a photo (measure.js) */
#measureDlg { display: none; position: fixed; inset: 0; z-index: 49; align-items: center;
           justify-content: center; background: color-mix(in srgb, var(--bg0) 80%, transparent);
           backdrop-filter: blur(4px); }
#measureDlg.on { display: flex; }
#msCard { display: flex; flex-direction: column; gap: 8px;
          width: min(980px, calc(100vw - 16px)); max-height: calc(100vh - 16px);
          overflow-y: auto; padding: 14px 16px; background: var(--bg1);
          border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); }
.msHead { display: flex; align-items: center; gap: 10px; min-width: 0; }
#msTitle { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-l, 15px); color: var(--tx0);
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msX { flex: none; background: none; border: 0; color: var(--tx2); font-size: var(--fs-l, 15px); }
.msSheet, .msStep, .msNote, .msCheck, .msRefused { margin: 0; font-size: var(--fs-s);
                                                    line-height: 1.4; color: var(--tx2); }
.msSheet[data-found="no"], .msRefused, .msCheck[data-state="refused"],
.msCheck[data-state="none"] { color: var(--warn-text); }
.msCheck[data-state="ok"] { color: var(--good-text); }
.msStep { color: var(--tx1); font-weight: 600; }
.msNote { color: var(--tx3); font-size: var(--fs-xs); }
.msTools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.msKindL { display: flex; align-items: center; gap: 6px; color: var(--tx2); font-size: var(--fs-s); }
.msKind { padding: 3px 6px; font-size: var(--fs-s); background: var(--bg0); color: var(--tx1);
          border: 1px solid var(--line2); border-radius: 6px; }
.msZooms { display: flex; gap: 4px; }
.msZoom { padding: 2px 9px; font-size: var(--fs-xs); }
.msZoom.on { border-color: var(--phase); color: var(--tx0); }
.msStage { max-height: min(58vh, 560px); min-height: 120px; overflow: auto; background: var(--bg0);
           border-radius: 8px; touch-action: pan-x pan-y; }
.msSvg { display: block; height: auto; margin: 0 auto; cursor: crosshair; user-select: none; }
.msQuad { fill: color-mix(in srgb, var(--good) 10%, transparent); stroke: var(--good); }
.msCorner { fill: var(--bg0); stroke: var(--good); cursor: grab; }
.msLine { stroke: var(--warn); }
.msLine.pending { stroke: var(--phase); stroke-dasharray: 6 4; }
.msPt { fill: var(--phase); stroke: var(--bg0); }
.msLbl { fill: #fff; stroke: #000; paint-order: stroke; text-anchor: middle; }
.msForm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px;
          border: 1px solid var(--line2); border-radius: 8px; background: var(--bg2); }
.msF { display: flex; align-items: center; gap: 6px; color: var(--tx2); font-size: var(--fs-s);
       min-width: 0; }
.msF input { min-width: 0; width: 160px; padding: 4px 6px; font-size: var(--fs-s);
             background: var(--bg0); color: var(--tx1); border: 1px solid var(--line2);
             border-radius: 5px; }
.msF .msRulerIn { width: 64px; }
.msFBtns { display: flex; gap: 6px; }
.msList { margin: 0; padding-left: 18px; color: var(--tx1); font-size: var(--fs-s); }
.msList li { margin: 3px 0; overflow-wrap: anywhere; }
.msList li[data-sets="yes"] .msSets { color: var(--good-text); }
.msRuler, .msSets { color: var(--tx3); }
.msDel { margin-left: 6px; padding: 0 5px; background: none; border: 0; color: var(--tx3); }
.msBtns { display: flex; justify-content: flex-end; }
#heroRefs { margin-top: 8px; }
#heroRefs .refList { display: grid; gap: 8px;
                     grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
#briefCTA { flex: none; display: flex; flex-direction: column; align-items: stretch;
            gap: 9px; padding: 14px 20px 18px; border-top: 1px solid var(--line);
            background: var(--bg2); }
#briefCTA button.primary { padding: 9px 16px; font-size: var(--fs-m); }
#briefCTA .ctaSkip { align-self: flex-start; }
/* the brief as a read-only sheet (Concepts, and Scope on narrow screens) */
body.briefPop #briefPanel { display: flex; z-index: 30;
  top: calc(var(--top-h) + 10px); right: 16px; bottom: auto;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - var(--top-h) - 30px); }
body.phase-concepts #briefCTA { display: none; }

/* The page turns when the brief is written (J3, owner's test OT-1): the brief
   takes the main area with the next step's button on it, the conversation
   narrows to the side and stays open for changes. --brief-w is the one
   number the dock's width follows. */
body.phase-scope.briefReady { --chat-w: clamp(320px, 26vw, 440px);
  --brief-w: calc(var(--scope-w) - var(--chat-w) - 24px); }
body.phase-scope.briefReady #chatLog { padding: 18px 18px 10px; gap: 12px; }
body.phase-scope.briefReady .msg { font-size: var(--fs-m); line-height: 1.5; }
body.phase-scope.briefReady #chatRow { padding: 10px 14px 16px; }
body.phase-scope.briefReady #chatBusy { padding: 0 18px 6px; }
/* the button sits right under the brief, where the eye finished reading,
   not at the far foot of an empty panel */
body.phase-scope.briefReady:not(.briefPop) #briefPanel { bottom: auto;
  max-height: calc(100vh - var(--top-h) - 36px); }
body.phase-scope.briefReady .bpScroll { flex: 0 1 auto; padding: 24px 32px 16px; }
body.phase-scope.briefReady .bpTitle { font-size: var(--fs-2xl, 28px); }
body.phase-scope.briefReady #briefCTA { flex-direction: row; flex-wrap: wrap;
  align-items: center; gap: 10px 18px; padding: 16px 32px 20px; }
body.phase-scope.briefReady #briefCTA .ctaTxt { flex: 1 1 260px; color: var(--tx1); }
body.phase-scope.briefReady #briefCTA button.primary { padding: 12px 24px;
  font-size: var(--fs-l); order: 3; }
body.phase-scope.briefReady #briefCTA .ctaSkip { align-self: center; order: 2; }
body.phase-scope.briefReady #briefCTA > .runFailAt { flex: 1 1 100%; order: 0; }

/* --- Concepts: the board --- */
#board { position: fixed; z-index: 16; inset: var(--top-h) 0 0 var(--rail-w); display: none;
         flex-direction: column; background: var(--bg0); }
body.phase-concepts #board { display: flex; }
body.phase-concepts:not(.boardFocus) #toolbar,
body.phase-concepts:not(.boardFocus) #crumbWrap { display: none; }
.bdHead { flex: none; display: flex; align-items: center; gap: 12px 16px;
          flex-wrap: wrap; padding: 18px 28px 10px; }
.bdTitle { display: flex; align-items: baseline; gap: 12px; min-width: 0;
           flex-wrap: wrap; }
.bdTitle h2 { font-size: var(--fs-xl); font-weight: 650; color: var(--tx0); }
.bdSub { color: var(--tx3); font-size: var(--fs-s); }
.bdAll { padding: 4px 12px; font-size: var(--fs-xs); }
.bdCta { margin-left: auto; display: flex; align-items: center; gap: 14px;
         flex-wrap: wrap; justify-content: flex-end; }
.bdCta button.primary { padding: 8px 16px; font-size: var(--fs-m); }
.bdScroll { flex: 1; min-height: 0; overflow-y: auto;
             padding: 4px 28px calc(var(--steer-h, 200px) + 40px); }
.bdSec h3 { margin: 14px 0 10px; color: var(--tx2); font-size: var(--fs-2xs);
            text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
/* card sizes (2026-10-30): Large is the default - about three a row at
   1536 px, four at 1920 - Medium was the old size, Small packs a row */
#board { --card-min: 400px; }
#board[data-size="medium"] { --card-min: 280px; }
#board[data-size="small"] { --card-min: 168px; }
.bdGrid { display: grid; gap: 16px;
          grid-template-columns: repeat(auto-fill, minmax(min(var(--card-min), 100%), 1fr)); }
/* small cards: the model and its name; the rest is in the card's menus */
#board[data-size="small"] .bcBlurb, #board[data-size="small"] .bcAdds, #board[data-size="small"] .bcAsked, #board[data-size="small"] .bcParts,
#board[data-size="small"] .bcFoot .pvGate { display: none; }
#board[data-size="small"] .bcTitle { white-space: nowrap; overflow: hidden;
                                     text-overflow: ellipsis; font-size: var(--fs-s); }
#board[data-size="small"] .bcBody { padding: 9px 10px 10px; }
#board[data-size="small"] .bcDl { padding: 4px 7px; }
#board[data-size="small"] .bcDl .lbl { position: absolute; width: 1px; height: 1px;
                                      overflow: hidden; clip: rect(0 0 0 0); }
#board[data-size="small"] .bcFoot .applyBtn { padding: 4px 10px; font-size: var(--fs-xs); }
.bdSize { display: inline-flex; align-items: center; gap: 2px; padding: 3px;
          border: 1px solid var(--line); border-radius: 10px; }
.bdSizeL { color: var(--tx3); font-size: var(--fs-xs); padding: 0 6px 0 4px; }
.bdSizeB { padding: 4px 10px; border: 0; border-radius: 7px; background: none;
           color: var(--tx2); font-size: var(--fs-xs); white-space: nowrap; }
.bdSizeB:hover { color: var(--tx0); }
.bdSizeB[aria-pressed="true"] { background: var(--phase-bg); color: var(--tx0); }
.bdEmpty { color: var(--tx3); margin-top: 30px; text-align: center; }
.bcard { display: flex; flex-direction: column; min-width: 0; overflow: hidden;
         background: var(--bg1); border: 1px solid var(--line); border-radius: 14px;
         transition: border-color .12s; }
.bcard:hover { border-color: var(--line2); }
.bcard.focus { border-color: var(--phase); box-shadow: 0 0 0 2px var(--phase-bg); }
/* a step's result, marked for a moment; brought into view clear of the bar */
.bcard { scroll-margin: 12px 12px calc(var(--steer-h, 60px) + 24px); }
.bcard.arrived { border-color: var(--phase); animation: bcArrive 1.3s ease-out 3; }
@keyframes bcArrive { 0% { box-shadow: 0 0 0 0 var(--phase); }
                      100% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) {
  .bcard.arrived { animation: none; box-shadow: 0 0 0 3px var(--phase); }
}
.bcFig { display: block; position: relative; padding: 0; border: 0; border-radius: 0;
         background: var(--bg2); }
.bcFig img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
/* the card's model in 3D (cardview.js): over the PNG once drawn; a vertical
   swipe still scrolls the board, a sideways drag turns the model */
.bc3d { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
        transition: opacity .2s; touch-action: pan-y; cursor: grab; }
.bc3d:active { cursor: grabbing; }
.bcFig[data-view="3d"] .bc3d { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .bc3d { transition: none; } }
.bcBody { flex: 1; display: flex; flex-direction: column; gap: 6px;
          padding: 12px 14px 14px; min-width: 0; }
.bcTitle { font-weight: 600; color: var(--tx0); }
.bcBlurb { color: var(--tx2); font-size: var(--fs-s); line-height: 1.45; }
.bcAsked { margin: 0; color: var(--tx2); font-size: var(--fs-s); line-height: 1.4; }
.bcAsked.miss { color: var(--tx); font-weight: 600; }
.bcParts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
           color: var(--tx3); font-size: var(--fs-2xs); }
.bcParts button { padding: 1px 8px; border-radius: 999px; font-size: var(--fs-2xs); }
.bcAdds { margin: 0; font-size: var(--fs-2xs); color: var(--tx2); }
body.boardFocus .bcAdds { display: none; }
.bcFoot { margin-top: auto; padding-top: 6px; display: flex; align-items: center;
          gap: 8px; flex-wrap: wrap; }
.bcFoot .pvGate { margin-top: 0; }
.bcActs { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bcDl, .bdZip { display: inline-flex; align-items: center; gap: 6px;
                padding: 5px 10px; font-size: var(--fs-s); white-space: nowrap; }
.bcDl .ico, .bdZip .ico { width: 16px; height: 16px; flex: none; }
.bdZip { background: none; color: var(--tx2); }
.mnote { margin: 0 10px 6px; color: var(--tx2); font-size: var(--fs-xs);
         line-height: 1.45; }
.bcard.pending .sk.img { aspect-ratio: 4 / 3; border-radius: 0; }
.bcard.pending .bcTitle { color: var(--tx3); font-weight: 400; font-style: italic; }
/* focus mode: the board collapses to a filmstrip over the live canvas */
body.boardFocus #board { bottom: auto; height: var(--board-strip);
  background: color-mix(in srgb, var(--bg0) 94%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
body.boardFocus .bdHead { padding: 10px 20px 6px; }
body.boardFocus .bdTitle h2 { font-size: var(--fs-l); }
body.boardFocus .bdSub { display: none; }
body.boardFocus .bdScroll { display: flex; gap: 10px; overflow-x: auto;
                            overflow-y: hidden; padding: 2px 20px 10px; }
body.boardFocus .bdSec, body.boardFocus .bdGrid { display: flex; gap: 10px; }
body.boardFocus .bdSec h3, body.boardFocus .bcBlurb,
body.boardFocus .bcParts { display: none; }
body.boardFocus .bcard { scroll-margin: 0 12px; }
body.boardFocus .bcard { flex: none; flex-direction: row; width: 236px;
                         height: calc(var(--board-strip) - 64px); }
body.boardFocus .bcFig { flex: none; width: 84px; }
body.boardFocus .bcFig img { width: 84px; height: 100%; aspect-ratio: auto; }
body.boardFocus .bcBody { padding: 9px 10px; gap: 4px; justify-content: space-between; }
body.boardFocus .bcTitle { font-size: var(--fs-s); white-space: nowrap;
                           overflow: hidden; text-overflow: ellipsis; }
body.boardFocus .bcFoot { flex-wrap: nowrap; padding-top: 0; }
body.boardFocus .bcFoot .pvGate { display: none; }
body.boardFocus .bcFoot .applyBtn { margin-left: 0; padding: 4px 10px;
                                    font-size: var(--fs-xs); }
body.boardFocus .bcActs { margin-left: 0; }
/* the filmstrip is tight: Download keeps its icon, the word hides */
body.boardFocus .bcDl { padding: 4px 6px; }
body.boardFocus .bcDl .lbl { position: absolute; width: 1px; height: 1px;
                             overflow: hidden; clip: rect(0 0 0 0); }
body.boardFocus .bcard.pending { display: none; }
/* the filmstrip has no room for a sentence: the slim bar and the conversation say it */
body.boardFocus .bcard .runFailAt { display: none; }
/* the filmstrip follows the round in play (J3). The opened card says "open"
   in a word and a bar; names are marks + words, their picture on hover or
   keyboard focus; earlier rounds fold into one group. */
body.boardFocus .bcard.focus { border-color: var(--phase); background: var(--phase-bg);
  box-shadow: 0 0 0 2px var(--phase), 0 2px 10px rgba(0,0,0,.25); }
.bcOpen { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 999px;
  background: var(--phase); color: var(--bg0); font-size: var(--fs-2xs); font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase; vertical-align: 1px; }
body.boardFocus .bdScroll { align-items: center; }
body.boardFocus .bcChip { flex: none; display: inline-flex; align-items: center; gap: 7px;
  max-width: 220px; padding: 6px 12px; border-radius: 999px; background: var(--bg2);
  border: 1px solid var(--line2); color: var(--tx1); font-size: var(--fs-s); }
body.boardFocus .bcChip:hover, body.boardFocus .bcChip:focus-visible { border-color: var(--phase);
  color: var(--tx0); }
.bcName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcMark { flex: none; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--tx2); box-sizing: border-box; }
.bcChip.ok .bcMark { background: var(--good-text, var(--tx1)); border-color: var(--good-text, var(--tx1)); }
body.boardFocus .bcEarlier { flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 10px; background: none; border: 1px dashed var(--line2);
  color: var(--tx1); font-size: var(--fs-s); white-space: nowrap; }
.bcEarlier .ico { width: 14px; height: 14px; transition: transform .12s; transform: rotate(-90deg); }
.bcEarlier[aria-expanded="true"] .ico { transform: none; }
@media (prefers-reduced-motion: reduce) { .bcEarlier .ico { transition: none; } }
.bcDiv { flex: none; align-self: stretch; width: 1px; background: var(--line2); margin: 6px 2px; }
/* one card on the board: no strip, only the head over the big view */
body.boardFocus.strip-none { --board-strip: 56px; }
.bcPeek { position: fixed; z-index: 44; width: 200px; padding: 6px; border-radius: 10px;
  background: var(--bg1); border: 1px solid var(--line2); box-shadow: var(--shadow);
  pointer-events: none; font-size: var(--fs-xs); color: var(--tx1); }
.bcPeek img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: var(--bg2); border-radius: 6px; margin-bottom: 4px; }
body.phase-concepts #stage { left: var(--rail-w); }
body.boardFocus #stage { top: calc(var(--top-h) + var(--board-strip));
                         bottom: calc(var(--steer-h, 180px) + 16px); }
/* the view tools keep to the top-left corner: centred, they sat over the
   model's middle (2026-10-30) */
body.boardFocus #toolbar { bottom: auto; top: calc(var(--top-h) + var(--board-strip) + 10px);
                           left: calc(var(--rail-w) + 12px); right: auto; margin-inline: 0; }
body.boardFocus #stageTop { top: calc(var(--top-h) + var(--board-strip) + 14px); }

/* --- Concepts: the chat as a bottom steer bar --- */
body.phase-concepts #dock { top: auto; bottom: 16px; left: calc(var(--rail-w) + 28px); right: 28px;
  width: auto;
  max-height: calc(100vh - var(--top-h) - 32px); background: var(--bg1); }
#threadTgl { display: none; }
body.phase-concepts #threadTgl { display: inline-flex; align-items: center; gap: 7px;
  flex: none; white-space: nowrap; padding: 7px 12px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line2); color: var(--tx1);
  font-size: var(--fs-s); }
body.phase-concepts #threadTgl:hover { border-color: var(--phase); color: var(--tx0); }
body.phase-concepts #threadTgl .ico { width: 16px; height: 16px; flex: none; }
.tgNew { padding: 1px 7px; border-radius: 999px; background: var(--phase-bg);
         border: 1px solid var(--phase-line); color: var(--tx0);
         font-size: var(--fs-2xs); font-weight: 600; }
/* minimized (the board's default, steer.js): ONE slim bar - the
   Conversation button, then the composer; while the AI works a one-line
   status sits above it. #chat lends its children to the bar's grid. */
body.phase-concepts:not(.threadOpen) #dock { display: grid;
  grid-template-columns: auto minmax(0, 1fr); align-items: center;
  column-gap: 8px; padding: 6px 8px 6px 8px; }
body.phase-concepts:not(.threadOpen) #chat { display: contents; }
body.phase-concepts:not(.threadOpen) #chatLog { display: none; }
body.phase-concepts:not(.threadOpen) #threadTgl { grid-row: 2; grid-column: 1; }
body.phase-concepts:not(.threadOpen) #compose { grid-row: 2; grid-column: 2; min-width: 0; }
body.phase-concepts:not(.threadOpen) #chatRow { padding: 0; }
body.phase-concepts:not(.threadOpen) #chatBusy { grid-row: 1; grid-column: 1 / -1;
                                                 padding: 2px 4px 6px; min-width: 0; }
body.phase-concepts:not(.threadOpen) #runFail,
body.phase-concepts:not(.threadOpen) #runDone { grid-row: 1; grid-column: 1 / -1;
                                                min-width: 0; }
body.phase-concepts:not(.threadOpen) #chatBusyTxt { white-space: nowrap; overflow: hidden;
                                                    text-overflow: ellipsis; min-width: 0; }
/* expanded: the whole conversation, "Minimize" at its top */
body.phase-concepts.threadOpen #threadTgl { align-self: flex-end; margin: 8px 12px 0; }
body.phase-concepts.threadOpen #dock { height: min(70vh, 720px); }
body.phase-concepts.threadOpen #chatLog { flex: 1; min-height: 0; overflow-y: auto;
                                          padding: 8px 16px 2px; }
body.phase-concepts .msg { max-width: min(90%, 980px); }
body.phase-concepts.threadOpen #chatRow { padding: 8px 12px 12px; }

/* --- the handoff moment --- */
#handoff { display: none; position: fixed; inset: 0; z-index: 48;
           align-items: center; justify-content: center;
           background: color-mix(in srgb, var(--bg0) 76%, transparent);
           backdrop-filter: blur(5px); }
#handoff.on { display: flex; }
#hoCard { --ho: var(--ph-scope); --ho-bg: var(--ph-scope-bg);
          width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
          overflow-y: auto; padding: 24px 26px; background: var(--bg1);
          border: 1px solid var(--line2); border-top: 3px solid var(--ho);
          border-radius: 16px; box-shadow: var(--shadow);
          animation: hoIn .22s ease-out; }
#hoCard.ph-concepts { --ho: var(--ph-concepts); --ho-bg: var(--ph-concepts-bg); }
#hoCard.ph-project { --ho: var(--ph-project); --ho-bg: var(--ph-project-bg); }
.hoKicker { color: var(--ho); font-weight: 700; font-size: var(--fs-xs);
            letter-spacing: 1px; text-transform: uppercase; }
#hoCard h2 { margin: 6px 0 4px; font-size: var(--fs-xl); color: var(--tx0);
             overflow-wrap: anywhere; }
.hoSub { color: var(--tx2); font-size: var(--fs-s); }
.hoImg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
         margin: 14px 0 4px; border-radius: 10px; background: var(--bg2); }
.hoLines, .hoList ul { margin: 10px 0 0; padding-left: 18px; color: var(--tx2);
                       font-size: var(--fs-s); }
.hoLines li, .hoList li { margin: 3px 0; }
.hoList { margin-top: 14px; }
.hoList b { color: var(--tx3); font-size: var(--fs-2xs); text-transform: uppercase;
            letter-spacing: 1px; }
.hoBtns { display: flex; justify-content: flex-end; align-items: center; gap: 14px;
          margin-top: 22px; }
#hoCard .hoGo { padding: 8px 18px; font-size: var(--fs-m); background: var(--ho-bg);
                border-color: var(--ho); color: var(--tx0); }
.hoBack { background: none; border: 0; padding: 0; color: var(--tx3);
          text-decoration: underline; font-size: var(--fs-s); }
@keyframes hoIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes phIn { from { opacity: 0; } }
body.drafting #dock, #briefPanel, #board { animation: phIn .2s ease-out; }
@media (prefers-reduced-motion: reduce) {
  #hoCard, body.drafting #dock, #briefPanel, #board { animation: none; }
}

/* ---- project overview: the whole product, every piece hoverable ---- */
#partTip { position: fixed; z-index: 30; display: none; pointer-events: none;
           min-width: 220px; max-width: 300px; padding: 10px 12px;
           background: var(--label-bg-a); border: 1px solid var(--hi-line);
           border-radius: var(--r-lg); box-shadow: var(--shadow);
           font-size: var(--fs-s); color: var(--tx1); }
#partTip.on { display: block; }
.ptHead { display: flex; align-items: baseline; gap: 8px; }
.ptHead b { color: var(--tx0); font-size: var(--fs-m); }
.ptStatus { margin-left: auto; font-size: var(--fs-2xs); white-space: nowrap; }
.ptStatus.ready { color: var(--good); }
.ptStatus.supports, .ptStatus.stale { color: var(--warn); }
.ptStatus.fail { color: var(--bad); }
.ptStatus.hold { color: var(--warn); }
.ptBlurb { margin-top: 3px; color: var(--tx2); font-size: var(--fs-xs);
           line-height: 1.4; }
.ptStats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px;
           font-variant-numeric: tabular-nums; color: var(--tx0); }
.ptCopies { color: var(--hi-text); }
.ptColours { list-style: none; margin: 6px 0 0; padding: 0; font-size: var(--fs-xs);
             color: var(--tx1); font-variant-numeric: tabular-nums; }
.ptFoot { margin-top: 7px; color: var(--tx3); font-size: var(--fs-2xs); }

/* ---- sidebar head: status in words, the guide as a labelled row ---- */
.pstatus { margin: 0 10px 6px 18px; padding: 0 8px; font-size: var(--fs-xs);
           color: var(--tx3); }
.pstatus.ready { color: var(--good); }
.pstatus.supports, .pstatus.stale { color: var(--warn); }
.pstatus.fail { color: var(--bad); }
.pstatus.held { color: var(--warn); margin-top: -4px; }
.item.guideRow { text-decoration: none; }
.guideIco { flex: none; width: 30px; height: 30px; display: grid; place-items: center;
            border-radius: 6px; background: var(--bg2); border: 1px solid var(--line);
            color: var(--hi-text); }
.guideRow .ext { margin-left: auto; color: var(--tx3); font-size: var(--fs-xs); }

/* ---- the stage caption: what you're looking at, in a sentence ---- */
#stageTop { position: fixed; z-index: 12; top: calc(var(--work-t) + 12px);
            left: calc(var(--stage-l) + 16px); right: calc(var(--stage-r) + 16px);
            display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px;
            pointer-events: none; }
#stageTop > * { pointer-events: auto; }
#stageCap { flex: 1 1 280px; max-width: 620px; min-width: 0; display: flex; align-items: center;
            gap: 12px; padding: 8px 10px 8px 14px; border-radius: var(--r-lg);
            background: color-mix(in srgb, var(--bg1) 88%, transparent);
            border: 1px solid var(--line); backdrop-filter: blur(8px); }
#stageCap[hidden], body.homed #stageCap, body.drafting #stageCap { display: none; }
/* what is on stage, when it is not simply the kept design (v9 1A) */
#stageWhat { flex: none; padding: 6px 12px; border-radius: 999px;
             font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
             color: var(--hi-text); border: 1px solid var(--hi-line);
             background: color-mix(in srgb, var(--bg1) 88%, transparent);
             backdrop-filter: blur(8px); }
#stageWhat.stale { color: var(--warn-text); border-color: var(--warn); }
/* A6 S4: the view cube in the corner - six buttons turned by the camera's own rotation */
#viewCube { position: fixed; z-index: 13; width: 54px; height: 54px;
            right: calc(var(--stage-r) + 22px);
            bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 16px); }
#viewCube[hidden], body.homed #viewCube, body.drafting #viewCube, body.phase-scope #viewCube,
body.phase-concepts #viewCube { display: none; }
#vcBox { position: relative; width: 54px; height: 54px; transform-style: preserve-3d; }
.vcFace { position: absolute; left: 0; top: 0; width: 54px; height: 54px; padding: 0;
          display: grid; place-items: center; font-size: 11px; font-weight: 600;
          color: var(--tx1); background: color-mix(in srgb, var(--bg2) 90%, transparent);
          border: 1px solid var(--line2); border-radius: 0; cursor: pointer;
          backface-visibility: hidden; transform-origin: 50% 50%; }
.vcFace:hover { background: var(--acc-bg); color: var(--tx0); border-color: var(--hi-line); }
@media (max-width: 599px) { #viewCube { display: none; } }
/* A6 S3: which shape the red ghost is */
#ghostChip { flex: none; padding: 6px 12px; border-radius: 999px;
             font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
             color: var(--tx1); border: 1px solid var(--ghost);
             background: color-mix(in srgb, var(--bg1) 88%, transparent); backdrop-filter: blur(8px); }
#ghostChip[hidden], body.homed #ghostChip, body.drafting #ghostChip { display: none; }
/* "make one like this": the person's photo beside the model (likecmp.js) */
#likeBtn { flex: none; padding: 6px 12px; border-radius: 999px; font-size: var(--fs-xs);
           font-weight: 600; white-space: nowrap; color: var(--tx1);
           border: 1px solid var(--line2);
           background: color-mix(in srgb, var(--bg1) 88%, transparent); backdrop-filter: blur(8px); }
#likeBtn[hidden], body.homed #likeBtn, body.drafting #likeBtn { display: none; }
/* A6 S2: Show all pieces / one piece alone, on the overview */
#showChip { flex: none; max-width: 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#showChip[hidden], body.homed #showChip, body.drafting #showChip { display: none; }
#showPart, #showAll { padding: 6px 12px; border-radius: 999px; font-size: var(--fs-xs);
                      font-weight: 600; color: var(--tx1); border: 1px solid var(--line2);
                      background: color-mix(in srgb, var(--bg1) 88%, transparent);
                      backdrop-filter: blur(8px); }
#showPart { max-width: 100%; min-width: 0; }
#showAll { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
           color: var(--hi-text); border-color: var(--hi-line); }
#showAll[hidden] { display: none; }
#likePanel { position: fixed; z-index: 12; top: calc(var(--work-t) + 60px);
             right: calc(var(--stage-r) + 16px); width: min(300px, calc(100vw - 32px));
             max-height: calc(100vh - var(--work-t) - 140px); overflow-y: auto;
             display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
             background: color-mix(in srgb, var(--bg1) 94%, transparent);
             border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow); }
#likePanel[hidden], body.homed #likePanel, body.drafting #likePanel { display: none; }
.lkHead { display: flex; align-items: center; gap: 8px; color: var(--tx0); font-size: var(--fs-s); }
.lkHead b { flex: 1; min-width: 0; }
.lkX { flex: none; background: none; border: 0; color: var(--tx3); }
.lkFig { margin: 0; }
.lkFig img { display: block; width: 100%; border-radius: 8px; background: var(--bg2); }
.lkFig figcaption { margin-top: 4px; color: var(--tx3); font-size: var(--fs-2xs);
                    overflow-wrap: anywhere; }
.lkNote { margin: 0; color: var(--warn-text); font-size: var(--fs-xs); line-height: 1.4; }
#stageWhat[hidden], body.homed #stageWhat, body.drafting #stageWhat { display: none; }
/* ONE line; click (or Enter) opens the whole sentence, again closes it */
#capText { flex: 1; color: var(--tx1); font-size: var(--fs-s); line-height: 1.5;
           cursor: pointer; }
#capText.open { white-space: normal; overflow: visible; }
#stageCap:has(#capText.open) { align-items: flex-start; }
#capGuide { flex: none; display: inline-flex; align-items: center; gap: 6px;
            padding: 5px 11px; border-radius: 999px; font-size: var(--fs-xs);
            font-weight: 600; white-space: nowrap; text-decoration: none;
            color: var(--hi-text); background: var(--hi-bg); border: 1px solid var(--hi-line); }
#capGuide:hover { border-color: var(--hi); color: var(--tx0); }
#capGuide svg { width: 15px; height: 15px; }

/* project provenance (sidebar head) */
.porigin { display: flex; align-items: center; gap: 10px; margin: 0 10px 4px 28px;
           color: var(--tx3); font-size: var(--fs-xs); }
.porigin .pbrief { color: var(--hi); text-decoration: none; }
.porigin .pbrief:hover { text-decoration: underline; }
#chatRevert, #editRedo { display: none; }
#chatRevert.on, #editRedo.on { display: inline-block; }
/* ---- settings ---- */
#setBody { overflow-y: auto; padding: 12px 16px; flex: 1; min-height: 0;
           font-size: var(--fs-s); }
.setRow { display: flex; align-items: center; gap: 10px; margin: 8px 0;
          color: var(--tx2); }
.setRow select { flex: 1; min-width: 0; background: var(--bg2); color: var(--tx1);
                 border: 1px solid var(--line2); border-radius: var(--r);
                 padding: 4px 8px; }
.setNote { color: var(--tx3); font-size: var(--fs-xs); line-height: 1.5;
           margin: 4px 0; overflow-wrap: anywhere; }
.setNote b { color: var(--tx2); }
.setNote a { color: var(--hi); }
.code { font-family: var(--mono); font-size: var(--fs-xs); }
.docRow { display: flex; gap: 8px; align-items: baseline; padding: 3px 0;
          font-size: var(--fs-s); color: var(--tx2); }
.docRow .st { flex: none; width: 38px; font-size: var(--fs-2xs); font-weight: 700; }
.docRow .st.ok { color: var(--good); }
.docRow .st.miss { color: var(--bad); }
.docRow .st.opt { color: var(--warn); }
.docRow .fixln { display: block; color: var(--tx3); font-size: var(--fs-xs);
                 overflow-wrap: anywhere; }
.loadingNote { color: var(--tx3); font-style: italic; }
#setCap { flex: 0 1 11em; }
/* the closed box shows its whole text (G3 row 19): a label that is long wraps
   above its select instead of squeezing it */
.setRow { flex-wrap: wrap; }
.setRow select { flex: 1 1 12em; text-overflow: ellipsis; }
.qList { margin: 8px 0 2px; padding-left: 20px; }
.qList li { margin: 4px 0; }
.planQ .qList li { margin: 10px 0; }
.planQ .qQ { margin-bottom: 6px; }
.qBar { margin-top: 10px; }
.readCard .qOpts { margin-top: 8px; }
.qNote { margin-top: 6px; color: var(--tx2); font-size: var(--fs-s);
         white-space: normal; }
.qHint { margin-top: 7px; color: var(--tx3); font-size: var(--fs-xs);
         font-style: italic; }
.copyErr { margin-left: 8px; padding: 1px 8px; font-size: var(--fs-xs);
           border: 1px solid var(--line2); background: none;
           color: var(--tx2); border-radius: 6px; }
.copyErr:hover { border-color: var(--acc); color: var(--tx1); }
#chatPins { display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
            margin: 0 16px 6px; font-size: var(--fs-xs); color: var(--tx3); }
.pinChip { display: inline-flex; align-items: center; gap: 4px;
           padding: 1px 4px 1px 8px; border-radius: 7px;
           background: var(--bg3); color: var(--tx2);
           border: 1px solid var(--line2); max-width: 100%; }
.pinChip button { padding: 0 3px; font-size: var(--fs-3xs); background: none;
                  border: 0; color: var(--tx3); }
.pinChip img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
#pinAdd { padding: 0 7px; font-size: var(--fs-xs); border-style: dashed; }
#mpinChips:empty { display: none; }
#mpinChips { display: contents; }
/* measured pins (v9 Stage 2): held, moved, or on another piece */
.pinChip.measured.held { border-color: var(--good); }
.pinChip.measured.moved, .pinChip.measured.gone { border-color: var(--bad); color: var(--bad-text); }
.pinChip.measured.other, .pinChip.measured.unknown { opacity: .75; }
.pinChip .pinWhy { color: var(--tx3); font-size: var(--fs-3xs); margin-left: 2px; }
#pinBar { margin: 0 0 8px; padding: 6px 9px; border-radius: var(--r); font-size: var(--fs-xs);
          color: var(--tx1); border: 1px solid var(--line); background: var(--bg2); }
#pinBar[hidden] { display: none; }
#pinBar.bad { border-color: var(--bad); color: var(--bad-text); }
#pinBar .linkBtn { margin-left: 6px; }
.pvPins { margin-top: 6px; font-size: var(--fs-xs); color: var(--tx1); }
.pvPins.bad { color: var(--bad-text); }
#inspect .inPin { padding: 4px 10px; font-size: var(--fs-xs); }
#inspect .inPin.linkBtn { padding: 4px 2px; }
.pinIn { width: 150px; padding: 2px 8px; font-size: var(--fs-xs); }
#photoChips { display: none; align-items: center; flex-wrap: wrap; gap: 5px;
              margin: 0 16px 6px; font-size: var(--fs-xs); }
#photoChips .pinChip { padding-left: 3px; }
#photoBtn { align-self: flex-end; padding: 6px 9px; }
.msg.sys button { margin-left: 4px; padding: 2px 10px;
                  font-size: var(--fs-xs); }

/* ---- v2 landing / journey ---- */
#home, #projectsView { position: fixed; z-index: 14; inset: var(--top-h) 0 0 var(--rail-w);
        display: none; overflow-y: auto;
        background: color-mix(in srgb, var(--bg0) 97%, transparent);
        backdrop-filter: blur(6px); }
body.homed #home, body.projectsOn #projectsView { display: block; }
/* Home and Projects have no project to name: no empty header band (L1 step 8) */
body.homed:not(.drafting) #top, body.projectsOn:not(.drafting) #top { display: none; }
body.homed:not(.drafting) #home, body.projectsOn:not(.drafting) #projectsView { top: 0; }
#projectsView[hidden] { display: none !important; }
/* Home is for browsing — hide the project-scoped header chrome there.
   AI stays: it is a global entry (continues the draft journey from Home). */
body.homed #crumbWrap, body.homed #pose, body.projectsOn #crumbWrap, body.projectsOn #pose,
body.homed #actions > *, body.projectsOn #actions > * { visibility: hidden; }
#homeIn { max-width: 1080px; margin: 0 auto; padding: 56px 32px 40px; }
/* the line under the name (Home and the website's hero only) */
#homeTag { margin: 0 0 6px; color: var(--hi-text); font: 600 var(--fs-l)/1.35 var(--font-head);
           letter-spacing: -0.01em; }
#homeIn h1 { font-size: var(--fs-2xl); font-weight: 600; color: var(--tx1);
             letter-spacing: var(--head-ls); }
#heroRow { display: flex; gap: 10px; margin-top: 18px; }
#heroIn { flex: 1; min-width: 0; padding: 12px 16px; font-size: var(--fs-ml);
          border-radius: 12px; background: var(--bg2);
          border: 1px solid var(--line2); color: var(--tx1); }
#heroIn:focus { border-color: var(--hi); }
#heroIn:focus-visible { outline: 2px solid var(--hi); outline-offset: 1px; }
#heroGo { padding: 0 22px; font-size: var(--fs-ml); border-radius: 12px; }
.homeSub { margin: 34px 0 0; color: var(--tx3); font-size: var(--fs-s); font-weight: 400; }
#homeLine { margin: 10px 0 0; color: var(--tx2); font-size: var(--fs-m); line-height: 1.5; max-width: 62ch; }
#tourLink { color: var(--hi); white-space: nowrap; }
#heroNote { margin: 8px 0 0; }
#examples .ggrid { margin-top: 12px; }
/* an example: the picture, what it is, its print status, and two buttons */
.exCard { display: flex; flex-direction: column; gap: 7px; padding: 12px; min-width: 0;
          border-radius: 12px; background: var(--bg1); border: 1px solid var(--line); }
.exCard img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: var(--thumb-png); }
.exCard .gname { color: var(--tx1); font-weight: 600; font-size: var(--fs-s); }
.exCard .gblurb { color: var(--tx3); font-size: var(--fs-xs); line-height: 1.45; }
.exCard .exStat { color: var(--tx2); font-size: var(--fs-xs); }
.exCard .exBtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.exCard .exBtns button { font-size: var(--fs-xs); padding: 5px 10px; }
/* "Start from one like this" on every Home card: a small corner button */
.gwrap .gcopy { position: absolute; top: 8px; right: 8px; padding: 3px 5px; border: 0; background: none;
                color: var(--tx3); border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;
                font-size: var(--fs-2xs); opacity: .0; }
.gwrap:hover .gcopy, .gwrap:focus-within .gcopy { opacity: 1; background: var(--bg2); color: var(--tx1); }
@media (hover: none) { .gwrap .gcopy { opacity: 1; } }
.gwrap .gcopy svg { width: 14px; height: 14px; }
.gcopyTag { font-size: var(--fs-2xs); color: var(--tx3); border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; }
/* the copy sheet and the first-AI-step card */
dialog.copyDlg { max-width: min(480px, calc(100vw - 32px)); }
dialog.copyDlg ul { margin: 6px 0 10px; padding-left: 20px; color: var(--tx2); font-size: var(--fs-s); line-height: 1.5; }
dialog.copyDlg label { display: block; margin: 10px 0 4px; color: var(--tx2); font-size: var(--fs-s); }
dialog.copyDlg input { width: 100%; box-sizing: border-box; padding: 8px 10px; }
dialog.copyDlg .cpErr { color: var(--bad); font-size: var(--fs-s); margin: 6px 0 0; }
dialog.copyDlg .cpNote { color: var(--tx3); font-size: var(--fs-xs); margin: 6px 0 0; }
.useCard { align-self: stretch; margin: 8px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line2);
           background: var(--bg1); color: var(--tx1); }
.useCard h3 { margin: 0 0 6px; font-size: var(--fs-m); }
.useCard p { margin: 0 0 8px; color: var(--tx2); font-size: var(--fs-s); line-height: 1.5; }
.useCard .ucRow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.useCard .ucRow button[aria-pressed="true"] { border-color: var(--hi); color: var(--hi); background: var(--hi-bg); }
.useCard .ucGo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* the print record in the plan: one box, the one record (nav.js printPlan) */
.step .pdMark { flex: none; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line2);
                background: var(--bg2); color: var(--good); display: inline-flex; align-items: center;
                justify-content: center; padding: 0; font-size: var(--fs-xs); }
.step .pdMark[data-state="stale"] { color: var(--warn); }
.step .pdWhen { color: var(--tx3); font-size: var(--fs-2xs); }
.recForm { margin: 4px 0 8px 22px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 10px;
           background: var(--bg1); display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-xs); }
.recForm .rfQ { flex: 1 1 100%; color: var(--tx1); }
.recForm input[type=text] { flex: 1 1 100%; min-width: 0; padding: 4px 8px; font-size: var(--fs-xs); }
.recForm button { font-size: var(--fs-xs); padding: 4px 8px; }
.recForm .rfMat { flex: 1 1 100%; color: var(--tx3); }
.planHead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.planHead a { font-size: var(--fs-xs); color: var(--hi); }
/* home browse: one section per category, cards inside */
#catChips { display: flex; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }
#catChips button { font-size: var(--fs-xs); padding: 3px 12px;
                   border-radius: 999px; color: var(--tx2); }
#catChips button:hover { color: var(--tx1); border-color: var(--acc); }
.gcat { margin: 26px 0 10px; display: flex; align-items: baseline; gap: 8px;
        border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.gcat h2 { font-size: var(--fs-s); text-transform: uppercase; letter-spacing: 1.2px;
           color: var(--tx2); font-weight: 700; }
.gcat .gcount { color: var(--tx3); font-size: var(--fs-xs); }
.ggrid { display: grid; gap: 12px;
         grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.gcard { display: flex; flex-direction: column; gap: 7px; padding: 12px;
         border-radius: 12px; background: var(--bg1); text-align: left;
         border: 1px solid var(--line); cursor: pointer; min-width: 0; }
.gcard:hover { border-color: var(--line2); background: var(--bg2); }
.gcard.gdraft { border-color: var(--ph-scope-line); border-style: dashed; }
.gcard.gdraft.ph-concepts { border-color: var(--ph-concepts-line); }
.gcard.gdraft.ph-concepts .stChip.on { color: var(--ph-concepts);
  border-color: var(--ph-concepts-line); background: var(--ph-concepts-bg); }
.gwrap { position: relative; display: flex; min-width: 0; }
.gwrap .gcard { flex: 1; padding-right: 34px; }
.gdel { position: absolute; top: 8px; right: 8px; padding: 0 7px; border: 0;
        background: none; color: var(--tx3); font-size: var(--fs-s); }
.gdel:hover { color: var(--bad); }
.gcard img { width: 100%; aspect-ratio: 1; object-fit: contain;
             border-radius: 8px; background: var(--thumb-png); }
.gcard .gname { display: flex; align-items: center; gap: 6px;
                color: var(--tx1); font-weight: 600; font-size: var(--fs-s); }
.gcard .gblurb { color: var(--tx3); font-size: var(--fs-xs);
                 line-height: 1.45; }
/* loading skeleton (replaced by the real gallery once the manifest lands);
   own classes so it can never be counted as a real card/section */
.skCat { margin: 26px 0 10px; padding-bottom: 6px;
         border-bottom: 1px solid var(--line); }
.skCard { display: flex; flex-direction: column; gap: 7px; padding: 12px;
          border-radius: 12px; background: var(--bg1);
          border: 1px solid var(--line); }
.sk { display: block; border-radius: 6px;
      background: linear-gradient(90deg, var(--bg2), var(--bg3), var(--bg2));
      background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk.img { width: 100%; aspect-ratio: 1; border-radius: 8px; }
.sk.ln { height: 10px; width: 70%; }
.sk.ln2 { height: 8px; width: 90%; }
.skCat .sk { height: 12px; width: 140px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .sk, #rstat.rendering .dot, #rstat.working .dot, #chatBusy::before, #spin::before { animation: none; }
}
/* broken thumbnail -> neutral placeholder tile */
img.ph { object-fit: none; background: var(--bg2); opacity: .7; }
.stChip { padding: 1px 8px; border-radius: 7px; font-size: var(--fs-2xs);
          background: var(--bg3); color: var(--tx3);
          border: 1px solid var(--line); text-transform: capitalize; }
.stChip.on { color: var(--hi); border-color: var(--hi-line); background: var(--hi-bg); }
.stChip.done { color: var(--good); }
/* the question after Print or Download (print.js askBar): one bar, the next visit */
#askBar { position: fixed; bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 56px);
          left: calc(var(--stage-l) + 8px); right: calc(var(--stage-r) + 8px);
          width: fit-content; max-width: calc(100vw - var(--stage-l) - var(--stage-r) - 16px);
          margin-inline: auto; z-index: 12; display: flex; flex-wrap: wrap; align-items: center;
          gap: 8px; background: color-mix(in srgb, var(--bg1) 96%, transparent);
          border: 1px solid var(--line2); border-radius: 12px;
          padding: 8px 12px; font-size: var(--fs-s); color: var(--tx2); }
#askBar[hidden] { display: none; }
#askBar .askQ { flex: 1 1 100%; color: var(--tx1); }
#askBar .askNote { flex: 1 1 100%; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#askBar .askNote input { flex: 1 1 200px; min-width: 0; padding: 4px 10px; font-size: var(--fs-s); }
#askBar .askLess { color: var(--tx3); border: 0; background: none; text-decoration: underline;
                   font-size: var(--fs-xs); padding: 4px 6px; }

#legend { position: fixed; bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 10px);
          left: calc(var(--stage-l) + 14px);
          z-index: 10; display: none;
          background: color-mix(in srgb, var(--bg1) 94%, transparent);
          border: 1px solid var(--line); border-radius: var(--r);
          padding: 8px 12px; font-size: var(--fs-xs); }
#legend span { display: inline-block; width: 11px; height: 11px;
               border-radius: 3px; margin: 0 5px 0 12px;
               vertical-align: -1px; }
#legend .ok { background: var(--oh-ok); }
#legend .warn { background: var(--oh-warn); }
#legend .bad { background: var(--oh-bad); }
#mLabels { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
body.homed #mLabels, body.drafting #mLabels { display: none; }
.mLab, #hLabel { position: fixed; z-index: 12; display: none;
          pointer-events: none; border-radius: var(--r); padding: 5px 10px;
          font: var(--fs-s)/1.5 var(--mono); white-space: pre; }
.mLab { display: block; border: 1px solid var(--bad); color: var(--bad-text-hi);
        background: var(--label-bg-a); transform: translate(-50%, -130%); }
.mLab.gone { border-color: var(--warn); color: var(--warn-text); }
#hLabel { border: 1px solid var(--ms-line); color: var(--ms-text-hi);
          background: var(--label-bg); transform: translate(-50%, -50%);
          text-align: center; }
#hLabel .sub { display: block; color: var(--ms-sub); font-size: var(--fs-2xs); }
/* a value typed on the model (v9 Stage 2) */
#hLabel.editable { pointer-events: auto; cursor: text; }
#hLabel.editable .main { border-bottom: 1px dashed var(--ms-line); }
#hLabel.editing .main { display: none; }
#hEdit { display: block; width: 9.5em; margin: 0 auto 2px; padding: 2px 6px;
         font: var(--fs-s)/1.4 var(--mono); text-align: center; }
#hEdit[aria-invalid="true"] { border-color: var(--bad); }
#hLabel .hErr { display: block; color: var(--bad-text); font-size: var(--fs-2xs); white-space: normal; }
#hLabel .hErr:empty { display: none; }
#hLabel .hSteps { display: flex; justify-content: center; gap: 6px; margin-top: 3px; }
#hLabel .hSteps[hidden] { display: none; }
#hLabel .hStep { min-width: 28px; padding: 0 8px; font: var(--fs-s)/1.5 var(--mono); }
#hLabel .hAsPrinted { display: block; margin: 3px auto 0; font-size: var(--fs-2xs); }
#hLabel .hAsPrinted[hidden] { display: none; }
/* hover (v9 Stage 2): what the surface under the cursor is */
#hoverTag { position: fixed; z-index: 13; pointer-events: none; max-width: 280px;
            padding: 6px 10px; border-radius: var(--r); border: 1px solid var(--hi-line);
            background: var(--label-bg-a); color: var(--tx1); box-shadow: var(--shadow);
            font-size: var(--fs-xs); line-height: 1.4; }
#hoverTag[hidden] { display: none; }
#hoverTag b { display: block; color: var(--hi-text-hi); font-size: var(--fs-s); }
#hoverTag .sub { display: block; color: var(--tx2); }
#hoverTag .k { color: var(--tx1); }
#hoverTag .hint { color: var(--tx3); font-size: var(--fs-2xs); }
#mHint { position: fixed; bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 10px);
         right: calc(var(--stage-r) + 14px); z-index: 10;
         display: none;
         background: color-mix(in srgb, var(--bg1) 94%, transparent);
         border: 1px solid var(--line); border-radius: var(--r);
         padding: 6px 11px; color: var(--tx2); font-size: var(--fs-xs); }
#spin { flex: none; margin-left: auto; display: none; align-items: center;
        gap: 8px; color: var(--tx2); font-size: var(--fs-xs);
        white-space: nowrap;
        background: color-mix(in srgb, var(--bg1) 94%, transparent);
        border: 1px solid var(--line); border-radius: var(--r);
        padding: 6px 12px; }
#spin::before { content: ""; width: 12px; height: 12px; border-radius: 50%;
                border: 2px solid var(--tx3); border-top-color: var(--ice);
                animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
#stageErr { position: fixed; z-index: 13; top: 50%;
            left: calc(var(--stage-l) + (100vw - var(--stage-l) - var(--stage-r)) / 2);
            transform: translate(-50%, -50%); display: none;
            flex-direction: column; align-items: center; gap: 8px;
            width: min(420px, 90vw); padding: 16px 20px; text-align: center;
            background: var(--bg1); border: 1px solid var(--bad);
            border-radius: var(--r-lg); box-shadow: var(--shadow); }
#stageErr.on { display: flex; }
#stageErrD { color: var(--tx2); font-size: var(--fs-s); overflow-wrap: anywhere; }
#empty { position: fixed; inset: 0; z-index: 30; display: none;
         place-items: center; background: var(--bg0); text-align: center;
         color: var(--tx2); }
#empty .big { font-size: var(--fs-l); color: var(--tx1); }
#empty p + p { margin-top: 6px; }
#empty code { color: var(--tx1); background: var(--bg3); padding: 2px 8px;
              border-radius: 5px; }
#toasts { position: fixed; top: var(--toast-top, calc(var(--work-t) + 62px));   /* under the stage's top band (toolbar.js) */
          left: calc(var(--stage-l) + 16px); right: calc(var(--stage-r) + 16px);
          z-index: 40; display: flex;
          flex-direction: column; gap: 8px; align-items: center;
          pointer-events: none; }
.toast { background: var(--toast-bg); border: 1px solid var(--line);
         border-left: 3px solid var(--acc); color: var(--tx1);
         border-radius: var(--r); padding: 8px 15px; font-size: var(--fs-s);
         animation: tin .18s ease-out; max-width: min(100%, 560px);
         box-shadow: var(--shadow);
         pointer-events: none; }   /* words only: a click goes to what is under it (landing 12) */
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

#palette { position: fixed; inset: 0; z-index: 50; display: none;
           background: var(--backdrop); backdrop-filter: blur(2px); }
#palette.open { display: block; }
#palBox { width: min(520px, 90vw); margin: 12vh auto 0;
          background: var(--bg1); border: 1px solid var(--line2);
          border-radius: var(--r-lg); overflow: hidden;
          box-shadow: var(--shadow); }
#palIn { width: 100%; border: 0; border-bottom: 1px solid var(--line);
         border-radius: 0; padding: 13px 16px; font-size: var(--fs-l);
         background: var(--bg1); }
#palIn:focus-visible { outline-offset: -2px; }
#palList { max-height: 44vh; overflow-y: auto; padding: 6px; }
.palItem { display: flex; align-items: center; gap: 10px; width: 100%;
           padding: 8px 12px; border: 0; background: none;
           border-radius: var(--r); color: var(--tx1); text-align: left;
           font-size: var(--fs-s); }
.palItem .hint { margin-left: auto; color: var(--tx3);
                 font-size: var(--fs-xs); }
.palItem.hot, .palItem:hover { background: var(--bg3); }

#coach { position: fixed; z-index: 45; bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 16px);
         left: calc(var(--stage-l) + 18px); width: min(280px, calc(100vw - 32px));
         display: none;
         background: var(--bg2); border: 1px solid var(--line2);
         border-radius: var(--r-lg); padding: 13px 15px;
         box-shadow: var(--shadow); }
#coach.open { display: block; }
#coach p { color: var(--tx2); font-size: var(--fs-s); margin: 6px 0 10px; }
#coach .row2 { display: flex; align-items: center; gap: 8px; }
#coach .dots { color: var(--tx3); font-size: var(--fs-xs); }
#coach button { margin-left: auto; padding: 3px 12px;
                font-size: var(--fs-xs); }
/* G1: the tip stands at the stage's top corner beside the panel, never over the model */
@media (min-width: 601px) {
  #coach { left: auto; right: 16px; bottom: auto; top: calc(var(--work-t) + 12px); width: min(250px, 30vw); }
  body.docked #coach { right: calc(var(--dock-w) + 16px); }
}

/* =============================== v7 edit =================================
   Header: Edit · Download ▾ · Print ▾. Dock: Edit | Settings, where Edit is
   ONE box on top (matching sliders appear under it) then Sliders | AI. */
.mwrap { position: relative; display: inline-flex; flex: none; }
#download .car { width: 13px; height: 13px; margin-left: -2px; opacity: .7; }
.split #slice { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split .caretBtn { border-top-left-radius: 0; border-bottom-left-radius: 0;
                   border-left-color: color-mix(in srgb, var(--hi) 55%, transparent);
                   padding: 4px 6px; margin-left: -1px; display: inline-flex;
                   align-items: center; }
.caretBtn .ico { width: 14px; height: 14px; }
.menu { position: fixed; z-index: 45;
        min-width: 290px; max-width: min(340px, calc(100vw - 16px));
        display: flex; flex-direction: column; gap: 1px; padding: 6px;
        background: var(--bg1); border: 1px solid var(--line2);
        border-radius: var(--r-lg); box-shadow: var(--shadow); }
.menu[hidden] { display: none; }
.mi { display: flex; align-items: flex-start; gap: 10px; width: 100%;
      padding: 8px 10px; border: 0; border-radius: 8px; background: none;
      color: var(--tx1); text-align: left; text-decoration: none;
      font-size: var(--fs-s); }
.mi:hover:not(:disabled), .mi:focus-visible { background: var(--bg3); }
.mi:disabled { opacity: .45; }
.mi[hidden] { display: none; }
.mi > .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--tx2); }
.miT { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.miT b { color: var(--tx0); font-weight: 600; }
.miS { color: var(--tx3); font-size: var(--fs-xs); }
.mi kbd { margin-left: auto; align-self: center; padding: 0 6px; border-radius: 5px;
          border: 1px solid var(--line2); color: var(--tx3); font-size: var(--fs-2xs);
          font-family: inherit; }
.mi[role="menuitemradio"] { padding-left: 12px; }
.mi[aria-checked="true"] b::after { content: "  ✓"; color: var(--good); }
.mhead { padding: 6px 10px 3px; color: var(--tx3); font-size: var(--fs-2xs);
         text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.msep { height: 1px; margin: 5px 4px; background: var(--line); }

/* under the head: the way back to the sliders, then Undo / Redo */
#editHead { display: none; align-items: center; gap: 8px; padding: 6px 16px 2px;
            flex: none; }
.ehSp { flex: 1; }
#dockTabs .ehWhat { justify-content: center; }
#dock .seg.hLink, #dock .seg.backLink, #dock .seg.convLink {
  flex: none; gap: 5px; padding: 4px 8px; border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--hi-text); font-size: var(--fs-s); font-weight: 500; }
#dock .seg.hLink:hover, #dock .seg.backLink:hover, #dock .seg.convLink:hover {
  background: var(--bg3); color: var(--tx0); }
#dock .seg.active[aria-pressed="true"] { background: var(--bg3); color: var(--tx0); border-color: var(--line2); }
#dock .seg.backLink { padding-left: 4px; }
#seg_adjust[hidden] { display: none; }
#dock .seg.convLink { color: var(--tx2); }
body.drafting #seg_chat { display: none; }
#histN { color: var(--tx3); }
#dock[data-tab="adjust"] #editHead, #dock[data-tab="chat"] #editHead,
#dock[data-tab="history"] #editHead { display: flex; }
.ehWhat { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#editTitle { color: var(--tx0); font-size: var(--fs-m); white-space: nowrap;
             overflow: hidden; text-overflow: ellipsis; }
#editSub { color: var(--tx3); font-size: var(--fs-xs); }
#chatRevert, #editRedo { flex: none; padding: 3px 9px; font-size: var(--fs-xs); }
#chatRevert .ico, #editRedo .ico { width: 14px; height: 14px; }
/* a 300 px panel (901-1100 px): "Back to the sliders", Undo and Redo ran off its edge -
   the two keep their icons and their names (titles), the words go */
@media (min-width: 901px) and (max-width: 1100px) {
  #chatRevert .lbl, #editRedo .lbl { position: absolute; width: 1px; height: 1px;
                                     overflow: hidden; clip: rect(0 0 0 0); }
}

/* the ONE composer: top of Edit in a project, bottom in the draft phases */
/* the composer gives way before the page under it does: the Keep bar and
   the sliders stay reachable whatever the inspector or the matches hold */
#compose { display: none; flex-direction: column; flex: 0 1 auto; min-height: 0; }
#dock[data-tab="adjust"] #compose, #dock[data-tab="chat"] #compose,
#dock[data-tab="history"] #compose { display: flex; }
body.drafting #compose { order: 10; }
body:not(.drafting) #chatRow { border-top: 0; padding: 6px 16px 10px; flex-wrap: wrap; }
body:not(.drafting) #chatIn { flex: 1 1 100%; order: -1; }
body:not(.drafting) #chatSend { margin-left: auto; }
body:not(.drafting) #chatCtx { margin-top: 2px; }
#photoBtn { align-self: flex-end; padding: 6px 8px; }
#photoBtn .ico { width: 17px; height: 17px; }

/* live matches under the box */
#askHits { display: flex; flex-direction: column; gap: 6px; margin: 0 16px 10px;
           max-height: min(46vh, 420px); overflow-y: auto; flex: 0 1 auto; min-height: 0; }
#askHits[hidden], body.drafting #askHits { display: none; }
.hitHead { color: var(--tx3); font-size: var(--fs-xs); padding: 0 2px; }
.hitHead.busy { color: var(--tx2); font-style: italic; }
.hit { padding: 8px 10px 9px; border-radius: var(--r-lg); background: var(--bg2);
       border: 1px solid var(--line); }
.hitTop { display: flex; align-items: center; gap: 8px; }
.hitLbl { flex: 1; min-width: 0; padding: 0; border: 0; background: none;
          color: var(--tx1); font-weight: 600; font-size: var(--fs-s);
          text-align: left; }
.hitLbl:hover { color: var(--tx0); text-decoration: underline; }
.hitScope { flex: none; display: inline-flex; align-items: center; gap: 4px;
            padding: 1px 8px; border-radius: 999px; font-size: var(--fs-2xs);
            color: var(--tx2); border: 1px solid var(--line2); white-space: nowrap; }
.hitScope.set { color: var(--info-text); border-color: var(--info-line); }
.hitScope.locked { color: var(--hi-text); border-color: var(--hi-line); background: var(--hi-bg); }
.hitScope .ico { width: 12px; height: 12px; }
.hitCtl { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.hitCtl input[type=range] { flex: 1; width: auto; min-width: 0; height: 3px; }
.hitCtl input[type=number] { width: 74px; padding: 2px 7px; text-align: right; }
.hitCtl .kunit { width: auto; min-width: 22px; }
.hitMore { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hitWhy { flex: 1 1 100%; color: var(--tx3); font-size: var(--fs-xs); }
.hitSet { margin-top: 6px; padding: 2px 10px; font-size: var(--fs-xs); }
.hitMore .hitSet { margin-top: 0; }
.hitAI { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px;
         border-radius: var(--r-lg); background: none; text-align: left;
         border: 1px dashed var(--line2); color: var(--tx1); }
.hitAI.lead { border-style: solid; border-color: var(--acc); background: var(--acc-bg); }
.hitAI > .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--acc); }
.hitFind { align-self: flex-start; padding: 0 2px; border: 0; background: none;
           color: var(--tx3); font-size: var(--fs-xs); text-decoration: underline; }
.hitFind:hover { color: var(--tx1); }

/* the inspector (v9 Stage 2): the picked surface and only its sliders */
#inspect { display: flex; flex-direction: column; gap: 6px; margin: 0 16px 10px;
           padding: 9px 11px 10px; border-radius: var(--r-lg);
           border: 1px solid var(--hi-line); background: var(--bg1);
           max-height: min(34vh, 300px); overflow-y: auto; flex: 0 1 auto; min-height: 64px; }
#inspect[hidden], body.drafting #inspect { display: none; }
#inspect .inHead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
#inspect .inName { color: var(--hi-text-hi); font-size: var(--fs-m); }
#inspect .inWhat { color: var(--tx2); font-size: var(--fs-xs); }
#inspect .inFacts { color: var(--tx1); font-size: var(--fs-xs); }
#inspect .inInfo { color: var(--tx2); font-size: var(--fs-xs); }
#inspect .inKnobs { display: flex; flex-direction: column; gap: 6px; }
#inspect .inActs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
#inspect .inAsk { padding: 4px 10px; font-size: var(--fs-xs); }

/* v9 1B: the project's history */
#histBar { padding: 6px 16px 0; flex: none; }
#histNamed[aria-pressed="true"] { color: var(--tx0); font-weight: 600; text-decoration: underline; }
.htitle.named { font-weight: 600; color: var(--tx0); }
.hname { flex: none; padding: 2px 10px; font-size: var(--fs-xs); }
.hrow { flex-wrap: wrap; row-gap: 4px; }
.hrow .htitle { flex: 1 1 8em; }
.hrow .hold { white-space: nowrap; }
#histList { list-style: none; margin: 0; padding: 4px 16px 16px; overflow-y: auto; flex: 1; }
.hrow { display: flex; align-items: center; gap: 10px; padding: 8px 0;
        border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.hwhen { flex: none; width: 52px; color: var(--tx3); font-size: var(--fs-xs);
         font-variant-numeric: tabular-nums; }
.htitle { flex: 1; min-width: 0; color: var(--tx1); overflow: hidden;
          text-overflow: ellipsis; white-space: nowrap; }
.hrow.now .htitle { color: var(--tx0); font-weight: 600; }
.hnow { flex: none; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-2xs);
        background: var(--good-bg); color: var(--good); }
.hrest { flex: none; padding: 2px 10px; font-size: var(--fs-xs); }
.hempty { color: var(--tx3); font-size: var(--fs-s); padding: 12px 0; }
body.drafting #editHead { display: none !important; }
.seg { flex: 1; display: inline-flex; align-items: center; justify-content: center;
       gap: 5px; padding: 5px 6px; background: none; color: var(--tx2);
       border: 1px solid var(--line); font-size: var(--fs-s); white-space: nowrap; }
.seg:hover { color: var(--tx1); }
.seg.active { background: var(--bg3); color: var(--tx0); border-color: var(--line2); }
.seg .ico { width: 15px; height: 15px; }
#segN { color: var(--tx3); }

/* the sliders view explains itself when there's nothing to slide */
.panelNote { margin: 4px 0 12px; padding: 10px 12px; border-radius: var(--r);
             background: var(--bg2); border: 1px solid var(--line);
             color: var(--tx2); font-size: var(--fs-s); line-height: 1.5; }
.panelNote[hidden] { display: none; }
#panel.noKnobs #knobs, #panel.noKnobs #selRow, #panel.noKnobs #tfNote,
#panel.noKnobs #pFoot { display: none !important; }
@keyframes kflash { from { background: var(--hi-bg); } to { background: transparent; } }
.krow.flash { animation: kflash 1.4s ease-out; }
/* a set-wide row's reach + the pending bar */
.kscope { display: inline-flex; align-items: center; gap: 5px; margin: 6px 0 0 24px;
          color: var(--tx3); font-size: var(--fs-xs); cursor: pointer; }
.kscope input { margin: 0; }
.kscope.locked { cursor: default; color: var(--hi-sub); }
.kscope .ico { width: 12px; height: 12px; }
.krow.unlinked { border-color: var(--warn-line); }
.krow.unlinked .kscope { color: var(--warn-text); }
#pendBar { margin-bottom: 10px; padding: 10px 12px; border-radius: var(--r-lg);
           background: var(--acc-bg); border: 1px solid var(--acc); }
#pendBar[hidden] { display: none; }
#pendTitle { color: var(--tx0); font-size: var(--fs-s); }
#pendList { margin: 6px 0 10px; padding-left: 18px; color: var(--tx1);
            font-size: var(--fs-xs); line-height: 1.6; }
#pendList b { font-weight: 600; }
.pendScope { color: var(--tx1); font-weight: 400; }
#pendNote { margin: -4px 0 10px; color: var(--warn-text); font-size: var(--fs-xs); line-height: 1.45; }
/* a pending change that makes the piece need supports (2026-10-27) */
#pendSup { margin: -4px 0 10px; color: var(--warn-text); font-size: var(--fs-xs); line-height: 1.45; }
#pendSup[hidden] { display: none; }
#pendSup .supMark { color: var(--warn); font-weight: 700; }
#pendSupH { color: var(--warn-text); }
#pendNote[hidden] { display: none; }
#pendBar .actions { display: flex; gap: 8px; }
#pendBar .actions button { flex: 1; }
/* Keep takes the room Discard does not need: "Keep · rebuild 3 designs" wrapped
   in a 1024 px dock (one line, an ellipsis and its title past that) */
#keepBtn { flex: 1 1 auto !important; min-width: 0; white-space: nowrap;
           overflow: hidden; text-overflow: ellipsis; }
#discardBtn, #keepCancel { flex: 0 0 auto !important; }
#autoRow #renderBtn { margin-left: auto; padding: 2px 10px; font-size: var(--fs-xs); }
#autoRow #renderBtn[hidden] { display: none; }
#saveAs { display: block; margin-top: 8px; color: var(--tx3); font-size: var(--fs-xs); }
#saveAs[hidden] { display: none; }
.pinLbl { display: inline-flex; align-items: center; gap: 4px; color: var(--tx3);
          font-size: var(--fs-xs); }
.pinLbl .ico { width: 13px; height: 13px; }

/* ============================ responsive ================================= */
/* <=1100: narrower dock; the header compacts so it fits beside the dock */
@media (max-width: 1100px) {
  :root { --dock-w: 300px; }
  .railTitle { max-width: 22vw; }
  #top { gap: 8px; }
  #actions { gap: 5px; flex-shrink: 1; min-width: 0; overflow-x: auto;
             scrollbar-width: none; }
  #actions button { padding: 4px 8px; flex: none; }
  #pose { flex-shrink: 1; min-width: 0; max-width: 150px; overflow: hidden;
          text-overflow: ellipsis; }
  #rstatT { position: absolute; width: 1px; height: 1px; overflow: hidden;
            clip: rect(0 0 0 0); white-space: nowrap; }
  body.docked #download .lbl, body.docked #editBtn .lbl {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); }
  body.docked #pose { max-width: 104px; }
  body.docked #crumbWrap { min-width: 96px; }
}
/* <=900: sidebar becomes an off-canvas drawer; the dock overlays full width */
@media (max-width: 900px) {
  /* the whole width beside the rail (under it, the rail took its clicks - landing 12) */
  #dock { width: calc(100% - var(--rail-w)); border-left: 0; }
  body.docked { --stage-r: 0px; }
  body.docked #top { right: 0; }
  #download .lbl { position: absolute; width: 1px; height: 1px;
                   overflow: hidden; clip: rect(0 0 0 0); }
  #homeIn { padding: 36px 20px 32px; }
  /* Scope: the conversation takes the width; the brief opens as a sheet
     from the rail chip, and its next step stays pinned underneath */
  body.phase-scope #dock { left: calc(var(--rail-w) + 8px); right: 8px; width: auto;
    top: calc(var(--top-h) + 8px); bottom: 104px; }
  body.phase-scope:not(.briefPop) #briefPanel { top: auto; bottom: 8px; left: calc(var(--rail-w) + 8px);
    right: 8px; width: auto; height: 88px; }
  body.phase-scope:not(.briefPop) .bpScroll { display: none; }
  body.phase-scope:not(.briefPop) #briefCTA { flex-direction: row; flex-wrap: wrap;
    align-items: center; align-content: center; gap: 6px 14px; height: 100%;
    padding: 8px 14px; border-top: 0; }
  body.phase-scope:not(.briefPop) #briefCTA .ctaTxt { flex: 1 1 100%; }
  body.phase-scope.briefPop #briefPanel { left: calc(var(--rail-w) + 8px); right: 8px;
    width: auto; top: calc(var(--top-h) + 8px); bottom: 8px; max-height: none; }
  /* the sheet takes the whole screen: the composer under it is not left
     there to be half-reached (its references made the sheet long) */
  body.phase-scope.briefPop #dock { visibility: hidden; }
  body.phase-scope #briefChip { display: inline-block; }
  /* written: the brief takes the screen above, its button at its foot; the
     conversation shrinks to the strip below, still there for changes (J3) */
  body.phase-scope.briefReady #briefChip { display: none; }
  body.phase-scope.briefReady:not(.briefPop) #briefPanel { top: calc(var(--top-h) + 8px);
    bottom: 232px; left: calc(var(--rail-w) + 8px); right: 8px; width: auto; height: auto; }
  body.phase-scope.briefReady:not(.briefPop) .bpScroll { display: block; flex: 1 1 auto;
    padding: 16px 16px 12px; }
  body.phase-scope.briefReady:not(.briefPop) #briefCTA { height: auto; flex-direction: column;
    align-items: stretch; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
  body.phase-scope.briefReady:not(.briefPop) #briefCTA .ctaTxt { flex: none; }
  body.phase-scope.briefReady:not(.briefPop) #briefCTA button.primary { order: 0; }
  body.phase-scope.briefReady:not(.briefPop) #briefCTA .ctaSkip { align-self: flex-start; order: 1; }
  body.phase-scope.briefReady #dock { top: auto; bottom: 8px; height: 216px; }
  body.phase-scope #chatLog { padding: 16px 18px 10px; }
  body.phase-scope #chatRow { padding: 10px 12px 14px; }
  .bdHead { padding: 14px 16px 8px; }
  .bdScroll { padding: 4px 16px calc(var(--steer-h, 200px) + 24px); }
  body.boardFocus .bdScroll { padding: 2px 16px 10px; }
  body.phase-concepts #dock, body.phase-concepts.threadOpen #dock {
    width: auto; left: calc(var(--rail-w) + 8px); right: 8px; bottom: 8px; }
  body.phase-concepts.threadOpen #dock { height: 70vh; }
  /* beside the rail the header is 76 px narrower: the steps' joins give the name the room
     (768 px: "Desk cable tray" was cut to a few letters - landing 12) */
  #phaseRail { gap: 8px; }
  .ph + .ph::before { width: 12px; margin: 0 6px; }
}
/* <=600: header wraps to two rows, toolbar wraps, home tightens */
@media (max-width: 600px) {
  /* a phone: one card a row whatever the size, so no size control; the
     bar's Conversation button keeps its icon and count, the word hides
     (v6.3: a tight space hides the word, not the meaning) */
  .bdSize { display: none; }
  .bdGrid { grid-template-columns: minmax(0, 1fr); }
  body.phase-concepts:not(.threadOpen) #threadTgl .tgWord {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.phase-concepts:not(.threadOpen) #threadTgl { padding: 7px 9px; }
  :root { --top-h: 84px; }   /* two rows: the name, then the status and the buttons (44 px) */
  #top { flex-wrap: wrap; align-content: center; row-gap: 4px;
         padding: 4px 10px; }
  #crumbWrap { flex: 1 1 calc(100% - 50px); }
  #actions { margin-left: auto; flex: 1 1 0; justify-content: flex-end; }
  #actions button { padding: 4px 7px; }
  #pose { max-width: 110px; }
  /* Home hides project chrome: collapse it so the bar is one row */
  body.homed { --top-h: 54px; }
  body.homed #crumbWrap { flex: 1 1 0; }
  body.homed #pose, body.homed #rstat,
  body.homed #actions > * { display: none; }
  #dockTabs { height: 54px; }
  /* draft phases: the rail is the whole header - one row */
  body.drafting { --top-h: 54px; }
  body.drafting #top { flex-wrap: nowrap; }
  #phaseRail { gap: 8px; }
  .railTitle { max-width: 30vw; font-size: var(--fs-m); }
  .ph:not(.on) .phName, .phSub { display: none; }
  .ph + .ph::before { width: 10px; margin: 0 5px; }
  #briefChip .bcLbl { display: none; }
  body.phase-scope:not(.briefPop) #briefCTA .ctaTxt { display: none; }
  /* focus mode on a phone: a slim filmstrip, the canvas, the steer bar */
  body.phase-concepts { --board-strip: 132px; }
  body.boardFocus .bdCta, body.boardFocus #toolbar { display: none; }
  /* one card, no strip: its next step cannot hide in a strip it does not have (J3) */
  body.boardFocus.strip-none .bdCta { display: flex; }
  body.boardFocus.strip-none { --board-strip: 136px; }
  body.boardFocus .bdHead { padding: 8px 12px 4px; }
  body.boardFocus .bcard { width: 200px; }
  body.boardFocus #stage { bottom: calc(var(--steer-h, 160px) + 12px); }
  .bdCta { margin-left: 0; justify-content: flex-start; }
  body { --tb-bottom: calc(var(--tab-h) + 8px); }
  #toolbar button { padding: 4px 7px; }
  #legend { left: 8px; right: 8px; }
  #mHint { left: 8px; right: 8px;
           bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 52px); }
  #askBar { bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 98px); }
  #stageTop { left: 8px; right: 8px; top: calc(var(--work-t) + 8px); }
  /* the pose chip and the caption share one row: the model keeps its room (L1 step 8) */
  #stageCap { flex: 1 1 0; min-width: 170px; }
  #stageCap { padding: 6px 8px 6px 10px; gap: 8px; }
  #capText { font-size: var(--fs-xs); }
  #homeIn { padding: 24px 16px 28px; }
  #homeIn h1 { font-size: var(--fs-xl); }
  #heroRow { flex-wrap: wrap; }
  #heroIn { flex: 1 1 100%; }
  #heroGo { padding: 10px 22px; flex: 1; }
  .ggrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .gcard { padding: 10px; }
  #askBar { width: auto; }
  #coach { left: 16px; }
  .msg { max-width: 100%; }
}

/* ---- this copy (friends spec): the AI not installed here, a pulled update
   under the person's own values, a history row from before an update, the
   printer's bed ---- */
.aiOff { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--r);
         background: var(--warn-bg); border: 1px solid var(--warn-line);
         color: var(--tx2); font-size: var(--fs-xs); line-height: 1.5;
         overflow-wrap: anywhere; }
.aiOff a { color: var(--info-text); }
#compose .aiOff { margin: 6px 0 0; }
#homeUpdates { margin: 18px 0 0; padding: 10px 14px; border-radius: var(--r);
               background: var(--warn-bg); border: 1px solid var(--warn-line);
               display: flex; flex-direction: column; gap: 8px; }
#homeUpdates[hidden] { display: none; }
.upHead { color: var(--tx1); font-size: var(--fs-s); }
.upRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
         color: var(--tx2); font-size: var(--fs-s); }
.upWhat { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.upActs { display: flex; gap: 8px; flex-wrap: wrap; }
.upActs button { white-space: nowrap; font-size: var(--fs-xs); padding: 3px 10px; }
.hrow .hold { flex: none; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-2xs);
              background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
#setBedRow { flex-wrap: wrap; }
#setBedRow[hidden] { display: none; }
#setBedRow input { background: var(--bg2); color: var(--tx1); border: 1px solid var(--line2);
                   border-radius: var(--r); padding: 3px 6px; min-width: 0; }
#setPrinterName { flex: 1 1 120px; }
.bedIn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.bedIn input { width: 4.2em; }
#setBedSave { white-space: nowrap; }

/* J1: a change waiting on a card, a card the AI revised, the one-tap picture job */
.bcChange { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.bcChange .bcChangeWord { flex: 1 1 100%; color: var(--ink2, inherit); }
.bcChange button { padding: 3px 10px; }
.refOneTap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.refOneTap .refOneQ { flex: 1 1 100%; font-size: 12px; }
.refOneTap .refOne { padding: 3px 10px; }
.bpJob .bpJobNote { display: block; font-size: 12px; opacity: .8; }

/* ---- Build this: the steps panel and its folded line (buildsteps.js, J2) ---- */
#buildSteps { margin: 0 0 10px; padding: 12px; border: 1px solid var(--line2);
  border-radius: var(--r-lg); background: var(--bg2); font-size: var(--fs-m); color: var(--tx1); }
#buildSteps[hidden] { display: none; }
#buildSteps .bsHead { margin: 0 0 8px; font-weight: 600; color: var(--tx0); }
#buildSteps .bsHead.bad { color: var(--bad-text); }
#buildSteps .bsList { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#buildSteps .bsRow { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; }
#buildSteps .bsMark { display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; border: 1px solid var(--line2); color: var(--tx2); font-size: var(--fs-xs); }
#buildSteps .bsMark.run { border-color: var(--ice); color: var(--tx0); background: var(--acc-bg); }
#buildSteps .bsMark.ok { border-color: var(--good-line-hi); color: var(--good-text); background: var(--good-bg); }
#buildSteps .bsMark.fail { border-color: var(--bad); color: var(--bad-text-hi); background: var(--bad-bg); }
#buildSteps .bsBody { min-width: 0; overflow-wrap: anywhere; }
#buildSteps .bsName { color: var(--tx0); }
#buildSteps .bsState { color: var(--tx2); font-size: var(--fs-xs); }
#buildSteps .bsText { display: block; color: var(--tx2); font-size: var(--fs-s); }
#buildSteps .bsRow[data-state="fail"] .bsText { color: var(--bad-text); }
#buildSteps .bsSecs { color: var(--tx2); font-size: var(--fs-xs); white-space: nowrap; }
/* G1: the checks inside the check row (the one list; there is no second card) */
#buildSteps .bsSubs { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; gap: 4px; }
#buildSteps .bsSub { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
#buildSteps .bsSubBody { min-width: 0; overflow-wrap: anywhere; }
#buildSteps .bsBtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#buildSteps .bsFold { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#buildSteps .bsFold .bsWords { flex: 1 1 160px; min-width: 0; }
#buildSteps .bsFindings { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }

/* the app's own dialog (dialog.js, v10 R6): what confirm() and alert() were */
dialog.appDlg { max-width: min(460px, calc(100vw - 32px)); padding: 20px 22px 16px;
                background: var(--bg1); color: var(--tx1); border: 1px solid var(--line2);
                border-radius: var(--r-lg); box-shadow: var(--shadow); }
dialog.appDlg::backdrop { background: var(--backdrop); }
dialog.appDlg h2 { margin: 0 0 10px; font-size: var(--fs-l); color: var(--tx0); }
.appDlgBody p { margin: 0 0 8px; font-size: var(--fs-m); line-height: 1.45; color: var(--tx1);
                overflow-wrap: anywhere; }
.appDlgField { width: 100%; box-sizing: border-box; margin-top: 4px; padding: 6px 8px; font-size: var(--fs-m); }
.appDlgBtns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.appDlgBtns button { padding: 6px 14px; font-size: var(--fs-m); }
.appDlgBtns button.danger { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-text-hi); }

/* the design picker in the Edit head was for a phone, where the sidebar was a
   hidden drawer; the pieces strip (L1) stays on screen above the sheet, so it
   is not shown anywhere now */
.ehDesign { display: none; }
@media (max-width: 600px) {
  /* "Conversation": the word goes on a phone, its icon and count stay */
  body.docked:not(.drafting) #seg_chat .convWord { position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* a thumb, not a mouse: 44 px to hit (R7) */
  #dock .seg, #dockTabs button, #pFoot button, #editHead button, body:not(.drafting) #chatRow button,
  #knobs .moreBtn, #psRows .stepGo, #pieces .pt, #pieces .delX, #psRows .psChk { min-height: 44px; min-width: 44px; }
  /* the print record's box and the controls of the first minute (v10 R8) */
  #psRows .step .pdMark { width: 44px; height: 44px; border-radius: 8px; }
  #psRows .step .pdMark:focus-visible { outline: 2px solid var(--acc); outline-offset: -4px; }
  .recForm button, #askBar button, .useCard button, .exCard .exBtns button, dialog.copyDlg button,
  #briefDefaults { min-height: 44px; min-width: 44px; }
  #psRows .step { min-height: 44px; }
}

/* Settings: the readiness checks and tool paths sit in a closed box at the foot */
#setTech > summary { cursor: pointer; list-style: revert; padding: 12px 0 6px; }
#setTech[open] > summary { color: var(--tx1); }

/* R4: What you told us (brief.js) */
.bpSaidBox { margin: 8px 0; }
.bpSaidBox > b { display: block; font-size: var(--fs-s); margin-bottom: 4px; }
.bpSaid { flex-wrap: wrap; align-items: center; gap: 6px; }
.bpSaidSrc { color: var(--tx2); font-size: var(--fs-xs); }
.bpSaidGo { padding: 2px 8px; font-size: var(--fs-xs); }
.bpSaid input { width: 7em; }

/* Scope's "Use defaults" (brief.js): the button and its one line, side by side */
.ctaDef { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ctaNote { color: var(--tx3); font-size: var(--fs-xs); }
.bpDefaults li { margin: 4px 0; }

/* the examples on a phone: one to a row, the picture no taller than a screen's third */
@media (max-width: 600px) {
  #exGrid { grid-template-columns: 1fr; }
  .exCard img { aspect-ratio: 16 / 9; max-height: 200px; }
  .exCard .exBtns button { flex: 1 1 100%; }
}

/* A6 S7: the measurements, listed under the stage line */
#measureList { position: fixed; z-index: 12; top: calc(var(--work-t) + 58px);
               left: calc(var(--stage-l) + 16px); max-width: min(560px, calc(100vw - var(--stage-l) - var(--stage-r) - 32px));
               padding: 6px 10px; border-radius: var(--r-lg); font-size: var(--fs-xs); color: var(--tx1);
               background: color-mix(in srgb, var(--bg1) 90%, transparent);
               border: 1px solid var(--line); backdrop-filter: blur(8px); }
#measureList[hidden], body.homed #measureList, body.drafting #measureList { display: none; }
#measureList .msNone { margin: 0 0 4px; color: var(--warn-text); }
#measureList .msRows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#measureList .msRow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
#measureList .msVal { color: var(--bad-text-hi); font-family: var(--mono); }
#measureList .msWas { color: var(--tx2); font-family: var(--mono); }
#measureList .msWhat { color: var(--tx1); min-width: 0; overflow-wrap: anywhere; }
#measureList .msNote { color: var(--tx3); font-size: var(--fs-2xs); }
#measureList .msRow[data-state="gone"] .msVal, #measureList .msRow[data-state="gone"] .msNote { color: var(--warn-text); }
#measureList button { padding: 2px 8px; font-size: var(--fs-2xs); white-space: nowrap; }

/* A6 S8: the right-click menu on the stage, and the move-around hint */
#ctxMenu { position: fixed; z-index: 40; min-width: 180px; padding: 4px; display: flex;
           flex-direction: column; border-radius: var(--r); border: 1px solid var(--line2);
           background: var(--bg1); box-shadow: var(--shadow); }
#ctxMenu[hidden] { display: none; }
.ctxItem { text-align: left; padding: 7px 10px; border: 0; border-radius: var(--r);
           background: none; color: var(--tx1); font-size: var(--fs-s); cursor: pointer; }
.ctxItem:hover, .ctxItem:focus-visible { background: var(--acc-bg); color: var(--tx0); }
#stageHint { position: fixed; z-index: 12; pointer-events: none; text-align: center;
             left: calc(var(--stage-l) + 16px); right: calc(var(--stage-r) + 90px);
             bottom: calc(var(--tb-bottom) + var(--toolbar-h) + 14px);
             color: var(--tx3); font-size: var(--fs-xs); }
#stageHint[hidden], body.homed #stageHint, body.drafting #stageHint, body.phase-scope #stageHint,
body.phase-concepts #stageHint { display: none; }

/* the checks are still running: sliders and Keep wait (the buttons say so) */
body.checking #knobs { opacity: .45; pointer-events: none; }
body.checking #download .lbl, body.checking #slice .lbl { white-space: nowrap; }

/* G3 row 16: a thumbnail's box says "loading" quietly until its picture lands */
img.thumbWait { background: linear-gradient(90deg, var(--bg2), var(--bg3), var(--bg2));
                background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
img.thumbWait, img.thumbWait.thumb { color: transparent; }
@media (prefers-reduced-motion: reduce) { img.thumbWait { animation: none; } }

/* ===== G3: phone and touch (gaps rows 4, 5, 15) ============================
   On a phone the Edit panel is a bottom sheet: the model stays in view in the
   top ~45% of the screen while a slider moves, the stage and its toolbar
   shrink to fit above the sheet. Every control is at least 40 px. */
@media (max-width: 600px) {
  body { --tb-row: 40px; --touch: 40px; }
  body.docked:not(.drafting) { --sheet-top: 45vh; --sheet-bot: 55vh; --tb-bottom: calc(55vh + 8px);
                               --toolbar-h: calc(var(--tb-row) + 14px); }
  @supports (height: 1dvh) {
    body.docked:not(.drafting) { --sheet-top: 45dvh; --sheet-bot: 55dvh; --tb-bottom: calc(55dvh + 8px); }
  }
  body.docked:not(.drafting) #dock { top: var(--sheet-top); width: 100%; border-left: 0;
    border-top: 1px solid var(--line2); border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px color-mix(in srgb, #000 35%, transparent); }
  body.docked:not(.drafting) #stage { bottom: var(--sheet-bot); }
  body.docked:not(.drafting) #dockTabs { height: 52px; }
  /* one row above the sheet: the views, then the inspection tools (section, overhang...)
     one swipe along - two rows would eat the model's room */
  /* Home or Settings fills a phone: the stage's tools never peek out over them */
  body.homed #toolbar, body.settingsOn #toolbar { display: none; }
  body.docked:not(.drafting) #toolbar { display: flex; flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; }
  body.docked:not(.drafting) #toolbar::-webkit-scrollbar { display: none; }
  body.docked:not(.drafting) #toolbar .tbRow { flex: none; overflow: visible; }
  body.docked:not(.drafting) #tools { order: 1; border-bottom: 0; padding-bottom: 0; margin-left: 6px;
    padding-left: 6px; border-left: 1px solid var(--line); }
  body.docked:not(.drafting) #stageTop { top: calc(var(--work-t) + 6px); }

  /* inside the sheet: one line each for the head, the box and its buttons, so the
     sliders keep room; what does not fit scrolls the sheet, never overlaps */
  body.docked:not(.drafting) #dock { overflow-y: auto; overscroll-behavior: contain; }
  body.docked:not(.drafting) #dock > * { flex-shrink: 0; }
  body.docked:not(.drafting) #dock > .dockPage.active { flex: 1 0 260px; }
  body.docked:not(.drafting) #panel.dockPage.active { min-height: 260px; }
  body.docked:not(.drafting) #editHead { padding: 8px 16px 2px; }
  body.docked:not(.drafting) #editSub { display: none; }
  body.docked:not(.drafting) #chatRow { flex-wrap: nowrap; align-items: center; padding: 4px 16px 6px; }
  body.docked:not(.drafting) #chatIn { flex: 1 1 0; min-width: 0; order: 0; }
  body.docked:not(.drafting) #chatSend { margin-left: 0; }

  /* a thumb, not a mouse: 40 px to hit, in the header, the toolbar, the stage chips */
  button, select, summary,
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=file]) {
    min-height: var(--touch); }
  button { min-width: var(--touch); }
  input[type=range], .krow input[type=range], .hitCtl input[type=range], #inspect input[type=range] {
    height: var(--touch); margin-top: 0; }
  #onlyLbl { display: inline-flex; align-items: center; min-height: var(--touch); }
  /* a text link inside a sentence stays a link (WCAG 2.5.8 inline exception);
     a row of controls (the test-plate line) does not */
  .linkBtn { min-height: 0; min-width: 0; }
  #tfNote .linkBtn { min-height: var(--touch); padding: 0 6px; }
  /* the eye (show this knob's dimension) keeps its 16 px footprint in the row,
     its touch box reaches past it */
  .eye { min-width: var(--touch); min-height: var(--touch); margin: -12px; }
  body.docked:not(.drafting) #pBody { min-height: 190px; }
  #stageCap #capText { padding-block: 12px; }
  #measureList { top: calc(var(--work-t) + 72px); }
  .ksw { min-height: var(--touch); }
  #autoRow label { display: inline-flex; align-items: center; min-height: var(--touch); }
  #toolbar .tbRow { height: var(--tb-row); }
  #toolbar button { padding: 4px 10px; }
  #toolbar #clipAxis { padding: 2px 6px; }
}

/* ============ the rail (v10 L1, docs/v10/ux-layout.html layout A) ============
   One map on every screen and phase: New (cobalt), Home, Projects, Library,
   Settings at the foot, the Toolpath mark on top. On a phone it is the
   bottom tab bar, New in the middle. */
#rail { position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail-w); z-index: 37;
        background: var(--bg1); border-right: 1px solid var(--line);
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        padding: 12px 0; }
#rail .rMark { display: flex; align-items: center; justify-content: center;
               width: 52px; height: 44px; margin-bottom: 8px; padding: 0; border: 0;
               border-radius: 10px; background: none; }
#rail .rMark:hover { background: var(--bg2); }
#rail .ri { display: flex; flex-direction: column; align-items: center; gap: 4px;
            width: 64px; padding: 8px 0; border: 0; border-radius: 10px; background: none;
            color: var(--tx2); font-size: var(--fs-xs); font-weight: 500; line-height: 1.2;
            text-decoration: none; }
#rail .ri:hover { background: var(--bg2); color: var(--tx1); }
#rail .ri.on { background: var(--bg2); color: var(--tx1); box-shadow: inset 3px 0 0 var(--periwinkle); }
#rail .ri:disabled { opacity: .55; }
#rail .rNew { color: var(--tx1); margin-bottom: 8px; }
#rail .rNew svg { width: 40px; height: 40px; padding: 9px; border-radius: 12px;
                  background: var(--cobalt); box-shadow: 0 8px 20px -10px var(--cobalt); }
#rail .rSp { flex: 1; }
/* Settings: a place of its own, over whatever was open */
#settingsView { position: fixed; z-index: 34; inset: 0 0 0 var(--rail-w); overflow-y: auto;
                background: var(--bg0); }
#settingsView[hidden] { display: none; }
#setHead, #settingsView #settings { max-width: 760px; margin: 0 auto; }
#setHead { display: flex; align-items: center; gap: 12px; padding: 28px 16px 4px; }
#setHead h1 { flex: 1; margin: 0; font-size: var(--fs-2xl); }
#settingsView #setBody { overflow: visible; padding: 4px 16px 40px; font-size: var(--fs-m); }
@media (max-width: 600px) {
  :root { --rail-w: 0px; --tab-h: 62px; }
  #rail { top: auto; right: 0; width: auto; height: var(--tab-h); flex-direction: row;
          justify-content: space-around; align-items: center; gap: 0; padding: 4px 4px 6px;
          border-right: 0; border-top: 1px solid var(--line); }
  #rail .rMark, #rail .rSp { display: none; }
  #rail .ri { width: auto; min-width: 56px; padding: 4px 6px; gap: 3px; margin: 0; }
  #rail .ri.on { box-shadow: inset 0 2px 0 var(--periwinkle); }
  #rail [data-rail=home] { order: 1; } #rail [data-rail=projects] { order: 2; }
  #rail [data-rail=new] { order: 3; } #rail [data-rail=library] { order: 4; }
  #rail [data-rail=settings] { order: 5; }
  #rail .rNew svg { width: 34px; height: 34px; padding: 7px; }
  /* every place stops above the tab bar */
  #stage, #home, #projectsView, #board, #dock, #briefPanel, #settingsView { margin-bottom: var(--tab-h); }
  #setHead { padding: 18px 16px 4px; }
  /* the tab bar's Projects is the way back: the name gets the header's width */
  .crumbUp { display: none; }
}
/* the library pages the app serves carry the rail too (links.js pageRail) */
body.railed { padding-left: var(--rail-w); padding-bottom: var(--tab-h); }
body.railed #rail { position: fixed; }
/* the server's state lives in Settings' technical box; a banner says it only when it is down */
#setTech #navFoot { border-top: 0; padding: 4px 0 8px; font-size: var(--fs-s); }
#srvBanner { position: fixed; z-index: 45; top: 8px; left: calc(var(--rail-w) + 8px); right: 8px;
             max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
             padding: 10px 14px; border-radius: var(--r-lg); background: var(--bad-bg);
             border: 1px solid var(--bad); color: var(--bad-text-hi); font-size: var(--fs-m);
             box-shadow: var(--shadow); }
#srvBanner[hidden] { display: none; }
#srvBannerT { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#srvBannerGo { flex: none; }

/* ---- v10 L1: the pieces strip (docs/v10/ux-layout.html A) ---- */
body.stripOn { --strip-h: 50px; }
#pieces { position: fixed; z-index: 15; top: var(--top-h); left: var(--stage-l); right: var(--stage-r);
          height: var(--strip-h); display: none; align-items: center; gap: 6px; padding: 0 14px;
          border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg1) 90%, transparent);
          overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
body.stripOn #pieces { display: flex; }
body.boardFocus #pieces, body.drafting #pieces { display: none; }
#pieces .pt { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
              border-radius: 999px; border: 1px solid var(--line); background: none;
              color: var(--tx2); font-size: var(--fs-s); white-space: nowrap; text-decoration: none;
              max-width: 260px; }
#pieces .pt .ptN { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#pieces .pt:hover { color: var(--tx1); border-color: var(--line2); }
#pieces .pt.active { background: var(--bg3); color: var(--tx0); border-color: var(--line2);
                     box-shadow: inset 0 -2px 0 var(--hi); }
#pieces .pt .vdot { margin: 0; }
#pieces .ptLink { border: 0; color: var(--hi-text); }
#pieces .ptLink svg { width: 16px; height: 16px; }
#pieces .ptSp { flex: 1 0 8px; }
#pieces .ptRow { flex: none; display: inline-flex; align-items: center; gap: 2px; }
#pieces .delX { padding: 2px 7px; border: 0; background: none; color: var(--tx3); }
#pieces .delX:hover { color: var(--bad); }
.ptTest { font-size: var(--fs-2xs); text-transform: lowercase; padding: 1px 7px; border-radius: 999px;
          border: 1px solid var(--warn-line); color: var(--warn-text); }
/* the project's ONE status, in words, beside its name */
#projStatus { flex: none; margin: 0; padding: 4px 10px; border-radius: 999px; font-size: var(--fs-s);
              font-weight: 600; white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis;
              background: color-mix(in srgb, currentColor 10%, transparent); }
#projStatus[hidden], body.homed #projStatus, body.projectsOn #projStatus { display: none; }
#projStatus.hasHeld { color: var(--warn); }

/* ---- the Projects view: your work first, then the library ---- */
#pjIn { max-width: 1180px; margin: 0 auto; padding: 36px 32px 48px; }
#pjIn h1 { margin: 0 0 14px; font-size: var(--fs-2xl); letter-spacing: var(--head-ls); }
#pjFind { display: flex; align-items: center; gap: 12px; }
#pjSearch { flex: 1; min-width: 0; max-width: 560px; padding: 11px 14px; font-size: var(--fs-m); }
#pjCount { color: var(--tx3); font-size: var(--fs-s); white-space: nowrap; }
#catChips .catChip[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: #fff; }
#gallery .pjLib { margin: 34px 0 0; color: var(--tx1); font-size: var(--fs-l); font-weight: 600; }
#gallery .gcat.mine h2 { color: var(--tx1); }
#gallery [hidden], #homeMine[hidden] { display: none !important; }
#homeMine h2 { display: flex; align-items: baseline; gap: 14px; }
.linkBtn { border: 0; background: none; padding: 0; color: var(--hi-text); font-size: var(--fs-s); }
.linkBtn:hover { text-decoration: underline; }
#homeMine .ggrid { margin-top: 12px; }

/* ---- the Print sheet: one Print, one place ---- */
#printSheet { position: fixed; z-index: 38; top: 0; right: 0; bottom: var(--tab-h); width: min(520px, 100vw);
              display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 18px; overflow-y: auto;
              background: var(--bg1); border-left: 1px solid var(--line2); box-shadow: -30px 0 60px rgba(0,0,0,.5); }
#printSheet[hidden] { display: none; }
#psHead { display: flex; align-items: flex-start; gap: 12px; }
#psHead > div { flex: 1; min-width: 0; }
#psH { margin: 0; font-size: var(--fs-xl); letter-spacing: var(--head-ls); overflow-wrap: anywhere; }
.psSub { color: var(--tx3); font-size: var(--fs-s); }
.psNote { margin: 0; padding: 9px 12px; border-radius: var(--r); font-size: var(--fs-s);
          color: var(--warn-text); background: var(--warn-bg); }
#psRows { display: flex; flex-direction: column; }
.psRow { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 52px 64px 32px; gap: 8px;
         align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.psRow .psChk { width: 18px; height: 18px; margin: 0; accent-color: var(--acc); }
.psRow .stepGo { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 2px; border: 0;
                 background: none; color: var(--tx1); text-align: left; font-weight: 600; }
.psRow .stepGo .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.psRow .stepGo .n { color: var(--tx3); font-weight: 400; }
.psRow .psMat { font-size: var(--fs-2xs); color: var(--tx2); border: 1px solid var(--line); border-radius: 999px;
                padding: 2px 8px; white-space: nowrap; }
.psRow .mono { color: var(--tx2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.psRow .pdWhen { grid-column: 2 / -1; color: var(--tx3); font-size: var(--fs-2xs); margin-top: -4px; }
#psRows .recForm { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0;
                   border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
#psTot { display: flex; justify-content: space-between; gap: 12px; padding: 4px 2px; color: var(--tx2);
         font-size: var(--fs-s); }
#psTot .mono { color: var(--tx1); text-align: right; }
#psMore { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; font-size: var(--fs-s); }
#psMore summary { cursor: pointer; color: var(--tx2); }
#psMore .mi { width: 100%; }
#psFoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
#psFoot > button { justify-content: center; padding: 11px 18px; font-size: var(--fs-m); }
#psLinks { display: flex; gap: 18px; justify-content: center; font-size: var(--fs-s); }
#psLinks a { color: var(--hi-text); }
@media (max-width: 600px) {
  #printSheet { top: 0; width: 100vw; border-left: 0; padding: 18px 14px 14px; }
  /* a thumb's checkbox and record box, the grams between: one line a piece (L1 step 8) */
  .psRow { grid-template-columns: 44px minmax(0, 1fr) auto 40px 44px; gap: 6px; }
  .psRow .psT { display: none; }
  #pjIn { padding: 22px 14px 32px; }
}
#exH { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

/* L1 (EF): Home says where a build that no page saw land is, and opens it */
.buildNotice { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  justify-content: space-between; margin: 0 0 16px; padding: 10px 14px;
  border: 1px solid var(--info-line); border-radius: var(--r-lg); background: var(--info-bg);
  color: var(--info-text); font-size: var(--fs-ml); }
.buildNotice[data-state="held"], .buildNotice[data-state="stopped"] {
  border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.buildNotice .bnText { flex: 1 1 260px; min-width: 0; }
.buildNotice .bnGo { white-space: nowrap; }
