/* style.css — Pathfinder · Singer-Elegant.
 *
 * Reference: ricefw-workbench-v2.html. "Speaks without raising its voice."
 * Restraint. ONE sans (Inter). ONE mono (JetBrains Mono). Lime livery
 * doing triple duty: brand · phosphor · pass-state. Color is semantic,
 * never decorative. Tags are not chips.
 */

:root {
  /* Surfaces */
  --bg-page:        #F6F7F4;
  --bg-panel:       #FFFFFF;
  --bg-instrument:  #0E0E0C;

  /* Type */
  --ink-primary:    #0E0E0C;
  --ink-body:       #2A2B28;
  --ink-mute:       #6A6D70;
  --ink-faint:      #A8AAA4;

  /* Rules */
  --rule:           #E4E5E0;
  --rule-soft:      #EFF0EC;
  --rule-strong:    #54575A;

  /* Livery — five colors, used surgically */
  --livery-lime:    #96C121;  /* primary · phosphor · pass */
  --livery-blue:    #386886;  /* AI-replaceable · review · info */
  --livery-orange:  #FF8400;  /* phase II · pending */
  --livery-red:     #C64C38;  /* eliminate · blocked · negative */
  --livery-teal:    #4CA686;  /* legacy carry-forward */

  --phosphor-glow:  rgba(150, 193, 33, 0.35);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg-page); }

body {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-body);
  font-feature-settings: 'tnum' 1, 'cv11' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    linear-gradient(rgba(84,87,90,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84,87,90,0.025) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: var(--ink-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 100ms linear, color 100ms linear;
}
a:hover { border-bottom-color: var(--livery-lime); }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 12px;
}

.muted { color: var(--ink-mute); font-size: 12px; letter-spacing: 0.02em; }

/* ── Header (instrument panel) ────────────────────────────────────── */
header.bar,
.topbar {
  background: var(--bg-instrument);
  color: #FFF;
  /* Symmetric vertical padding so the subtitle below the brand name has
     the same breathing room as the top of the header. Was 16/14 — now
     20/20, matching the topnav's vertical rhythm. */
  padding: 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--livery-lime);
  position: relative;
  flex-wrap: wrap;
}
.brand-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
  color: #FFF;
}
.brand-sub {
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
  /* Bumped from 6px so the subtitle isn't crammed under the brand name —
     now matches the topnav's vertical rhythm. */
  margin-top: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.chassis-plate,
.brand-plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.7);
  background: transparent;
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #FFF;
  text-transform: none;
  border-radius: 0;
}
.chassis-plate .lbl,
.brand-plate em {
  color: rgba(255,255,255,0.62);
  font-size: 9px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-style: normal;
  margin-right: 0;
}

.driver-tag,
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--livery-lime);
  color: var(--ink-primary);
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
}
.driver-tag .lbl,
.user-chip::before {
  color: rgba(14,14,12,0.88);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  font-family: var(--font-sans);
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  border: none;
  content: "OPR";
}
.user-chip::before { content: "OPR"; margin-right: 0; }

nav.top,
.topnav {
  display: flex;
  gap: 24px;
  align-items: center;
}
nav.top a,
.topnav a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  text-transform: uppercase;
  padding: 4px 0;
  position: relative;
  border: none;
}
nav.top a:hover,
.topnav a:hover { color: #FFF; }
nav.top a.active,
.topnav a.active {
  color: #FFF;
}
nav.top a.active::after,
.topnav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--livery-lime);
}
.topnav a.muted { color: rgba(255,255,255,0.62); }
.topnav a.muted:hover { color: rgba(255,255,255,0.92); }

/* ── Main + footer ─────────────────────────────────────────────────── */
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 36px 48px 56px;
}

footer,
.foot {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
  text-align: left;
}
footer .muted { font-size: 10px; letter-spacing: 0.18em; color: var(--ink-mute); }
footer .rev,
.foot .rev {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: none;
}

/* ── Title row + eyebrow ──────────────────────────────────────────── */
.title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 32px;
}
.eyebrow {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--livery-lime);
}
h1.page,
.card h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  line-height: 1.1;
  text-transform: none;
}
.page-sub {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 10px;
}

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 28px 32px;
  position: relative;
}
.card.narrow { max-width: 540px; margin: 40px auto; }
.card h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-primary);
  margin: 22px 0 8px;
  text-transform: none;
}

.row { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 24px; }

/* ── Banners ──────────────────────────────────────────────────────── */
.banner {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--livery-lime);
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--ink-body);
  border-radius: 0;
}
.banner-error  { border-left-color: var(--livery-red); }
.banner-ok     { border-left-color: var(--livery-lime); }
/* Warn banner — distinct from -error (red) and -info (lime). Used for       */
/* destructive-write confirmations like the regenerate-questions wipe gate.  */
.banner-warn   { border-left-color: var(--livery-red); background: #fff8e1; }
.banner-info   { border-left-color: var(--livery-lime); }
.banner ul { margin: 6px 0 0 18px; padding: 0; font-family: var(--font-mono); font-size: 12px; }

/* ── Forms ────────────────────────────────────────────────────────── */
form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form select,
form textarea {
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  background: var(--bg-panel);
  color: var(--ink-primary);
  width: 100%;
  transition: border-color 100ms linear;
}
form input[type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
form textarea {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 240px;
}
form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--livery-lime);
}

/* Global keyboard focus indicator — applies to every interactive element
   (buttons, links, cards, radios, checkboxes). Uses :focus-visible so
   mouse clicks don't trigger the ring; only keyboard navigation does.
   Closes the missing-focus-indicator design audit finding. */
:focus-visible {
  outline: 2px solid var(--livery-lime);
  outline-offset: 2px;
  border-radius: 2px;
}
/* For inputs we already paint the border lime on focus — keep the global
   ring off so we don't get a double indicator. */
form input:focus-visible,
form select:focus-visible,
form textarea:focus-visible {
  outline: none;
}
form small {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-mute);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 20px;
  margin-bottom: 18px;
}

/* ── Buttons ──────────────────────────────────────────────────────── *
 * Default = ghost (transparent + hairline border). Filled state is
 * reserved for primary actions.
 */
.btn,
.edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: transparent;
  color: var(--ink-body);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear, border-color 100ms linear;
}
.btn:hover,
.edit:hover {
  background: var(--bg-instrument);
  color: #FFF;
  border-color: var(--bg-instrument);
}
.btn.primary {
  background: var(--bg-instrument);
  color: #FFF;
  border-color: var(--bg-instrument);
}
.btn.primary:hover {
  background: var(--ink-primary);
  border-color: var(--livery-lime);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-body);
  border-color: var(--rule-strong);
}
/* Inside an instrument-panel `.cluster` (dark background), flip text +
   border to a light tone so all button variants meet WCAG contrast.
   `.btn.primary` already carries its own dark-bg / light-text styling,
   but every other variant inherits the page's dark `--ink-body` and
   becomes invisible on dark — fix that here. */
.cluster .btn:not(.primary),
.cluster .btn.ghost,
.cluster .btn-small {
  color: #E4E5E0;
  border-color: rgba(255, 255, 255, 0.32);
}
.cluster .btn:not(.primary):hover,
.cluster .btn.ghost:hover,
.cluster .btn-small:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
}
.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear, border-color 100ms linear;
}
.btn-small:hover {
  background: var(--bg-instrument);
  color: #FFF;
  border-color: var(--bg-instrument);
}

/* ── Filter tabs ──────────────────────────────────────────────────── */
.filters,
.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 22px;
  flex-wrap: wrap;
}
.filter-lbl {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-right: 10px;
}
.filter-bar .muted { font-size: 10px; letter-spacing: 0.24em; }

.tab,
.pill {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 13px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-mute);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  border-radius: 0;
  transition: color 100ms linear, border-color 100ms linear;
}
.tab:hover,
.pill:hover {
  color: var(--ink-primary);
  border-color: var(--rule-strong);
}
.tab.active,
.pill.pill-active {
  background: var(--bg-instrument);
  color: #FFF;
  border-color: var(--bg-instrument);
}
.tab.active::after,
.pill.pill-active::after {
  content: "";
  position: absolute;
  left: -1px; right: -1px; bottom: -3px;
  height: 2px;
  background: var(--livery-lime);
}

/* ── Gauge cluster (instrument panel) ─────────────────────────────── */
.cluster {
  display: flex;
  background: var(--bg-instrument);
  border: 1px solid var(--bg-instrument);
}
.gauge {
  padding: 10px 22px 12px;
  border-right: 1px solid rgba(255,255,255,0.06);
  min-width: 90px;
}
.gauge:last-child { border-right: none; }
.gauge-lbl {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: rgba(255,255,255,0.62);
  text-transform: uppercase;
  margin-bottom: 4px;
}
/* Denominator / percent line below each gauge value. Less visual weight than
   the value itself, so the eye still reads the headline number first. */
.gauge-denom {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.gauge-val {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 18px;
  color: var(--livery-lime);
  text-shadow: 0 0 4px var(--phosphor-glow);
  letter-spacing: 0.02em;
  line-height: 1;
}
.gauge.amber .gauge-val { color: #FFB347; text-shadow: 0 0 4px rgba(255, 132, 0, 0.35); }
.gauge.muted .gauge-val { color: rgba(255,255,255,0.85); text-shadow: none; }
.gauge.blue  .gauge-val { color: #6CA8D1; text-shadow: 0 0 4px rgba(56, 104, 134, 0.35); }
.gauge.red   .gauge-val { color: #E48070; text-shadow: 0 0 4px rgba(198, 76, 56, 0.35); }

/* ── Livery divider ───────────────────────────────────────────────── */
.livery {
  height: 2px;
  display: flex;
  margin: 0 0 28px;
}
.livery span { flex: 1; }
.livery .l1 { background: var(--livery-lime); }
.livery .l2 { background: var(--livery-blue); }
.livery .l3 { background: var(--livery-orange); }

/* ── Table ────────────────────────────────────────────────────────── */
.table-wrap,
.data-table {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  position: relative;
  border-radius: 0;
}
.table-wrap::before,
.table-wrap::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--rule-strong);
  border-style: solid;
}
.table-wrap::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.table-wrap::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

table.specs,
table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 13px;
}
.data-table { padding: 0; }  /* override the .data-table-as-card legacy path */

table.specs thead tr,
table.data-table thead tr {
  background: transparent;
  border-bottom: 1px solid var(--rule-strong);
}
table.specs th,
table.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--ink-mute);
  text-transform: uppercase;
  white-space: nowrap;
  background: transparent;
}
table.specs th.num,
table.data-table th.num { text-align: right; }
table.specs tbody tr,
table.data-table tbody tr {
  border-bottom: 1px solid var(--rule-soft);
  transition: background 100ms linear, box-shadow 100ms linear;
}
table.specs tbody tr:last-child,
table.data-table tbody tr:last-child { border-bottom: none; }
table.specs tbody tr:hover,
table.data-table tbody tr:hover {
  background: rgba(150, 193, 33, 0.03);
  box-shadow: inset 2px 0 0 var(--livery-lime);
}
table.specs td,
table.data-table td {
  padding: 14px 16px;
  font-size: 13px;
  vertical-align: middle;
}

/* Per-cell typography classes */
.id {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-primary);
  font-size: 12px;
  letter-spacing: 0;
}
.mod {
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.dom { color: var(--ink-body); font-size: 13px; font-weight: 400; }
.disp { color: var(--ink-body); font-size: 13px; font-weight: 400; }
.num,
table.data-table .num {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--ink-primary);
}
.phs { font-size: 12px; color: var(--ink-mute); font-weight: 400; }

/* ── Tags ─────────────────────────────────────────────────────────── *
 * 6px swatch + clean label in body color. No fills, no borders, no
 * stencils. Supports both the new (.essential / .eliminate / .phase2 /
 * .aireplace / .legacy) and legacy (.class-* / .status-*) classes.
 */
.tag,
.class-tag,
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-body);
  white-space: nowrap;
  --tag-block: var(--ink-faint);
}
.tag::before,
.class-tag::before,
.status-tag::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--tag-block);
  flex-shrink: 0;
  margin: 0;
}

/* New variants */
.tag.essential::before { background: var(--livery-lime); }
.tag.eliminate::before { background: var(--livery-red); }
.tag.phase2::before    { background: var(--livery-orange); }
.tag.aireplace::before { background: var(--livery-blue); }
.tag.legacy::before    { background: var(--livery-teal); }

/* Legacy classification classes — keep working through tag-block var */
.class-essential            { --tag-block: var(--livery-lime); }
.class-eliminate            { --tag-block: var(--livery-red); }
.class-phase_ii_candidate   { --tag-block: var(--livery-orange); }
.class-ai_replaceable       { --tag-block: var(--livery-blue); }
.class-legacy_carry_forward { --tag-block: var(--livery-teal); }
.class-over_engineered      { --tag-block: var(--livery-orange); }

/* Status — sentence case via LED + label */
.status-tag {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-body);
}
.status-tag::before {
  width: 7px; height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 4px var(--tag-block), 0 0 8px var(--tag-block);
}
.status-draft         { --tag-block: var(--ink-faint); }
.status-classified    { --tag-block: var(--livery-lime); }
.status-under_review  { --tag-block: var(--livery-orange); }
.status-approved      { --tag-block: var(--livery-lime); }
.status-rejected      { --tag-block: var(--livery-red); }

/* Status — explicit element form (preferred for new code) */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-body);
  letter-spacing: 0;
}
.led {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--livery-lime);
  box-shadow: 0 0 4px var(--livery-lime), 0 0 8px rgba(150, 193, 33, 0.3);
  flex-shrink: 0;
}
.led.amber { background: var(--livery-orange); box-shadow: 0 0 4px var(--livery-orange), 0 0 8px rgba(255, 132, 0, 0.3); }
.led.red   { background: var(--livery-red);    box-shadow: 0 0 4px var(--livery-red),    0 0 8px rgba(198, 76, 56, 0.3); }
.led.blue  { background: var(--livery-blue);   box-shadow: 0 0 4px var(--livery-blue),   0 0 8px rgba(56, 104, 134, 0.3); }
.led.muted { background: var(--ink-faint); box-shadow: none; }

/* ── Confidence readout (inline, no panel) ───────────────────────── */
.readout {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--livery-lime);
  letter-spacing: 0;
  text-shadow: 0 0 6px rgba(150, 193, 33, 0.25);
}

/* ── Effort delta ─────────────────────────────────────────────────── */
.delta {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0;
}
.delta.pos { color: var(--ink-primary); }
.delta.neg { color: var(--livery-red); }

/* ── Reclassify bar / model picker ────────────────────────────────── */
.reclassify-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--livery-lime);
  padding: 12px 16px;
  margin: 14px 0 18px;
  font-size: 12px;
}
.reclassify-bar .muted {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.inline-select {
  width: auto !important;
  padding: 5px 10px !important;
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* ── Meta block ───────────────────────────────────────────────────── */
.meta-block {
  margin-top: 22px;
  padding: 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

/* ── Service-manual dotted leaders (rare) ─────────────────────────── */
.lead-dots {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.lead-dots .label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.lead-dots .leader {
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-3px);
  height: 8px;
}
.lead-dots .value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Responsive header (Defect 3) ──────────────────────────────────
 * The header bar previously had `overflow: hidden` and zero media
 * queries, so below ~900px the right-side cluster (chassis-plate +
 * driver-tag + 9 nav links) was clipped and unreachable. Three
 * breakpoints below let the header reflow without a hamburger:
 *   1024px — right cluster drops to a second row, justified right
 *   768px  — collapse the brand-sub line, tighten plate + tag + nav
 *   480px  — drop the chassis-plate and OPR tag entirely; nav owns
 *             the second row at full width
 * Wrap-only fallback by design — hamburger collapse is out of scope.
 */
@media (max-width: 1024px) {
  header.bar,
  .topbar {
    flex-wrap: wrap;
    padding-bottom: 8px;
  }
  .header-right {
    flex-basis: 100%;
    margin-top: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  nav.top,
  .topnav {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .brand-sub { display: none; }
  .chassis-plate,
  .brand-plate {
    font-size: 10px;
    padding: 4px 8px;
  }
  .driver-tag,
  .user-chip {
    font-size: 10px;
    padding: 4px 9px;
  }
  nav.top a,
  .topnav a {
    padding: 4px 0;
    font-size: 11px;
  }
  nav.top,
  .topnav {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .chassis-plate,
  .brand-plate,
  .driver-tag,
  .user-chip { display: none; }
  nav.top,
  .topnav {
    flex-basis: 100%;
    justify-content: flex-end;
    gap: 14px;
  }
  nav.top a,
  .topnav a {
    padding: 6px 0;
  }
}

/* ── Scheme N1 nav dropdowns ──────────────────────────────────────────
 * Click-toggle dropdown panels on the dark instrument-panel nav.
 * Pattern mirrors `.gear-wrap` / `.gear-menu` from atoms.css — same
 * white panel, soft shadow, hairline border, lime focus accent — but
 * applied to the textual nav rhythm rather than the gear glyph. */

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-trigger {
  /* Mirror nav.top a typography so the trigger sits flush with sibling
     direct-links visually. */
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  padding: 4px 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.5;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger:focus-visible {
  color: #FFF;
  outline: none;
}
.nav-dropdown-trigger.active { color: #FFF; }
.nav-dropdown-trigger.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--livery-lime);
}
.nav-dropdown-caret {
  font-size: 9px;
  line-height: 1;
  opacity: 0.7;
  transition: transform 120ms linear;
}
.nav-dropdown.open .nav-dropdown-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
  z-index: 50;
  padding: 4px 0;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

/* Item color is set with a `nav.top` ancestor so it beats the global
 * `nav.top a` selector (specificity 0,1,1) that lives in the topnav
 * block above. Without this prefix the items render white-on-white. */
nav.top .nav-dropdown-item,
.topnav .nav-dropdown-item {
  display: block;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
  text-decoration: none;
  white-space: nowrap;
  border: none;
  text-transform: none;
}
nav.top .nav-dropdown-item:hover,
nav.top .nav-dropdown-item:focus-visible,
.topnav .nav-dropdown-item:hover,
.topnav .nav-dropdown-item:focus-visible {
  background: rgba(150, 193, 33, 0.16);
  color: var(--ink-primary);
  outline: none;
  /* Suppress the global `a:hover` lime underline inside the panel — the
     background-tint is the hover affordance. */
  border-bottom-color: transparent;
}
/* The `nav.top a.active::after` rule paints a lime bar across the bottom
 * of *any* `a.active` inside the top nav — including items inside an
 * open dropdown panel. Suppress for dropdown items: they signal active
 * via the trigger, not the item itself. */
nav.top .nav-dropdown-item.active::after,
.topnav .nav-dropdown-item.active::after {
  content: none;
}

/* ── Narrow viewport: collapse the nav into a hamburger ──────────────
 * <900px is the critical breakpoint per Scheme N1. Below it, the top
 * nav stacks vertically and exposes a hamburger toggle so the row no
 * longer needs to fit on one line. */

.nav-hamburger {
  display: none;
}

@media (max-width: 900px) {
  nav.top {
    flex-wrap: wrap;
    gap: 14px 18px;
    justify-content: flex-end;
  }
  .nav-dropdown-menu {
    /* Anchor menus on the right edge so they don't overflow viewport. */
    right: 0;
    left: auto;
  }
}

@media (max-width: 640px) {
  nav.top {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  nav.top > a,
  .nav-dropdown,
  .gear-wrap {
    width: 100%;
  }
  nav.top > a {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 0 8px 12px;
  }
  .nav-dropdown-item {
    color: rgba(255, 255, 255, 0.85);
  }
  .nav-dropdown-item:hover,
  .nav-dropdown-item:focus-visible {
    background: rgba(150, 193, 33, 0.18);
    color: #FFF;
  }
}


/* ─── Feedback widget (top toolbar) ───────────────────────────────── */

.feedback-trigger {
  /* Mirror nav.top a typography exactly so the button reads as a sibling
     nav link, not a chunky CTA. Naked background, no border, no pill —
     keeps the header layout clean and right-aligned. */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  flex-shrink: 0;
}
.feedback-trigger:hover,
.feedback-trigger:focus-visible { color: #FFF; outline: none; }

.feedback-dialog {
  /* Explicit centering so the dialog renders middle-of-viewport in every
     browser even if a parent layout would otherwise pin it to the
     top-left. Native `showModal()` should center on its own but some
     browsers + dark-mode UAs disagree without these. */
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, 92vw);
  height: fit-content;
  max-height: 90vh;
  border: 1px solid rgba(150, 193, 33, 0.4);
  border-radius: 12px;
  padding: 0;
  background: #1a1d23;
  color: #e7e9ee;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
}
.feedback-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
}
.feedback-form header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.feedback-form h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.feedback-close {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.feedback-close:hover { color: #96c121; }
.feedback-help {
  margin: 0;
  font-size: 12px;
  opacity: 0.72;
}
.feedback-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}
.feedback-form input[type=text],
.feedback-form textarea {
  font: 400 14px/1.45 inherit;
  background: #0f1217;
  color: #e7e9ee;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 9px 11px;
  resize: vertical;
}
.feedback-form input[type=text]:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: rgba(150, 193, 33, 0.7);
  box-shadow: 0 0 0 3px rgba(150, 193, 33, 0.18);
}
.feedback-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.feedback-form .btn-primary,
.feedback-form .btn-secondary {
  font: 500 13px/1 inherit;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.feedback-form .btn-primary {
  background: #96c121;
  color: #0c1006;
}
.feedback-form .btn-primary:hover { background: #aad62d; }
.feedback-form .btn-secondary {
  background: transparent;
  color: inherit;
  border-color: rgba(255, 255, 255, 0.2);
}
.feedback-form .btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }

.feedback-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.feedback-toast--ok {
  background: #96c121;
  color: #0c1006;
}
.feedback-toast--err {
  background: #c14821;
  color: #fff;
}
.feedback-body {
  background: #0f1217;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 16px;
  white-space: pre-wrap;
  font: 400 14px/1.55 "Inter", sans-serif;
}
.meta-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0 0 18px;
  font-size: 13px;
}
.meta-grid dt { font-weight: 600; opacity: 0.7; }
.meta-grid dd { margin: 0; }
