/*
 * The wizard's look. Deliberately plain: P6 is "novice first", and the operator
 * is reading this on a shop PC, standing up, possibly in gloves. Big targets,
 * high contrast, one column, no animation.
 *
 * The two colours are the same steel-on-air pair the part previews are drawn in
 * (dxfbot/svg.py), so a drawing sits on the page rather than on top of it.
 */
:root {
  --air: #f4f1ea;
  --steel: #2f3336;
  --ink: #1c1917;
  --line: #d6d1c7;
  --accent: #c2410c;
  --warn: #7c2d12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--air);
  color: var(--ink);
}

main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* --- top bar ------------------------------------------------------------- */
.bar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--steel); color: var(--air);
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
a.brand { color: inherit; text-decoration: none; }
a.brand:hover, a.brand:focus-visible { text-decoration: underline; }
.bar .who { margin-left: auto; font-size: 0.95rem; }
.inline { margin: 0; }
.link {
  background: none; border: 0; padding: 0;
  color: var(--air); font: inherit; text-decoration: underline; cursor: pointer;
}

/* --- step rail ----------------------------------------------------------- */
.rail {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  list-style: none; margin: 0 0 1.75rem; padding: 0;
  font-size: 0.85rem;
}
.rail li { display: flex; align-items: center; gap: 0.4rem; color: #6b6259; }
.rail li + li::before { content: "›"; margin-right: 0.4rem; color: var(--line); }
.rail .num {
  display: grid; place-items: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 1px solid var(--line);
}
.rail .here { color: var(--ink); font-weight: 600; }
.rail .here .num { background: var(--accent); border-color: var(--accent); color: #fff; }
/* A finished step is a link back to it (row 1.128 slice C2 (2)). */
.rail .done a { display: flex; align-items: center; gap: 0.4rem; color: inherit; }
.rail .done a .label { text-decoration: underline; }
.rail .done .num { border-color: var(--ink); }
/* A new job is its own action, in words, under the rail — never Back. */
.new-job { margin: -1.25rem 0 1.5rem; font-size: 0.85rem; }

/* --- a step -------------------------------------------------------------- */
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.5rem; }
.asks { margin: 0 0 1.5rem; font-size: 1.05rem; }

.facts { margin: 0 0 1.5rem; }
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #6b6259; }
.facts dd { margin: 0.15rem 0 1rem; font-size: 1.15rem; }
.role {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.5rem;
  vertical-align: 0.15em; color: #6b6259;
}
.note { font-size: 0.9rem; color: #6b6259; }

select { font: inherit; padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px; }

.preview { margin: 0 0 1.5rem; text-align: center; }
/* ⚠️ This background is load-bearing. The generated SVG carries the same colour
   as an inline style attribute, which the Content-Security-Policy blocks — so
   without this rule the drawing loses its background and a dark part sits on
   whatever is behind it. Dropping 'unsafe-inline' from the policy is what
   keeps the one `| safe` in this app from becoming a style-injection sink. */
.preview svg {
  max-width: 100%; height: auto; background: var(--air);
  border: 1px solid var(--line); border-radius: 6px;
}
.preview figcaption { margin-top: 0.6rem; font-size: 0.92rem; color: #4b443d; }

.plasma {
  border-left: 3px solid var(--accent);
  background: #fffdf8; padding: 0.85rem 1rem; margin: 0 0 1.75rem;
}
.plasma h2 { margin: 0 0 0.3rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.plasma p { margin: 0; }

.notyet {
  background: #fffdf8; border: 1px dashed var(--line);
  padding: 0.85rem 1rem; margin: 0 0 1.5rem; color: #4b443d;
}
.warn { color: var(--warn); font-weight: 500; }
/* release-check rows (step 7): the status cell carries the colour, not the row */
tr.warn { color: inherit; font-weight: inherit; }
tr.warn td:first-of-type { color: var(--warn); font-weight: 600; }
tr.not-evaluated:not(.detail) td:first-of-type { color: #7a4f00; font-weight: 600; }
tr.fail td:first-of-type { color: #a32d2d; font-weight: 600; }
tr.not-built td:first-of-type { color: #6b6259; font-style: italic; }

/* --- navigation ---------------------------------------------------------- */
.nav { display: flex; gap: 0.75rem; }
.button {
  display: inline-block; padding: 0.75rem 1.25rem; border-radius: 8px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); min-height: 3rem; line-height: 1.5rem;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.secondary { background: #fff; color: var(--ink); }
.button.disabled { opacity: 0.4; cursor: default; }

/* --- the picker ---------------------------------------------------------- */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.people form { margin: 0; }
.person {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; padding: 1.1rem 1.25rem;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; text-align: left; cursor: pointer;
}
.person:hover, .person:focus-visible { border-color: var(--accent); }
.person .name { font-size: 1.25rem; font-weight: 600; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* --- step 3: the outline design screen (build item 1.52) ----------------- */

.ask { margin: 0 0 1.25rem; }
.ask label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
/* The default unit is named on the label, before anything is typed. */
.ask label .unit-note { font-weight: 400; color: #6b6259; }
.ask input[type="text"] {
  font: inherit; font-size: 1.15rem; padding: 0.6rem;
  width: 100%; max-width: 18rem; min-height: 3rem;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
/* A refused box is marked, not merely described somewhere further down. */
.ask.bad input[type="text"] { border: 2px solid var(--warn); }
.ask.bad label { color: var(--warn); }
.hint { margin: 0.3rem 0 0; font-size: 0.9rem; color: #6b6259; }
/* The size-and-metal screen on the plate in sections (row 1.152, W1–W3):
   one wording or the other, never both. */
.plate-follows:not([data-plate]) .for-plate, .plate-follows[data-plate] .not-plate { display: none; }
/* A plate way said by its sections, one to a line (row 1.152). */
.sections-said span { display: block; }
.tone-fold summary { cursor: pointer; font-weight: 600; margin: 0 0 0.5rem; }

.examples {
  background: #fffdf8; border: 1px dashed var(--line);
  padding: 0.7rem 1rem; margin: 0 0 1.5rem; color: #4b443d;
}

fieldset.tiles { border: 0; padding: 0; margin: 0 0 1.75rem; }
fieldset.tiles legend { padding: 0; margin-bottom: 0.6rem; font-size: 1.05rem; font-weight: 600; }

/* auto-FIT, not auto-fill: every group happens to offer five choices, and with
   auto-fill the sixth empty track pushed the fifth tile onto a row of its own. */
.grid {
  display: grid; gap: 0.75rem; margin-bottom: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

/* Each tile is a real submit button, so clicking a picture is an ordinary page
   load that carries every other answer with it. `font: inherit` because a button
   does not inherit type by default. */
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 0.6rem 0.45rem; text-align: center; cursor: pointer;
  font: inherit; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.tile:hover:not([disabled]) { border-color: var(--accent); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile .shape { display: flex; align-items: center; justify-content: center; min-height: 5.5rem; }
/* Same load-bearing background as .preview svg above: the generated SVG's own
   inline style is blocked by the Content-Security-Policy. */
.tile .shape svg { max-width: 100%; height: auto; background: var(--air); border-radius: 4px; }
/* Two indicators on purpose: the ring reads up close, the filled tile reads from
   across a shop. `aria-pressed` is also what reports the choice to a screen
   reader, so the state is announced as well as drawn. */
.tile[aria-pressed="true"] { border: 2px solid var(--accent); background: #fff7ed; padding: 0.55rem 0.4rem; }
.tile[aria-pressed="true"] .shape { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile .name { font-weight: 600; font-size: 0.95rem; }
.tile .note { font-size: 0.8rem; line-height: 1.3; color: #6b6259; }
/* What an upload already holds, said on the layout's tile (row 1.147 slice 1d-u). */
.tile .note.held { font-weight: 600; color: #3f3a35; }
/* An upload's own picture in a rough: its white ground reads as the sketch's
   air, not a pasted box (1d-u drive). */
.roughs svg image { mix-blend-mode: multiply; }
.tile.unavailable, .tile[disabled] { opacity: 0.55; cursor: not-allowed; }
/* Said when the picture had to leave something out to be drawn at all. */
.tile .caveat { display: block; font-style: normal; opacity: 0.85; }

.redraw { margin: 0 0 1.5rem; }

.problem {
  background: #fff; border-left: 3px solid var(--warn); border-radius: 0 6px 6px 0;
  padding: 0.85rem 1rem; margin: 0 0 1.5rem;
}
.problem .what { margin: 0 0 0.35rem; font-weight: 600; color: var(--warn); }
.problem .todo { margin: 0; }

.reviewb { margin: 0 0 1.75rem; }
.reviewb h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
/* §3.1 asks for the dimensions in large type, so this is the biggest thing on
   the page after the drawing itself. */
.bigsize { margin: 0.6rem 0 0.3rem; font-size: 2rem; font-weight: 700; text-align: center; }
.reviewb .echo { margin: 0 0 0.5rem; text-align: center; }
.details {
  display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem;
  margin: 1rem 0 0; font-size: 0.95rem;
}
.details dt { color: #6b6259; }
.details dd { margin: 0; }

.nav { flex-wrap: wrap; }
.nav .reason { flex-basis: 100%; margin: 0.5rem 0 0; font-size: 0.95rem; color: #6b6259; }

/* Step 2 — the material step. A stated fact (the one cutting setup) reads like an
   answer; a rule the engine could not resolve is marked, not merely worded. */
.ask .label { display: block; font-weight: 600; margin: 0 0 0.3rem; }
.ask .stated { margin: 0; font-size: 1.15rem; }
.ask select { min-width: 14rem; min-height: 3rem; background: #fff; }
.ask.bad select { border: 2px solid var(--warn); }
.rules { margin: 0 0 1.75rem; }
.rules h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.rule.missing { color: #6b6259; }
.rule.invalid { color: var(--warn); font-weight: 600; }
.rule .note { display: block; }

/* Item 1.100 — step 6's repair proposal: the part before and after, side by side.
   The figures reuse .preview so the generated SVG gets the same load-bearing
   background rule (the Content-Security-Policy blocks its inline style). */
.repair {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem; margin: 0 0 1.5rem; background: #fff;
}
.repair.applied { border-color: var(--accent); }
/* The verdict in a sentence (step 6, item 1.96). Empty until one arrives, and
   an empty slot takes no room: no sentence must look like no slot. */
.narration {
  border-left: 3px solid var(--accent); background: #fff;
  padding: 0.75rem 1rem; margin: 0 0 1.5rem;
}
/* ⚠️ Not `display: none`: this is a live region, and one that is hidden when
   the words arrive is not announced by a screen reader. Empty, it is given no
   box of its own instead. */
.narration:empty { padding: 0; margin: 0; border: 0; background: none; }
.narration-text { margin: 0 0 0.4rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.narration .note { margin: 0; }
.repair h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.compare {
  display: grid; gap: 1rem; margin: 0 0 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.compare figure { margin: 0; }
/* Item 1.13 second half: a third picture in the compare (the upload beside the
   AI's picture as traced) — and the prepared picture is 4x the upload, so each
   fits its column rather than widening the page. */
.compare img { display: block; max-width: 100%; height: auto; }
.changes { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.choose .button { margin: 0 0.5rem 0.5rem 0; }

/* Item 1.98 — step 7's one question: is this the part you wanted? */
.decision {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem; margin: 0 0 1.5rem; background: #fff;
}
.decision h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.decision .recorded { margin: 0 0 0.75rem; }
.decision label { display: block; margin: 0 0 0.3rem; }
.decision textarea { width: 100%; max-width: 32rem; margin: 0 0 0.75rem; font: inherit; }
.describe textarea { display: block; width: 100%; max-width: 40rem; margin: 0.3rem 0 0.75rem; font: inherit; }
.decision .choices { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Item 1.13 — a job from an uploaded picture: the artwork screen and its pages. */
.picture-frame { position: relative; display: inline-block; max-width: 100%; margin: 0 0 1rem; }
.picture-frame img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }
.picture-frame.drawing { cursor: crosshair; touch-action: none; }
.box-overlay {
  position: absolute; box-sizing: border-box; pointer-events: none;
  border: 2px solid var(--accent); color: var(--accent);
  font-size: 0.8rem; font-weight: 700; padding: 0 0.2rem;
}
.box-overlay.box-erase { border-style: dashed; }
/* Row 1.124 — the AI's reading drawn on the size-and-metal screen: an SVG over
   the picture, scaled with it by its viewBox, no script. */
.picture-frame svg.regions { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.picture-frame svg.regions rect { fill: none; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.picture-frame svg.regions .region-words { stroke: #0070d6; fill: rgba(0, 112, 214, 0.12); }
.picture-frame svg.regions .region-artwork { stroke: var(--accent); stroke-dasharray: 6 4; }
.reading { border-left: 4px solid #0070d6; padding: 0.25rem 1rem; margin: 0 0 1rem; background: #eef5ff; }
.reading h2 { margin-top: 0.5rem; }
.box-overlay.box-none { border-color: #6b6259; color: #6b6259; border-style: dotted; }
.box-row.needs-kind select { outline: 3px solid var(--accent); }
.box-overlay.box-measure { border-style: dotted; }
.boxes { border-collapse: collapse; margin: 0 0 1.5rem; }
.boxes th, .boxes td { padding: 0.2rem 0.4rem; text-align: left; font-size: 0.95rem; }
.boxes input { font: inherit; }
/* ⚠️ A button of its own, never `.link`: that is the header's light-on-dark
   style, and on this page it drew the word in the page's own colour — a button
   nobody could see (found on Cary's walk, item 1.13). */
.draw-box { min-height: 0; padding: 0.2rem 0.7rem; line-height: 1.4; font-size: 0.9rem; }
.box-row.armed { background: #fff; outline: 2px solid var(--accent); }
.box-row.armed .draw-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.boxes select { font: inherit; max-width: 13rem; }
/* Item 1.13 — the outline step's fork: two ways to describe the part, take one. */
.fork {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.75rem; align-items: stretch;
  margin: 0 0 1.25rem;
}
.fork .way {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 0.9rem 1rem;
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); text-decoration: none;
}
.fork .way:hover, .fork .way:focus { border-color: var(--accent); }
.fork .way .go { margin-top: auto; font-weight: 600; color: var(--accent); }
.fork .or { align-self: center; font-weight: 700; color: #6b6259; }
@media (max-width: 40rem) { .fork { grid-template-columns: 1fr; } .fork .or { justify-self: center; } }
.pointer-at { margin: -0.6rem 0 1rem; font-size: 0.95rem; color: #6b6259; min-height: 1.4em; }
.problems {
  border: 2px solid var(--accent); border-radius: 10px; background: #fff;
  padding: 0.75rem 1rem; margin: 0 0 1.5rem;
}
.problems h2 { margin: 0 0 0.4rem; font-size: 1.05rem; color: var(--accent); }
.problems ul { margin: 0; padding-left: 1.2rem; }
.look:has(input:checked) img { outline: 4px solid var(--accent); }
.boxes input[readonly] { background: transparent; border-color: transparent; }
/* A grid, not a wrapping row: four looks (a picture in three tones) sit two
   by two instead of one under another (seen at the drive, item 1.13 second half). */
.looks {
  display: grid; gap: 1rem; margin: 0 0 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.look { display: block; max-width: 22rem; cursor: pointer; }
.look img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); margin: 0.3rem 0; }
/* Item 1.13 second half — the AI redraw: the words box, and the pictures to trace from. */
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.words label { display: block; }
.words textarea { display: block; width: 100%; max-width: 40rem; margin: 0.3rem 0 0; font: inherit; }
.candidates .look { max-width: 18rem; }
.lines {
  white-space: pre-wrap; overflow-wrap: anywhere; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.9rem;
}
.files { margin: 0 0 1.5rem; padding-left: 1.2rem; }
.files li:first-child { list-style: none; margin-left: -1.2rem; }
img.preview { max-width: 100%; height: auto; border: 1px solid var(--line); }
/* A tall picture capped at about half the screen, so the one button under it
   is in view with it (the Chrome survey of 2026-10-11: *Approve the part*,
   *Check this shape* and the DXF link all sat below a picture taller than the
   screen). *See it large* opens the full picture where one exists. */
img.preview, figure.picture img, .picture-frame img, .reviewb figure.preview svg { max-height: 55vh; width: auto; }
.picture-frame { max-height: 55vh; }
form.inline { display: inline; }

/* Item 1.128 slice A — the redesigned job screens (spec §3.1 `Wizard as
   redesigned`, §3.2 `Screen rules`). */
.back { display: inline-block; margin: 0 0 1rem; font-size: 0.95rem; text-decoration: none; }
.back:hover, .back:focus-visible { text-decoration: underline; }
figure.picture { margin: 0 0 1.5rem; }
figure.picture img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }
figure.picture figcaption { font-size: 0.95rem; color: #6b6259; margin-top: 0.3rem; }
.ask .error { display: block; color: var(--accent); font-weight: 600; margin: 0 0 0.3rem; }
.ask.bad { border-left: 4px solid var(--accent); padding-left: 0.75rem; }
.act { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.5rem 0; }
.act .reason { flex-basis: 100%; margin: 0; font-size: 0.95rem; color: #6b6259; }
.verdict { font-size: 1.05rem; margin: 0 0 1.5rem; }
.repair .added { color: #e67e00; font-weight: 600; }
.repair .removed { color: #0070d6; font-weight: 600; }
.compare .removed { color: #0070d6; font-weight: 600; }
.compare .missed { color: #c8102e; font-weight: 600; }
.repair .button { margin: 0.5rem 0.5rem 0.5rem 0; }
.details-fold { margin: 0 0 1.5rem; }
.details-fold summary { cursor: pointer; font-weight: 600; margin: 0 0 0.5rem; }
.nav.more { margin-top: 1.5rem; }
.marker {
  position: absolute; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: #0070d6; color: #fff; font-weight: 700; font-size: 0.85rem;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #0070d6; pointer-events: none;
}
.box-overlay.box-proposed { border-color: #0070d6; color: #0070d6; }
.box-row.proposed { background: #eef5ff; }
.tag {
  display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.4rem; border-radius: 6px;
  background: #0070d6; color: #fff; font-size: 0.75rem; white-space: nowrap;
}
.words-section, .redraw-section { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.questions li { margin: 0 0 0.5rem; }
.questions label { margin-left: 0.5rem; }
.proposal-route { border-left: 4px solid #0070d6; padding-left: 0.75rem; }
.candidates .tile form { margin: 0.3rem 0 0; }
.candidates .tile figcaption { font-size: 0.95rem; }

/* Screen 1's tiles are links (item 1.128 slice B): a tile, not underlined
   text, and big enough to press on a phone. */
.grid.start { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 1.75rem; }
.grid.start .tile { text-decoration: none; padding: 1.1rem 0.8rem; }
.grid.start .tile .name { font-size: 1.05rem; }
/* A cut chart's page names are long: the picker wraps to the page, never
   pushes it sideways on a phone (slice B's walk). */
#material select { max-width: 100%; }
/* The picked picture on screen 2: whole, but never so tall that the name box
   and the button fall below the fold (slice B's walk). */
#upload-preview img { max-height: 45vh; width: auto; max-width: 100%; }

/* The words screen (row 1.110). */
.word-block { border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 1rem; margin: 0 0 1rem; }
.word-block legend { font-weight: 600; padding: 0 0.3rem; }
.word-block textarea { width: 100%; max-width: 32rem; font-size: 1.1rem; display: block; }
.faces .look { max-width: 15rem; }
.faces .look img { background: var(--air); }
.where-grid { display: grid; grid-template-columns: repeat(3, 2.4rem); grid-template-rows: repeat(3, 1.8rem); gap: 0.25rem; border: 1px solid var(--line); padding: 0.4rem; width: max-content; background: var(--air); }
.where-grid label { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nudge { margin: 0.5rem 0; }
.nudge input { max-width: 8rem; }
[hidden] { display: none !important; }

/* The holders for words that do not sit on the metal (row 1.111): a pick among
   pictures, so each tile is a label around a radio — the radio is read by a
   screen reader and the tile is drawn pressed when it is checked; the one
   button under them does the work. No script. */
.holders .grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.tile.pick { position: relative; align-items: stretch; text-align: left; }
.tile.pick > input[type="radio"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* A link on a tile (See it large) sits ABOVE the stretched radio, or the radio
   takes its click and nothing opens (Cary's walk, 1.144 slice 2a). */
.tile.pick a { position: relative; z-index: 1; }
.tile.pick img { width: 100%; height: auto; background: var(--air); border-radius: 4px; }
/* The layouts' rough sketches (row 1.147 slice 1c): inline SVG, drawn as the
   pictures are, with the same load-bearing background (the CSP blocks the
   SVG's own style). */
.tile.pick svg { width: 100%; height: auto; background: var(--air); border-radius: 4px; }
.roughs .grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.roughs.grounds .grid { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
.tile.pick:has(> input:checked) { border: 2px solid var(--accent); background: #fff7ed; padding: 0.55rem 0.4rem; }
.tile.pick:has(> input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
/* A layout's kinds — its ground, its border's shape — sit ON its tile and show
   while it is picked: beside what they act on (Cary's walk of 1d-u, job 145:
   a fold under the grid, "no one would ever know"). Above the stretched radio,
   as a link is; the tile's own picked state reads its OWN radio (`>`), never
   a kind's, which is always checked. */
.tile.pick .kinds { display: none; position: relative; z-index: 1; border: 0; padding: 0; margin: 0.45rem 0 0; }
.tile.pick:has(> input:checked) .kinds { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tile.pick .kinds legend { padding: 0; margin-bottom: 0.3rem; font-size: 0.8rem; font-weight: 600; }
.tile.pick .kinds .kind { position: relative; display: flex; flex-direction: column; align-items: center; width: calc(33.3% - 0.35rem); font-size: 0.72rem; cursor: pointer; }
.tile.pick .kinds .kind input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tile.pick .kinds .kind:has(input:checked) svg { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile.pick .kinds .kind:has(input:focus-visible) svg { outline: 3px solid var(--accent); outline-offset: 2px; }
/* The parts beside the layout (row 1.147 1d-w; Harness as ruled D3): rows of
   word chips on the picked tile, under its kinds, shown while it is picked;
   above the stretched radio as the kinds are. The tile's rough holds a layer
   per part value (`roughs.LAYER_CLASS`), hidden here and shown when the
   tile's own chip for it is checked — every value of `parts.CHOICES` has its
   rule below (a test holds the two lists together). */
.tile.pick .parts, .tile.pick .parts-none { display: none; position: relative; z-index: 1; }
.tile.pick:has(> input:checked) .parts { display: block; border: 0; padding: 0; margin: 0.55rem 0 0; }
.tile.pick:has(> input:checked) .parts-none { display: block; }
.tile.pick .parts > legend { padding: 0; font-size: 0.8rem; font-weight: 600; }
.tile.pick .parts .part { border: 0; padding: 0; margin: 0.35rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tile.pick .parts .part legend { padding: 0; margin-bottom: 0.2rem; font-size: 0.75rem; color: #4b5563; }
.tile.pick .parts .chip { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; border: 1px solid #d6d3d1; border-radius: 999px; padding: 0.1rem 0.5rem; background: #fff; cursor: pointer; }
.tile.pick .parts .chip:has(input:checked) { border-color: var(--accent); background: #ffedd5; font-weight: 600; }
.tile.pick .parts .chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile.pick .parts .chip input { margin: 0; }
.tile.pick .parts .from-words { font-size: 0.68rem; color: #9a3412; }
.tile.pick > svg [class^="pl-"] { display: none; }
.tile.pick > svg .pl-border-outline { display: inline; }
.tile.pick:has(.parts input[name$="-border"]:checked:not([value="outline"]):not([value="ai"])) > svg .pl-border-outline { display: none; }
.tile.pick:has(.parts input[name$="-border"][value="rectangle"]:checked) > svg .pl-border-rectangle,
.tile.pick:has(.parts input[name$="-border"][value="oval"]:checked) > svg .pl-border-oval,
.tile.pick:has(.parts input[name$="-border"][value="circle"]:checked) > svg .pl-border-circle,
.tile.pick:has(.parts input[name$="-border"][value="arch"]:checked) > svg .pl-border-arch,
.tile.pick:has(.parts input[name$="-ground"][value="grass"]:checked) > svg .pl-ground-grass,
.tile.pick:has(.parts input[name$="-ground"][value="hills"]:checked) > svg .pl-ground-hills,
.tile.pick:has(.parts input[name$="-ground"][value="rocks"]:checked) > svg .pl-ground-rocks,
.tile.pick:has(.parts input[name$="-ground"][value="desert"]:checked) > svg .pl-ground-desert,
.tile.pick:has(.parts input[name$="-ground"][value="plain"]:checked) > svg .pl-ground-plain,
.tile.pick:has(.parts input[name$="-backdrop"][value="wanted"]:checked) > svg .pl-backdrop-wanted { display: inline; }
/* A kind layout's own sketch draws every kind; the one picked is shown (Cary's walk of 1d-w). */
.tile.pick > svg [class^="pk-"] { display: none; }
.tile.pick:has(.kinds input[value="rectangle"]:checked) > svg .pk-rectangle,
.tile.pick:has(.kinds input[value="oval"]:checked) > svg .pk-oval,
.tile.pick:has(.kinds input[value="circle"]:checked) > svg .pk-circle,
.tile.pick:has(.kinds input[value="arch"]:checked) > svg .pk-arch,
.tile.pick:has(.kinds input[value="grass"]:checked) > svg .pk-grass,
.tile.pick:has(.kinds input[value="hills"]:checked) > svg .pk-hills,
.tile.pick:has(.kinds input[value="rocks"]:checked) > svg .pk-rocks,
.tile.pick:has(.kinds input[value="desert"]:checked) > svg .pk-desert,
.tile.pick:has(.kinds input[value="plain"]:checked) > svg .pk-plain,
.tile.pick:has(.kinds input[value="positive"]:checked) > svg .pk-positive,
.tile.pick:has(.kinds input[value="art-metal"]:checked) > svg .pk-art-metal,
.tile.pick:has(.kinds input[value="negative"]:checked) > svg .pk-negative,
.tile.pick:has(.kinds input[value="name-metal"]:checked) > svg .pk-name-metal { display: inline; }
.tile.pick .badge { align-self: flex-start; font-size: 0.75rem; font-weight: 600; color: #9a3412; background: #ffedd5; border-radius: 999px; padding: 0.1rem 0.5rem; }
.tile.pick .warn { font-size: 0.8rem; color: #6b6259; }
.holders .declined { font-size: 0.9rem; color: #6b6259; margin-top: 0.75rem; }
.holders .added { color: #e67e00; font-weight: 600; }
.holders .removed { color: #0070d6; font-weight: 600; }
/* Row 1.147: the ground row under the compositions — smaller tiles, one per
   ground — and the fold of sizes and the words' place, closed by default. */
.holders .grounds .grid { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.holders details.adjust { margin: 0 0 1.25rem; }
.holders details.adjust summary { cursor: pointer; font-weight: 600; }
.holders .adjust-group { border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.9rem; margin: 0.75rem 0; }
.holders .adjust-group legend { padding: 0 0.3rem; font-weight: 600; }
.holders .adjust-group .ask { margin: 0.4rem 0; }
.holders .adjust-group label { margin-right: 0.8rem; }
.holders .adjust-group input[type="text"] { max-width: 10rem; }

/* --- recent jobs on screen 1 (row 1.128 slice C2 (4)) --------------------- */
.recent { margin-top: 2rem; }
.recent-jobs { list-style: none; margin: 0; padding: 0; }
.recent-jobs li + li { border-top: 1px solid var(--line); }
.recent-jobs a {
  display: grid; grid-template-columns: 3.5rem 1fr auto; gap: 0.25rem 0.75rem;
  align-items: center; padding: 0.5rem 0; color: inherit; text-decoration: none;
}
.recent-jobs img, .recent-jobs .no-picture {
  grid-row: span 2; width: 3.5rem; height: 3.5rem; object-fit: contain;
  border: 1px solid var(--line); background: #fff;
}
.recent-jobs .main { font-weight: 600; }
.recent-jobs .name { text-decoration: underline; }
.recent-jobs .status { font-weight: 400; margin-left: 0.5rem; }
.recent-jobs .more { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 0.75rem; font-size: 0.85rem; color: #6b6259; }
@media (max-width: 40rem) {
  .recent-jobs a { grid-template-columns: 3.5rem 1fr; }
  .recent-jobs .when { display: none; }
}
/* The machine setup beside its button (row 1.128 slice C2 (1)). */
.setup { margin: 1rem 0 0.5rem; }
.setup h2 { font-size: 1rem; margin: 0 0 0.25rem; }
.setup .summary { margin: 0; }
.setup .summary .row { display: flex; gap: 0.75rem; }
.setup .summary dt { min-width: 7rem; color: #6b6259; }
.setup .summary dd { margin: 0; }
.setup .summary .was { font-size: 0.85rem; color: #6b6259; margin-left: 0.4rem; }
.setup .change { margin: 0.25rem 0 0; font-size: 0.9rem; }

/* The drafts being checked (row 1.148 S1; Cary's walk: "this screen needs a
   very visible indicator saying it is running"): a banner held at the top of
   the window with a moving bar, and the tile being checked ringed. */
.measuring-banner {
  position: sticky; top: 0; z-index: 10; margin: 0 0 1rem;
  background: var(--accent); color: #fff; border-radius: 10px;
  padding: 0.75rem 1rem 0.9rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.measuring-banner strong { font-size: 1.1rem; }
.measuring-banner .bar { position: relative; height: 6px; margin-top: 0.55rem; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, 0.35); }
.measuring-banner .bar::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 35%; border-radius: 3px; background: #fff;
  animation: measuring-slide 1.4s ease-in-out infinite;
}
@keyframes measuring-slide { from { left: -35%; } to { left: 100%; } }
.look.tile.checking { outline: 4px solid var(--accent); outline-offset: 2px; }
.look.tile.checking .now { color: var(--accent); font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .measuring-banner .bar::after { animation: none; left: 0; width: 100%; opacity: 0.6; }
}

/* The scrap question (row 1.148 S3): the drawing beside the tick list; a
   ticked piece fades; a dashed ring is a piece the guard holds. */
.scraps-board { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
@media (max-width: 720px) { .scraps-board { grid-template-columns: 1fr; } }
.scraps-drawing-box { margin: 0; }
.scraps-drawing-box svg, .scraps-drawing-box img { width: 100%; height: auto; background: var(--air); border-radius: 6px; display: block; }
.scraps-drawing-box figcaption { font-size: 0.8rem; color: #6b6259; margin-top: 0.4rem; }
.scraps-drawing .metal, .scraps-drawing .scrap { fill: #4a4540; stroke: none; }
.scraps-drawing .scrap.ghost { fill: #d9d4cf; opacity: 0.5; }
.scraps-drawing .scrap.lit { fill: var(--accent); }
.scraps-drawing .ring { fill: none; stroke: #dc0000; stroke-width: 1.5px; }
.scraps-drawing .ring.guarded { stroke: #b36b00; stroke-dasharray: 4 3; }
.scraps-drawing .num { fill: #dc0000; font-family: system-ui, sans-serif; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 0.3em; stroke-linejoin: round; }
.scraps-list { border: 0; padding: 0; margin: 0; }
.scraps-list legend { font-weight: 600; margin-bottom: 0.4rem; }
.scraps-list ul { list-style: none; margin: 0; padding: 0; max-height: 30rem; overflow: auto; border: 1px solid #e6e0da; border-radius: 6px; }
.scraps-list li { padding: 0.35rem 0.6rem; border-bottom: 1px solid #efeae4; font-size: 0.9rem; }
.scraps-list li:last-child { border-bottom: 0; }
.scraps-list label { display: flex; gap: 0.5rem; align-items: baseline; cursor: pointer; }
.scraps-list .warn { color: #b36b00; font-style: normal; }

/* The structural ask, one piece at a time (row 1.148 S3-b): the numbered
   picture sized to the card, the other ways and the paid ways set apart. */
.repair.trouble .trouble-picture { margin: 0 0 1rem; max-width: 640px; }
.repair.trouble .trouble-picture img { width: 100%; height: auto; background: var(--air); border-radius: 6px; display: block; }
.trouble-ways { margin: 1rem 0; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 6px; }
.trouble-ways legend { font-weight: 600; padding: 0 0.25rem; }
.trouble-ways label.pick { display: block; margin: 0.25rem 0 0.75rem; }
.trouble-ways .words-box { display: block; margin: 0.5rem 0; }
.trouble-ways .words-box textarea { display: block; width: 100%; max-width: 640px; margin-top: 0.25rem; }
.trouble-ways .paid { margin: 0.75rem 0 0; }
.trouble-ways .paid .button { margin: 0 0.5rem 0.5rem 0; }
.held-fixes { margin: 0.5rem 0; padding-left: 1.25rem; }
.trouble-ways .paid .reason { display: block; margin-top: 0.25rem; }

/* --- shop setup: the shop's steel (row 1.148 slice (4)) ------------------ */
.bar .setup-link { margin-left: auto; color: var(--air); font-size: 0.95rem; }
.bar .setup-link + .who { margin-left: 0; }
.steel-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 1rem 1.1rem; margin: 0 0 1.25rem; }
.steel-card h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.steel-card .facts { margin-bottom: 0.4rem; }
.steel-card .facts dd { margin-bottom: 0.3rem; }
.steel-card > .note { margin: 0 0 1rem; }
fieldset.steel-choice { border: 0; padding: 0; margin: 0 0 1.25rem; }
fieldset.steel-choice legend { padding: 0; margin-bottom: 0.5rem; font-weight: 600; }
.steel-option { display: grid; grid-template-columns: auto 1fr; column-gap: 0.6rem; align-items: baseline; padding: 0.45rem 0; cursor: pointer; }
.steel-option input { grid-row: span 2; margin: 0; }
.steel-option .name { font-weight: 600; }
.steel-option .hint { grid-column: 2; margin: 0; font-size: 0.9rem; color: #6b6259; }
.saved { color: #166534; font-weight: 600; }

/* The bench (row 1.150): the staff's page per job. */
.bar .bench-link { margin-left: 0.9rem; }
.bar .bench-link + .who { margin-left: 0; }
.bench .figures { font-variant-numeric: tabular-nums; }
.bench-tool .does { margin: 0.2rem 0 0.6rem; }
.bench-tool .runs-under { display: grid; grid-template-columns: max-content 1fr; column-gap: 0.8rem; row-gap: 0.15rem; margin: 0 0 0.6rem; font-size: 0.92rem; }
.bench-tool .runs-under dt { color: #6b6259; }
.bench-tool .runs-under dd { margin: 0; }
.bench-tool .runs-under .price { font-weight: 600; }
.bench-tool textarea, .bench-tool select { display: block; margin: 0.2rem 0 0.5rem; max-width: 36rem; width: 100%; }
