/*
 * Prooflane's shared components for the screens around the Record (dashboard, changes, orders, reading pages, Proof
 * File), in look v3 through the brand.css tokens. The Record, home and pricing are drawn by look.css.
 * Status colours come only from .sig-* classes, and always with a shape and a word.
 * Guide and snippets: docs/DESIGN.md. Gallery: /dev/gallery.
 */

/* ---------- Status context: one class sets the colours every child reads ---------- */
.sig-green, .sig-pass, .sig-likely_yes { --sig: var(--go); --sig-wash: var(--go-wash); --sig-edge: var(--go-edge); --sig-lamp: var(--go); }
.sig-amber, .sig-watch, .sig-unclear { --sig: var(--caution); --sig-wash: var(--caution-wash); --sig-edge: var(--caution-edge); --sig-lamp: var(--caution); }
.sig-red, .sig-fail, .sig-likely_no { --sig: var(--stop); --sig-wash: var(--stop-wash); --sig-edge: var(--stop-edge); --sig-lamp: var(--stop); }
.sig-unknown, .sig-none { --sig: var(--unknown); --sig-wash: var(--unknown-wash); --sig-edge: var(--unknown-edge); --sig-lamp: var(--unknown); }

/* ---------- Mark: the shape that goes with every status (never colour alone) ---------- */
.mark { display: inline-block; width: 1.4rem; height: 1.4rem; flex: none; color: var(--sig); vertical-align: -0.28em; }
.mark svg { display: block; width: 100%; height: 100%; }
.mark--lg { width: 2.25rem; height: 2.25rem; }
.mark--sm { width: 1.1rem; height: 1.1rem; vertical-align: -0.15em; }
.status-word { font-weight: 700; color: var(--sig); }

/* ---------- A number or a price is plain bold text. (The macro names are older than the look.) ---------- */
.led { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.led-price { display: inline-flex; align-items: baseline; gap: 0.35em; font-size: var(--step-2); font-weight: 700; white-space: nowrap; }
.led-price__unit { font-size: 1rem; font-weight: 400; color: var(--ink-2); }

/* ---------- The status icon for a whole record: the same mark, larger. One icon, with its word beside it ---------- */
.light { --lamp: 1.5rem; display: inline-flex; flex: none; vertical-align: middle; color: var(--sig, var(--unknown)); }
.light svg { display: block; width: var(--lamp); height: var(--lamp); }
.light--xl { --lamp: 3rem; }
.light--lg { --lamp: 2.5rem; }
.light--md { --lamp: 1.6rem; }
.light--sm { --lamp: 1.15rem; }

/* A status icon with its word, for lists and tables */
.signal-chip { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; color: var(--sig); white-space: nowrap; }

/* ---------- Status pill: the short status word on its tint ---------- */
.stamp {
  display: inline-flex; align-items: center; gap: 0.4rem; background: var(--sig-wash); color: var(--sig);
  border: 1px solid var(--sig-edge); border-radius: 999px; padding: 0.3rem 0.8rem; font-weight: 700; font-size: 1rem; line-height: 1.2;
}
.stamp--lg { font-size: 1.125rem; padding: 0.4rem 0.95rem; }

/* ---------- Sheet: one white card that holds a document (a Record's detail, a Proof File, a guide) ---------- */
.desk { padding: var(--s-4) 0 var(--s-6); }
@media (min-width: 48rem) { .desk { padding: var(--s-6) var(--gutter) var(--s-7); } }
.sheet { background: var(--paper); color: var(--ink); max-width: 46rem; margin: 0 auto; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); position: relative; }
@media (min-width: 48rem) { .sheet { border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); } }
.sheet__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem var(--s-4);
  padding: var(--s-4) var(--gutter) var(--s-3); border-bottom: 1px solid var(--rule);
}
@media (min-width: 48rem) { .sheet__head { padding: var(--s-4) var(--s-6) var(--s-3); } }
.sheet__title { margin: 0; font-weight: 700; font-size: 1rem; color: var(--ink-2); }
.sheet__meta { margin: 0; font-size: 1rem; color: var(--ink-3); }

.sheet__part { padding: var(--s-5) var(--gutter); border-bottom: 1px solid var(--rule); }
@media (min-width: 48rem) { .sheet__part { padding: var(--s-6) var(--s-6); } }
.sheet__part:last-child { border-bottom: 0; }
.part-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  font-size: var(--step-2); margin: 0 0 var(--s-2);
}
.part-title small { font-weight: 400; font-size: 1rem; color: var(--ink-3); letter-spacing: 0; }

/* ---------- The Record: who it is, the verdict, what brokers see, one next step. The long detail folds away ---------- */
.record__top { max-width: 44rem; padding-top: var(--s-4); padding-bottom: var(--s-5); display: grid; gap: var(--s-4); }
@media (min-width: 48rem) { .record__top { padding-top: var(--s-6); gap: var(--s-5); } }
.record__top > .alert { margin: 0; }
.record__id { display: grid; gap: var(--s-2); justify-items: start; }
.record__title { font-size: var(--step-2); margin: var(--s-2) 0 var(--s-3); }
.record__lead { color: var(--ink-2); margin: 0 0 var(--s-3); }
.record__next .sign { max-width: 30rem; }
.record__meta { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ink-3); }

.record-page .sheet { max-width: 44rem; }
/* The sheet meets the footer: on a phone both are edge-to-edge white, so no empty band of desk between them. */
@media (max-width: 47.99rem) { .record-page .desk { padding-bottom: 0; } .record-page .sheet { border-bottom: 0; } }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 48px; list-style: none; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; flex: none; width: 0.65rem; height: 0.65rem; border-right: 2.5px solid var(--ink-2); border-bottom: 2.5px solid var(--ink-2); transform: rotate(45deg); margin-right: 0.4rem; }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold > summary .part-title { margin: 0; font-size: var(--step-1); }
.fold[open] > summary { margin-bottom: var(--s-4); }
.claimed { margin: 0; color: var(--ink-2); }

.violation dl > div + div { margin-top: 0.35rem; }

.notice__title { margin: 0; }
.notice__body { margin: 0.25rem 0 0; }

/* ---------- Way back: one link above the heading, an arrow pointing back (never a label over the heading) ---------- */
.back { margin: 0 0 var(--s-2); }
.back a {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; font-weight: 700; color: var(--ink-2);
  text-decoration: none;
}
.back a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.back svg { width: 1rem; height: 1rem; transform: scaleX(-1); flex: none; }
.sheet__part > .back:first-child, .paper-page__inner > .back:first-child { margin-top: calc(var(--s-3) * -1); }

/* ---------- Go links: places to go from here, ruled rows with an arrow ---------- */
.go-links { list-style: none; margin: 0 0 var(--s-4); padding: 0; border-top: 1px solid var(--rule); max-width: var(--measure); }
.go-links li { border-bottom: 1px solid var(--rule); }
.go-links a { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 52px; padding: var(--s-2) var(--s-1);
  color: var(--ink); text-decoration: none; font-weight: 700; }
.go-links a:hover { background: var(--paper-2); color: var(--ink); }
.go-links a:hover .go-links__label { text-decoration: underline; text-underline-offset: 0.2em; }
.go-links__text { display: grid; gap: 0.1rem; }
.go-links__note { font-weight: 400; color: var(--ink-2); font-size: 1rem; }
.go-links svg { width: 1.15rem; height: 1.15rem; flex: none; color: var(--ink-2); }

/* Where a form is sent: one ruled line, then the action and what happens next. */
.form-go { border-top: 1px solid var(--rule); padding-top: var(--s-4); margin-top: var(--s-6); max-width: var(--measure); }
.form-go > p { margin-bottom: var(--s-3); }
.form-go > p:last-child { margin-bottom: 0; }
@media (max-width: 33.99rem) { .form-go .button-large { width: 100%; } }

/* ---------- A link standing on its own line is a 44px target (the text keeps its place). ---------- */
.link-line a, .rate dt a, .growth-toc a, .watch-tags a {
  display: inline-block; padding-top: 0.6rem; padding-bottom: 0.6rem; margin-top: -0.6rem; margin-bottom: -0.6rem;
}
.link-line { margin-top: var(--s-3); }
/* A contents line that wraps keeps its number beside its first line. */
.growth-toc a { display: block; }
/* A change on a watched record opens from anywhere on its row. */
.timeline .tl-item:has(.tl-title > a:only-child) { cursor: pointer; }
.tl-item .tl-title > a:only-child::after { content: ""; position: absolute; inset: -0.4rem 0; }
.tl-item .tl-title > a:only-child:focus-visible { outline: none; }
.tl-item .tl-title > a:only-child:focus-visible::after { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 2px; }

/* ---------- Fine print: the plain-words notice a page must carry, quiet but always shown ---------- */
.fine-print { max-width: var(--measure); margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); background: var(--paper-2);
  border-radius: var(--radius-small); color: var(--ink-2); font-size: var(--step--1); line-height: 1.5; }
.fine-print > :last-child { margin-bottom: 0; }

/* ---------- Example label: every made-up carrier says so wherever it shows ---------- */
.specimen { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.3rem 0.75rem; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--rule); color: var(--ink-2); font-size: 1rem; line-height: 1.3; }
.specimen__tag { font-weight: 700; color: var(--ink); }
.specimen--inline { padding: 0.15rem 0.6rem; vertical-align: middle; }
/* The full sentence can run to two lines on a phone, where a pill's round ends made it look like a field. */
.specimen:not(.specimen--inline) { border-radius: 14px; }

/* ---------- The carrier: its name, where it is, its numbers ---------- */
.plate { margin: 0; }
.plate__name { margin: 0; font-weight: 700; font-size: var(--step-2); line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.plate__dba { margin: 0.15rem 0 0; color: var(--ink-2); font-size: 1rem; }
.plate__place { margin: 0.15rem 0 0; color: var(--ink-2); }
.plate__ids { display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; align-items: baseline; margin: 0.15rem 0 0; color: var(--ink-2); }
.usdot { display: inline-flex; align-items: baseline; gap: 0.35em; font-variant-numeric: tabular-nums; }
.usdot__label { font-weight: 400; }
.usdot .num { font-family: var(--font-sans); font-weight: 600; color: var(--ink); }
.usdot--lg { font-size: var(--step-1); }
.docket { color: var(--ink-2); }

/* ---------- The verdict: one plain sentence with its status colour, and the one reason why ---------- */
.answer { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--radius); background: var(--sig-wash); border: 1.5px solid var(--sig-edge); }
.answer__verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: start; margin: 0; }
.answer__light { margin-top: 0.1rem; }
.answer__headline:focus { outline: none; }
.answer__headline { margin: 0; font-size: var(--step-3); line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
.answer__reason { margin: 0; font-size: var(--step-1); line-height: 1.4; color: var(--ink); }
.answer__reason strong { font-weight: 700; }
.answer__note { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--ink-2); }

.read-line { margin: 0; font-size: 1rem; color: var(--ink-3); }
.read-line a { color: inherit; }

/* ---------- The one next step: a blue button that says what it is and what it costs ---------- */
.sign {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.1rem var(--s-3);
  min-height: 60px; padding: 0.8rem 1.25rem; border-radius: 20px;
  background: var(--action); color: #fff; text-decoration: none; transition: background-color 120ms;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 14%), 0 6px 16px rgb(22 96 224 / 24%);
}
a.sign:hover { background: var(--action-strong); color: #fff; }
.sign:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
.sign__tab { grid-column: 1; font-size: 1rem; font-weight: 400; }
.sign__title { grid-column: 1; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.sign__cost { grid-column: 1; font-size: 1rem; font-weight: 400; }
.sign__arrow { grid-row: 1 / span 3; grid-column: 2; width: 1.5rem; height: 1.5rem; }
.sign--paper { background: var(--paper); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
a.sign--paper:hover { background: var(--brand-soft); color: var(--brand-strong); }

/* ---------- What brokers see: a short checklist. A problem carries its one "Fix this" ---------- */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.check { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-4); }
.check.sig-fail, .check.sig-watch { border-color: var(--sig-edge); }
.check__top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.15rem 0.7rem; align-items: start; }
.check__top > .mark { grid-row: span 2; margin-top: 0.15rem; }
/* The title wraps in its own column, so the status word always sits at the right of its first line. */
.check__title { font-family: var(--font-sans); font-size: 1rem; font-weight: 400; color: var(--ink-2); margin: 0; letter-spacing: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s-3); align-items: baseline; }
.check__word { grid-area: 1 / 2; font-weight: 700; color: var(--sig); text-align: right; }
.check__headline { font-weight: 700; font-size: var(--step-0); line-height: 1.35; margin: 0; }
.check__detail { margin: 0.5rem 0 0; color: var(--ink-2); }
.check__fix { margin: var(--s-3) 0 0; padding-top: var(--s-3); border-top: 1px solid var(--rule); display: grid; gap: 0.5rem; }
.check__does { margin: 0; color: var(--ink-2); }
.check__fix .button { justify-content: space-between; text-align: left; width: 100%; }
.check__cta { display: block; font-size: 1.2rem; font-weight: 700; }
.check__fix .cost { display: block; font-weight: 400; font-size: 1rem; line-height: 1.35; }
.check__free { margin: 0; font-weight: 600; }
.check__why { margin: 0.6rem 0 0; color: var(--ink-2); }
.check__diy { margin: 0; font-size: 1rem; }
.check__diy a { display: inline-flex; align-items: center; min-height: 44px; }
.check__more { margin: var(--s-3) 0 0; }
.check__more > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-size: 1rem; text-decoration: underline; text-underline-offset: 0.18em; list-style: none; }
.check__more > summary::-webkit-details-marker { display: none; }
/* A line with nothing to fix is one row; tapping it opens the proof. */
.check--quiet { padding: 0; }
/* Not known and Good lines follow the work and ask nothing of him: lighter words, and a run of the same status joins
   into one quiet list. Every line still opens to its proof. */
.check--quiet:is(.sig-pass, .sig-unknown) .check__headline { font-weight: 400; }
.checks > .check--quiet.sig-pass + .check--quiet.sig-pass, .checks > .check--quiet.sig-unknown + .check--quiet.sig-unknown {
  margin-top: calc(-1 * var(--s-3) - 1px); border-top-left-radius: 0; border-top-right-radius: 0; }
.checks > .check--quiet.sig-pass:has(+ .check--quiet.sig-pass), .checks > .check--quiet.sig-unknown:has(+ .check--quiet.sig-unknown) {
  border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.check__fold > summary { list-style: none; cursor: pointer; padding: var(--s-3) var(--s-4); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; min-height: 56px; }
.check__fold > summary::-webkit-details-marker { display: none; }
.check__fold > summary::after { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); margin-right: 0.3rem; }
.check__fold[open] > summary::after { transform: rotate(-135deg); }
.check__fold > :not(summary) { margin-left: var(--s-4); margin-right: var(--s-4); }
.check__fold > :last-child { margin-bottom: var(--s-4); }
.check__evidence { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.check__rules { margin: 0.6rem 0 0; font-size: 1rem; line-height: 1.5; color: var(--ink-2); }

/* ---------- Fact with its source ---------- */
.fact { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.75rem; }
.fact__value { font-weight: 700; }
.src { font-size: 1rem; color: var(--ink-3); line-height: 1.45; }
.src a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.src a:hover { color: var(--ink); }

/* ---------- Ledger: label, value, source; rows on a phone ---------- */
.ledger { margin: 0; border-top: 1px solid var(--rule); }
.ledger__row { display: grid; gap: 0.1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.ledger dt { font-size: 1rem; font-weight: 700; color: var(--ink-2); }
.ledger dd { margin: 0; }
.ledger__value { font-weight: 700; }
.ledger__value .mark { margin-right: 0.3rem; }
.ledger__note { display: block; font-weight: 400; color: var(--ink-2); font-size: 1rem; margin-top: 0.1rem; }
@media (min-width: 48rem) {
  .ledger__row { grid-template-columns: 13rem minmax(0, 1fr) auto; gap: var(--s-4); align-items: baseline; }
  .ledger__src .src { white-space: nowrap; }
  .ledger dt { font-size: 1rem; }
  .ledger__src { text-align: right; }
}
.ledger__row.sig-red .ledger__value, .ledger__row.sig-amber .ledger__value,
.ledger__row.sig-fail .ledger__value, .ledger__row.sig-watch .ledger__value { color: var(--sig); }

/* ---------- Timeline (inspections, changes) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 0.69rem; top: 0.6rem; bottom: 0.6rem; width: 3px;
  background: repeating-linear-gradient(180deg, var(--rule-strong) 0 0.9rem, transparent 0.9rem 1.6rem);
}
.tl-item { position: relative; padding: 0 0 var(--s-5) 2.6rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item > .mark { position: absolute; left: 0; top: 0.1rem; width: 1.45rem; height: 1.45rem; background: var(--paper); border-radius: 50%; }
.tl-when { margin: 0; font-size: 1rem; color: var(--ink-3); }
.tl-title { margin: 0.1rem 0 0.25rem; font-size: 1.15rem; }
.tl-meta { margin: 0 0 0.5rem; color: var(--ink-2); font-size: 1rem; }

/* Violations inside an inspection */
.violation { border: 1px solid var(--rule); border-radius: var(--radius-small); padding: var(--s-4); margin: var(--s-3) 0 0; background: var(--paper); }
/* On the Record the sheet is already the card: each violation under its inspection is a ruled section, not a box. */
.timeline .violation { border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: var(--s-4) 0 0; margin-top: var(--s-4); background: none; }
.violation__head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; align-items: baseline; margin-bottom: 0.35rem; }
.violation__title { font-weight: 700; font-size: 1.1rem; margin: 0; letter-spacing: 0.004em; }
.violation dl { margin: 0.5rem 0 0; display: grid; gap: 0.5rem; }
.violation dl > div { min-width: 0; }
.violation dt { font-weight: 700; font-size: 1rem; color: var(--ink-2); }
/* An inspector's words can hold long joined codes ("Wheel/Rim-..."): they wrap instead of pushing the page sideways. */
.violation dd { margin: 0; overflow-wrap: anywhere; }
.oos-flag { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-sans); font-weight: 700; font-size: 1rem; color: var(--stop); }
.outlook { margin: var(--s-3) 0 0; padding: var(--s-3); background: var(--paper-2); border-radius: var(--radius-small); }
.outlook__head { display: flex; gap: 0.5rem; align-items: center; font-weight: 700; margin: 0 0 0.25rem; }
.outlook ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); font-size: 1rem; }
/* A small fold inside a card (official wording, a form to open, the terms agreed): the Record's fold, one ruled row
   with the chevron at the right, turned up when open. Folds in a row share their rules. */
.official, .more { margin-top: var(--s-3); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.official + .official, .more + .more { margin-top: 0; border-top: 0; }
:is(.card, .violation) > :is(.official, .more):last-child { border-bottom: 0; padding-bottom: 0; }
.official[open], .more[open] { padding-bottom: var(--s-4); }
.official > summary, .more > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 48px; padding: var(--s-2) 0;
  font-weight: 700; color: var(--ink); list-style: none;
}
.official > summary::-webkit-details-marker, .more > summary::-webkit-details-marker { display: none; }
.official > summary::after, .more > summary::after { content: ""; flex: none; width: 0.65rem; height: 0.65rem; border-right: 2.5px solid var(--ink-2); border-bottom: 2.5px solid var(--ink-2); transform: rotate(45deg); margin-right: 0.4rem; transition: transform 150ms var(--ease-out); }
.official[open] > summary::after, .more[open] > summary::after { transform: rotate(-135deg); }
.official > summary:hover, .more > summary:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.official[open] > summary, .more[open] > summary { margin-bottom: var(--s-2); }
.official__body { font-size: 1rem; background: var(--paper-2); border-radius: var(--radius-small); padding: var(--s-3); margin: 0.25rem 0 0; }
.official__body p { margin: 0 0 0.35rem; }

/* ---------- Steps (a real sequence) ---------- */
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); counter-reset: step; }
.step { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.step__n {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 6px;
  background: var(--sign); color: var(--sign-ink); font-weight: 700; font-size: 1.2rem;
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px rgb(255 255 255 / 90%); padding-top: 0.1em;
}
.step__n--free { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.step__title { font-size: var(--step-1); margin: 0.2rem 0 0.3rem; }
.step p { margin: 0 0 0.4rem; }
.step__cost { font-weight: 700; }
.step__free { display: inline-block; font-family: var(--font-sans); font-weight: 700; font-size: 1rem; padding: 0.1rem 0.45rem; border: 1.5px solid var(--ink); border-radius: 4px; margin-left: 0.35rem; vertical-align: 0.1em; }

/* ---------- Rate sheet (prices) ---------- */
.rates { margin: 0; border-top: 1px solid var(--rule); }
.rate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.rate dt { display: flex; align-items: baseline; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; min-width: 0; }
.rate dt::after { content: ""; flex: 1; min-width: 1rem; border-bottom: 2px dotted var(--rule-strong); transform: translateY(-0.3em); }
.rate__price { margin: 0; font-weight: 700; font-size: 1.15rem; text-align: right; font-variant-numeric: tabular-nums; }
.rate__terms { grid-column: 1 / -1; margin: 0; color: var(--ink-2); }
.rate__price small { font-weight: 700; color: var(--ink-2); font-family: var(--font-sans); font-size: 1rem; }

/* ---------- Search results ---------- */
.results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.result { border-bottom: 1px solid var(--rule); }
.result a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); row-gap: 0.15rem; align-items: center; padding: var(--s-4) var(--s-2); color: var(--ink); text-decoration: none; }
.result a > * { grid-column: 1; }
/* Each row opens a Record, so it shows where it goes. */
.result a > .result__go { grid-column: 2; grid-row: 1 / span 3; width: 1.25rem; height: 1.25rem; color: var(--ink-3); }
.result a > .result__go svg { width: 100%; height: 100%; display: block; }
.result a:hover .result__name { text-decoration: underline; text-underline-offset: 0.18em; }
.result a:hover { background: var(--paper-2); }
.result__name { font-weight: 700; letter-spacing: 0.012em; }
.result__meta { font-size: 1rem; color: var(--ink-3); }

/* ---------- The DOT number field: one big box and one button ---------- */
.door { margin: 0; max-width: 30rem; }
.door__label { display: block; font-weight: 600; font-size: 1.125rem; margin-bottom: 0.4rem; }

.door input.door__input {
  width: 100%; min-height: 64px; margin: 0; padding: 0.6rem 1rem; border: 2px solid var(--rule-strong); border-radius: var(--radius-small);
  background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.door input.door__input::placeholder { color: #6b7280; font-weight: 400; letter-spacing: 0; opacity: 1; }
.door input.door__input:focus-visible { outline: 3px solid var(--action); outline-offset: 1px; border-color: var(--action); }
.door__actions { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
.door__actions .button { width: 100%; min-height: 60px; font-size: 1.25rem; }
.door__alt { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }

/* ---------- Sections of a reading page ---------- */
.fine { color: var(--ink-2); font-size: 1rem; margin-top: var(--s-5); max-width: var(--measure); }
.band { padding: var(--s-7) 0; }

.band__lead { font-size: 1.2rem; color: var(--ink-2); max-width: 38rem; line-height: 1.45; margin-bottom: var(--s-6); }

.faq { border-top: 1px solid var(--rule); max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: 58px; padding: var(--s-3) 0;
  font-family: var(--font-sans); font-weight: 700; font-size: 1.1rem; line-height: 1.3; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 0.6rem; height: 0.6rem; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); margin-right: 0.3rem; transition: transform 150ms var(--ease-out); }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq .faq__a { padding: 0 0 var(--s-4); color: var(--ink-2); max-width: var(--measure); }
.faq .faq__a p:last-child { margin-bottom: 0; }

.prose-page { max-width: 44rem; }
.sheet__part.prose-page { max-width: none; }
.sheet__part.prose-page > * { max-width: 44rem; }
.prose-page > h2:first-child, .prose-page > h1:first-child { margin-top: 0; }
/* The short version: a plain summary slip above a long document. */
.summary-slip { background: var(--paper-2); border-top: 1px solid var(--rule); border-radius: 0 0 var(--radius-small) var(--radius-small);
  padding: var(--s-4) var(--s-5) var(--s-2); margin: var(--s-5) 0 0; }
.summary-slip > h2.part-title { font-size: var(--step-1); margin: 0 0 var(--s-2); }
.summary-slip ul { padding-left: 1.2rem; }
.summary-slip li + li { margin-top: 0.35rem; }
.prose-page h2 { margin-top: var(--s-6); }
.prose-page p, .prose-page li { color: var(--ink); }

/* Plain page wrapper on paper (how it works, about, search): white down to the footer, even on a short page. */
main:has(> .paper-page) { background: var(--paper); }
.paper-page { background: var(--paper); }
.paper-page__inner { padding-top: var(--s-6); padding-bottom: var(--s-7); }
/* More room above a heading than below it, on every paper page. */
.paper-page__inner > * + h2, .paper-page__inner > div > * + h2 { margin-top: var(--s-6); }

/* ---------- Kind error pages (layout in read.css) ---------- */
.trouble__code { font-size: 1rem; color: var(--ink-3); margin: 0 0 var(--s-2); }

/* ---------- Gallery ---------- */
.gallery-section { padding: var(--s-6) 0; border-bottom: 1px solid var(--rule); }
.gallery-section > h2 { font-size: var(--step-2); }
.gallery-row { display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: flex-start; margin-bottom: var(--s-4); }
.gallery-cell { display: grid; gap: var(--s-2); justify-items: start; }
.gallery-cell > code { font-size: 1rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--s-3); }
.swatch { border: 1px solid var(--rule); border-radius: var(--radius-small); overflow: hidden; background: var(--paper); font-size: 1rem; }
.swatch__chip { height: 3.5rem; }
.swatch__name { padding: 0.35rem 0.5rem; font-family: var(--font-mono); }
.chip-desk { background: var(--desk); } .chip-paper { background: var(--paper); } .chip-paper-2 { background: var(--paper-2); }
.chip-ink { background: var(--ink); } .chip-ink-2 { background: var(--ink-2); } .chip-ink-3 { background: var(--ink-3); }
.chip-rule { background: var(--rule); } .chip-sign { background: var(--sign); } .chip-brand { background: var(--brand); }
.chip-action { background: var(--action); } .chip-action-strong { background: var(--action-strong); }
.chip-go { background: var(--go); } .chip-caution { background: var(--caution); } .chip-stop { background: var(--stop); }
.chip-go-lamp { background: var(--go-lamp); } .chip-caution-lamp { background: var(--caution-lamp); } .chip-stop-lamp { background: var(--stop-lamp); }

/* ---------- Print: the Record prints like a document ---------- */
@media print {
  @page { margin: 14mm 12mm; }
  .no-print, .official > summary { display: none !important; }
  .desk { padding: 0 !important; }
  .sheet { box-shadow: none !important; max-width: none; border: 0 !important; }
  .sheet__part { padding: 6mm 0 !important; break-inside: auto; }
  /* The Record's long parts line up with its first part (the same column and side space). */
  .record-page .sheet { max-width: 44rem; }
  .record-page .sheet__part, .record__more-title { padding-left: var(--gutter) !important; padding-right: var(--gutter) !important; }
  .check, .violation, .ledger__row, .tl-item, .sign { break-inside: avoid; }
  .official > .official__body { display: block !important; }
  details.official:not([open]) > .official__body { display: block !important; }
  .sign { background: #fff !important; color: #000 !important; box-shadow: inset 0 0 0 2px #000 !important; }
  .sign__tab { background: #fff !important; color: #000 !important; }
  .light { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .stamp { -webkit-mask-image: none; mask-image: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-family: var(--font-mono); font-size: 0.75em; color: #444; }
  .src a::after { content: none; }
  /* Paper cannot be tapped: the Record's long parts and each check's proof print open, and nothing on paper looks
     like it opens. Only the "Details and sources" control goes; the evidence and the brokers' rules under it stay. */
  .fold > summary::after, .check__fold > summary::after, .check__more > summary { display: none !important; }
  /* A check with its proof open is long: let it run on to the next page, and keep each small piece whole. */
  .check { break-inside: auto; }
  .check__top, .check__fix, .check__why, .check__rules, .check__proof li { break-inside: avoid; }
  .record__title, .part-title { break-after: avoid; }
  /* Paper has no blue fill: the fix and its price read as plain black words in a box. */
  .check__fix .button { background: #fff !important; color: #000 !important; box-shadow: inset 0 0 0 2px #000 !important; }
  .check__fix .button .cost { color: #000 !important; }
}
/* On its own: a browser that does not know ::details-content drops only this rule (a closed part then prints closed;
   one he opened prints open). */
@media print {
  .fold::details-content, .official::details-content, .check__more::details-content,
  .check__fold::details-content { content-visibility: visible; }
}

/* ---------- Search, tips, explainer lists ---------- */
.searchform { margin: 0 0 var(--s-6); max-width: 40rem; }
.searchform__row { display: grid; gap: var(--s-3); }
@media (min-width: 34rem) { .searchform__row { grid-template-columns: minmax(0, 1fr) auto; } }
.searchform input[type="search"] { min-height: 56px; font-size: 1.15rem; border-width: 2px; border-color: var(--ink); }
.searchform .button { min-height: 56px; }
.results-wrap { margin-top: var(--s-5); }

.meaning { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-4); }
.meaning__row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: center; }
.meaning__row p { margin: 0; color: var(--ink-2); }
.meaning__row .meaning__word { font-weight: 700; font-size: 1.2rem; color: var(--sig); }
.never { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-3); }
.never li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.never .mark { color: var(--ink); }
.prose-page .ledger { margin-bottom: var(--s-5); }
.prose-page .ledger__note { margin: 0; color: var(--ink); }

/* ---------- Kit pages in the Prooflane look ---------- */

.card-form { position: relative; }
/* The form's own double rule already opens it: a first group of choices needs no second rule. */
.card-form > input[type="hidden"]:first-child + fieldset, .card-form > fieldset:first-child { border-top: 0; padding-top: 0; }
.narrow-note { margin-top: var(--s-4); font-size: 1rem; color: var(--ink-2); text-align: center; }

.sources__corrected { display: flex; gap: 0.4rem; align-items: center; font-weight: 700; }
.sources__corrected .mark { color: var(--ink); }
.terms-note { font-size: 1rem; color: var(--ink-2); border-left: 0; padding: var(--s-2) 0; }

.error-page .cluster { margin-top: var(--s-5); }
.claimed { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-weight: 700; }
.claimed .mark { color: var(--ink); }

.rate dt a { color: inherit; }
