/* Image mode (v1.1), layout "Focus" (docs/spec/10-images.md). Uses the page's colour tokens. */

/* Mode switch in the header; the two modes' main areas swap. */
.modesw { display: inline-flex; border: 1px solid var(--accent); border-radius: 999px; overflow: hidden; margin-left: 8px; }
.modesw button { border: none; border-radius: 0; background: transparent; color: var(--accent); padding: 4px 14px;
                 font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.modesw button + button { border-left: 1px solid var(--accent); }
.modesw button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.modesw .icon { margin: 0; }
body[data-mode="image"] #video-main { display: none; }
#img-mode[hidden] { display: none; }

/* Set view: tree | centre | right column, like video. */
.im-lay { display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 16px; padding: 16px;
          max-width: 1900px; margin: 0 auto; align-items: start; }
@media (max-width: 1599px) { .im-lay:not(.focus) { grid-template-columns: 280px minmax(0, 1fr); }
  .im-lay:not(.focus) .im-side { grid-column: 1 / -1; position: static; height: auto; } }
/* #205: on a phone the tree, the centre and the queue stack in one shrinkable column. */
@media (max-width: 860px) { .im-lay:not(.focus) { grid-template-columns: minmax(0, 1fr); }
  .im-lay .im-tree { position: static; max-height: none; } }
.im-tree { position: sticky; top: 62px; max-height: calc(100vh - 78px); overflow: auto; }
.im-side { position: sticky; top: 62px; height: calc(100vh - 78px); display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.im-side > section { padding: 12px; min-height: 0; }
.im-side #im-queue-slot { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }   /* the Queue, the whole column */
.im-centre { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* #43: the centre is two regions a poll treats differently. display:contents keeps the layout as
   it was (the 14px gap between the set and the composer, the composer's sticky position). */
.im-results, .im-compose { display: contents; }

/* Project tree */
.tree-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tree-tools button, .im-sm { padding: 3px 9px; font-size: 12.5px; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.p-head h2 { margin: 0; }
.proj { border-radius: 8px; margin-top: 4px; }
/* Each part has its own column (card #191): Archived has no star and no delete button, and without fixed places its
   name slid into the 24px star column and showed as "A…". The name column is the one that grows. */
.proj-row { display: grid; grid-template-columns: 16px 24px minmax(0, 1fr) auto auto auto 26px; gap: 4px; align-items: center;
            padding: 3px 4px; border-radius: 8px; cursor: pointer; }
.proj-row > .chev { grid-column: 1; }
.proj-row > .pc-star { grid-column: 2; }
.proj-row > .proj-name { grid-column: 3; }
.proj-row > .pbusy { grid-column: 4; }
.proj-row > .proj-count { grid-column: 5; }
.proj-row > .pc-seen { grid-column: 6; }
.proj-row > .pc-del { grid-column: 7; }
.proj-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.proj.open > .proj-row { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.proj-row .chev .icon { margin: 0; transition: transform .15s; }
.proj.open .chev .icon { transform: rotate(90deg); }
.proj-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-name input { width: 100%; font: inherit; padding: 1px 4px; border: 1px solid var(--accent); border-radius: 4px;
                   background: var(--panel); color: var(--ink); }
.proj-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.proj-kids { margin: 2px 0 6px 22px; display: flex; flex-direction: column; gap: 2px; }
.node { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 4px;
        border-radius: 6px; cursor: pointer; }
.node:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.node.on { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.node .nt { position: relative; width: 34px; height: 34px; border-radius: 5px; overflow: hidden; background: var(--chip); }
.node .nt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.node .kind { position: absolute; right: 1px; bottom: 1px; background: rgba(0,0,0,.6); color: #fff; border-radius: 3px;
              display: inline-flex; padding: 1px; }
.node .kind .icon { width: 10px; height: 10px; margin: 0; }
.node-l1 { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-l1.none { font-style: italic; color: var(--muted); }
.node-l2 { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-hint { color: var(--muted); font-size: 12.5px; padding: 6px 2px; }

/* A set: header + dense grid */
.set-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-top .t { font-weight: 700; }
.set-top .sp { flex: 1; }
.set-prompt { margin-top: 8px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.diff { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.diff del { color: var(--bad); } .diff ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.im-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.cand { margin: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--chip); }
.cand.sel { border-color: var(--accent); }
.cand .pic { position: relative; background: #1b1b1a; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.cand .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* The picture's number: top left, always readable (solid dark pill, a light edge, above the picture). */
.cand .no { position: absolute; left: 6px; top: 6px; z-index: 2; background: rgba(0,0,0,.78); color: #fff; font-size: 11px;
            font-weight: 700; line-height: 18px; height: 18px; padding: 0 7px; border-radius: 9px; white-space: nowrap;
            box-shadow: 0 0 0 1px rgba(255,255,255,.25); font-variant-numeric: tabular-nums; pointer-events: none; }
.cand.waiting .pic { min-height: 90px; }
/* The waiting tile's spinner, label and ETA: one centred column, whatever the ratio or window width. */
.cand.waiting .pic > .busy { position: absolute; inset: 0; box-sizing: border-box; padding: 6px; justify-content: center;
                             align-items: center; text-align: center; overflow: hidden; }
.cand.waiting .busy > * { flex: none; max-width: 100%; }
.cand .busy .eta { font-size: 11.5px; color: #eee; font-variant-numeric: tabular-nums; }
.cand .busy > .icon { width: 20px; height: 20px; margin: 0; color: #8fb4ff; }
/* The picture the next edit starts from: a ring and a label (bottom, over the picture). */
.cand.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.cand .basetag { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
                 justify-content: center; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700;
                 border-radius: 8px; padding: 2px 6px; }
.cand .basetag .icon { width: 12px; height: 12px; margin: 0; }
.cand .projtag { position: absolute; left: 6px; bottom: 6px; z-index: 2; max-width: calc(100% - 12px); background: rgba(0,0,0,.7); color: #fff;
                 font-size: 10.5px; padding: 1px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand .projtag ~ .edits { bottom: 28px; }   /* .sent sits top right: never give it a bottom too */
.cand .sent { position: absolute; right: 6px; top: 6px; z-index: 2; background: #6b4fd8; color: #fff; font-size: 10.5px;
              padding: 1px 6px; border-radius: 999px; display: inline-flex; gap: 3px; align-items: center; }
.cand .sent .icon { width: 10px; height: 10px; margin: 0; }
/* An image with edit sessions: bottom left, orange while edits are still coming */
.cand .edits { position: absolute; left: 6px; bottom: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; height: 20px;
               padding: 0 7px; border: none; border-radius: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px;
               font-weight: 600; cursor: pointer; }
.cand .edits .icon { width: 12px; height: 12px; margin: 0; }
.cand .edits.busy { background: var(--busy-dot); color: var(--busy-ink); }
.cand .edits:hover { filter: brightness(1.15); }
.node.sub { margin-left: 18px; }
.cand .busy { color: #bbb; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cand .busy i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #777; border-top-color: var(--accent);
                animation: im-spin 1s linear infinite; }
@keyframes im-spin { to { transform: rotate(360deg); } }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 2px 3px; background: var(--panel); }
.bar .pc-ico { width: 26px; height: 26px; }
.bar .del { color: var(--muted); }
.bar .del:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.bar .pick { width: auto; padding: 0 8px; gap: 4px; font-size: 12px; font-weight: 600;
             background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* The composer, docked at the bottom of the centre */
.dock { position: sticky; bottom: 12px; z-index: 3; background: var(--panel); border: 1px solid var(--line);
        border-radius: 12px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
        display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; }
.dock textarea { min-height: 64px; }
.dock .acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 220px; }
.dock .acts .primary { height: 40px; }
.dock .opts { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.dock .opts label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.dock .opts input[type=number] { width: 78px; }
.dock .target { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-bottom: -4px; }
.dock .target b { color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 4px 10px; background: transparent; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button:disabled { background: transparent; color: var(--muted); font-weight: 400; cursor: not-allowed; opacity: 1; }   /* tokens only: --muted on --panel is AA in light and dark */
.im-size-note { font-size: 12px; align-self: center; }
.speedlbl { font-size: 11.5px; color: var(--muted); }
/* #205: on a phone the composer is one column (the options column held the prompt at 0 px), and no select is wider than its card. */
select { max-width: 100%; }
@media (max-width: 600px) { .dock { grid-template-columns: minmax(0, 1fr); }
  .dock .acts { min-width: 0; } .dock .opts select, .dock .opts label { min-width: 0; } }

/* Focus view (edit session): the side panels fold to rails */
.im-lay.focus { grid-template-columns: minmax(0, 1fr) 64px; }
.im-lay.focus #im-rail-l { display: none; }
.im-lay.focus .im-tree, .im-lay.focus .im-side { display: none; }
.rail { display: none; position: sticky; top: 62px; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; }
.im-lay.focus .rail { display: flex; }
.rail .lab { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rail .rb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border: 2px solid transparent;
            background: var(--chip); cursor: pointer; display: flex; align-items: center; justify-content: center;
            font-weight: 700; font-size: 13px; color: var(--muted); }
.rail .rb.on { border-color: var(--accent); }
.rail .rb img { width: 100%; height: 100%; object-fit: cover; }
.rail .ri { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
            position: relative; }
.rail .ri .icon { margin: 0; width: 18px; height: 18px; }
.rail .ri .q-left { position: absolute; top: -4px; right: -6px; }
.flyout { position: fixed; top: 62px; right: 80px; width: 340px; max-height: calc(100vh - 90px); overflow: auto; z-index: 20;
          box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.flyout[hidden] { display: none; }
.focus-stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.focus-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumbs { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.crumbs .icon { margin: 0; }
/* The session as a tree of pictures: a node is one image (Start, or a picked result) with the
   edits made from it listed under it. → continues a row, ↳ starts a branch (another picked picture). */
.htree { display: grid; grid-auto-rows: auto; column-gap: 26px; row-gap: 10px; overflow-x: auto; padding: 4px 2px 6px 2px; align-items: start; }
.inode { position: relative; width: 230px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); padding: 6px;
         display: flex; flex-direction: column; gap: 6px; }
.inode.cont::before, .inode.brk::before { position: absolute; left: -22px; top: 22px; color: var(--muted); font-size: 15px; }
.inode.cont::before { content: "→"; }
.inode.brk::before { content: "↳"; top: 4px; }
.inode.path { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.inode.base-on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.inode.next:not(.root) { border-style: dashed; }
.in-head { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: center; cursor: pointer; border-radius: 6px; }
.in-head:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.in-head img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--chip); display: block; }
.in-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12px; }
.in-meta .from { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-meta .tags, .in-step .tags { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.in-base { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--accent); }
.in-base .icon { width: 11px; height: 11px; margin: 0; }
.in-steps { display: flex; flex-direction: column; gap: 3px; }
.in-step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 5px; align-items: center; font-size: 11.5px;
           padding: 3px 5px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.in-step:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.in-step.cur { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.in-step .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-step .eta { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.in-none { font-size: 11px; color: var(--muted); padding: 2px 5px; }
.ntag { font-size: 10.5px; padding: 0 5px; border-radius: 6px; background: var(--chip); color: var(--muted); font-variant-numeric: tabular-nums; }
.ntag.bad { color: var(--bad); }
/* An edit's mode: Change, Reframe, or (steps made before card #72) Zoom out. */
.mtag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 6px;
        white-space: nowrap; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.mtag .icon { width: 11px; height: 11px; margin: 0; }
.mtag.m-reframe { background: color-mix(in srgb, #2aa876 18%, transparent); color: #2aa876; }
.mtag.m-zoom { background: color-mix(in srgb, #6b4fd8 20%, transparent); color: #8c74ff; }
/* Card #149: a model the owner is still trying (the picker's "untested" label). */
.chip.untested { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 6px; white-space: nowrap;
                 background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--ink);
                 border: 1px solid var(--warn); cursor: help; }
.chip.chip-rw { background: var(--chip); color: var(--ink); border-color: var(--line); cursor: help; }   /* tokens only: AA in light and dark */
.chip.cloud .icon, .node-l2 .icon { width: 12px; height: 12px; margin: 0 3px 0 0; vertical-align: -2px; }
.step-title .chip.eta:empty { display: none; }
.step-title .pickinfo { color: var(--accent); }
.step-title .pickinfo .icon { width: 12px; height: 12px; margin: 0 3px 0 0; vertical-align: -2px; }
.seg button .icon { width: 13px; height: 13px; margin: 0 4px 0 0; vertical-align: -2px; }
/* The Full library */
.tree-tools .on { background: var(--accent); color: var(--accent-ink); }
.im-grid.lib { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
section.lib > .act#im-libmore { margin-top: 12px; }
.focus-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 16px; align-items: start; }
@media (max-width: 1399px) { .focus-main { grid-template-columns: 1fr; } }
.base { position: relative; border-radius: 10px; overflow: hidden; background: #111; display: flex; justify-content: center; }
.base img { max-width: 100%; max-height: 62vh; object-fit: contain; display: block; }
.base .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; background: rgba(0,0,0,.6); color: #eee;
             font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.instr { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.instr .opts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.instr .opts label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.instr .go { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.step-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 13px; margin-bottom: 6px; }
.step-title q { color: var(--muted); }

/* Image viewer */
#im-viewer { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.86); display: flex; flex-direction: column;
             align-items: center; justify-content: center; gap: 10px; padding: 24px; }
#im-viewer[hidden] { display: none; }
#im-viewer { overflow: hidden; }
#im-viewer img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; border-radius: 6px; touch-action: none;
                 user-select: none; transition: transform .06s ease-out; }
#im-viewer img.zoomed { position: relative; z-index: 1; border-radius: 0; }
#im-viewer .cap { color: #eee; font-size: 13px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
#im-viewer .cap .muted { color: #aaa; }
#im-viewer .vb { position: absolute; border: none; background: rgba(255,255,255,.12); color: #fff; width: 40px; height: 40px;
                 border-radius: 999px; font-size: 20px; padding: 0; }
#im-viewer .vb:hover { background: rgba(255,255,255,.25); }
#im-viewer .imv-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#im-viewer .imv-act { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px;
                      border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #eee; font-size: 13px; cursor: pointer; }
#im-viewer .imv-act:hover { background: rgba(255,255,255,.18); }
#im-viewer .imv-act svg { width: 16px; height: 16px; flex: none; }
#im-viewer .imv-act.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
#im-viewer .imv-act.del:hover { background: rgba(220,60,60,.35); border-color: rgba(220,60,60,.6); }
#im-viewer .imv-act kbd { font: 10.5px ui-monospace, monospace; color: #aaa; border: 1px solid rgba(255,255,255,.22);
                          border-radius: 4px; padding: 0 4px; }
#imv-close { top: 16px; right: 16px; } #imv-prev { left: 16px; top: 50%; } #imv-next { right: 16px; top: 50%; }

.dock .target .draft { color: var(--warn); }
/* In progress: images still to come in a project, set or edit session */
.busy-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; box-sizing: border-box; height: 16px; padding: 0 5px; border-radius: 8px;
            background: var(--busy-dot); color: var(--busy-ink); font-size: 10.5px; font-weight: 700; flex: none; }
.node .busy-tag { align-self: center; }
/* Two-line buttons: what it makes, then how long or how much */
button.two-line { flex-direction: column; gap: 0; line-height: 1.2; padding-top: 5px; padding-bottom: 5px; }
button.two-line small { font-size: 11px; font-weight: 400; opacity: .85; }
button.primary.two-line { display: inline-flex; align-items: center; justify-content: center; }

/* Queue: image jobs alongside video's */
.mode-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 0 5px; margin-right: 5px;
            border-radius: 4px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.mode-tag.img { background: color-mix(in srgb, #6b4fd8 20%, transparent); color: #8c74ff; }

/* Go to where it was made (from the Library): the picture flashes in its set or edit step. */
.cand.flash { animation: im-flash 1.6s ease-out; }
@keyframes im-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* Moving a set or edit session to another project (#3): drag onto a project, or Move to... */
.node[draggable="true"] { cursor: grab; }
.node-end { display: inline-flex; align-items: center; gap: 4px; }
.node .node-move { opacity: .6; width: 24px; height: 24px; min-width: 24px; }
.node:hover .node-move, .node:focus-within .node-move, .node .node-move:focus { opacity: 1; }
.node .node-move[disabled] { opacity: .35; cursor: not-allowed; }
.node.dragging { opacity: .45; }
.proj-row.drop-no, .proj-row.drop-no * { cursor: not-allowed; }
.proj-row.flash { animation: im-flash 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .proj-row.flash { animation: none; outline: 2px solid var(--accent); outline-offset: -2px; } }
.mv-ghost { position: fixed; top: -100px; left: -100px; padding: 4px 10px; border-radius: 6px; font-size: 12.5px;
            background: var(--panel); color: var(--ink); border: 1px solid var(--accent); max-width: 260px; }
.im-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.proj-row.drop-ok { outline: 2px dashed var(--accent); outline-offset: -2px;
                    background: color-mix(in srgb, var(--accent) 16%, transparent); }
.proj-row.drop-ok .proj-count { color: var(--accent); font-weight: 700; }
.im-move { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
           background: rgba(0,0,0,.45); padding: 12px; }
.im-move-box { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
               width: min(380px, 92vw); max-height: 80vh; display: flex; flex-direction: column; gap: 10px; }
.im-move-box h3 { margin: 0; font-size: 14px; }
.im-move-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; min-height: 0; }
.im-move-list .mv-to { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.im-move-list .mv-to:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.im-move-list .mv-to.here { opacity: .55; cursor: not-allowed; }
.im-move-list .mv-to .icon { width: 14px; height: 14px; margin: 0; }
.im-move-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* The "new" mark (card #2): not seen yet. Tokens --new, --new-ink, --new-dot are in index.html (light and dark).
   Every mark is a shape or text as well as a colour; the hidden text is .sr-only. Nothing here changes a size:
   the ring is an overlay, the dot sits in the number pill, the tags use the busy tag's slot. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nm { display: none; }
.new .nm { display: inline-flex; align-items: center; }
.nm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--new-dot); margin-right: 5px; flex: none; }
.cand .pic::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .3s; }
.cand .pic.new::after { box-shadow: inset 0 0 0 2px var(--new-dot); }
.cand .no .nm-dot { width: 10px; height: 10px; margin-right: 4px; background: #5fd0e0; }   /* the pill is always dark: the light teal, 9:1 there */
.new-tag { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 16px; padding: 0 6px; border-radius: 8px;
           background: var(--new); color: var(--new-ink); font-size: 10.5px; font-weight: 700; white-space: nowrap; flex: none; }
.node .new-tag { align-self: center; }
.pbusy, .node-end { gap: 4px; }
.new-chip { background: var(--new); color: var(--new-ink); font-weight: 700; }
.vclip.new video { outline: 2px solid var(--new); outline-offset: -2px; }
.th-pic.new .th-name .nm { margin-right: 2px; }
.nm-sw { display: inline-flex; align-items: center; margin-left: 6px; font-size: 11px; font-weight: 700; }
.nm-sw .nm-dot { width: 8px; height: 8px; margin-right: 3px; }
.rh { display: flex; align-items: center; gap: 10px; min-width: 0; }
.results-head > .rh:first-child { flex: none; }
.results-head > .rh:last-child { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
@media (max-width: 600px) { .results-head { flex-wrap: wrap; gap: 2px 12px; } .results-head > .rh:last-child { flex-basis: 100%; justify-content: flex-start; } }
#results-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* #205: a long picture name is cut, never widens the page */
.lib-n { margin-left: 4px; }
.pc-seen { color: var(--new); }
@media (prefers-reduced-motion: reduce) { .cand .pic::after { transition: none; } }
[data-new][hidden] { display: none !important; }
/* Anatomy guidance (card #44): a real checkbox, the exact text in an expander, removable negative tags */
.anat { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.anat-chk { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); cursor: pointer; }
.anat-chk input { width: 20px; height: 20px; }
.anat-chk input:focus-visible, .anat summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.anat-txt summary { cursor: pointer; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.anat-txt p { margin: 4px 0; overflow-wrap: anywhere; }
.anat-h summary { cursor: pointer; } .anat-h div { overflow-wrap: anywhere; }

/* Uploaded pictures (card #111): a root named by its file; the label wraps to two lines (a name with no spaces breaks
   anywhere), the card's header keeps one line with the full name in its title; a file that can't load shows a grey box. */
.node-l1.up-l1 { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.set-top .up-t { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-card .im-grid { grid-template-columns: minmax(0, 420px); }
.cand .pic.broken { background: var(--chip); min-height: 160px; display: flex; align-items: center; justify-content: center; }
.cand .pic.broken img { display: none; }
.cand .pic .cant { color: var(--muted); font-size: 12.5px; padding: 8px; text-align: center; }
/* Card #28: the keep marks (Design 6-9). Text on a near-black chip: 4.5:1 over any picture, light or dark theme;
   the colour is a left rule, never the only signal (the words say it). Under 480 px it wraps instead of truncating. */
.cand .keepmark { position: absolute; right: 6px; bottom: 6px; z-index: 2; max-width: calc(100% - 12px); background: rgba(0,0,0,.82); color: #fff;
                  font-size: 11px; font-weight: 600; line-height: 1.25; padding: 2px 7px; border-radius: 6px; border-left: 3px solid #57c08d; }
.cand .keepmark.warn { border-left-color: #e0a640; }
.cand .keepmark.error { border-left-color: #ff8a80; }
.cand .projtag ~ .keepmark { bottom: 28px; }
.cand .basetag ~ .keepmark { bottom: 30px; }
@media (max-width: 480px) { .cand .keepmark { left: 6px; right: auto; top: 26px; bottom: auto; } }
.arch-note { color: var(--muted); font-size: 12px; margin: 4px 8px 8px; }
.arch-empty { color: var(--muted); padding: 24px 8px; }

/* Card #81: clip marks and the Archived list in the video library (Design 2, 4, 8). */
.clipmark { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.25; padding: 2px 7px; border-radius: 6px;
            background: var(--chip); color: var(--ink); border-left: 3px solid var(--ok); margin-left: 6px; }
.clipmark.warn { border-left-color: var(--warn); }
.clipmark.error { border-left-color: var(--bad); }
.arch-clip video { width: 100%; max-height: 220px; background: #000; }
.arch-clip .th-bar { display: flex; align-items: center; gap: 6px; padding: 4px 0; }

/* A deleted base picture (card #97): a quiet box in the picture's place, same size, no new colours. */
.pic-gone { display: flex; align-items: center; justify-content: center; flex-direction: column; box-sizing: border-box; width: 100%; height: 100%;
  background: var(--panel); border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.pic-gone span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pic-gone .icon { width: 16px; height: 16px; }
.pic-gone i { font-style: normal; font-size: 11px; }
.pic-gone.base { min-width: 260px; min-height: 200px; border-radius: 10px; }
.in-head .pic-gone { width: 56px; height: 56px; flex: none; }
.edit-mode-opts { margin-top: 6px; }
.edit-mode-opts .speedlbl { flex-basis: 100%; }

/* Queued, rendering, failed: one tag family (card #126): a glyph and text, never colour alone. Static under reduced motion. */
.busy-tag.q::before { content: ""; width: 6px; height: 6px; border: 1.5px solid currentColor; border-radius: 50%; margin-right: 3px; box-sizing: border-box; }
.busy-tag.r::before { content: ""; width: 6px; height: 6px; border: 1.5px solid currentColor; border-top-color: transparent; border-radius: 50%; margin-right: 3px; box-sizing: border-box; animation: bz-spin 1s linear infinite; }
.busy-tag.f { background: var(--bad); color: #fff; }
.busy-tag.f::before { content: "!"; margin-right: 3px; font-weight: 800; }
@keyframes bz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-tag.r::before { animation: none; } }
.fail-dot i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.nm-busy { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--busy-dot); margin-right: 3px; flex: none; }
.in-head.new .nm { position: absolute; margin: 2px; }
.in-head { position: relative; }

/* Drop a picture onto image mode to upload it for editing (#103; look and wording: Design review) */
.im-dropzone { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 0 0 10px; padding: 8px; border: 2px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12.5px; }
.im-dropzone.over { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
#img-mode.file-over { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* Card #278: a model a host is still loading is greyed out but can be picked and queued */
/* Card #307: one look for the loading note (Image and Video tabs) and one grey for a loading option; tokens only (AA in light and dark) */
.loading-note { color: var(--muted); font-size: 12px; }
option.loading, option.model-loading { color: var(--muted); }
