/* ==========================================================================
   illustrate.css - the illustrator view. Plan 17 S5.

   THE BENCH'S SKIN, NOT A NEW ONE. Felix, 2026-10-25: "base the styling on
   the original software - more symbols are good and more modern is fine
   but the aesthetic should stay similar". So this page takes skins.css's
   tokens and rack2.css's anatomy and changes only what an illustrator on
   an iPad needs changed:

     the same      Doto, large, uppercase and tracked, for the mark, the
                   step names, the pane labels and the slot heads; a mono
                   with tabular figures for every number; the system
                   grotesk for reading; 2px radius on controls and 0 on
                   the layout; the hairline (--hair, an alpha of the
                   skin's own ink) where v1 had a rule; the accent for
                   SELECTED and nothing else; the scrub field; glyphs;
                   labels floating in the panes; a status line; and the
                   steps as a guide across the titlebar
     changed       a control row is 28px, not 20, because it is touched

   Tokens of this page's own, which the Design tab writes and
   illustrate.config.json fixes:

     --ib-type     the base size the type scale hangs from (12 = the bench)
     --ib-pad      the density: comfortable 1, compact 0.8
     --ib-split    the 2D's share against the 3D
     --accent      the house's own, overridable

   THREE LAYOUTS, ONE SET OF PANES. <html data-layout> picks the
   arrangement, data-pair whether the 2D and the 3D sit side by side, and
   data-big which of them is the big view when they do not:

     A  STUDIO SPLIT   2D | 3D | rack, always paired
     B  STEPS          one big view (+ a 3D thumbnail) | rack
     C  CANVAS         full bleed, the rack a floating sheet, the 3D a
                       picture-in-picture
   ====================================================================== */

:root {
  --ib-type: 12px;
  --ib-pad: 1;
  --ib-split: 1fr;
  --ib-insp: 304px;
  --t-xs: calc(var(--ib-type) - 2px);
  --t-sm: calc(var(--ib-type) - 1px);
  --t-md: var(--ib-type);
  --t-lg: calc(var(--ib-type) + 1px);
  --row: calc(28px * var(--ib-pad));
  --bar: 34px;
  --foot: 22px;
  /* Traffic lights, in the skin's own hues where it has them: a refusal
     is the cut's orange, as the bench's report has it. */
  --ib-ok: var(--hole);
  --ib-amber: #e8a317;
  --ib-red: var(--cut);
}
html[data-density="compact"] { --ib-pad: 0.8; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--f-ui); font-size: var(--t-md); line-height: 1.4;
  background: var(--ground); color: var(--ink);
  overflow: hidden; -webkit-tap-highlight-color: transparent;
  display: grid; grid-template-rows: var(--bar) minmax(0, 1fr) auto var(--foot);
  height: 100dvh;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
.spacer { flex: 1 1 auto; }
.dim { color: var(--ink-dim); }

/* Figures, wherever they appear. */
input[type=number], .mrow .v, .status, .scale, .ctl input, .tile .fig,
.ib-big, .ib-sheetcount b {
  font-family: var(--f-num); font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
/* A display label: the one shape Doto is allowed to take. */
.brand, .rackhead, .slot > summary, .pane figcaption b, .msub,
.tile .lab, .stepbtn, .ib-reportlab, .ib-led,
.ib-dialog h2, .ib-boot b, .seg .lab {
  font-family: var(--f-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: var(--tr-wide);
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: var(--r); }

* { scrollbar-width: thin; scrollbar-color: var(--hair-2) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hair-2); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }

/* ------------------------------------------------------------- titlebar - */
.titlebar {
  display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s3); background: var(--chrome);
  border-bottom: 1px solid var(--rule);
  position: relative; z-index: 20;
}
.brand { color: var(--head); font-size: var(--t-md); letter-spacing: var(--tr-mark); white-space: nowrap; }
.ib-title {
  font-family: var(--f-num); font-size: var(--t-sm); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch;
  padding-left: var(--s3); border-left: 1px solid var(--hair-2);
}
.tbtn {
  font-family: var(--f-num); font-size: 15px; line-height: 1;
  min-width: 30px; height: 26px; padding: 0 var(--s2);
  background: transparent; color: var(--ink-dim);
  border: 1px solid var(--hair-2); border-radius: var(--r); cursor: pointer;
  transition: background .08s linear, color .08s linear;
}
.tbtn:hover:not([disabled]) { background: var(--raise); color: var(--ink); }
.tbtn[disabled] { opacity: .4; cursor: default; }
.tbtn[aria-expanded="true"], .tbtn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Whether it builds: a lamp and a word, where the bench puts its state. */
.ib-led { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-dim); white-space: nowrap; }
.ib-led i { width: 9px; height: 9px; border-radius: 50%; background: var(--ib-ok); box-shadow: 0 0 0 2px var(--hair); }
.ib-led.amber i { background: var(--ib-amber); }
.ib-led.red i { background: var(--ib-red); }
.ib-led.red { color: var(--ib-red); }
.ib-led.busy i { background: var(--ink-dim); animation: ibpulse .9s infinite alternate; }
@keyframes ibpulse { from { opacity: .3; } to { opacity: 1; } }

/* ------------------------------------------------------------ the menu - */
.sheet {
  position: absolute; top: var(--bar); right: var(--s3); z-index: 40;
  background: var(--raise); border: 1px solid var(--hair-2); border-radius: var(--r);
  padding: var(--s1); min-width: 260px;
  display: flex; flex-direction: column; gap: 1px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22), 0 1px 2px rgba(0,0,0,.18);
}
.sheet[hidden] { display: none !important; }
.sheet button {
  text-align: left; color: var(--ink); background: transparent; border: none; border-radius: var(--r);
  padding: 7px var(--s2); cursor: pointer; display: flex; align-items: center; gap: var(--s2);
  font-size: var(--t-md);
}
.sheet button .g { width: 1.4em; text-align: center; color: var(--ink-dim); font-family: var(--f-num); }
.sheet button:hover { background: var(--field); }
.sheet hr { border: 0; border-top: 1px solid var(--hair); margin: var(--s1) 0; width: 100%; }
.sheet .lbl { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tr-wide); font-size: 9px; color: var(--ink-dim); padding: var(--s1) var(--s2) 0; }
.sheet .seg { padding: var(--s1) var(--s2); }

/* ----------------------------------------------------------- the stage -- */
.ib-stage {
  display: grid; gap: 1px; background: var(--hair-2);
  min-height: 0; position: relative;
}
.pane { margin: 0; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--pane); }
.pane canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.pane iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--pane); }
.pane figcaption {
  position: absolute; z-index: 3; inset: 0 0 auto 0;
  display: flex; align-items: baseline; gap: var(--s2);
  padding: 6px var(--s2); font-size: var(--t-xs); color: var(--ink-dim);
  pointer-events: none;
  text-shadow: 0 1px 0 var(--pane), 0 -1px 0 var(--pane), 1px 0 0 var(--pane), -1px 0 0 var(--pane);
}
.pane figcaption b { color: var(--ink); }
.pane figcaption .dim { font-family: var(--f-ui); text-transform: none; letter-spacing: 0; }
.pane .scale { margin-left: auto; font-size: var(--t-xs); color: var(--ink-dim); }
html[data-step="art"] .ib-main figcaption { display: none; }
.pane.dragging canvas { cursor: grabbing; }
.pane.can-grab canvas { cursor: grab; }
body.drawing .ib-main { outline: 2px solid var(--accent); outline-offset: -2px; }
body.drawing .ib-main canvas { cursor: crosshair; }

/* The 3D's views, the bench's viewcube. */
.viewcube {
  position: absolute; z-index: 4; right: var(--s2); top: 26px;
  display: grid; grid-template-columns: repeat(4, 38px); gap: 1px;
}
.viewcube button {
  font-family: var(--f-num); font-size: 10px; letter-spacing: .04em;
  height: 26px; padding: 0; cursor: pointer;
  background: var(--chrome); color: var(--ink-dim);
  border: 1px solid var(--hair-2); border-radius: var(--r);
}
.viewcube button:hover { background: var(--raise); color: var(--ink); }
.viewcube button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ib-swap { position: absolute; left: var(--s2); bottom: var(--s2); z-index: 4; display: none; background: var(--chrome); }
.ib-tools { position: absolute; left: var(--s2); bottom: var(--s2); display: none; gap: 2px; z-index: 4; }
.ib-tools .tbtn { width: 40px; height: 40px; background: var(--chrome); box-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* ------------------------------------------------------------- the guide -
   The steps across the top, the flow at a glance: a number in a box (a
   tick once done), the step's glyph, its name in Doto. The accent is the
   step you are on and nothing else. */
.ib-steps { display: flex; align-items: center; gap: 2px; margin-left: var(--s3); min-width: 0; overflow-x: auto; }
.ib-steps .arrow { color: var(--ink-dim); opacity: .6; font-family: var(--f-num); padding: 0 2px; }
.ib-steps.free .arrow { visibility: hidden; width: 2px; padding: 0; }
.stepb {
  position: relative; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  height: 26px; padding: 0 var(--s2) 0 3px; cursor: pointer;
  background: transparent; color: var(--ink-dim); border: 1px solid transparent; border-radius: var(--r);
  font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tr-wide); font-size: var(--t-xs);
}
.stepb .n {
  display: inline-grid; place-items: center; width: 18px; height: 18px;
  font-family: var(--f-num); font-size: 10px; font-weight: 600; letter-spacing: 0;
  border: 1px solid var(--hair-2); border-radius: var(--r); color: var(--ink);
}
.stepb .g { font-family: var(--f-num); font-weight: 400; font-size: 13px; letter-spacing: 0; }
.stepb:hover { background: var(--raise); color: var(--ink); }
.stepb.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.stepb.on .n { border-color: var(--on-accent); color: var(--on-accent); }
.stepb.done { color: var(--ink); }
.stepb.done .n { background: var(--ink); color: var(--chrome); border-color: var(--ink); }
.stepb.locked { opacity: .4; cursor: default; }
.stepb .flag { position: absolute; right: 2px; top: 2px; width: 6px; height: 6px; border-radius: 50%; }
.stepb .flag.red { background: var(--ib-red); }
.stepb .flag.amber { background: var(--ib-amber); }
@media (max-width: 1100px) { .stepb .lab { display: none; } .stepb.on .lab { display: inline; } }

/* EDIT, the bench's OUTLINE pane button: the outline's corners, by hand. */
.editbtn {
  pointer-events: auto; cursor: pointer; margin-left: var(--s2);
  font-family: var(--f-display); font-weight: 700; font-size: 9px; letter-spacing: .09em; text-transform: uppercase;
  background: var(--chrome); color: var(--ink-dim); border: 1px solid var(--hair-2); border-radius: var(--r);
  padding: 0 8px; line-height: 18px; text-shadow: none;
}
.editbtn:hover { background: var(--raise); color: var(--ink); }
.editbtn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.editbtn[hidden] { display: none; }

/* ---------------------------------------------------------- A, B and C -- */
html[data-layout="A"] .ib-stage {
  grid-template-columns: var(--ib-split) 1fr var(--ib-insp);
  grid-template-areas: "main d3 insp";
}
html[data-layout="A"] .ib-main { grid-area: main; }
html[data-layout="A"] .ib-3d { grid-area: d3; }
html[data-layout="A"] .ib-insp { grid-area: insp; }
/* The drawing wants the room on Artwork. */
html[data-layout="A"][data-step="art"] .ib-stage { grid-template-columns: 1.8fr 1fr var(--ib-insp); }

html[data-layout="B"] .ib-stage {
  grid-template-columns: 1fr var(--ib-insp);
  grid-template-areas: "view insp";
}
html[data-layout="B"] .ib-insp { grid-area: insp; }
html[data-layout="B"][data-big="2d"] .ib-main,
html[data-layout="B"][data-big="3d"] .ib-3d { grid-area: view; }
html[data-layout="B"][data-big="2d"] .ib-3d,
html[data-layout="B"][data-big="3d"] .ib-main {
  position: absolute; right: calc(var(--ib-insp) + var(--s3)); bottom: var(--s3);
  width: min(28%, 300px); aspect-ratio: 4 / 3; z-index: 6; cursor: pointer;
  outline: 1px solid var(--hair-2); box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
html[data-layout="B"][data-pair="1"] .ib-stage {
  grid-template-columns: var(--ib-split) 1fr var(--ib-insp);
  grid-template-areas: "main d3 insp";
}
html[data-layout="B"][data-pair="1"] .ib-main,
html[data-layout="B"][data-pair="1"] .ib-3d {
  position: relative; width: auto; right: auto; bottom: auto; aspect-ratio: auto; box-shadow: none; outline: 0;
}
html[data-layout="B"][data-pair="1"] .ib-main { grid-area: main; }
html[data-layout="B"][data-pair="1"] .ib-3d { grid-area: d3; }
html[data-layout="B"] .ib-swap { display: block; }

html[data-layout="C"] .ib-stage { grid-template-columns: 1fr; grid-template-areas: "main"; }
html[data-layout="C"] .ib-main { grid-area: main; }
html[data-layout="C"][data-big="3d"] .ib-3d { grid-area: main; }
html[data-layout="C"][data-big="3d"] .ib-main,
html[data-layout="C"][data-big="2d"] .ib-3d {
  position: absolute; top: var(--s3); right: var(--s3); width: min(30%, 320px); aspect-ratio: 4 / 3; z-index: 6;
  outline: 1px solid var(--hair-2); box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer;
}
html[data-layout="C"][data-pair="1"] .ib-stage { grid-template-columns: var(--ib-split) 1fr; grid-template-areas: "main d3"; }
html[data-layout="C"][data-pair="1"] .ib-3d { grid-area: d3; position: relative; top: auto; right: auto; width: auto; aspect-ratio: auto; box-shadow: none; outline: 0; }
html[data-layout="C"] .ib-tools { display: flex; bottom: var(--s3); }
html[data-layout="C"] .ib-insp {
  position: absolute; right: var(--s3); bottom: 52px; max-height: calc(100% - 72px); width: min(320px, calc(100% - 80px));
  z-index: 7; border: 1px solid var(--hair-2); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
html[data-layout="C"] .ib-insp.shut { display: none; }
html[data-layout="C"] .ib-strip .ib-back, html[data-layout="C"] .ib-strip .ib-next { display: none; }
/* Narrow (a phone, or an iPad in split view): the rack goes under. */
@media (max-width: 860px) {
  html[data-layout="A"] .ib-stage, html[data-layout="B"] .ib-stage {
    grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 42vh);
    grid-template-areas: "view" "insp";
  }
  html[data-layout="A"] .ib-main, html[data-layout="A"] .ib-3d { grid-area: view; }
  html[data-layout="A"][data-big="2d"] .ib-3d, html[data-layout="A"][data-big="3d"] .ib-main,
  html[data-layout="B"][data-big="2d"] .ib-3d, html[data-layout="B"][data-big="3d"] .ib-main {
    position: absolute; right: var(--s3); top: var(--s3); bottom: auto; width: 38%; aspect-ratio: 4 / 3; z-index: 6;
    outline: 1px solid var(--hair-2); box-shadow: 0 6px 20px rgba(0,0,0,.22);
  }
  .ib-title { display: none; }
}

/* ----------------------------------------------------------- the rack -- */
.ib-insp { background: var(--chrome); overflow-y: auto; overflow-x: hidden; min-height: 0; }
.rackhead {
  position: sticky; top: 0; z-index: 2; background: var(--chrome);
  padding: var(--s2) var(--s3) 6px; font-size: var(--t-xs); color: var(--head);
  border-bottom: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2);
}
.rackhead .g { font-family: var(--f-num); font-weight: 400; font-size: 14px; letter-spacing: 0; margin-right: 4px; color: var(--ink); }
.rackhead .dim { font-family: var(--f-ui); font-weight: 400; text-transform: none; letter-spacing: 0; }
.slot { border-bottom: 1px solid var(--hair); }
.slot > summary {
  list-style: none; cursor: pointer; padding: 8px var(--s3);
  display: flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); color: var(--ink);
}
.slot > summary::-webkit-details-marker { display: none; }
.slot > summary::before {
  content: ""; flex: 0 0 auto; width: 0; height: 0;
  border-left: 4px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
  color: var(--ink-dim); transition: transform .12s ease; transform-origin: 2px 50%;
}
.slot[open] > summary::before { transform: rotate(90deg); }
.slot > summary:hover { background: var(--raise); }
.slot > summary .g { font-family: var(--f-num); font-weight: 400; letter-spacing: 0; font-size: 13px; color: var(--ink-dim); }
.slot .tag {
  margin-left: auto; font-family: var(--f-num); font-size: var(--t-xs); font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--ink-dim);
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slot .tag.warn { color: var(--ib-red); }
.slot .body { padding: 2px var(--s3) var(--s3); display: flex; flex-direction: column; gap: 4px; }
.hint { font-size: var(--t-sm); line-height: 1.5; color: var(--ink-dim); margin: 4px 0 0; }
.hint b { color: var(--ink); font-weight: 600; }
.hint kbd {
  font-family: var(--f-num); font-size: var(--t-xs); border: 1px solid var(--hair-2); border-radius: var(--r);
  padding: 0 4px; color: var(--ink);
}
.sub { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tr-wide);
       font-size: 9px; color: var(--ink-dim); margin: var(--s2) 0 2px; }

/* The scrub field: label, value and position in ONE control (rack2.css's
   ?ctl=scrub). Drag anywhere to scrub, press and let go to type. */
.ctl {
  position: relative; isolation: isolate; height: var(--row);
  background: var(--field); border: 1px solid var(--hair); border-radius: var(--r);
  overflow: hidden; cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none;
}
.ctl::before {
  content: ""; position: absolute; z-index: 0; inset: 0 auto 0 0;
  width: calc(var(--v, 0) * 1%); background: var(--track); pointer-events: none;
}
.ctl:hover { border-color: var(--hair-2); }
.ctl:hover::before { background: var(--fill); opacity: .55; }
.ctl.scrubbing { border-color: var(--accent); }
.ctl.scrubbing::before { background: var(--fill); opacity: .8; }
.ctl > label {
  position: absolute; z-index: 2; left: var(--s2); top: 0; right: 9ch;
  line-height: calc(var(--row) - 2px); font-size: var(--t-sm); color: var(--ink-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
}
.ctl > label .g { font-family: var(--f-num); color: var(--ink); margin-right: 5px; }
.ctl > input {
  position: absolute; z-index: 3; right: 0; top: 0; width: 9ch; height: 100%;
  padding: 0 var(--s2) 0 0; text-align: right; font-size: var(--t-sm);
  background: transparent; border: none; border-radius: 0; color: var(--ink); cursor: text;
  -moz-appearance: textfield; appearance: textfield;
}
.ctl > input::-webkit-inner-spin-button, .ctl > input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ctl > input:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--raise); }
.ctl .unit { position: absolute; z-index: 2; right: 3px; top: 0; line-height: calc(var(--row) - 2px); font-size: 9px; color: var(--ink-dim); pointer-events: none; font-family: var(--f-num); }
.ctl.unitted > input { padding-right: 22px; width: 10ch; }
.ctl.readout { cursor: not-allowed; border-style: dashed; }
.ctl.readout > input { opacity: .55; cursor: not-allowed; }
.ctl.readout > label::after { content: "set"; margin-left: 6px; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.ctlpair { display: grid; grid-template-columns: 1fr 30px 1fr; gap: 4px; align-items: center; }
.ctlpair .tbtn { height: var(--row); min-width: 0; padding: 0; font-size: 13px; }

/* A tile: a picture of the thing and its name. The bench's shape
   dropdown, drawn. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 4px; margin: 2px 0; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-height: 78px; padding: 6px 4px 6px; cursor: pointer;
  background: var(--field); color: var(--ink); border: 1px solid var(--hair); border-radius: var(--r);
  transition: background .08s linear, border-color .08s linear;
}
.tile:hover { background: var(--raise); border-color: var(--hair-2); }
.tile.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tile svg { width: 60px; height: 44px; overflow: visible; }
.tile .lab { font-size: 8.5px; line-height: 1.15; text-align: center; }
.tile .fig { font-size: 9px; color: var(--ink-dim); }
.tile.on .fig { color: var(--on-accent); opacity: .7; }
.tile svg .sil { fill: var(--geom-fill); fill-opacity: .55; stroke: var(--geom); stroke-width: 1.3; stroke-linejoin: miter; }
.tile svg .pic { fill: var(--panel); fill-opacity: .16; stroke: var(--panel); stroke-width: 1.3; stroke-linejoin: miter; }
.tile svg .ink { fill: none; stroke: var(--geom); stroke-width: 1.4; }
.tile svg .dot { fill: var(--geom); }
.tile svg .dimq { stroke: var(--dimline); stroke-width: .8; stroke-dasharray: 2 2; fill: none; }
.tile.on svg .sil { fill: #fff; fill-opacity: .55; }
.tile.wide { grid-column: span 2; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 6px 10px; min-height: 0; }
.tile.wide .lab { text-align: left; }

.slotbtn {
  font-size: var(--t-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--row); padding: 0 var(--s3);
  background: transparent; color: var(--ink); border: 1px solid var(--hair-2); border-radius: var(--r);
  transition: background .08s linear, border-color .08s linear;
}
.slotbtn .g { font-family: var(--f-num); font-size: 13px; }
.slotbtn:hover:not([disabled]) { background: var(--raise); }
.slotbtn[disabled] { opacity: .45; cursor: default; }
.slotbtn.on, .slotbtn.go { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.slotbtn.big { min-height: 40px; font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tr-wide); font-size: 11px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 4px; }
.btnrow > .slotbtn { flex: 1 1 auto; }

/* A segmented choice. */
.seg { display: flex; gap: 1px; flex-wrap: wrap; }
.seg button {
  flex: 1 1 auto; min-height: var(--row); padding: 0 var(--s2); cursor: pointer;
  font-family: var(--f-num); font-size: var(--t-xs);
  background: var(--field); color: var(--ink-dim); border: 1px solid var(--hair); border-radius: var(--r);
}
.seg button:hover { background: var(--raise); color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Read-outs, as the bench's MEASURE column sets them. */
.mrow { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--t-sm); padding: 2px 0; }
.mrow .k { color: var(--ink-dim); }
.mrow .v { color: var(--ink); }
.mrow.hi .v { color: var(--hi); font-weight: 600; }
.mrow.warn .v { color: var(--ib-red); font-weight: 600; }
.msub { font-size: 9px; color: var(--ink-dim); margin: var(--s2) 0 var(--s1); padding-bottom: 3px; border-bottom: 1px solid var(--hair); }

input[type=text], input[type=email], textarea, select {
  font-family: var(--f-ui); font-size: var(--t-sm);
  background: var(--field); color: var(--ink);
  border: 1px solid var(--hair-2); border-radius: var(--r);
  padding: 4px 8px; width: 100%; min-width: 0; min-height: var(--row);
}
input::placeholder, textarea::placeholder { color: var(--ink-dim); opacity: .8; }
textarea { min-height: 64px; resize: vertical; line-height: 1.45; }
.ib-toggle { display: flex; gap: var(--s2); align-items: center; min-height: var(--row); font-size: var(--t-sm); cursor: pointer; }
.ib-toggle input { width: 16px; height: 16px; accent-color: var(--ink); }

.ib-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 3px; }
.ib-swatches button {
  aspect-ratio: 1; min-width: 0; padding: 0; cursor: pointer;
  border: 1px solid var(--hair-2); border-radius: var(--r);
}
.ib-swatches button.on { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: inset 0 0 0 1px var(--ink); }
.ib-swatches button.metal { background-image: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%, rgba(0,0,0,.18)); }
.ib-big { font-size: 18px; font-weight: 600; line-height: 1.15; }
.ib-beta { font-family: var(--f-num); font-size: 8px; background: var(--ink); color: var(--chrome); border-radius: var(--r); padding: 1px 4px; vertical-align: middle; letter-spacing: .06em; }
.ib-sheetcount { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ib-sheetcount div { background: var(--field); border: 1px solid var(--hair); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.ib-sheetcount b { font-size: 16px; }
.ib-sheetcount span { font-size: var(--t-xs); color: var(--ink-dim); }
.ib-thumb { width: 100%; max-height: 160px; object-fit: contain; background: var(--field); border: 1px solid var(--hair); display: block; }
.ib-preview { width: 100%; background: #fff; display: block; border: 1px solid var(--hair-2); }

/* -------------------------------------------------------- the report -- */
.ib-strip {
  display: flex; align-items: center; gap: var(--s3);
  padding: 6px var(--s3); background: var(--chrome); border-top: 1px solid var(--hair-2);
  min-height: 44px; position: relative; z-index: 9;
}
.ib-reportlab { font-size: 9px; color: var(--ink-dim); align-self: flex-start; padding-top: 8px; }
.ib-said { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ib-row {
  position: relative; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap;
  padding: 3px var(--s2) 3px 22px; font-size: var(--t-sm); line-height: 1.45;
  border-left: 2px solid transparent;
}
.ib-row::before { position: absolute; left: 8px; top: 4px; font-family: var(--f-num); font-size: var(--t-xs); content: "·"; color: var(--ink-dim); }
.ib-row[data-level="red"] { border-left-color: var(--ib-red); background: var(--raise); }
.ib-row[data-level="red"]::before { content: "✕"; color: var(--ib-red); }
.ib-row[data-level="amber"] { border-left-color: var(--ib-amber); }
.ib-row[data-level="amber"]::before { content: "!"; color: var(--ib-amber); font-weight: 700; }
.ib-row.okrow::before { content: "✓"; color: var(--ib-ok); }
.ib-row .txt { flex: 1 1 18ch; min-width: 0; cursor: pointer; }
.ib-row .txt.ok { cursor: default; color: var(--ink-dim); }
.ib-row.hot .txt { font-weight: 600; }
.ib-row button { min-height: 26px; font-size: var(--t-xs); }
.ib-row .more { font-size: var(--t-xs); background: transparent; border: none; text-decoration: underline; color: var(--ink-dim); cursor: pointer; padding: 0 4px; }
.ib-row details { flex-basis: 100%; font-size: var(--t-xs); color: var(--ink-dim); }
.ib-said > .more { align-self: flex-start; margin-left: 18px; font-size: var(--t-xs); background: transparent; border: none; text-decoration: underline; color: var(--ink-dim); cursor: pointer; }
.stepbtn {
  height: 32px; padding: 0 var(--s3); font-size: 10px; cursor: pointer; white-space: nowrap;
  background: transparent; color: var(--ink); border: 1px solid var(--hair-2); border-radius: var(--r);
}
.stepbtn:hover:not([disabled]) { background: var(--raise); }
.stepbtn.go { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.stepbtn[disabled] { opacity: .4; cursor: default; }
.stepbtn.go[disabled] { background: var(--field); color: var(--ink-dim); border-color: var(--hair-2); }

/* --------------------------------------------------------------- status - */
.status {
  display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s3);
  background: var(--chrome); border-top: 1px solid var(--hair-2);
  font-size: var(--t-xs); color: var(--ink-dim); white-space: nowrap; overflow: hidden;
}
.status b { color: var(--ink); font-weight: 600; }
html[data-layout="C"] .status { position: relative; z-index: 9; }

/* ------------------------------------------------- boot, toast, dialog -- */
.ib-boot {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 40;
  background: var(--raise); color: var(--ink); border: 1px solid var(--hair-2); border-radius: var(--r);
  padding: 8px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.ib-boot div { display: flex; gap: var(--s3); align-items: baseline; }
.ib-boot b { font-size: 10px; }
.ib-boot b::after { content: "▌"; margin-left: 4px; animation: ibpulse .55s infinite alternate steps(2); font-family: var(--f-num); }
.ib-boot span { font-size: var(--t-sm); color: var(--ink-dim); }
.ib-boot.gone { display: none; }
.ib-toast {
  position: fixed; left: 50%; top: calc(var(--bar) + 10px); transform: translateX(-50%); z-index: 41;
  display: flex; align-items: center; gap: var(--s3);
  background: var(--raise); color: var(--ink); border: 1px solid var(--hair-2); border-radius: var(--r);
  padding: 8px 12px; font-size: var(--t-sm); box-shadow: 0 6px 20px rgba(0,0,0,.22);
  opacity: 0; transition: opacity .15s; pointer-events: none; max-width: 90vw;
}
.ib-toast.on { opacity: 1; pointer-events: auto; }
.ib-toast button { min-height: 24px; padding: 0 var(--s2); background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--r); cursor: pointer; font-size: var(--t-xs); }
.ib-dialog {
  border: 1px solid var(--hair-2); border-radius: var(--r); padding: 0; max-width: min(640px, 94vw); width: 100%;
  background: var(--chrome); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.ib-dialog::backdrop { background: rgba(0,0,0,.35); }
.ib-dialog .body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.ib-dialog h2 { margin: 0 0 var(--s1); font-size: 12px; color: var(--head); }
.ib-dialog p { margin: 0; font-size: var(--t-md); }
.ib-dialog .btns { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; margin-top: var(--s2); }
.ib-dialog .btns button, .ib-dialog a.go { min-height: 30px; padding: 0 var(--s3); border: 1px solid var(--hair-2); border-radius: var(--r); background: transparent; cursor: pointer; font-size: var(--t-sm); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.ib-dialog .btns button.go, .ib-dialog a.go { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ib-dialog label { display: flex; flex-direction: column; gap: 3px; font-size: var(--t-sm); color: var(--ink-dim); }
.ib-dialog textarea[data-say] { min-height: 36px; }
.ib-design { max-height: 72vh; overflow-y: auto; }
.ib-design h3 { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tr-wide); font-size: 9px; color: var(--ink-dim); margin: var(--s2) 0 3px; }
.ib-design input[type=range] { width: 100%; accent-color: var(--ink); }
.ib-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.ib-gallery button {
  min-height: 118px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; justify-content: flex-end;
  text-align: left; padding: 10px; cursor: pointer;
  background: var(--field); border: 1px solid var(--hair); border-radius: var(--r); color: var(--ink);
}
.ib-gallery button:hover { background: var(--raise); border-color: var(--hair-2); }
.ib-gallery button svg { width: 100%; height: 60px; }
.ib-gallery button svg .sil { fill: var(--geom-fill); fill-opacity: .55; stroke: var(--geom); stroke-width: 1.3; }
.ib-gallery button svg .pic { fill: var(--panel); fill-opacity: .16; stroke: var(--panel); stroke-width: 1.3; }
.ib-gallery b { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tr-wide); font-size: 10px; }
.ib-gallery span { font-family: var(--f-num); font-size: var(--t-xs); color: var(--ink-dim); }
body.busy { cursor: progress; }

/* A pane shrunk to a thumbnail (B and C) keeps its name and loses the
   rest: the hint, and the 3D's views, are for the big pane. */
html[data-layout="B"][data-pair="0"][data-big="2d"] .ib-3d figcaption .dim,
html[data-layout="B"][data-pair="0"][data-big="3d"] .ib-main figcaption .dim,
html[data-layout="C"][data-pair="0"][data-big="2d"] .ib-3d figcaption .dim,
html[data-layout="C"][data-pair="0"][data-big="3d"] .ib-main figcaption .dim,
html[data-layout="B"][data-pair="0"][data-big="2d"] .ib-3d .viewcube,
html[data-layout="C"][data-pair="0"][data-big="2d"] .ib-3d .viewcube { display: none; }
/* C, unpaired: the rack floats under the 3D's picture-in-picture. */
html[data-layout="C"][data-pair="0"] .ib-insp { max-height: calc(100% - 52px - min(22.5vw, 240px) - 24px); }
