/* HBI Quoting — UI guide §3: system fonts, one accent, 16px+ base,
   real borders, color = status only, light theme, printable. */

:root {
  --accent: #1d4ed8;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #d1d5db;
  --bg: #fafafa;
  --panel: #ffffff;
  --gray: #6b7280;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red-bg: #fee2e2;
  --green-bg: #dcfce7;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1rem;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}
.wordmark { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.top-center { flex: 1; display: flex; justify-content: center; }
.topnav { display: flex; align-items: center; gap: 1rem; }
.topnav a { color: var(--accent); text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
.inline-form { display: inline; }
.linklike {
  border: none; background: none; color: var(--muted);
  font: inherit; cursor: pointer; padding: 0;
}
.linklike:hover { color: var(--ink); }

.page { max-width: 1200px; margin: 1.25rem auto; padding: 0 1rem; }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Buttons */
.btn {
  font: inherit;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1e40af; color: #fff; }
.btn-nav { font-size: 1.1rem; padding: 0.15rem 0.75rem; }

/* Chips: status is chip + word, never color alone */
.chip {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid currentColor;
  margin-right: 0.25rem;
  white-space: nowrap;
}
.chip-gray { color: var(--gray); }
.chip-blue { color: var(--blue); }
.chip-green { color: var(--green); }
.chip-red { color: var(--red); }
.chip-amber { color: var(--amber); background: var(--amber-bg); }

/* Banners */
.banner { padding: 0.6rem 0.9rem; border-radius: 6px; margin: 0 0 1rem; }
.banner-red { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.banner-amber { background: var(--amber-bg); border: 1px solid var(--amber); color: var(--amber); }
.banner-green { background: var(--green-bg); border: 1px solid var(--green); color: var(--green); }
.banner-note { margin-top: 0.35rem; }
details.fold summary { cursor: pointer; }
details.fold > div { margin-top: 0.25rem; }
details.banner-fold { margin-top: 0.35rem; font-size: 0.92em; }

/* Login */
.login-card {
  max-width: 22rem; margin: 4rem auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem;
}
.login-card label { display: block; margin-bottom: 0.9rem; }
.login-card input {
  width: 100%; font: inherit; padding: 0.45rem 0.6rem; margin-top: 0.2rem;
  border: 1px solid var(--line); border-radius: 6px;
}

/* Upload zone */
/* Home is a narrow column: one upload component, then the batch list. The
   zone is as short as the action is simple (Lou's layout pass 9/2). */
.home { max-width: 56rem; margin: 0 auto; }
.home h2 { margin-top: 1.25rem; }
.dropzone {
  border: 2px dashed var(--line); border-radius: 8px; background: var(--panel);
  padding: 1rem 1rem 0.9rem; text-align: center;
}
.dropzone.drag { border-color: var(--accent); background: #eff6ff; }
.dz-title { margin: 0 0 0.2rem; font-size: 1rem; }
.dz-browse { color: var(--accent); text-decoration: underline; cursor: pointer; }
.dz-caps { margin: 0; color: var(--muted); font-size: 0.9rem; }
/* The selection list: one row per chosen file, removable until submitted */
.dz-list { list-style: none; margin: 0.75rem auto 0; padding: 0; max-width: 36rem; text-align: left; }
.dz-list:empty { display: none; }
.dz-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.5rem; border-top: 1px solid var(--line); }
.dz-item:first-child { border-top: none; }
.dz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-size { flex: none; font-size: 0.85rem; }
.dz-remove {
  flex: none; font: inherit; line-height: 1.2; padding: 0 0.45rem;
  border: 1px solid var(--line); border-radius: 4px; background: var(--panel);
  color: var(--muted); cursor: pointer;
}
.dz-remove:hover { border-color: var(--red); color: var(--red); }
.dz-note { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--amber); }
.dz-note:empty { display: none; }
.dz-clear { font-size: 0.9rem; }
/* The action row is part of the component: hidden until a file lands */
.dz-actions { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.75rem; }
.dz-actions[hidden] { display: none; }
/* Whole batch row opens the batch (the link stays for keyboard / no-JS) */
.row-link { cursor: pointer; }
.row-link:hover td { background: #f3f4f6; }

/* Tables */
.table { border-collapse: collapse; width: 100%; background: var(--panel); }
.table th, .table td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; }
.table th { background: #f3f4f6; font-weight: 600; }

.search-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-form input { flex: 1; font: inherit; padding: 0.45rem 0.6rem;
  border: 1px solid var(--line); border-radius: 6px; }

/* Carousel */
.car-topnav { display: flex; align-items: center; gap: 0.6rem; }
.car-pos { min-width: 5.5rem; text-align: center; font-variant-numeric: tabular-nums; }
/* Part-number search (2026-10-16): a box in the top bar, its hits listed under it. */
.car-search { position: relative; margin-left: 0.6rem; }
.car-search[hidden], .car-search-list[hidden] { display: none; }
.car-search input { font: inherit; font-size: 0.95rem; width: 13rem; max-width: 100%;
  padding: 0.3rem 0.55rem; border: 1px solid #9ca3af; border-radius: 6px; background: var(--panel); }
.car-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.car-search-list { position: absolute; top: calc(100% + 0.3rem); left: 0; z-index: 20;
  width: max(100%, 30rem); max-width: calc(100vw - 2rem); background: var(--panel);
  border: 1px solid #9ca3af; border-radius: 6px; padding: 0.25rem; }
.search-hit { display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left;
  font: inherit; font-size: 0.92rem; padding: 0.35rem 0.5rem; border: none; border-radius: 4px;
  background: none; cursor: pointer; }
.search-hit:hover, .search-hit:focus-visible { background: #eff6ff; }
.search-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.search-hit.current { font-weight: 600; }
/* The name keeps room before the why gives way; the chip never shrinks. */
.search-name { flex: 1 1 8rem; min-width: 4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-why { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.search-hit .chip { flex: none; margin-right: 0; }
.search-note { color: var(--muted); font-size: 0.85rem; padding: 0.35rem 0.5rem; }
/* Phone width: the box takes its own line under the arrows, never a sideways scroll. */
@media (max-width: 700px) {
  .top-center:has(.car-topnav) { flex: 1 1 100%; order: 3; }
  .car-topnav { flex-wrap: wrap; justify-content: center; }
  .car-search { flex: 1 1 100%; margin-left: 0; }
  .car-search input { width: 100%; }
  .car-search-list { width: 100%; }
}
.car-actions { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
/* A row of copy buttons under a small label (the QuoteSheet ranges, Rich's sheet). */
.copy-group { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.copy-group:empty { display: none; }
.copy-group .btn { white-space: nowrap; } /* an open fold beside them must not squeeze a label */
.copy-group-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
/* Rich's sheet, folded behind the QuoteSheet copies until Rich picks the standard. */
details.rich-fold summary { font-size: 0.85rem; color: var(--muted); }
.copy-stale { color: var(--amber); font-size: 0.85rem; font-weight: 600; }
.est-switch { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem;
  color: var(--amber); cursor: pointer; }
.car-main {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem; align-items: start;
}
@media (max-width: 900px) { .car-main { grid-template-columns: 1fr; } }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }

.pane-left { padding: 0.6rem; }
.sheet-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.sheet-tab { padding: 0.1rem 0.6rem; border: 1px solid var(--line); border-radius: 6px;
  background: none; font: inherit; cursor: pointer; }
.sheet-tab.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.print-frame { overflow: auto; max-height: 75vh; border: 1px solid var(--line);
  background: #eee; text-align: center; }
.print-frame img { max-width: 100%; height: auto; cursor: zoom-in; display: block; margin: 0 auto; }
.print-frame.zoomed img { max-width: none; cursor: zoom-out; }

.pane-right { padding: 0.9rem; }
.slide-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.5rem; border-bottom: 2px solid var(--line); padding-bottom: 0.45rem;
  margin-bottom: 0.6rem; flex-wrap: wrap; }
.slide-title { font-weight: 600; }

.fields { border-collapse: collapse; width: 100%; }
.fields td { border: 1px solid var(--line); padding: 0.3rem 0.5rem; vertical-align: top; }
.fields td.col-name { width: 42%; color: #374151; }
.fields tr.group-row td {
  background: #f3f4f6; font-weight: 600; border-top: 2px solid var(--line);
  font-size: 0.85rem; color: var(--muted);
}
.field-reason { display: block; color: var(--amber); font-size: 0.82rem; margin-top: 0.1rem; }
.caveat-dot { color: var(--amber); cursor: help; }
/* Where a pasted value came from (Material Spec, R3) — information, not a flag. */
.field-source { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }
/* An unverified read Claude committed to — visible but never dressed as a
   pasted value (Lou 2026-09-01). */
.claude-read { color: var(--amber); font-style: italic; }
.btn-est { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.btn-est:hover:not(:disabled) { border-color: var(--amber); color: var(--ink); }
/* Full-viewport drawing preview: click / Esc to dismiss. */
.lightbox {
  position: fixed; inset: 0; z-index: 50; cursor: zoom-out;
  background: rgba(0, 0, 0, 0.82);
  display: flex; align-items: center; justify-content: center;
}
.lightbox img {
  max-width: 96vw; max-height: 96vh;
  background: #fff; box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}

.slide-actions { display: flex; align-items: center; gap: 0.6rem; margin: 0.8rem 0 0.4rem; flex-wrap: wrap; }
.slide-actions details.rich-fold { flex-basis: 100%; }
details.panel { margin-top: 0.7rem; border: 1px solid var(--line); border-radius: 6px;
  padding: 0.45rem 0.7rem; background: #fcfcfc; }
details.panel summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.checklist { margin: 0.5rem 0 0.2rem; padding-left: 1.1rem; }
.checklist li { margin-bottom: 0.35rem; }
.kv { margin: 0.4rem 0 0; }
.kv dt { float: left; clear: left; width: 10rem; color: var(--muted); }
.kv dd { margin-left: 10.5rem; }

.placeholder { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.placeholder .big { font-size: 1.1rem; color: var(--ink); margin-bottom: 0.4rem; }
@keyframes pulse { 50% { opacity: 0.45; } }
.pulsing { animation: pulse 1.6s ease-in-out infinite; }

.batch-strip { display: flex; gap: 0.45rem; align-items: center; margin-top: 0.9rem;
  padding: 0.5rem 0.2rem; flex-wrap: wrap; }
.dot { width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 2px solid var(--gray);
  background: none; padding: 0; cursor: pointer; }
.dot-QUEUED { border-color: var(--gray); }
.dot-RUNNING { border-color: var(--blue); background: #bfdbfe; }
.dot-DONE { border-color: var(--green); background: var(--green); }
.dot-FAILED { border-color: var(--red); background: var(--red); }
.dot-blocked { border-color: var(--amber); background: var(--amber); }
.dot.current { outline: 2px solid var(--accent); outline-offset: 2px; }

.copied { color: var(--green); }

@media print {
  .topbar, .car-actions, .batch-strip, .slide-actions, .sheet-bar { display: none !important; }
  .car-main { grid-template-columns: 1fr; }
  .pane { border: none; }
  body { background: #fff; }
}

/* Users screen + account (M3 front slice) */
.btn-small { font-size: 0.82rem; padding: 0.15rem 0.5rem; }
.actions form { margin-right: 0.3rem; }
.link-box .link-url { display: block; margin-top: 0.45rem; word-break: break-all; font-size: 0.9rem; }
.add-user { max-width: 28rem; }
.add-user label { display: block; margin-bottom: 0.6rem; }
.add-user input, .add-user select { display: block; width: 100%; box-sizing: border-box; padding: 0.4rem 0.5rem; margin-top: 0.2rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.login-card h2 { font-size: 1.05rem; margin: 1.2rem 0 0.6rem; }

/* Corrections (M3 half one, UI guide §4): obvious affordance — hint line,
   pencil on every editable cell, "Corrected by" chip, × to remove. */
.hint { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.88rem; }
.fields td.editable { position: relative; cursor: pointer; padding-right: 1.6rem; }
.fields td.editable:hover { background: #eff6ff; }
.pencil { position: absolute; right: 0.45rem; top: 0.3rem; color: var(--line); font-size: 0.9rem; }
.fields td.editable:hover .pencil { color: var(--accent); }
.corr-value { font-weight: 600; }
.corr-meta { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }
.corr-remove { margin-left: 0.35rem; border: 1px solid var(--line); background: var(--panel);
  border-radius: 4px; cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0 0.35rem; color: var(--muted); }
.corr-remove:hover { color: var(--red); border-color: var(--red); }
.stale-note { color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }
.edit-box { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; cursor: default; }
.edit-input, .edit-reason { padding: 0.3rem 0.45rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.edit-input { width: 11rem; }
.edit-reason { width: 14rem; }
.edit-actions { display: flex; gap: 0.3rem; }
.edit-error { flex-basis: 100%; color: var(--red); font-size: 0.85rem; }

/* -- corrections inbox (M3 half two) -------------------------------------- */
.nav-badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 1em; background: #b45309; color: #fff; font-size: .8em; text-align: center; }
.adjudication { border: 1px solid #ddd; border-radius: 6px; padding: .8rem 1rem; margin: .5rem 0 1rem; background: #fafafa; }
.adj-head h2 { margin: .2rem 0 .6rem; font-size: 1.1rem; }
.adj-compare { display: flex; gap: 1rem; flex-wrap: wrap; }
.adj-card { flex: 1 1 16rem; border: 1px solid #e5e5e5; border-radius: 6px; padding: .5rem .7rem; background: #fff; }
.adj-card-corr { border-color: #86efac; }
.adj-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #666; }
.adj-value { font-size: 1.05rem; margin: .2rem 0; }
.adj-history ul { margin: .3rem 0 0 1rem; padding: 0; }
.adj-note { display: block; margin: .7rem 0 .4rem; }
.adj-note input { width: min(100%, 40rem); }
.adj-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.btn-danger { border-color: #dc2626; color: #b91c1c; }
.prior-note, .restored-note { display: block; font-size: .85rem; color: #555; margin-top: .25rem; }
.prior-note .btn { margin-left: .4rem; }
.pager { display: flex; gap: 1rem; align-items: center; }

/* -- lookup editor (M4) --------------------------------------------------- */
.lk-main { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.lk-editor { flex: 3 1 36rem; }
.lk-versions { flex: 1 1 16rem; border-left: 1px solid #e5e5e5; padding-left: 1rem; }
.lk-versions ul { list-style: none; padding: 0; margin: 0; }
.lk-versions li { margin: .4rem 0; }
.lk-grid input, .lk-grid select { width: 100%; box-sizing: border-box; }
.lk-note { display: block; margin: .6rem 0; }
.lk-note input { width: min(100%, 40rem); }
.lk-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.lk-modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 50; }
.lk-modal[hidden] { display: none; }  /* the class rule would outrank the UA hidden rule */
.lk-modal-card { background: #fff; border-radius: 8px; padding: 1rem 1.2rem; width: min(52rem, 92vw); max-height: 85vh; overflow: auto; }
.lk-headline { font-weight: 600; }
.lk-impact-list { padding-left: 1rem; }
.proposed-note { display: block; font-size: .85rem; color: #1d4ed8; margin-top: .25rem; }

/* -- prompt versions (M5) -------------------------------------------------- */
.pv-live { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: .7rem 1rem; margin-bottom: 1rem; }
.pv-live h2 { margin-top: 0; }
.pv-live-line { margin: .2rem 0; font-size: 1.05rem; }
.pv-revert { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin-top: .6rem; }
.pv-actions { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.pv-head h1 { margin-bottom: .2rem; }
.pv-label { display: block; font-weight: 600; margin-bottom: .3rem; }
.pv-text { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem; line-height: 1.4; padding: .6rem; border: 1px solid var(--line); border-radius: 6px; }
.pv-text-readonly { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: .6rem; font-size: .9rem; max-height: 32rem; overflow: auto; }
.pv-row { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; margin: .6rem 0; }
.pv-row label { display: flex; gap: .35rem; align-items: baseline; }
.pv-grow { flex: 1 1 18rem; }
.pv-grow input { flex: 1; min-width: 0; font: inherit; padding: .3rem .45rem;
  border: 1px solid var(--line); border-radius: 6px; }
.pv-reason { margin-bottom: .4rem; }
.pv-reasons { margin: .2rem 0 .6rem 1.1rem; padding: 0; }
.pv-headline { font-weight: 600; }
.pv-progress { margin-top: .5rem; color: var(--blue); }
.pv-progress[hidden] { display: none; }

/* The diff: production left, this draft right; word-level inside a line. */
.pv-diff { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.pv-diff td { vertical-align: top; }
.pv-diff .d-no { width: 3rem; text-align: right; user-select: none; }
.pv-diff .d-text { white-space: pre-wrap; word-break: break-word; }
.pv-diff tr.d-changed td, .pv-diff tr.d-added td, .pv-diff tr.d-removed td { background: #fffdf5; }
.pv-diff tr.d-skip td { background: #f3f4f6; text-align: center; }
.pv-diff .d-del { background: var(--red-bg); }
.pv-diff .d-ins { background: var(--green-bg); }
.pv-rows td { vertical-align: top; }

/* -- Admin shell (admin redesign, 2026-10-05) ------------------------------
   A side menu on every admin page; it stacks above the page on a phone. */
.admin-layout { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.admin-nav { flex: 1 1 12rem; max-width: 15rem; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { padding: .45rem .75rem; border-radius: 6px; color: var(--ink); text-decoration: none; }
.admin-nav a:hover { background: #eef2fb; }
.admin-nav a[aria-current="page"] { background: #e3e9fb; font-weight: 600; }
.admin-nav-group { padding: .9rem .75rem .2rem; font-size: .75rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.admin-nav-count { float: right; color: var(--muted); font-weight: 400; }
.admin-main { flex: 999 1 34rem; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.25rem; margin-bottom: 1rem; }
.card h2 { margin-top: 0; }
.table-scroll { overflow-x: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }

/* The overview */
.ad-head p { margin-top: -.5rem; max-width: 68ch; }
.ad-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
.ad-live { flex: 2 1 30rem; min-width: 0; }
.ad-side { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; }
.ad-table { width: 100%; border-collapse: collapse; }
.ad-table th { text-align: left; font-size: .82rem; color: var(--muted); font-weight: 600;
  padding: .35rem .6rem .35rem 0; border-bottom: 1px solid var(--line); }
.ad-table td { padding: .6rem .6rem .6rem 0; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.ad-table tr:last-child td { border-bottom: none; }
.ad-what { font-weight: 600; }
.ad-nowrap { white-space: nowrap; }
.ad-open { text-align: right; }
.ad-legend { margin: .6rem 0 0; }
.ad-green { color: var(--green); }
.ad-amber { color: var(--amber); }
.ad-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.ad-count { margin: 0 0 .4rem; }
.ad-num { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ad-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.ad-recent time { display: inline-block; min-width: 10rem; font-variant-numeric: tabular-nums; }

/* The prompt, in sections */
.pv-steps { list-style: none; margin: 0 0 1rem; padding: .8rem 1rem; display: flex; flex-wrap: wrap;
  gap: .75rem 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.pv-step { flex: 1 1 11rem; display: flex; gap: .6rem; align-items: flex-start; }
.pv-step-n { flex: 0 0 1.75rem; height: 1.75rem; border-radius: 999px; display: flex;
  align-items: center; justify-content: center; font-weight: 700; border: 2px solid #9ca3af;
  color: var(--muted); box-sizing: border-box; }
.pv-step-current .pv-step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.pv-step-done .pv-step-n { border-color: var(--green); color: var(--green); }
.pv-compare { margin: 0 0 .4rem; }
.pv-toc { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; margin: 0 0 .5rem; }
.pv-toc a { text-decoration: none; }
.pv-group { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #4b5563;
  margin: 1.4rem 0 .5rem; }
.pv-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.25rem; margin-bottom: .75rem; scroll-margin-top: 1rem; }
.pv-sec-changed { border: 2px solid var(--amber); }
.pv-sec-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-start; }
.pv-sec-titles { flex: 1 1 20rem; min-width: 0; }
.pv-sec-titles h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.pv-sec-controls { margin: 0 0 .4rem; color: #374151; }
.pv-sec-fields { display: flex; flex-wrap: wrap; gap: .35rem; }
.pv-field { font-size: .8rem; padding: .05rem .45rem; border-radius: 4px; background: #f3f4f6;
  border: 1px solid #e5e7eb; color: #374151; }
.pv-sec-tools { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.pv-sec-tools .btn { min-height: 2.5rem; }
.pv-sec-tools [hidden] { display: none; }
.pv-sec-body { white-space: pre-wrap; max-width: 76ch; line-height: 1.6; margin-top: .75rem; }
.pv-sec-body .d-del { background: var(--red-bg); color: #7f1d1d; text-decoration: line-through; }
.pv-sec-body .d-ins { background: var(--green-bg); color: #14532d; text-decoration: underline;
  text-decoration-thickness: 2px; }
.pv-sec-editor { margin-top: .75rem; }
.pv-sec-textarea { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.55;
  padding: .6rem .7rem; border: 1px solid #9ca3af; border-radius: 6px; resize: vertical; }
details.pv-diffwrap { margin-top: 1.5rem; }
details.pv-diffwrap > summary { cursor: pointer; }
details.pv-diffwrap > summary h2 { display: inline; font-size: 1.05rem; }
/* Phone width: the top bar wraps instead of pushing the page sideways, and
   the admin menu becomes one wrapped row above the page. */
@media (max-width: 700px) {
  .topbar, .topnav { flex-wrap: wrap; }
  .admin-layout { gap: 1rem; }
  .admin-nav { max-width: none; flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: .25rem; }
  .admin-nav a { padding: .35rem .6rem; background: #f3f4f6; }
  .admin-nav-group { display: none; }
  .admin-nav-count { float: none; margin-left: .3rem; }
}

/* -- Lookup tables (admin redesign part 2, 2026-10-05) ---------------------- */
.lk-head h1 { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.lk-about { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.lk-about-what { margin: 0; flex: 2 1 22rem; max-width: 64ch; }
.lk-about-facts { margin: 0; flex: 1 1 16rem; display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: .25rem .75rem; font-size: .92rem; }
.lk-about-facts dt { color: var(--muted); }
.lk-about-facts dd { margin: 0; }
.lk-try label { display: block; margin-bottom: .25rem; }
.lk-try #lk-try-text { width: 100%; box-sizing: border-box; font: inherit; padding: .5rem .65rem;
  border: 1px solid #9ca3af; border-radius: 6px; }
.lk-try-examples { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .5rem 0; }
.lk-try-result { border-radius: 6px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.lk-try-result:empty { display: none; }
.lk-try-hit { background: var(--green-bg); border: 1px solid var(--green); }
.lk-try-miss { background: var(--amber-bg); border: 1px solid var(--amber); color: #78350f; }
.lk-try-error { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.lk-fams { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .6rem; }
.lk-fam { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem;
  display: flex; flex-direction: column; gap: .6rem; }
.lk-fam-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.lk-rank { flex: 0 0 1.9rem; height: 1.9rem; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; font-weight: 700; background: #f3f4f6; border: 1px solid #9ca3af; }
.lk-fam-name { flex: 1 1 12rem; min-width: 0; font: inherit; font-weight: 600; padding: .3rem .5rem;
  border: 1px solid var(--line); border-radius: 6px; }
.lk-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.lk-chip { display: inline-flex; align-items: center; gap: .15rem; padding: .15rem .15rem .15rem .55rem;
  border-radius: 6px; font-size: .9rem; font-weight: 600; letter-spacing: .02em; background: #f3f4f6;
  border: 1px solid #d1d5db; }
.lk-chip-hit { background: #dbeafe; border: 2px solid var(--accent); color: #1e3a8a; }
.lk-chip-x { border: none; background: none; cursor: pointer; font-size: 1rem; line-height: 1;
  min-width: 1.6rem; min-height: 1.6rem; color: #4b5563; border-radius: 4px; }
.lk-chip-x:hover { background: #e5e7eb; color: var(--ink); }
.lk-fam-addrow { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.lk-fam-add { flex: 1 1 12rem; max-width: 20rem; font: inherit; padding: .35rem .55rem;
  border: 1px solid #9ca3af; border-radius: 6px; }
/* Versions as a timeline */
.lk-versions { border-left: none; padding-left: 0; }
.lk-versions ul { border-left: 2px solid var(--line); padding-left: .9rem; }
.lk-versions li { position: relative; margin: 0 0 .9rem; }
.lk-versions li::before { content: ""; position: absolute; left: -1.27rem; top: .45rem; width: .6rem;
  height: .6rem; border-radius: 999px; background: var(--panel); border: 2px solid #9ca3af; }
