/* FieldFleet Diesel — design system
   One typeface, Archivo, shipped with the app (62 KB, no Google Fonts): normal width for words,
   squeezed to 75% and heavy for figures, like a pump counter or a number plate.
   Stone neutrals, 1px dividers instead of boxes, sentence-case headings. Red only for problems. */
@font-face { font-family: 'Archivo'; src: url('fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
:root {
  --ink: #1C1917;
  --ink-2: #44403C;
  --muted: #78716C;
  --faint: #A8A29E;
  --line: #E7E5E4;
  --line-strong: #D6D3D1;
  --surface: #FFFFFF;
  --bg: #FAFAF9;
  --sunk: #F5F5F4;
  --btn: #1C1917;
  --btn-ink: #FAFAF9;
  --focus: #57534E;
  --bad: #B42318;  --bad-bg: #FEF3F2;  --bad-line: #FECDCA;
  --warn: #B54708; --warn-bg: #FFFAEB; --warn-line: #FEDF89;
  --ok: #067647;   --ok-bg: #ECFDF3;   --ok-line: #ABEFC6;
  --low: #57534E;  --low-bg: #F5F5F4;
  --shadow: 0 1px 2px rgba(28,25,23,.06), 0 8px 24px rgba(28,25,23,.08);
  --scrim: rgba(28,25,23,.38);

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Archivo', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --fig-w: 75%;
  --r: 10px;
  --r-lg: 16px;
  --nav-w: 232px;
  --tap: 48px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #F5F5F4; --ink-2: #D6D3D1; --muted: #A8A29E; --faint: #78716C; --line: #292524; --line-strong: #3A3532;
  --surface: #171412; --bg: #0C0A09; --sunk: #1F1B19; --btn: #F5F5F4; --btn-ink: #1C1917; --focus: #D6D3D1;
  --bad: #F97066; --bad-bg: #2A1310; --bad-line: #55160C; --warn: #FDB022; --warn-bg: #2A1E08; --warn-line: #4E3A0B;
  --ok: #47CD89; --ok-bg: #0B2418; --ok-line: #0F4A2D; --low: #D6D3D1; --low-bg: #24201E;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5); --scrim: rgba(0,0,0,.6);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --ink: #F5F5F4; --ink-2: #D6D3D1; --muted: #A8A29E; --faint: #78716C; --line: #292524; --line-strong: #3A3532;
  --surface: #171412; --bg: #0C0A09; --sunk: #1F1B19; --btn: #F5F5F4; --btn-ink: #1C1917; --focus: #D6D3D1;
  --bad: #F97066; --bad-bg: #2A1310; --bad-line: #55160C; --warn: #FDB022; --warn-bg: #2A1E08; --warn-line: #4E3A0B;
  --ok: #47CD89; --ok-bg: #0B2418; --ok-line: #0F4A2D; --low: #D6D3D1; --low-bg: #24201E;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5); --scrim: rgba(0,0,0,.6);
  color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); font-optical-sizing: auto; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, td.n, .fig { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───── App frame ───── */
.app { min-height: 100%; display: grid; grid-template-columns: 1fr; }
.side { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; min-width: 0; text-decoration: none; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.brand .mark svg { width: 16px; height: 16px; }
.brand .co { font-weight: 400; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding-block: 24px 120px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-content: start; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.tabbar .dot { position: absolute; top: 5px; left: calc(50% + 7px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; font-weight: 600; }

@media (min-width: 1000px) {
  .app { grid-template-columns: var(--nav-w) 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 18px 12px; background: var(--bg); overflow-y: auto; }
  .side .brand { padding: 4px 8px 18px; }
  .side nav { display: grid; gap: 2px; }
  .side .grp { font-size: 12px; color: var(--muted); padding: 18px 10px 6px; }
  .side a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
  .side a.nav svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
  .side a.nav:hover { background: var(--sunk); }
  .side a.nav[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
  .side a.nav[aria-current="page"] svg { color: var(--ink); }
  .side a.nav .count { margin-left: auto; font-size: 12px; color: var(--bad); font-weight: 600; }
  .side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13px; }
  .topbar .brand { display: none; }
  .tabbar { display: none; }
  .content { padding-block: 32px 64px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

/* ───── Page header ───── */
.ph { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; justify-content: space-between; }
.ph h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.ph .sub { color: var(--muted); margin-top: 4px; max-width: 64ch; }
.ph .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.sec { display: grid; gap: 12px; min-width: 0; align-content: start; }
.sec > *, .cols > *, .form > * { min-width: 0; }
.sec > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sec h2 { font-weight: 650; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); }
.sec .more { font-size: 13px; color: var(--muted); text-decoration: none; }
.sec .more:hover { color: var(--ink); }
.cols { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .cols.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }

/* ───── Big figures strip ───── */
.strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.strip > div { padding: 16px 16px 18px 0; display: grid; gap: 2px; align-content: start; min-width: 0; }
.strip > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.strip > div:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
.strip > div:nth-child(4) { border-top: 1px solid var(--line); }
@media (min-width: 760px) {
  .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .strip > div:nth-child(3) { border-left: 1px solid var(--line); padding-left: 16px; border-top: 0; }
  .strip > div:nth-child(4) { border-top: 0; }
}
.strip .label { font-size: 12px; color: var(--muted); }
.strip .fig { font-family: var(--display); font-stretch: var(--fig-w); font-weight: 700; font-size: clamp(30px, 6vw, 44px); line-height: 1.05; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .fig small { font-family: var(--font); font-stretch: 100%; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.strip .foot { font-size: 12px; color: var(--muted); }
.fig.bad, .strip .bad { color: var(--bad); }
.fig.ok { color: var(--ok); }

/* ───── Buttons & inputs ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.btn.primary:hover { opacity: .92; }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.big { min-height: 56px; font-size: 16px; padding: 0 24px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--sunk); }
.iconbtn svg { width: 20px; height: 20px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.field .err { font-size: 13px; color: var(--bad); }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.input.big { min-height: 56px; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.input[aria-invalid="true"] { border-color: var(--bad); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2378716C' stroke-width='1.6'%3E%3Cpath d='M2 4.5l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
select.input.select-sm, .select-sm { width: auto; max-width: 100%; min-height: 36px; padding: 6px 30px 6px 12px; border-radius: 999px; font-size: 13px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.form { display: grid; gap: 16px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--btn); }

.seg { justify-self: start; max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sunk); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.seg.big { display: grid; }
.seg.big button { padding: 14px; font-size: 16px; }

/* ───── Pills ───── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 999px; white-space: nowrap; line-height: 20px; background: var(--low-bg); color: var(--low); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.High, .pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.Medium, .pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.ok { color: var(--ok); background: var(--ok-bg); }

/* ───── Tables ───── */
.tablewrap { overflow-x: auto; border-top: 1px solid var(--line-strong); -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th:first-child, table.t td:first-child { padding-left: 0; }
table.t th:last-child, table.t td:last-child { padding-right: 0; }
table.t .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--sunk); }
table.t tr.voided td { color: var(--faint); text-decoration: line-through; }
table.t td .strong { font-weight: 500; }
table.t td .sub { font-size: 12px; color: var(--muted); }
table.t tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line-strong); }

/* ───── Lists & flags ───── */
.list { border-top: 1px solid var(--line-strong); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.row.click { cursor: pointer; }
.row.click:hover { background: linear-gradient(90deg, transparent, var(--sunk) 8%, var(--sunk) 92%, transparent); }
.row .t1 { font-weight: 500; }
.row .t2 { color: var(--muted); font-size: 14px; }
.row .meta { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.row .actions { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.row.resolved .t1, .row.resolved .t2 { color: var(--faint); }
@media (max-width: 560px) { .row { grid-template-columns: minmax(0, 1fr) auto; } .row > .pill { grid-column: 1 / -1; justify-self: start; } .row .actions { grid-column: 1 / -1; } }
.group-h { display: flex; align-items: center; gap: 10px; padding: 18px 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); }

/* ───── Empty / loading / notice ───── */
.empty { padding: 40px 0; display: grid; gap: 10px; justify-items: start; max-width: 52ch; }
.empty h3 { font-size: 17px; font-weight: 600; }
.empty p { color: var(--muted); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--sunk); font-size: 14px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice .btn { margin-left: auto; }
.skel { background: linear-gradient(90deg, var(--sunk), var(--line), var(--sunk)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.loading { display: grid; gap: 14px; padding: 8px 0; }

/* ───── Sync chip ───── */
.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--sunk); white-space: nowrap; border: 0; cursor: default; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.sync.wait i { background: var(--warn); }
.sync.off i { background: var(--faint); }
.demo-chip { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); background: var(--warn-bg); padding: 3px 8px; border-radius: 6px; }

/* ───── Sheet (detail panel) & dialog ───── */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; z-index: 51; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column;
  left: 0; right: 0; bottom: 0; max-height: 92vh; border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet.on { transform: none; }
.sheet .sh-h { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); padding-left: max(20px, env(safe-area-inset-left, 0px)); }
.sheet .sh-h h2 { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; }
.sheet .sh-b { overflow-y: auto; padding: 20px; display: grid; gap: 22px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.sheet .sh-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (min-width: 760px) {
  .sheet { left: auto; top: 0; bottom: 0; width: min(560px, 100vw); max-height: none; border-radius: 0; transform: translateX(100%); }
  .sheet.dialog { top: 50%; bottom: auto; left: 50%; right: auto; width: min(480px, calc(100vw - 32px)); max-height: 86vh; border-radius: 18px; transform: translate(-50%, -46%); opacity: 0; transition: opacity .18s, transform .22s; }
  .sheet.dialog.on { transform: translate(-50%, -50%); opacity: 1; }
}
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 3 / 4; max-width: 100%; border-radius: var(--r); overflow: hidden; background: var(--sunk); border: 1px solid var(--line); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.photo .cap { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 500; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 6px; }
.photo.missing { border-style: dashed; color: var(--bad); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70; background: var(--btn); color: var(--btn-ink); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
@media (min-width: 1000px) { .toast { bottom: 28px; } }

/* ───── Charts ───── */
.spark { width: 96px; height: 28px; display: block; }
.spark path.l { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.spark path.a { fill: var(--sunk); }
.spark .base { stroke: var(--faint); stroke-dasharray: 2 3; stroke-width: 1; }
.spark circle { fill: var(--ink); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .band { fill: var(--sunk); }
.chart .base { stroke: var(--ink-2); stroke-dasharray: 4 4; stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .pt { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.chart .pt.bad { stroke: var(--bad); fill: var(--bad); }
.chart .pt.warn { stroke: var(--warn); fill: var(--warn); }
.gauge { height: 14px; border-radius: 7px; background: var(--sunk); overflow: hidden; border: 1px solid var(--line); }
.gauge > i { display: block; height: 100%; background: var(--ink-2); border-radius: 7px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.bar .track { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--ink-2); }

/* ───── Log page big choices ───── */
.choices { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .choices { grid-template-columns: repeat(3, 1fr); } }
.choice { display: grid; gap: 6px; text-align: left; padding: 20px; min-height: 120px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color .15s, transform .1s; }
.choice:hover { border-color: var(--ink-2); }
.choice:active { transform: scale(.99); }
.choice svg { width: 26px; height: 26px; color: var(--ink); }
.choice b { font-size: 17px; font-weight: 600; }
.choice span { color: var(--muted); font-size: 14px; }
.photopick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photopick label { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border: 1.5px dashed var(--line-strong); border-radius: var(--r); display: grid; place-items: center; text-align: center; gap: 4px; cursor: pointer; color: var(--muted); font-size: 13px; overflow: hidden; background: var(--surface); }
.photopick label.done { border-style: solid; border-color: var(--ok-line); }
.photopick label img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photopick label b { position: relative; z-index: 1; font-weight: 500; color: var(--ink); }
.photopick label.done b { background: rgba(0,0,0,.55); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 12px; position: absolute; left: 8px; bottom: 8px; }
.photopick input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ───── Login ───── */
.auth { min-height: 100%; display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth .card { width: min(420px, 100%); display: grid; gap: 22px; }
.auth h1 { font-weight: 750; font-stretch: 88%; font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.auth .lede { color: var(--muted); }
.auth .alt { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.auth .alt::before, .auth .alt::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ───── Stickers (print) ───── */
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.sticker { border: 1px solid var(--line-strong); border-radius: 14px; padding: 16px; display: grid; gap: 10px; justify-items: center; text-align: center; background: #fff; color: #111; break-inside: avoid; }
.sticker .co { font-family: var(--display); font-stretch: var(--fig-w); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 15px; }
.sticker .qr { width: 100%; max-width: 190px; aspect-ratio: 1; }
.sticker .qr svg { width: 100%; height: 100%; display: block; }
.sticker .nm { font-weight: 600; font-size: 16px; line-height: 1.2; }
.sticker .rg { font-family: var(--display); font-stretch: var(--fig-w); font-weight: 700; font-size: 20px; letter-spacing: .06em; border: 2px solid #111; border-radius: 6px; padding: 0 8px; }
.sticker .cta { font-family: var(--display); font-stretch: var(--fig-w); font-weight: 700; font-size: 18px; letter-spacing: .1em; text-transform: uppercase; background: #111; color: #fff; padding: 4px 12px; border-radius: 6px; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .side, .topbar, .tabbar, .noprint, .ph .tools { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .stickers { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .sticker { border: 1px solid #999; }
}

/* ───── Driver page ───── */
.pic { display: grid; place-items: center; color: var(--ink); background: var(--sunk); border-radius: 24px; padding: 28px 0; }
.pic svg { width: min(200px, 52vw); height: auto; }
.stepn { font-size: 15px; font-weight: 600; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.shotstrip { display: flex; gap: 6px; justify-content: center; }
.shotstrip .mini { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border: 2px solid var(--ok-line); background: var(--sunk); }
.shotstrip .mini img { width: 100%; height: 100%; object-fit: cover; }
.shotprev { max-width: 220px; margin: 0 auto; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 2px solid var(--ok-line); }
.shotprev img { width: 100%; height: 100%; object-fit: cover; }
.btn.cam { position: relative; overflow: hidden; }
.btn.cam input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drv { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.drv-top { display: flex; align-items: center; gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.drv-top .veh { display: grid; min-width: 0; flex: 1; }
.drv-top .veh b { font-size: 17px; font-weight: 650; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drv-top .veh .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-top .reg { font-stretch: 70%; font-weight: 700; font-size: 16px; letter-spacing: .05em; border: 2px solid var(--ink); border-radius: 6px; padding: 1px 7px; white-space: nowrap; flex: none; }
.drv-prog { height: 3px; background: var(--line); }
.drv-prog i { display: block; height: 100%; background: var(--ink); transition: width .25s; }
.drv-body { flex: 1; display: flex; flex-direction: column; gap: 20px; padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 560px; width: 100%; margin: 0 auto; }
.drv-q { font-size: 30px; font-weight: 750; font-stretch: 92%; line-height: 1.1; letter-spacing: -0.025em; }
.drv-help { color: var(--muted); font-size: 17px; line-height: 1.4; }
.drv-val { font-family: var(--display); font-stretch: var(--fig-w); font-weight: 750; font-size: 64px; line-height: 1; min-height: 80px; display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; font-variant-numeric: tabular-nums; overflow: hidden; }
.drv-val .u { font-size: 24px; color: var(--muted); font-stretch: 100%; font-weight: 500; }
.drv-val .ph0 { color: var(--faint); }
.drv-warn { color: var(--warn); font-weight: 500; font-size: 15px; }
.drv-err { color: var(--bad); font-weight: 500; font-size: 15px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.pad button { min-height: 68px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 30px; font-stretch: 88%; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; touch-action: manipulation; }
.pad button:active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pad button svg { width: 26px; height: 26px; }
.drv-actions { display: grid; gap: 10px; }
.drv-actions .btn.big { min-height: 64px; font-size: 19px; font-weight: 650; border-radius: 18px; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yesno button { min-height: 132px; border-radius: 20px; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 30px; font-stretch: 92%; font-weight: 750; letter-spacing: -0.02em; cursor: pointer; }
.yesno button:first-child { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.yesno button:active { border-color: var(--ink); }
.shots { display: grid; gap: 12px; }
.shot { position: relative; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 12px 14px; border-radius: 16px; border: 1.5px dashed var(--line-strong); background: var(--surface); cursor: pointer; overflow: hidden; }
.shot .thumb { width: 60px; height: 60px; border-radius: 10px; background: var(--sunk); flex: none; display: grid; place-items: center; overflow: hidden; }
.shot .thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot .thumb svg { width: 26px; height: 26px; color: var(--muted); }
.shot b { font-size: 18px; font-weight: 600; display: block; }
.shot span { color: var(--muted); font-size: 14px; }
.shot.done { border-style: solid; border-color: var(--ok-line); }
.shot.done .tick { margin-left: auto; color: var(--ok); }
.shot.skipped { border-style: solid; border-color: var(--warn-line); }
.shot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.reasons { display: grid; gap: 8px; }
.reasons button { min-height: 56px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); text-align: left; padding: 0 16px; font-size: 17px; cursor: pointer; }
.reasons button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.done-tick { width: 120px; height: 120px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin: 24px auto 8px; }
.done-tick svg { width: 64px; height: 64px; }
.summary { display: grid; border-top: 1px solid var(--line-strong); }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.summary div span { color: var(--muted); }
.summary div b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* Driver: problem chips in two columns, language choice under the PIN pad */
.reasons.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reasons.two button { padding: 10px 14px; line-height: 1.25; }
.reasons.two button:last-child:nth-child(odd) { grid-column: 1 / -1; }
.langpick { justify-self: center; margin: 16px auto 0; }
.langpick button { padding: 10px 18px; font-size: 14px; }
.row .do { margin-top: 4px; font-size: 13px; color: var(--ink); }
.row .do b { font-weight: 500; color: var(--muted); }
.todo .row { align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; }
.todo .n { font-stretch: var(--fig-w); font-size: 26px; font-weight: 700; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.todo .n.bad { color: var(--bad); }

/* ───── Overview headline: the one number the app exists for, with a gauge of logged vs missing litres ───── */
.hero { display: grid; gap: 28px 48px; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); padding: 24px 0 26px; }
.hero .k { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.hero .big { font-stretch: var(--fig-w); font-weight: 800; font-size: clamp(64px, 17vw, 124px); line-height: .92; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; }
.hero .big.bad { color: var(--bad); } .hero .big.ok { color: var(--ok); }
.hero .big.words { font-size: clamp(36px, 8vw, 64px); line-height: 1; white-space: normal; text-wrap: balance; }
.hero .cap { color: var(--muted); margin-top: 10px; max-width: 46ch; }
.gauge { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--sunk); margin-top: 18px; }
.gauge i { display: block; height: 100%; background: var(--ink); min-width: 0; }
.gauge i.miss { background: repeating-linear-gradient(135deg, var(--bad) 0 5px, color-mix(in srgb, var(--bad) 55%, transparent) 5px 9px); min-width: 10px; border-left: 2px solid var(--bg); }
.gauge-l { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.gauge-l .bad { color: var(--bad); font-weight: 500; }
.hero dl { margin: 0; display: grid; align-content: start; }
.hero dl > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.hero dl > div:last-child { padding-bottom: 0; }
.hero dt { font-size: 14px; color: var(--ink-2); }
.hero dd { margin: 0; grid-row: 1; grid-column: 2; font-stretch: var(--fig-w); font-weight: 700; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero dd.bad { color: var(--bad); }
.hero dl small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; padding: 32px 0 34px; }
  .hero dl > div:first-child { border-top: 0; padding-top: 0; }
}

/* ───── Driver: PIN boxes, no-signal bar, and a full-screen answer after Save ───── */
.pinrow { display: grid; grid-template-columns: repeat(4, 60px); gap: 12px; justify-content: center; }
.pinrow span { height: 68px; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; }
.pinrow span.on { border-color: var(--ink); }
.pinrow span.on::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); }
.drv-off { display: flex; align-items: center; gap: 8px; justify-content: center; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; padding: 8px 16px; text-align: center; }
.drv-off::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #FDB022; flex: none; }
.drv.sent, .drv.held { color: #fff; }
.drv.sent { background: #067647; }
.drv.held { background: #1C1917; }
.drv.sent .drv-top, .drv.held .drv-top { border-color: rgba(255,255,255,.22); }
.drv.sent .drv-top .small, .drv.held .drv-top .small, .drv.sent .drv-help, .drv.held .drv-help, .drv.sent .summary div span, .drv.held .summary div span { color: rgba(255,255,255,.78); }
.drv.sent .drv-top .reg, .drv.held .drv-top .reg { border-color: #fff; }
.drv.sent .brand .mark, .drv.held .brand .mark { background: #fff; color: #1C1917; }
.drv.sent .drv-prog, .drv.held .drv-prog { background: transparent; } .drv.sent .drv-prog i, .drv.held .drv-prog i { background: transparent; }
.drv.sent .summary, .drv.held .summary, .drv.sent .summary div, .drv.held .summary div { border-color: rgba(255,255,255,.22); }
.drv.sent .done-tick { background: #fff; color: #067647; }
.drv.held .done-tick { background: #FDB022; color: #1C1917; }
.drv.sent .btn, .drv.held .btn { background: #fff; color: #1C1917; border-color: #fff; }
.drv.sent .btn.ghost, .drv.held .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.drv.sent .drv-err, .drv.held .drv-err { color: #fff; background: #B42318; padding: 8px 12px; border-radius: 10px; display: inline-block; }
.done-tick { width: 132px; height: 132px; margin: 28px auto 4px; }
.done-big { font-size: 44px; font-weight: 800; font-stretch: 88%; letter-spacing: -0.03em; line-height: 1; text-align: center; }
