/* zapp vehicle manager — one stylesheet, no framework, no unused rules */

:root {
  /* Contrast pass: the old #f1f1ea on #0a0a10 was ~19:1 — technically great,
     physically tiring on a panel people stare at all day. Text now sits around
     11:1 and surfaces are lifted off pure black, which reads calmer while
     staying well clear of the 4.5:1 floor. */
  --ink: #0f0f16;
  --ink2: #16161f;
  --ink3: #1d1d28;
  --paper: #d9d9d3;
  --paper-strong: #eeeee8;
  --muted: #91919e;
  --volt: #d9ff3f;
  --hot: #ff5c72;
  --line: rgba(217, 217, 211, 0.10);
  --line2: rgba(217, 217, 211, 0.19);

  --cls-x: #e9e4f2;
  --cls-s: #ff5c72;
  --cls-a: #ffc53d;
  --cls-b: #b98cff;
  --cls-c: #4f9dff;
  --cls-d: #4ddb8a;
  /* Pearl: a cool-to-warm sweep so it reads iridescent rather than just pale. */
  --pearl: linear-gradient(115deg, #f6f1ff 0%, #cfe7ff 28%, #ffe6f3 55%, #dcfff0 78%, #f6f1ff 100%);

  --todo: #8b8b98;
  --in_progress: #ff9a3c;
  --in_review: #6fd3ff;
  --approved: #4ddb8a;
  --pushed: #4f7dff;
  --live: #d9ff3f;

  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --skew: skewX(-6deg);
  --rail: 224px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 14px/1.55 var(--mono);
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
summary::-webkit-details-marker { display: none; }

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

.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--volt); color: var(--ink); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.shell.is-folded { --rail: 62px; }

.rail {
  border-right: 1px solid var(--line);
  padding: 26px 0 22px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;
}

.railtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 16px 0 22px; }
.wordmark { display: block; padding-bottom: 30px; }
.wordmark__z {
  display: block; font-family: var(--display); font-size: 27px; line-height: .95;
  letter-spacing: -0.02em; transform: var(--skew); transform-origin: left; color: var(--paper-strong);
}
.wordmark__g { display: block; font-size: 10px; letter-spacing: .26em; color: var(--volt); margin-top: 7px; padding-left: 2px; }

.fold {
  background: none; border: 1px solid var(--line2); color: var(--muted);
  width: 24px; height: 24px; cursor: pointer; flex: none; line-height: 1;
  display: grid; place-items: center; padding: 0;
}
.fold:hover { color: var(--paper-strong); border-color: var(--line2); }
.fold span { display: block; transition: transform .15s ease; }
.is-folded .fold span { transform: rotate(180deg); }

.nav ul { display: flex; flex-direction: column; gap: 1px; }
.nav__link {
  display: flex; align-items: center; gap: 12px; padding: 8px 22px;
  color: var(--muted); border-left: 2px solid transparent; white-space: nowrap;
}
.nav__link:hover { color: var(--paper-strong); background: var(--ink2); }
.nav__link.is-active { color: var(--paper-strong); border-left-color: var(--volt); }
.nav__ico { flex: none; width: 16px; text-align: center; font-size: 13px; color: inherit; }

.rail__foot { margin-top: auto; padding: 18px 22px 0; border-top: 1px solid var(--line); }
.rail__who { font-size: 12px; line-height: 1.4; white-space: nowrap; }
.rail__who span { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: .14em; }
.linkish { background: none; border: 0; padding: 6px 0 0; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--hot); }
.inline { display: inline; }

/* Folded rail keeps the icons and hides everything else. */
.is-folded .wordmark__g,
.is-folded .nav__label,
.is-folded .rail__who,
.is-folded .rail__foot form { display: none; }
.is-folded .wordmark__z { font-size: 19px; }
.is-folded .railtop { padding: 0 12px; flex-direction: column; align-items: center; gap: 14px; }
.is-folded .nav__link { padding: 9px 0; justify-content: center; }
.is-folded .rail__foot { padding: 14px 0 0; text-align: center; }

main { min-width: 0; padding: 32px clamp(18px, 3.4vw, 54px) 100px; }

@media (max-width: 900px) {
  .shell, .shell.is-folded { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .railtop { padding: 0; }
  .wordmark { padding-bottom: 0; }
  .wordmark__z { font-size: 21px; }
  .wordmark__g, .fold { display: none; }
  .nav ul { flex-direction: row; flex-wrap: wrap; gap: 2px 12px; }
  .nav__link { padding: 4px 0; border-left: 0; border-bottom: 2px solid transparent; background: none !important; }
  .nav__link.is-active { border-left: 0; border-bottom-color: var(--volt); }
  .nav__ico { display: none; }
  .rail__foot { margin-left: auto; border-top: 0; padding: 0; display: flex; gap: 12px; align-items: center; }
  main { padding: 22px 18px 72px; }
}

/* ---------- page head ---------- */

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; flex-wrap: wrap; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.title { font-family: var(--display); font-size: clamp(28px, 4vw, 42px); line-height: .98; letter-spacing: -.025em; transform: var(--skew); transform-origin: left; color: var(--paper-strong); }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 11px; max-width: 62ch; }
.pagehead__actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; padding-bottom: 4px; }

.flash { border-left: 2px solid var(--volt); padding: 10px 15px; margin: 0 0 24px; background: var(--ink2); font-size: 13px; }
.flash--error { border-left-color: var(--hot); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--paper);
  border: 1px solid var(--line2); padding: 8px 15px; cursor: pointer; font-size: 12.5px;
  transition: border-color .12s, color .12s, background .12s;
}
.btn:hover { border-color: var(--paper); color: var(--paper-strong); }
.btn--primary { background: var(--volt); border-color: var(--volt); color: #14140c; font-weight: 700; }
.btn--primary:hover { background: #e4ff6b; border-color: #e4ff6b; color: #14140c; }
.btn--danger { border-color: rgba(255, 92, 114, .5); color: var(--hot); }
.btn--ghost { border-color: transparent; color: var(--muted); padding-left: 0; padding-right: 0; }
.btn--ghost:hover { color: var(--paper-strong); border-color: transparent; }
.btn--sm { padding: 5px 10px; font-size: 11.5px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- forms ---------- */

.field { display: block; margin-bottom: 16px; }
.field > span, .lbl { display: block; font-size: 11px; letter-spacing: .16em; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="search"], select, textarea {
  width: 100%; background: var(--ink2); border: 1px solid var(--line); padding: 9px 11px;
  color: var(--paper); font-size: 13.5px;
}
input:hover, select:hover, textarea:hover { border-color: var(--line2); }
input:focus, select:focus, textarea:focus { border-color: var(--volt); outline: none; }
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 14px top 17px, right 9px top 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; cursor: pointer; }
.check input { width: 14px; height: 14px; accent-color: var(--volt); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 20px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.err { color: var(--hot); font-size: 12px; margin-top: 6px; }

/* colour picker: swatch + hex text, kept in sync by app.js */
.colorpick { display: flex; gap: 10px; align-items: center; }
.colorpick input[type="color"] {
  width: 46px; height: 38px; padding: 2px; background: var(--ink2);
  border: 1px solid var(--line2); cursor: pointer; flex: none;
}
.colorpick input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colorpick input[type="color"]::-webkit-color-swatch { border: 0; }
.colorpick input[type="text"] { flex: 1; text-transform: lowercase; }

/* ---------- login ---------- */

.auth { display: grid; min-height: 100vh; place-items: center; padding: 40px 20px; }
.auth__card { width: 100%; max-width: 380px; }
.auth__mark { font-family: var(--display); font-size: 50px; line-height: .9; letter-spacing: -.03em; transform: var(--skew); transform-origin: left; color: var(--paper-strong); }
.auth__sub { color: var(--muted); font-size: 11px; letter-spacing: .28em; margin: 6px 0 42px; }
.auth__legal { color: var(--muted); font-size: 11px; margin-top: 26px; line-height: 1.6; }

/* ---------- dashboard ---------- */

.overview { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(22px, 5vw, 66px); align-items: end; margin-bottom: 56px; }
@media (max-width: 860px) { .overview { grid-template-columns: 1fr; gap: 30px; } }

.bignum { font-family: var(--display); font-size: clamp(78px, 15vw, 156px); line-height: .78; letter-spacing: -.045em; transform: var(--skew); transform-origin: left; color: var(--paper-strong); }
.bignum sup { font-size: .26em; vertical-align: super; margin-left: .06em; color: var(--volt); }
.bigcap { color: var(--muted); font-size: 12px; letter-spacing: .16em; margin-top: 20px; }

.meter { display: block; height: 3px; background: var(--line2); margin-top: 16px; overflow: hidden; }
.meter__f { display: block; height: 100%; background: var(--volt); transform-origin: left; }

/* stacked bar: every status in one strip, coloured */
.stackbar { display: flex; height: 8px; overflow: hidden; background: var(--ink3); margin-top: 18px; }
.stackbar i { display: block; height: 100%; }
.stackkey { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 14px; font-size: 11.5px; color: var(--muted); }
.stackkey span { display: inline-flex; align-items: center; gap: 7px; }
.stackkey b { width: 8px; height: 8px; flex: none; }

.stat { min-width: 0; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 24px 30px; }
.stat__l { font-size: 11px; letter-spacing: .16em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat__l i { width: 8px; height: 8px; flex: none; }
.stat__v { font-family: var(--display); font-size: 26px; line-height: 1.15; margin-top: 7px; letter-spacing: -.02em; color: var(--paper-strong); }
.stat__n { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.sechead h2 { font-size: 12px; letter-spacing: .2em; color: var(--muted); font-weight: 500; }
.sechead a { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.sechead a:hover { color: var(--volt); }
.section { margin-bottom: 56px; }

.ladder { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.ladder__row { display: grid; grid-template-columns: 30px minmax(120px, 1fr) 60px minmax(80px, 3fr); gap: 16px; align-items: center; background: var(--ink); padding: 12px 0; }
.ladder__i { font-size: 11px; color: var(--muted); }
.ladder__n { font-family: var(--display); font-size: 18px; text-align: right; letter-spacing: -.02em; }
.ladder__bar { height: 3px; background: var(--ink3); }
.ladder__bar i { display: block; height: 100%; transform-origin: left; }
@media (max-width: 620px) { .ladder__row { grid-template-columns: 26px 1fr 48px; } .ladder__bar { display: none; } }

/* ---------- filters ---------- */

.filterbox { border: 1px solid var(--line); background: var(--ink2); margin-bottom: 18px; }
/* Plain (always-open) filter block, used on the dashboard and handling lookup. */
.filters { border: 1px solid var(--line); background: var(--ink2); padding: 16px 16px 0; margin-bottom: 22px; }
.filters__count { color: var(--muted); font-size: 12px; margin-right: auto; }
.filterbox > summary {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer;
  font-size: 12.5px; color: var(--paper); list-style: none;
}
.filterbox > summary:hover { color: var(--paper-strong); }
.filterbox > summary::after { content: "▾"; color: var(--muted); transition: transform .15s ease; }
.filterbox[open] > summary::after { transform: rotate(180deg); }
.filterbox > summary .count { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.filterbody { padding: 4px 16px 0; border-top: 1px solid var(--line); }
.filters__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; }
.filters__foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 4px 0 16px; }
.filters__search { grid-column: 1 / -1; }
.range { display: flex; gap: 7px; align-items: center; }
.range input { width: 100%; }

.searchrow { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.searchrow .field { flex: 1 1 280px; margin-bottom: 0; }
.searchrow .status { font-size: 11.5px; color: var(--muted); padding-bottom: 10px; min-width: 8ch; }

/* active filter chips */
.activefilters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.activefilters .lbl { margin: 0 4px 0 0; }
.fchip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px;
  border: 1px solid var(--line2); padding: 4px 6px 4px 10px; color: var(--paper);
}
.fchip b { font-weight: 400; color: var(--muted); }
.fchip a { color: var(--muted); padding: 0 3px; line-height: 1; }
.fchip a:hover { color: var(--hot); }

/* ---------- vehicle table ---------- */

.vtable { width: 100%; border-collapse: collapse; }
.vtable th { text-align: left; font-weight: 400; font-size: 11px; letter-spacing: .13em; color: var(--muted); padding: 0 14px 11px 0; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.vtable th a:hover { color: var(--paper-strong); }
.vtable td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.vtable tbody tr:hover { background: var(--ink2); }
.vtable tbody tr:hover .vname { color: var(--volt); }
.vname { font-size: 14px; color: var(--paper-strong); }
.vmodel { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
/* Numbers read left-aligned against their heading, not flung to the far edge. */
.num { text-align: left; font-variant-numeric: tabular-nums; }
.num-w { width: 92px; }
.sub { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.cell-thumb { width: 116px; padding-right: 16px; }
@media (max-width: 1100px) { .hide-md { display: none; } }
@media (max-width: 900px) { .hide-sm { display: none; } }
@media (max-width: 640px) { .hide-xs { display: none; } }

.thumb { display: block; position: relative; width: 100%; background: var(--ink3); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.thumb__fb { position: absolute; inset: 0; display: grid; place-items: center; z-index: 0; font-size: 10px; letter-spacing: .12em; color: var(--muted); text-align: center; padding: 4px; overflow: hidden; }
.thumb.is-missing img { display: none; }
.thumb.is-missing { background: repeating-linear-gradient(-45deg, var(--ink2) 0 6px, var(--ink3) 6px 12px); }

/* status: colour plus label, never colour alone */
.st { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.st i { width: 8px; height: 8px; flex: none; background: var(--todo); }
.st[data-status="todo"] i { background: var(--todo); }
.st[data-status="in_progress"] i { background: var(--in_progress); }
.st[data-status="in_review"] i { background: var(--in_review); }
.st[data-status="approved"] i { background: var(--approved); }
.st[data-status="pushed"] i { background: var(--pushed); }
.st[data-status="live"] i { background: var(--live); }

.chips { display: inline-flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.chip { font-size: 10px; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line2); padding: 2px 6px; }
.chip--tag { color: var(--paper); }

.pager { display: flex; gap: 16px; align-items: center; margin-top: 26px; font-size: 12.5px; color: var(--muted); }
.pager a:hover { color: var(--volt); }
.empty { padding: 52px 0; color: var(--muted); max-width: 46ch; }
.is-loading { opacity: .45; transition: opacity .12s linear; }

/* ---------- progression board ---------- */
/* States run left to right. Cards are small enough that a wide column fits
   four across; narrower columns fall back to three, two, then one. */

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 1fr);
  gap: 1px;
  background: var(--line);
  overflow-x: auto;
  padding-bottom: 6px;
  /* stretch, not start — every column runs to the height of the tallest so the
     board reads as one block instead of a ragged skyline. */
  align-items: stretch;
}

.col { background: var(--ink); min-height: 58vh; padding: 0 10px 30px; border-top: 2px solid var(--todo); display: flex; flex-direction: column; }
.col[data-status="todo"] { border-top-color: var(--todo); }
.col[data-status="in_progress"] { border-top-color: var(--in_progress); }
.col[data-status="in_review"] { border-top-color: var(--in_review); }
.col[data-status="approved"] { border-top-color: var(--approved); }
.col[data-status="pushed"] { border-top-color: var(--pushed); }
.col[data-status="live"] { border-top-color: var(--live); }

.col__head { padding: 10px 0 12px; position: sticky; top: 0; background: var(--ink); z-index: 2; }
.col__i { font-size: 10px; color: var(--muted); letter-spacing: .18em; }
.col__t { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 5px; }
.col__name { font-size: 12.5px; font-weight: 500; color: var(--paper-strong); }
.col__n { font-family: var(--display); font-size: 17px; letter-spacing: -.02em; }
.col[data-status="todo"] .col__n { color: var(--todo); }
.col[data-status="in_progress"] .col__n { color: var(--in_progress); }
.col[data-status="in_review"] .col__n { color: var(--in_review); }
.col[data-status="approved"] .col__n { color: var(--approved); }
.col[data-status="pushed"] .col__n { color: var(--pushed); }
.col[data-status="live"] .col__n { color: var(--live); }
.col.is-over { background: var(--ink2); }
.col.is-over .col__head { background: var(--ink2); }

.col__drop { min-height: 80px; flex: 1 1 auto; }
/* auto-fill caps naturally at 4 because the column never gets wide enough
   for a fifth 88px track plus gaps. */
.col__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 7px; }
.col__empty { color: var(--muted); font-size: 11.5px; padding: 16px 2px; }

.card { display: block; background: var(--ink2); cursor: grab; border: 1px solid transparent; border-left: 2px solid var(--line2); transition: border-color .12s, background .12s; }
.card:hover { background: var(--ink3); border-color: var(--line2); }
.card:active { cursor: grabbing; }
.card.is-dragging { opacity: .35; }
.col[data-status="todo"] .card { border-left-color: var(--todo); }
.col[data-status="in_progress"] .card { border-left-color: var(--in_progress); }
.col[data-status="in_review"] .card { border-left-color: var(--in_review); }
.col[data-status="approved"] .card { border-left-color: var(--approved); }
.col[data-status="pushed"] .card { border-left-color: var(--pushed); }
.col[data-status="live"] .card { border-left-color: var(--live); }
.card__b { display: block; padding: 7px 8px 8px; }
/* Two lines, then ellipsis — a long name stays readable instead of being cut
   after four characters the way a single nowrap line did. */
.card__n {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 11px; line-height: 1.3; color: var(--paper-strong);
  overflow: hidden; word-break: break-word; min-height: 2.6em;
}
.card__m { display: flex; gap: 6px; align-items: center; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin-top: 5px; }
.card__m span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .thumb__fb { font-size: 8px; letter-spacing: .06em; }

/* ---------- detail ---------- */

.detail { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(24px, 4vw, 52px); align-items: start; }
@media (max-width: 940px) { .detail { grid-template-columns: 1fr; } }
.detail__aside { position: sticky; top: 26px; }
.detail__meta { margin-top: 18px; display: grid; gap: 11px; }
.detail__meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.detail__meta span { color: var(--muted); }

.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 0 11px; color: var(--muted); cursor: pointer; font-size: 12px; letter-spacing: .1em; white-space: nowrap; }
.tab:hover { color: var(--paper-strong); }
.tab[aria-selected="true"] { color: var(--paper-strong); border-bottom-color: var(--volt); }
.panel[hidden] { display: none; }

.logs { border-top: 1px solid var(--line); margin-top: 24px; }
.log { padding: 13px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; }
.log__meta { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.log__mins { font-family: var(--display); font-size: 15px; }

.audit { font-size: 12px; }
.audit li { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.audit time { color: var(--muted); }
.audit b { font-weight: 400; color: var(--volt); }

/* ---------- handling ---------- */

.hl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: clamp(24px, 4vw, 48px); align-items: start; }
.hl--formfirst { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
@media (max-width: 960px) { .hl, .hl--formfirst { grid-template-columns: 1fr; } }
.xml { font-family: var(--mono); font-size: 12px; line-height: 1.5; background: var(--ink2); border: 1px solid var(--line); padding: 13px; overflow: auto; max-height: 460px; white-space: pre; tab-size: 2; margin: 0; }
.revlist { border-top: 1px solid var(--line); }
.rev { padding: 13px 0; border-bottom: 1px solid var(--line); }
.rev__h { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.rev__n { font-family: var(--display); font-size: 16px; }
.rev__meta { color: var(--muted); font-size: 11.5px; }
.rev__note { font-size: 12.5px; margin-top: 5px; }
.toolbar { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- misc ---------- */

.lookup { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.lookup__r { background: var(--ink); display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) 90px 150px; gap: 16px; padding: 12px 0; align-items: center; font-size: 13px; }
.lookup__r:hover { background: var(--ink2); }
@media (max-width: 720px) { .lookup__r { grid-template-columns: 1fr 110px; } .lookup__r > :nth-child(2), .lookup__r > :nth-child(3) { display: none; } }

.stack { display: grid; gap: 13px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.tabular { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- row selection and bulk edit ---------- */

.vtable tbody tr[data-open] { cursor: pointer; }
.vtable tbody tr.is-selected { background: rgba(217, 255, 63, 0.07); }
.vtable tbody tr.is-selected:hover { background: rgba(217, 255, 63, 0.10); }
.vtable tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--volt); }
.cell-pick { width: 34px; padding-right: 0; }
.cell-pick input { width: 15px; height: 15px; accent-color: var(--volt); cursor: pointer; }

.bulkbar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--ink2); border: 1px solid var(--line2);
  border-bottom: 0; padding: 14px 16px; margin-top: 18px;
  box-shadow: 0 -10px 24px rgba(10, 10, 16, .55);
}
.bulkbar[hidden] { display: none; }
.bulkbar .field { margin-bottom: 0; min-width: 150px; }
.bulkbar__count { font-size: 12.5px; color: var(--paper-strong); padding-bottom: 9px; white-space: nowrap; }
.bulkbar__count b { font-family: var(--display); font-size: 16px; margin-right: 4px; }
.bulkbar__spacer { flex: 1 1 auto; }
.bulkbar__actions { display: flex; gap: 8px; padding-bottom: 2px; }
@media (max-width: 700px) { .bulkbar { gap: 8px; padding: 12px; } .bulkbar .field { min-width: 120px; } }

.kbdhint { font-size: 11.5px; color: var(--muted); margin-top: 14px; }
.kbdhint kbd { border: 1px solid var(--line2); padding: 1px 5px; font-size: 10.5px; font-family: var(--mono); color: var(--paper); }

/* ---------- class badges ---------- */

.cls {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; padding: 1px 5px; font-size: 10.5px; line-height: 1.5;
  border: 1px solid currentColor; font-weight: 500; letter-spacing: .04em;
  background: transparent;
}
.cls[data-class="X"] { color: #14140c; border-color: transparent; background: var(--pearl); font-weight: 700; }
.cls[data-class="S"] { color: var(--cls-s); }
.cls[data-class="A"] { color: var(--cls-a); }
.cls[data-class="B"] { color: var(--cls-b); }
.cls[data-class="C"] { color: var(--cls-c); }
.cls[data-class="D"] { color: var(--cls-d); }

.stat__l .cls { margin-right: 2px; }
.meter__f.is-pearl { background: var(--pearl); }
.detail__meta .cls { font-size: 11px; }
