/* Fleet Records: Pacific Lumber & Truss brand (chosen 2026-10-04 from three variants: "A, dashboard grid").
   Navy sidebar with the logo plate, light ground, Inter / Inter Tight / Barlow Condensed figures.
   Signature: the website headline's 3px oak underline, used only under the page's key figure and as the active
   marker (sidebar item, filter segment, hovered bar row). Teal = action and selection. Red = overdue and errors. */


:root {
  --navy: #1C2E5C; --ink: #0E1A36; --navy-dark: #14224A;
  --teal: #0D8274; --teal-dark: #0C5F55; --teal-mid: #0F7D6F; --teal-bright: #19B49F; --teal-light: #5FD6C2;
  --oak: #D89A52; --oak-soft: #E4B87E; --oak-dark: #B87A38;
  --ground: #F8F9FA; --panel: #FFFFFF; --text: #2F2F2F; --text-2: #485063; --text-3: #5F6878;
  --rule: #E1E5EC; --rule-2: #EDF0F4; --track: #E8ECF2; --hover: #F3F6FA; --teal-tint: #E6F4F1;
  --danger: #B42318; --danger-tint: #FDEDEB; --svc: var(--teal-dark);
  --f-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-head: "Inter Tight", Inter, system-ui, sans-serif;
  --f-fig: "Barlow Condensed", "Arial Narrow", sans-serif;
  /* Fixed rem scale, ratio ~1.2 */
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-base: .875rem; --fs-md: 1rem; --fs-lg: 1.1875rem; --fs-xl: 1.4375rem;
  --fs-2xl: 1.75rem; --fs-stat: 2.5rem; --fs-hero: 3rem;
  --r: 8px; --r-sm: 5px;
  --side: 232px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* --- Reset ------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
a { color: inherit; }
body {
  font-family: var(--f-body); font-size: var(--fs-base); line-height: 1.5; color: var(--text); background: var(--ground);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
::selection { background: rgba(25, 180, 159, .28); color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* utilities the shared invoice drawer markup uses */
.block { display: block; } .flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; }
.gap-2 { gap: .5rem; } .gap-x-4 { column-gap: 1rem; } .gap-y-1 { row-gap: .25rem; } .min-w-0 { min-width: 0; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-4 { margin-top: 1rem; } .mb-2 { margin-bottom: .5rem; }
.font-normal { font-weight: 400 !important; } .nowrap { white-space: nowrap; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; } .ic-xs { width: 13px; height: 13px; stroke-width: 2.2; }

.muted { color: var(--text-3); } .small { font-size: var(--fs-sm); }
.mono, .mono-num { font-family: ui-monospace, monospace; font-size: .92em; letter-spacing: -.01em; }
.link { color: var(--teal-dark); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(12, 95, 85, .35); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Shell ------------------------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--navy); color: #DCE3F0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 14px 18px; overflow-y: auto;
}
.side-plate { display: block; background: #fff; border-radius: 10px; padding: 10px 14px; margin: 0 4px; }
.side-plate img { width: 100%; height: auto; max-width: 176px; margin: 0 auto; }
.side-app { font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .14em; text-transform: uppercase;
  color: #AFC0DA; margin: 14px 10px 18px; }
.side-nav { display: grid; gap: 2px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 14px; border-radius: 6px;
  color: #E3E9F4; text-decoration: none; font-weight: 500; font-size: var(--fs-base);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.side-link .ic { color: #9FB2D2; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.is-active { background: var(--teal); color: #fff; font-weight: 600; }
.side-link.is-active .ic { color: #fff; }
.side-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .14);
  font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-sm); text-align: center; color: #fff; }
.side-link.is-active .side-count { background: rgba(14, 26, 54, .28); }
.side-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-user { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.side-user-name { font-size: var(--fs-sm); color: #C9D4E6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.side-signout { border: 0; background: transparent; color: #AFC0DA; padding: 6px; border-radius: 5px; }
.side-signout:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-since { font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-md); letter-spacing: .02em; color: #9FB2D2; line-height: 1.35; }

/* Unit-type switcher: every page shows one type; this is where it is picked. */
.typeswitch { margin: -4px 0 16px; }
.typeswitch-btn {
  list-style: none; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; cursor: pointer;
  padding: 9px 12px 10px 14px; border-radius: 8px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.typeswitch-btn::-webkit-details-marker { display: none; }
.typeswitch-btn:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .24); }
.typeswitch-label { grid-column: 1; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9FB2D2; }
.typeswitch-cur { grid-column: 1; display: flex; align-items: center; gap: 9px; color: #fff;
  font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-lg); letter-spacing: .01em; line-height: 1.2; }
.typeswitch-cur .ic { color: var(--oak-soft); }
.typeswitch-chev { grid-column: 2; grid-row: 1 / span 2; color: #AFC0DA; transform: rotate(90deg); transition: transform .15s var(--ease); }
.typeswitch[open] .typeswitch-chev { transform: rotate(-90deg); }
.typeswitch.is-unset .typeswitch-btn { border-color: var(--oak); }
.typeswitch-menu { display: grid; gap: 2px; margin-top: 6px; padding: 6px; border-radius: 8px; background: var(--navy-dark); }
.typeswitch-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 6px; color: #E3E9F4;
  text-decoration: none; font-weight: 500; }
.typeswitch-item .ic { color: #9FB2D2; }
.typeswitch-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.typeswitch-item.is-on { background: var(--teal); color: #fff; font-weight: 600; }
.typeswitch-item.is-on .ic { color: #fff; }
.typeswitch-n { margin-left: auto; font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-sm); color: #AFC0DA; }
.typeswitch-item.is-on .typeswitch-n { color: #fff; }
.typeswitch-all { display: block; padding: 8px 10px 4px; margin-top: 2px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: var(--fs-sm); color: #AFC0DA; text-decoration: none; }
.typeswitch-all:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* Under the Fleet list: the legend, and the quiet way to the sold units */
.listfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 12px; }
.listfoot-sold { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); text-decoration: underline;
  text-decoration-color: var(--rule); text-underline-offset: 3px; }
.listfoot-sold:hover { color: var(--teal-dark); text-decoration-color: currentColor; }

/* Type picker page */
.typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.typetile { display: grid; gap: 14px; padding: 18px 20px 16px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  text-decoration: none; color: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.typetile:hover { border-color: var(--teal); box-shadow: 0 2px 10px rgba(14, 26, 54, .08); }
.typetile.is-on { border-color: var(--teal); box-shadow: inset 0 -3px 0 var(--oak); }
.typetile-head { display: flex; align-items: center; gap: 12px; }
.typetile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--navy); color: #fff; }
.typetile-icon .ic { width: 26px; height: 26px; stroke-width: 1.7; }
.typetile-name { font-family: var(--f-head); font-weight: 700; font-size: var(--fs-lg); color: var(--ink); line-height: 1.2; }
.typetile-units { font-size: var(--fs-sm); color: var(--text-3); }
.typetile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--rule-2); }
.typetile-facts dt { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.typetile-facts dd { font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-xl); color: var(--ink); line-height: 1.15; }
.typetile-facts dd.is-alert { color: var(--danger); }
.typetile-facts dd.is-zero { color: var(--text-3); }

.main { min-width: 0; }
.page { max-width: 1400px; padding: 24px 32px 48px; }

/* --- Filter row -------------------------------------------------------------------------------------- */
.filters { background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.filters-row { max-width: 1400px; padding: 10px 32px 12px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld-label { font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.select {
  appearance: none; height: 34px; padding: 0 32px 0 11px; border: 1px solid #CDD4DF; border-radius: var(--r-sm); background: #fff;
  font-size: var(--fs-base); font-weight: 500; color: var(--ink); max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6878' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
.select:hover { border-color: #AEB8C8; }
.filters .select { min-width: 128px; }
.seg { display: inline-flex; border: 1px solid #CDD4DF; border-radius: var(--r-sm); background: #fff; overflow: hidden; max-width: 100%; }
.seg-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; white-space: nowrap;
  font-size: var(--fs-base); font-weight: 500; color: var(--text-2); text-decoration: none; border-left: 1px solid var(--rule);
}
.seg-btn:first-child { border-left: 0; }
.seg-btn .ic { color: var(--text-3); }
.seg-btn:hover { background: var(--hover); color: var(--ink); }
.seg-btn.is-on { color: var(--ink); font-weight: 650; background: #F1F4F9; }
.seg-btn.is-on .ic { color: var(--teal); }
.seg-btn.is-on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--oak); }
.filters-reset { align-self: center; margin-top: 18px; font-size: var(--fs-sm); font-weight: 600; color: var(--teal-dark); }

/* --- Page head and stat strip ------------------------------------------------------------------------ */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.h1 { font-family: var(--f-head); font-weight: 800; font-size: var(--fs-2xl); line-height: 1.12; letter-spacing: -.015em; color: var(--ink); text-transform: uppercase; }
.pagehead-sub { margin-top: 6px; color: var(--text-2); font-size: var(--fs-base); }
.pagehead-alert {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--r-sm); border: 1px solid #F1C9C4;
  background: var(--danger-tint); color: #8A1B12; font-size: var(--fs-sm); text-decoration: none;
}
.pagehead-alert:hover { border-color: var(--danger); }

.stats { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.stats-vehicle { grid-template-columns: minmax(0, 1.3fr) repeat(var(--n, 6), minmax(0, 1fr)); }
.stat { padding: 14px 20px 16px; border-left: 1px solid var(--rule); min-width: 0; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat dt { font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat dd { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 4px; }
.stat-fig { font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-stat); line-height: 1; letter-spacing: -.005em; color: var(--ink); text-decoration: none; white-space: nowrap; }
a.stat-fig:hover { color: var(--teal-dark); }
.stat-fig-date { font-size: 2rem; line-height: 1.25; }
.stat-key .stat-fig { font-size: var(--fs-hero); }
.keyline { display: inline-block; padding-bottom: 4px; border-bottom: 3px solid var(--oak); }
.stat-note, .stat-delta { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.35; margin-top: 4px; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.stat-delta:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.stat-alert .stat-fig { color: var(--danger); }

/* --- Grid and panels --------------------------------------------------------------------------------- */
.grid { display: grid; gap: 20px; margin-bottom: 20px; align-items: start; }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 20px 18px; min-width: 0; }
.grid-2-1 > .panel { align-self: stretch; }
.panel-fill { display: flex; flex-direction: column; }
.panel-fill .chartbox { flex: 1; min-height: 300px; height: auto; }
.bars-rest { display: grid; grid-template-columns: minmax(0, 1fr) auto 3em; column-gap: 10px; align-items: baseline; margin-top: 4px; padding: 9px 0 2px;
  border-top: 1px dashed var(--rule); text-decoration: none; color: var(--text-2); font-weight: 500; }
.bars-rest b { font-weight: 600; color: var(--ink); text-align: right; }
.bars-rest-names { grid-column: 1 / -1; grid-row: 2; font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-rest:hover span:first-child { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.cell-veh { min-width: 0; }
.cell-sub { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.panel-flush { padding: 0; }
.panel-flush .panel-head { padding: 16px 20px 12px; margin: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.h2 { font-family: var(--f-head); font-weight: 700; font-size: var(--fs-md); color: var(--ink); letter-spacing: -.005em; }
.panel-meta { font-size: var(--fs-sm); color: var(--text-3); }
.panel-meta b { color: var(--ink); font-weight: 600; }
.more { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-sm); font-weight: 600; color: var(--teal-dark); text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }
.more-foot { margin-top: 12px; }
.chartbox { position: relative; height: 300px; }
.empty { color: var(--text-3); font-size: var(--fs-base); padding: 14px 0; }
.tbl .empty { padding: 22px 20px; }
.empty-good { display: flex; align-items: center; gap: 8px; color: var(--teal-dark); }
.footnote { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-3); }

/* ranked bars */
.bars { display: grid; }
.brow {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 3em; column-gap: 10px; row-gap: 5px; align-items: baseline;
  padding: 8px 0 9px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--rule-2);
}
.bars li:last-child .brow { border-bottom-color: transparent; }
.brow-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow-amt { font-weight: 600; color: var(--ink); text-align: right; }
.brow-share { text-align: right; color: var(--text-3); font-size: var(--fs-sm); }
.brow-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.brow-track > span { display: block; height: 100%; border-radius: 3px; background: var(--navy); transition: background-color .15s var(--ease); }
.brow-n { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--text-3); margin-top: -1px; }
.brow::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 2px; background: var(--oak); opacity: 0; transition: opacity .15s var(--ease); }
.brow:hover::after, .brow:focus-visible::after, .brow.is-on::after { opacity: 1; }
.brow:hover .brow-label, .brow.is-on .brow-label { color: var(--ink); }
.brow:hover .brow-track > span, .brow.is-on .brow-track > span { background: var(--teal); }

/* tables */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; font-size: var(--fs-base); }
.tbl th {
  text-align: left; font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--rule); background: #FAFBFC; white-space: nowrap;
}
.tbl th.num { text-align: right; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl-rows tbody tr { cursor: pointer; }
.tbl-rows tbody tr:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.cell-strong { font-weight: 600; color: var(--ink); }
.numlink { text-decoration: none; color: inherit; }
.numlink:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.tbl tr.is-sold td { color: var(--text-3); }
.tbl tr.is-sold .cell-strong { color: var(--text-2); }
.share { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); }
.share-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.share-bar > span { display: block; height: 100%; background: var(--teal); }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sys { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #EEF1F6; color: var(--navy); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.pdflink { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-dark); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }
.pdflink:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- Unit tag ---------------------------------------------------------------------------------------- */
.utag {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 6px; border: 1px solid #C9D1DE; border-radius: 4px;
  background: #fff; color: var(--ink); text-decoration: none; vertical-align: middle; white-space: nowrap;
}
.utag-ic { width: 15px; height: 15px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.utag b { font-family: var(--f-fig); font-weight: 700; font-size: 1.0625rem; line-height: 1; letter-spacing: .01em; }
.utag-gen { font-family: var(--f-fig); font-weight: 500; font-size: var(--fs-sm); color: var(--text-3); }
a.utag:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
a.utag:hover .utag-ic { stroke: var(--teal-light); }
a.utag:hover .utag-gen { color: #C9D4E6; }
.utag.is-sold { background: transparent; border-style: dashed; color: var(--text-3); }
.utag.is-sold .utag-ic { stroke: var(--text-3); }
.utag.is-sold b { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.utag-lg { height: 64px; padding: 0 16px 0 13px; gap: 10px; border-width: 2px; border-color: var(--navy); border-radius: 7px; }
.utag-lg .utag-ic { width: 28px; height: 28px; stroke-width: 1.9; }
.utag-lg b { font-size: 2.75rem; font-weight: 700; }
.utag-lg .utag-gen { font-size: var(--fs-lg); align-self: flex-end; padding-bottom: 10px; }
.soldmark { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; background: #ECEEF2; color: var(--text-2);
  font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; vertical-align: 1px; }
.soldmark-lg { margin: 0; font-size: var(--fs-sm); padding: 3px 9px; background: var(--ink); color: #fff; }

/* --- Due list ---------------------------------------------------------------------------------------- */
.duelist { display: grid; }
.due-unit { padding: 10px 0; border-bottom: 1px solid var(--rule-2); }
.due-unit:first-child { padding-top: 2px; }
.due-unit:last-child { border-bottom: 0; }
.due-unit-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.due-unit-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-unit-name:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.due-items { display: grid; gap: 3px; margin: 7px 0 0 2px; }
.due-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: var(--fs-sm); }
.due-what { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-when { font-weight: 600; white-space: nowrap; }
.due-overdue { color: var(--danger); }
.due-overdue .due-when { color: var(--danger); }
.due-unknown { color: var(--text-3); }
.due-unknown .due-when { color: var(--text-2); }
.due-soon, .due-soon .due-when { color: var(--teal-dark); }
.due-later, .due-later .due-when { color: var(--text-2); }
.due-item .due-what { color: var(--text); }
.due-finding { color: var(--navy); }
.due-finding .due-when { color: var(--text-2); font-weight: 500; }

/* --- Vehicle page ------------------------------------------------------------------------------------ */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: 14px; }
.crumbs a { color: var(--teal-dark); font-weight: 500; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 600; }
.vhead { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 18px; }
.vhead-text { min-width: 0; flex: 1 1 320px; }
.vhead-meta { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 6px; color: var(--text-2); font-size: var(--fs-base); }
.vhead-meta .mono { color: var(--ink); }
.vhead-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: var(--r); background: #EEF0F4; color: var(--text); margin-bottom: 18px; font-size: var(--fs-base); }
.gens { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: var(--fs-sm); margin-bottom: 18px; }
.gen { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--text-2); }
.gen:hover span:last-child { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.stat-due dd { margin-top: 10px; }
.duefact { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-weight: 600; font-size: var(--fs-base); }
.duefact small { flex-basis: 100%; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); padding-left: 22px; }

.recs { display: grid; }
.rec { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule-2); }
.rec:first-child { padding-top: 2px; }
.rec:last-child { border-bottom: 0; }
.rec-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--rule-2); }
.rec-mark.due-overdue { background: var(--danger-tint); }
.rec-mark.due-soon { background: var(--teal-tint); }
.prio { font-family: var(--f-fig); font-weight: 700; font-size: var(--fs-sm); }
.prio-high { background: var(--danger-tint); color: var(--danger); }
.prio-medium { background: #EEF1F6; color: var(--navy); }
.prio-low { background: var(--rule-2); color: var(--text-3); }
.rec-title { font-weight: 600; color: var(--ink); }
.rec-detail { margin-top: 4px; }
.rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; font-size: var(--fs-sm); color: var(--text-3); }
.rec-actions { display: inline-flex; gap: 10px; margin-left: auto; }
.textbtn { border: 0; background: none; padding: 2px 0; font-size: var(--fs-sm); font-weight: 600; color: var(--teal-dark); }
.textbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.textbtn-quiet { color: var(--text-3); }
.closed { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-2); }
.closed summary { cursor: pointer; color: var(--text-3); font-weight: 600; }
.closed ul { display: grid; gap: 4px; margin-top: 8px; }
.prose { font-size: var(--fs-base); line-height: 1.6; color: var(--text); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: .6em; }
.prose ul { list-style: disc; padding-left: 1.2em; display: grid; gap: .3em; }
.rec-detail.prose { font-size: var(--fs-sm); color: var(--text-2); }
.kv-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.histfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 0 20px 14px; }
.seg-years { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.histfilter-sys { margin-left: auto; }
.histfilter-sys .select { width: 250px; }
.trace { display: inline-flex; align-items: center; gap: 3px; font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 600; color: var(--teal-dark); white-space: nowrap; }

/* --- Buttons ----------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: var(--r-sm);
  border: 1px solid var(--teal); background: var(--teal); color: #fff; font-weight: 600; font-size: var(--fs-base); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: #CDD4DF; }
.btn-ghost:hover { background: var(--hover); border-color: #AEB8C8; color: var(--ink); }

/* --- Invoice drawer (shared markup from _event_drawer.html / _event_body.html) ----------------------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(14, 26, 54, .34); z-index: 150; animation: a-fade .18s var(--ease); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--panel); z-index: 151; display: flex; flex-direction: column;
  box-shadow: -12px 0 32px rgba(14, 26, 54, .18); animation: a-slide .22s var(--ease); outline: none;
}
@keyframes a-fade { from { opacity: 0; } }
@keyframes a-slide { from { transform: translateX(28px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-scrim { animation: none; } * { transition: none !important; } }
body.drawer-open { overflow: hidden; }
.drawer-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.drawer-head { position: relative; background: var(--navy); color: #fff; padding: 18px 20px 17px; display: flex; gap: 14px; align-items: center; border-bottom: 3px solid var(--teal); }
.drawer-title { font-family: var(--f-fig); font-weight: 600; font-size: 1.75rem; line-height: 1.1; letter-spacing: .005em; }
.drawer-title .sep, .drawer-sub .sep { margin: 0 .4em; color: #8FA3C6; }
.drawer-sub { font-size: var(--fs-sm); color: #C9D4E6; margin-top: 2px; }
.drawer-body { overflow-y: auto; padding: 18px 20px 28px; display: grid; gap: 18px; align-content: start; }
.drawer-section { border-top: 1px solid var(--rule); padding-top: 14px; }
.drawer .h2 { font-size: var(--fs-sm); font-family: var(--f-fig); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; border: 0; background: transparent; color: var(--text-2); }
.iconbtn:hover { background: var(--hover); }
.iconbtn-on-green { color: #DCE3F0; margin-left: auto; align-self: flex-start; }
.iconbtn-on-green:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.actionrow { display: flex; align-items: flex-end; gap: 8px; }
.actionrow .block { flex: 1; min-width: 0; }
.drawer .select { width: 100%; height: 36px; }
.label { display: block; margin-bottom: 4px; font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; font-size: var(--fs-base); }
.kv dt { color: var(--text-3); font-size: var(--fs-sm); padding-top: 1px; }
.kv dd { font-weight: 600; color: var(--ink); }
.lines { width: 100%; font-size: var(--fs-sm); }
.lines td { padding: 7px 0 6px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.lines td + td { padding-left: 12px; white-space: nowrap; }
.lines .kind { font-family: var(--f-fig); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-dark); }
.lines tfoot td { border-bottom: 0; font-weight: 700; color: var(--ink); }
.lines tfoot tr:last-child td { border-top: 2px solid var(--ink); font-size: var(--fs-base); }
.saved { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-dark); font-weight: 600; font-size: var(--fs-sm); background: var(--teal-tint); padding: 5px 10px; border-radius: 5px; justify-self: start; }
.prov { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: 600; color: var(--teal-dark); }
.stamp { display: inline-block; padding: 1px 7px; border-radius: 3px; background: #ECEEF2; color: var(--text-2);
  font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; }
/* --- Responsive -------------------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .stats-vehicle { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-vehicle .stat:nth-child(4n + 1) { border-left: 0; padding-left: 0; }
  .stats-vehicle .stat:nth-child(n + 5) { border-top: 1px solid var(--rule); }
  .hide-md { display: none; }
}
@media (max-width: 1100px) {
  .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .stats:not(.stats-vehicle) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats:not(.stats-vehicle) .stat:nth-child(3n + 1) { border-left: 0; padding-left: 0; }
  .stats:not(.stats-vehicle) .stat:nth-child(n + 4) { border-top: 1px solid var(--rule); }
}
@media (max-width: 900px) {
  .app { display: block; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 16px; overflow: visible; }
  .side-plate { padding: 6px 10px; margin: 0; border-radius: 7px; }
  .side-plate img { max-width: 104px; }
  .side-app { margin: 0; font-size: var(--fs-xs); }
  .typeswitch { margin: 0; position: relative; }
  .typeswitch-btn { padding: 5px 10px 6px 12px; }
  .typeswitch-label { display: none; }
  .typeswitch-cur { font-size: var(--fs-md); }
  .typeswitch-menu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 230px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
  .side-nav { order: 3; flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .side-link { padding: 7px 11px; flex: none; gap: 7px; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-user { margin: 0; }
  .side-user-name, .side-since { display: none; }
  .filters { position: static; }
  .filters-row { padding: 10px 16px 12px; gap: 10px 12px; }
  .page { padding: 18px 16px 40px; }
  .grid-1-1 { grid-template-columns: minmax(0, 1fr); }
  .h1 { font-size: var(--fs-xl); }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .filters-row > .fld { flex: 1 1 calc(50% - 6px); }
  .filters-row > .fld[role="group"] { flex-basis: 100%; }
  .filters .select { min-width: 0; width: 100%; }
  .seg { overflow-x: auto; scrollbar-width: none; }
  .stats, .stats-vehicle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat { border-top: 1px solid var(--rule); border-left: 0; padding: 12px 0; }
  .stats .stat:first-child { grid-column: 1 / -1; border-top: 0; }
  .stats .stat:nth-child(odd):not(:first-child) { border-left: 1px solid var(--rule); padding-left: 14px; }
  .stat-fig { font-size: 2.125rem; }
  .stat-key .stat-fig { font-size: 2.75rem; }
  .chartbox { height: 220px; }
  .panel { padding: 14px 16px 16px; }
  .panel-flush { padding: 0; }
  .panel-flush .panel-head { padding: 14px 16px 10px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
  .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; }
  .histfilter { padding: 0 16px 12px; }
  .histfilter-sys { margin-left: 0; flex-basis: 100%; }
  .histfilter-sys .select { width: 100%; }
  .seg-years { max-width: 100%; }
  .utag-lg { height: 54px; }
  .utag-lg b { font-size: 2.25rem; }
  .vhead-actions { width: 100%; }
}

/* --- Shared components used across the app's other pages ------------------------------------------- */
.drawer-head .utag { background: #fff; border-color: #fff; height: 40px; }
.drawer-head .utag b { font-size: 1.5rem; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 20px 18px; }
.pagehead h1 { font-family: var(--f-head); font-weight: 800; font-size: var(--fs-2xl); line-height: 1.12; letter-spacing: -.015em; color: var(--ink); text-transform: uppercase; }
.h1-plain, .pagehead h1.h1-plain { text-transform: none; letter-spacing: -.01em; }
.lede { margin-top: 6px; color: var(--text-2); font-size: var(--fs-base); max-width: 75ch; }
.h2-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.h2-row .more { margin-left: auto; }
.panel-flush > .h2-row { padding: 16px 20px 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.stack { display: grid; gap: 20px; }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.empty-line { color: var(--text-3); padding: 10px 0; }
.wrap { white-space: normal; min-width: 260px; max-width: 520px; }
.strong { font-weight: 600; color: var(--ink); }
.link-svc { font-variant-numeric: normal; display: inline-flex; align-items: center; gap: 4px; color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.link-svc:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: var(--fs-sm); }
.btn-amber { background: var(--teal); }
.btn-danger { background: #fff; color: var(--danger); border-color: #EBC1BC; }
.btn-danger:hover { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
.input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid #CDD4DF; border-radius: var(--r-sm); background: #fff; font-size: var(--fs-base); color: var(--ink); }
textarea.input { height: auto; padding: 8px 11px; line-height: 1.5; }
.input:hover { border-color: #AEB8C8; }
.input:focus, .select:focus { outline: 2px solid var(--teal); outline-offset: -1px; border-color: var(--teal); }
.input::placeholder { color: #7D8696; }
.check { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.searchbox .input { padding-left: 34px; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--panel); font-size: var(--fs-base); color: var(--text); }
.notice-ok { border-color: #BFE3DB; background: var(--teal-tint); color: var(--teal-dark); }
.notice-warn { border-color: #EBCB9E; background: #FBF2E6; color: #7A4E17; }
.notice-err { border-color: #F1C9C4; background: var(--danger-tint); color: #8A1B12; }
.notice-svc { border-color: #C9D3E6; background: #EEF2F9; color: var(--navy); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; line-height: 1.5; }
.s-queued, .s-processing { background: #EEF2F9; color: var(--navy); }
.s-needs_review { background: #FBF2E6; color: #7A4E17; }
.s-done { background: var(--teal-tint); color: var(--teal-dark); }
.s-failed { background: var(--danger-tint); color: var(--danger); }
.s-rejected { background: #ECEEF2; color: var(--text-2); }
.p-high { background: var(--danger-tint); color: var(--danger); }
.p-medium { background: #EEF1F6; color: var(--navy); }
.p-low { background: var(--rule-2); color: var(--text-3); }
.dropzone { border: 2px dashed #C2CAD7; border-radius: var(--r); background: var(--panel); transition: border-color .15s var(--ease), background .15s var(--ease); }
.dropzone.over { border-color: var(--teal); background: var(--teal-tint); }
.typechip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 1px solid #CDD4DF; border-radius: var(--r-sm);
  background: #fff; color: var(--text-2); font-weight: 500; font-size: var(--fs-base); text-decoration: none; white-space: nowrap; position: relative; }
.typechip:hover { background: var(--hover); color: var(--ink); }
.typechip.is-on { color: var(--ink); font-weight: 650; background: #F1F4F9; border-color: #AEB8C8; }
.typechip.is-on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--oak); }
.typechip .small, .typechip .muted { font-family: var(--f-fig); font-weight: 600; color: var(--text-3); }
.yearstrip { display: flex; flex-wrap: wrap; gap: 4px; }
.yearchip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid #CDD4DF; border-radius: var(--r-sm);
  background: #fff; font-weight: 500; font-size: var(--fs-sm); color: var(--text-2); text-decoration: none; }
.yearchip:hover { background: var(--hover); color: var(--ink); }
.yearchip.is-on { color: var(--ink); font-weight: 650; background: #F1F4F9; }
.yearchip.is-on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--oak); }
.sorth { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.sorth svg { opacity: .4; }
.sorth:hover, .sorth.is-active { color: var(--ink); }
.sorth.is-active svg { opacity: 1; color: var(--teal); }
.tbl tr[data-event] { cursor: pointer; }
.tbl a:not(.link) { text-decoration: none; }
.tbl a:not(.link):not(.utag):not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.tbl tr[data-event]:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--rule); }
.bulkbar { position: sticky; bottom: 16px; z-index: 25; margin-top: 14px; display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); box-shadow: 0 8px 24px rgba(14, 26, 54, .25); }
.bulkbar.is-on { display: flex; }
.bulkbar .select { width: 300px; color: var(--ink); }
.btn-on-dark { background: #fff; color: var(--ink); border-color: #fff; }
.btn-on-dark:hover { background: var(--teal-light); border-color: var(--teal-light); color: var(--ink); }
.bulkbar .textbtn { color: #C9D4E6; }
.pager { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 12px 20px; font-size: var(--fs-sm); color: var(--text-3); }
.sep { margin: 0 .35em; opacity: .7; }
/* due-state mark (ui.diamond) */
.dstate { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; font-size: var(--fs-sm); }
.dstate .ic { width: 16px; height: 16px; }
.dstate.due-later { font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); color: var(--text-3); margin-top: 10px; }
.hide-sm-inline { display: inline; }

/* --- Needs attention: the work board ------------------------------------------------------------------ */
.board { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.45fr) minmax(0, 1.15fr); gap: 16px; align-items: start; margin-bottom: 24px; }
.board-col { display: grid; gap: 16px; min-width: 0; }
.queue { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); min-width: 0; }
.queue-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 12px; border-bottom: 1px solid var(--rule-2); }
.queue-head > .ic { color: var(--teal); }
.queue-title { white-space: nowrap; font-family: var(--f-fig); font-weight: 700; font-size: var(--fs-md); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.queue-count { font-family: var(--f-fig); font-weight: 700; font-size: var(--fs-md); line-height: 1; padding: 3px 8px 2px; border-radius: 4px; background: #F6EBDD; color: #7A4E17; }
.queue-count.is-zero { background: var(--rule-2); color: var(--text-3); }
.queue-head .more { margin-left: auto; }
.queue-list { display: grid; }
.queue-item { display: grid; gap: 4px; padding: 11px 16px; border-bottom: 1px solid var(--rule-2); text-decoration: none; color: inherit; }
.queue-item:last-child { border-bottom: 0; }
a.queue-item:hover, .queue-item[data-event]:hover { background: var(--hover); cursor: pointer; }
.queue-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.queue-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-amt { font-family: var(--f-fig); font-weight: 600; font-size: 1.25rem; color: var(--ink); white-space: nowrap; }
.queue-sub { font-size: var(--fs-sm); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-empty { display: flex; gap: 10px; align-items: flex-start; padding: 16px; color: var(--text-2); font-size: var(--fs-sm); }
.queue-empty .ic { color: var(--teal); margin-top: 1px; }
.queue-foot { display: block; padding: 10px 16px; border-top: 1px solid var(--rule-2); font-size: var(--fs-sm); font-weight: 600; color: var(--teal-dark); text-decoration: none; }
.queue-foot:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1280px) { .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .board > .queue-due { grid-column: 1 / -1; grid-row: 1; } }
@media (max-width: 640px) { .board { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .side-nav { scroll-snap-type: x proximity; padding-right: 40px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
  .side-link { scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .filters .seg { scroll-snap-type: x proximity; padding-right: 28px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .filters .seg-btn { scroll-snap-align: start; }
  /* the 1100px rule's :not() outranks the plain phone rule; restate it at the same weight */
  .stats:not(.stats-vehicle) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats:not(.stats-vehicle) .stat { border-top: 1px solid var(--rule); border-left: 0; padding: 12px 0; }
  .stats:not(.stats-vehicle) .stat:first-child { grid-column: 1 / -1; border-top: 0; }
  .stats:not(.stats-vehicle) .stat:nth-child(odd):not(:first-child) { border-left: 1px solid var(--rule); padding-left: 14px; }
}

/* --- Insights: ask Claude, and the fleet findings ---------------------------------------------------- */
.ask { margin-bottom: 20px; }
.ask-form { display: flex; gap: 10px; align-items: flex-start; }
.ask-input { flex: 1; min-height: 46px; resize: vertical; font-size: var(--fs-md); padding: 11px 13px; line-height: 1.45; }
.ask-btn { height: 46px; padding: 0 20px; }
.ask-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ask-examples .typechip { cursor: pointer; font-size: var(--fs-sm); height: 30px; }
.ask-busy { display: none; align-items: center; gap: 10px; margin-top: 12px; color: var(--teal-dark); font-size: var(--fs-sm); font-weight: 600; }
.ask-busy.htmx-request, .htmx-request .ask-busy { display: flex; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--teal-tint); border-top-color: var(--teal); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.answers { display: grid; margin-top: 8px; }
.answer { padding: 16px 0 14px; border-top: 1px solid var(--rule-2); }
.answer:first-child { margin-top: 10px; }
.answer.is-fresh { animation: a-fade .3s var(--ease); }
.answer-q { display: flex; align-items: baseline; gap: 8px; }
.answer-q .ic { color: var(--teal); align-self: center; }
.answer-question { font-weight: 600; color: var(--ink); flex: 1; min-width: 0; }
.answer-meta { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.answer-body { margin: 8px 0 0 24px; max-width: 80ch; }
.answer-table { margin: 12px 0 0 24px; border: 1px solid var(--rule); border-radius: var(--r-sm); }
.answer-table .tbl th:first-child, .answer-table .tbl td:first-child { padding-left: 12px; }
.answer-units { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0 24px; }
.answer-error { margin: 8px 0 0 24px; color: var(--danger); font-size: var(--fs-sm); }
.answer-how { margin: 10px 0 0 24px; font-size: var(--fs-xs); color: var(--text-3); }
.answer-how summary { cursor: pointer; font-weight: 600; }
.answer-how pre { margin-top: 6px; padding: 8px 10px; background: var(--ground); border: 1px solid var(--rule-2); border-radius: var(--r-sm); white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
.insights-note { margin: 0 20px 14px; }
.insights-overview { margin: 0 20px 6px; max-width: 85ch; font-size: var(--fs-md); line-height: 1.55; color: var(--text); }
.insight-list { display: grid; }
.insight { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 6px 22px; padding: 16px 20px; border-top: 1px solid var(--rule-2); }
.insight-kind { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-family: var(--f-fig); font-weight: 600; font-size: var(--fs-sm);
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding-top: 2px; }
.insight-prio { padding: 1px 7px; border-radius: 3px; background: var(--danger-tint); color: var(--danger); letter-spacing: .06em; }
.insight-prio-med { background: #EEF1F6; color: var(--navy); }
.insight-title { font-family: var(--f-head); font-weight: 700; font-size: var(--fs-md); color: var(--ink); line-height: 1.35; }
.insight-detail { margin-top: 4px; max-width: 80ch; color: var(--text-2); }
.insight-units { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.insight-figure { font-family: var(--f-fig); font-weight: 600; font-size: 1.75rem; line-height: 1.1; color: var(--ink); white-space: nowrap; text-align: right; }
@media (max-width: 760px) {
  .insight { grid-template-columns: minmax(0, 1fr) auto; }
  .insight-kind { grid-column: 1 / -1; flex-direction: row; }
  .ask-form { flex-direction: column; align-items: stretch; }
  .answer-body, .answer-table, .answer-units, .answer-error, .answer-how { margin-left: 0; }
}
.earlier { margin-top: 20px; }
.earlier-list { display: grid; }
.earlier-item { border-top: 1px solid var(--rule-2); }
.earlier-item > summary { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; cursor: pointer; list-style: none; }
.earlier-item > summary::-webkit-details-marker { display: none; }
.earlier-item > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); flex: none; align-self: center; transition: transform .15s var(--ease); }
.earlier-item[open] > summary::before { transform: rotate(45deg); }
.earlier-q { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.earlier-item > summary:hover .earlier-q { color: var(--teal-dark); }
.earlier-item .answer { border-top: 0; padding-top: 0; }
.earlier-item .answer-q { display: none; }

/* Fleet list: three collapsible sections */
.fleet-group > summary { cursor: pointer; list-style: none; align-items: center; }
.fleet-group > summary::-webkit-details-marker { display: none; }
.fleet-group > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); flex: none; margin-right: 4px; transition: transform .15s var(--ease); }
.fleet-group[open] > summary::before { transform: rotate(45deg); }
.fleet-group > summary:hover .h2 { color: var(--teal-dark); }
.fleet-group:not([open]) > summary { padding-bottom: 16px; }
.fleet-years { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 20px 14px; }
.fleet-years .muted.small { margin-right: 4px; }
/* One tbody per unit: main row + full-width notes line, one divider, one hover */
.fleet-tbl tbody td { border-bottom: 0; }
.fleet-tbl tbody + tbody { border-top: 1px solid var(--rule-2); }
.fleet-tbl tbody:hover td { background: var(--hover); }
.fleet-tbl tr.fleet-notes td { padding-top: 0; padding-bottom: 11px; font-size: var(--fs-sm); line-height: 1.45; }
