/* GaadiKhata styles. Mobile first; sidebar layout from 900px.
   Palette: asphalt ink, highway-sign green, odometer amber. */

:root {
  color-scheme: light;
  --bg: #F1F3F2;
  --surface: #FFFFFF;
  --ink: #1E2630;
  --muted: #5B6670;
  --line: #D9DFDC;
  --green: #0C6B32;
  --green-hover: #08561F;
  --green-soft: #E4F2E6;
  --leaf: #4BA707;
  --on-green: #FFFFFF;
  --amber: #E3A21A;
  --amber-soft: #FBF0D6;
  --amber-ink: #6B4A05;
  --red: #B42318;
  --red-soft: #FCE8E6;
  --odo-cell: #1E2630;
  --odo-digit: #F4F6F5;
  --calc: #2F5D8A;
  --focus: #2F5D8A;
  --radius-s: 6px;
  --radius-m: 10px;
  --head: 'Barlow Semi Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 64px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12171C;
    --surface: #1A2128;
    --ink: #E6EAEE;
    --muted: #9AA5AF;
    --line: #2C353E;
    --green: #3FB46A;
    --green-hover: #55C47E;
    --green-soft: #17351F;
    --leaf: #7BC94A;
    --on-green: #08130F;
    --amber-soft: #3A2E12;
    --amber-ink: #F1C766;
    --red: #F97066;
    --red-soft: #3A1D1B;
    --odo-cell: #0B0F13;
    --calc: #8DB8E3;
    --focus: #8DB8E3;
  }
}

*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 64px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: .005em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--green); text-underline-offset: 2px; }
a:hover { color: var(--green-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 22px; height: 22px; flex: none; }

/* ---- Skip link, top bar, navigation ---- */

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  padding: .6rem 1rem; border: 0; border-radius: var(--radius-s);
  background: var(--ink); color: var(--bg); font: inherit;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; height: 56px; padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 21;
  height: env(safe-area-inset-top, 0px); background: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font: 700 1.35rem var(--head); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  min-height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--nav-h); color: var(--muted); text-decoration: none;
  font-size: .72rem; font-weight: 500;
}
.nav a.active { color: var(--green); font-weight: 600; }
.nav a.nav-add .icon {
  width: 44px; height: 44px; padding: 10px; margin-top: -14px;
  border-radius: 50%; background: var(--green); color: var(--on-green);
  box-shadow: 0 0 0 4px var(--surface);
}
.nav a.nav-add { color: var(--ink); }

.page { padding: 1rem 1rem calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 2rem); max-width: 760px; margin: 0 auto; }
main:focus { outline: none; }
.page-title:focus { outline: none; }
.loading { color: var(--muted); padding: 2rem 0; }

@media (min-width: 900px) {
  .topbar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; height: auto; align-items: flex-start; padding: 1.25rem; border-bottom: 0; border-right: 1px solid var(--line); background: transparent; z-index: 21; }
  .nav {
    top: 80px; bottom: auto; left: 0; right: auto; width: 220px;
    display: flex; flex-direction: column; gap: 2px; padding: 0 .75rem;
    background: transparent; border-top: 0;
  }
  .nav a { flex-direction: row; justify-content: flex-start; gap: .75rem; min-height: 44px; padding: 0 .75rem; border-radius: var(--radius-s); font-size: .95rem; color: var(--ink); }
  .nav a:hover { background: var(--surface); }
  .nav a.active { background: var(--green-soft); color: var(--green); }
  .nav a.nav-add { order: -1; margin-bottom: .75rem; background: var(--green); color: var(--on-green); font-weight: 600; }
  .nav a.nav-add:hover { background: var(--green-hover); color: var(--on-green); }
  .nav a.nav-add .icon { width: 22px; height: 22px; padding: 0; margin: 0; background: none; box-shadow: none; color: inherit; }
  .page { margin-left: 220px; padding: 2rem 2.5rem 4rem; max-width: 900px; }
}

/* ---- Banner, toasts, notices ---- */

.banner { margin-bottom: 1rem; padding: .7rem .9rem; border-radius: var(--radius-s); background: var(--amber-soft); color: var(--amber-ink); font-size: .9rem; }
.banner p { margin: 0; }
.banner p + p { margin-top: .35rem; }
.banner a { color: inherit; font-weight: 600; }

.toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px); transform: translateX(-50%); z-index: 40; display: grid; gap: .5rem; width: min(92vw, 420px); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { padding: .75rem 1rem; border-radius: var(--radius-s); background: var(--ink); color: var(--bg); font-weight: 500; transition: opacity .3s; }
.toast-error { background: var(--red); color: #fff; }
.toast-out { opacity: 0; }

.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--radius-s); margin: 0 0 1rem; }
.notice p { margin: 0 0 .35rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { background: var(--amber-soft); color: var(--amber-ink); }
.notice-warn a { color: inherit; font-weight: 600; }
.panel-error { padding: 1rem; border-radius: var(--radius-m); background: var(--red-soft); }

/* ---- Buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.1rem; border-radius: var(--radius-s);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 1rem var(--body); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); color: var(--on-green); }
.btn-danger { border-color: var(--red); background: var(--surface); color: var(--red); }
.btn-danger:hover, .btn-danger:active { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.btn-sm { min-height: 40px; padding: 0 .85rem; font-size: .92rem; }
.btn-sm .icon { width: 18px; height: 18px; }
.btn-block { width: 100%; min-height: 54px; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 1.5rem; }
.actions-tight { margin: .75rem 0 0; }

.back { display: inline-flex; align-items: center; gap: .25rem; margin: 0 0 .5rem -.25rem; padding: .35rem .25rem; color: var(--muted); text-decoration: none; font-weight: 500; }
.back .icon { width: 18px; height: 18px; }

/* ---- Odometer digits (the signature element) ---- */

.odo { display: inline-flex; align-items: stretch; gap: 3px; font: 600 1.5rem/1 var(--head); }
.odo-cell {
  display: inline-grid; place-items: center; min-width: 1.05em; padding: .22em .14em;
  border-radius: 4px; background: var(--odo-cell); color: var(--odo-digit);
  box-shadow: inset 0 -.35em .4em -.3em rgba(255, 255, 255, .12), inset 0 .35em .4em -.3em rgba(0, 0, 0, .5);
}
.odo-frac { background: var(--amber); color: #1E2630; }
.odo-cell:not(.odo-frac) + .odo-frac { margin-left: 4px; }
.odo-unit { align-self: flex-end; margin-left: .4em; font: 600 .5em var(--head); color: var(--muted); }
.odo-lg { font-size: clamp(2.6rem, 13vw, 3.6rem); gap: 4px; }
.odo-lg .odo-unit { font-size: .38em; }

.hero-odo { margin: 1rem 0 1.25rem; padding: 1.25rem 1rem 1rem; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.hero-cap { margin: .85rem 0 0; color: var(--muted); font-size: .92rem; max-width: 60ch; }
.hero-empty p { margin: 0; font-weight: 500; }

/* ---- Stats and facts ---- */

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 1rem 0 1.75rem; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .15rem; padding: .85rem 1rem; background: var(--surface); }
.stat-lead { grid-column: 1 / -1; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font: 600 1.5rem/1.1 var(--head); }
.stat-lead .stat-value { font-size: 2.3rem; color: var(--green); }
@media (min-width: 600px) { .stats { grid-template-columns: 2fr 1fr 1fr; } .stat-lead { grid-column: auto; } }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.25rem; margin: 0 0 1rem; }
.facts > div { border-left: 3px solid var(--line); padding-left: .7rem; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; font: 600 1.2rem/1.25 var(--head); }
.facts-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }
.facts-tight { margin: .75rem 0 0; }
.facts-tight dd { font-size: 1.05rem; }
@media (min-width: 600px) { .facts { grid-template-columns: repeat(4, 1fr); } .facts-tight { grid-template-columns: repeat(3, 1fr); } }

.calc { color: var(--calc); text-decoration: underline dashed 1px; text-underline-offset: 3px; }
.legend { color: var(--muted); font-size: .85rem; }

/* ---- Sections and lists ---- */

.block { margin: 0 0 2rem; }
.block-head, .title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.title-row { align-items: center; margin-bottom: 1rem; }
.title-row .page-title { margin: 0; }
.link-add { display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; text-decoration: none; }
.link-add .icon { width: 18px; height: 18px; }
.subtitle { color: var(--muted); margin-top: -.25rem; }

.tag { display: inline-block; padding: .05rem .45rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font: 500 .75rem/1.5 var(--body); vertical-align: middle; }
.tag-full { background: var(--green-soft); border-color: transparent; color: var(--green); }
.tag-sample { background: var(--amber-soft); border-color: transparent; color: var(--amber-ink); }

.vlist, .vcards, .entries { list-style: none; margin: 0; padding: 0; }
.vlist { border-top: 1px solid var(--line); }
.vrow { border-bottom: 1px solid var(--line); }
.vrow-link {
  display: grid; grid-template-columns: 40px 1fr; column-gap: .75rem; row-gap: .15rem;
  padding: 1rem .25rem; color: var(--ink); text-decoration: none;
}
.vrow-link:hover .vrow-name { color: var(--green); }
.vrow-icon { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.vrow-name { font: 600 1.2rem var(--head); }
.vrow-sub { color: var(--muted); font-size: .88rem; margin: 0; }
.vrow-mileage, .vrow-hint, .vrow-odo { grid-column: 2; }
.vrow-mileage { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.vrow-cap { color: var(--muted); font-size: .85rem; }
.vrow-hint { margin: .4rem 0 0; font-size: .92rem; color: var(--amber-ink); }
.vrow-odo { color: var(--muted); font-size: .88rem; }

.vcards { display: grid; gap: 1rem; }
.vcard { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.vcard-head { display: flex; gap: .75rem; align-items: center; }
.vcard-name { margin: 0; font-size: 1.25rem; }

.entries { border-top: 1px solid var(--line); }
.entry { border-bottom: 1px solid var(--line); }
.entry-link { display: block; padding: .85rem .25rem; color: var(--ink); text-decoration: none; }
.entry-link:hover { background: var(--surface); }
.entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.entry-date { font: 600 1.05rem var(--head); }
.entry-vehicle { color: var(--muted); font-size: .9rem; }
.entry-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: .2rem 1rem; margin: 0; }
.entry-facts div { display: flex; justify-content: space-between; gap: .5rem; font-size: .92rem; }
.entry-facts dt { color: var(--muted); }
.entry-facts dd { margin: 0; text-align: right; }
@media (min-width: 600px) { .entry-facts { grid-template-columns: repeat(4, auto); justify-content: start; } .entry-facts div { justify-content: flex-start; } }
.entry-derived { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .4rem 0 0; font-size: .9rem; }
.entry-station, .entry-notes { margin: .3rem 0 0; color: var(--muted); font-size: .88rem; }
.entry-issue { margin: .4rem 0 0; padding: .35rem .6rem; border-radius: var(--radius-s); background: var(--amber-soft); color: var(--amber-ink); font-size: .88rem; }
.entry-has-issue .entry-facts dd:last-child { color: var(--amber-ink); font-weight: 600; }

.month-group { margin-bottom: 1.25rem; }
.month-head { display: flex; justify-content: space-between; margin: 0; padding: .4rem .25rem; font-size: 1rem; color: var(--muted); }

/* ---- Chart ---- */

.chart { margin: 0; padding: .75rem .5rem .25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.chart svg { display: block; width: 100%; height: auto; max-height: 220px; }
.chart .bar { fill: var(--line); }
.chart .bar-now { fill: var(--green); }
.chart .axis { stroke: var(--line); }
.chart .bar-val { font: 600 10px var(--head); fill: var(--ink); text-anchor: middle; }
.chart .bar-lbl { font: 500 10px var(--body); fill: var(--muted); text-anchor: middle; }

/* ---- Forms ---- */

.form { display: grid; gap: 1.1rem; max-width: 560px; }
.field { display: grid; gap: .35rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: .95rem; padding: 0; }
.field legend { margin-bottom: .4rem; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .6rem .75rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: 400 1.05rem var(--body);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field input.is-calc { color: var(--calc); border-style: dashed; }
.field-error { margin: 0; color: var(--red); font-size: .88rem; font-weight: 500; }
.form-error { margin: 0; padding: .7rem .9rem; border-radius: var(--radius-s); background: var(--red-soft); color: var(--red); font-weight: 500; }
.hint-calc { color: var(--calc); }

.grid-2, .grid-3 { display: grid; gap: 1.1rem; }
@media (min-width: 520px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.choice-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; flex: 1 1 auto; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.choice span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: .4rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); font-weight: 500;
}
.choice small { font-size: .72rem; color: var(--muted); font-weight: 400; }
.choice input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-off span { opacity: .55; }
.choice-off input { cursor: not-allowed; }

.optional { border-top: 1px solid var(--line); padding-top: .75rem; }
.optional summary { cursor: pointer; font-weight: 600; color: var(--green); min-height: 32px; }
.optional[open] summary { margin-bottom: 1rem; }
.optional .field + .field { margin-top: 1rem; }

.form-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding: .75rem 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (min-width: 900px) { .form-actions { position: static; background: none; } }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0 0 1.25rem; }
.filters .field input, .filters .field select { min-height: 44px; font-size: 1rem; }
@media (min-width: 700px) { .filters { grid-template-columns: repeat(4, 1fr); } }

/* ---- Empty states, danger zone, dialog ---- */

.empty { padding: 2rem 1.25rem; border: 1.5px dashed var(--line); border-radius: var(--radius-m); background: var(--surface); }
.empty p { color: var(--muted); max-width: 48ch; }

.danger { margin: 2.5rem 0 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.danger h2 { color: var(--red); font-size: 1.15rem; }

.dialog { width: min(92vw, 420px); padding: 1.25rem; border: 0; border-radius: var(--radius-m); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgba(10, 14, 18, .55); }
.dlg-type { margin-bottom: 1rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; }

.noscript { padding: 1rem; text-align: center; }

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

/* ---- Smart fuel entry ---- */

.choose { display: grid; gap: .9rem; max-width: 560px; }
.choose-main {
  display: flex; gap: 1rem; align-items: center; padding: 1.25rem; border-radius: var(--radius-m);
  background: var(--green); color: var(--on-green); text-decoration: none; line-height: 1.4;
}
.choose-main:hover { background: var(--green-hover); color: var(--on-green); }
.choose-main strong { display: block; font: 700 1.4rem var(--head); margin-bottom: .2rem; }
.choose-main span span { opacity: .9; font-size: .95rem; }
.choose-icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.choose-icon .icon { width: 30px; height: 30px; }

.lead { color: var(--muted); max-width: 60ch; }
.notice-demo { background: var(--amber-soft); color: var(--amber-ink); border-left: 4px solid var(--amber); }
.smart-cta { margin-top: .25rem; }


.photo-slots { display: grid; gap: 1rem; }
@media (min-width: 640px) { .photo-slots { grid-template-columns: 1fr 1fr; } }
.photo-slot { display: grid; gap: .6rem; padding: 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.photo-slot.has-photo { border-color: var(--green); }
.photo-slot.is-busy { opacity: .6; pointer-events: none; }
.photo-slot h2 { margin: 0; font-size: 1.15rem; }
.photo-text .hint + .hint { margin-top: .2rem; }
.photo-preview { display: grid; place-items: center; height: 180px; border-radius: var(--radius-s); background: var(--bg); overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: contain; background: #0E1216; }
.photo-empty { display: grid; justify-items: center; gap: .3rem; color: var(--muted); font-size: .88rem; }
.photo-empty .icon { width: 34px; height: 34px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.file-btn { position: relative; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.progress ol { list-style: none; margin: 0; padding: .9rem 1rem; display: grid; gap: .45rem; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.progress li { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.progress li .icon { width: 18px; height: 18px; }
.progress li.done { color: var(--green); }
.progress li.now { color: var(--ink); font-weight: 600; }
.progress .dot { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: none; }
.progress .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.progress li.now .dot::after { background: var(--green); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.6); opacity: .5; } }

.review-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.review-top p { margin: 0; }
.thumbs { display: flex; gap: .5rem; }
.thumb { display: block; width: 64px; height: 64px; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); background: #0E1216; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.checks ul { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .4rem; max-width: 560px; }
.check { display: flex; gap: .5rem; align-items: flex-start; padding: .5rem .7rem; border-radius: var(--radius-s); font-size: .92rem; }
.check .icon { width: 18px; height: 18px; margin-top: 2px; }
.check-ok { background: var(--green-soft); color: var(--green); }
.check-warn { background: var(--amber-soft); color: var(--amber-ink); }
.check-info { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }

.form-section { margin: .5rem 0 -.25rem; font-size: 1.1rem; color: var(--muted); }
.field.needs-review input, .field.needs-review select { border-color: var(--amber); border-width: 2px; background: var(--amber-soft); }
.review-flag { display: inline-flex; align-items: center; gap: .25rem; color: var(--amber-ink); font-weight: 600; }
.review-flag .icon { width: 16px; height: 16px; }
.not-found { color: var(--muted); font-style: italic; }
.link-btn { margin-left: .4rem; padding: .3rem .1rem; border: 0; background: none; color: var(--green); font: 600 .85rem var(--body); text-decoration: underline; cursor: pointer; min-height: 32px; }
.form-actions-stack { display: grid; gap: .6rem; }
.split { display: flex; gap: .6rem; flex-wrap: wrap; }
.split .btn { flex: 1 1 auto; }
@media (prefers-reduced-motion: reduce) { .progress li.now .dot::after { animation: none; } }
.form-actions.form-actions-stack { position: static; background: none; }

/* ---- Sign-in ---- */

body.signed-out .nav { display: none; }
body.signed-out .page { padding-bottom: 2rem; }
@media (min-width: 900px) { body.signed-out .page { margin-left: auto; } body.signed-out .topbar { display: none; } }
.login { max-width: 420px; margin: 1rem auto 0; display: grid; gap: 1rem; }
.login .page-title { margin: 0; }
.login .lead { margin: 0; }
.login-logo { border-radius: 14px; }
.login-note { text-align: center; }
.btn-google { background: var(--surface); border-color: var(--line); gap: .7rem; }
.btn-google .icon { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.phone-row { display: flex; align-items: stretch; }
.phone-row .cc { display: grid; place-items: center; padding: 0 .8rem; border: 1.5px solid var(--line); border-right: 0; border-radius: var(--radius-s) 0 0 var(--radius-s); background: var(--bg); font-weight: 600; }
.phone-row input { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.banner-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* ---- Top-bar settings gear ---- */
.topbar { justify-content: space-between; }
.topbar-gear { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -.5rem; border-radius: 50%; color: var(--muted); }
.topbar-gear:hover, .topbar-gear.active { color: var(--green); background: var(--green-soft); }
@media (min-width: 900px) {
  .topbar { flex-direction: column; justify-content: flex-start; }
  .topbar-gear { position: fixed; left: .75rem; bottom: 1.25rem; width: auto; height: 44px; padding: 0 .75rem; border-radius: var(--radius-s); }
}

/* ---- Maintenance ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.chip { padding: .45rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; min-height: 40px; display: inline-flex; align-items: center; }
.chip-on { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; }
.svc-title { margin: 0; }
.svc-list { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--line); margin-left: .4rem; }
.svc { position: relative; padding-left: 1rem; }
.svc::before { content: ""; position: absolute; left: -.55rem; top: 1.25rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--surface); border: 3px solid var(--green); }
.svc-link { display: block; margin: 0 0 .9rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); text-decoration: none; }
.svc-link:hover { border-color: var(--green); }
.svc-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.svc-date { font: 600 1.1rem var(--head); }
.svc-amount { font: 700 1.5rem var(--head); color: var(--green); margin: .2rem 0; }
.svc-meta, .svc-desc { margin: 0; font-size: .9rem; color: var(--muted); }
.svc-desc { margin-top: .25rem; color: var(--ink); }
.svc-hero { display: grid; gap: .2rem; }
.svc-total { font: 700 2.4rem var(--head); color: var(--green); }
.item-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.item-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.item-desc small { display: block; color: var(--muted); font-size: .8rem; }
.item-amt { white-space: nowrap; font-weight: 600; }
.sum-list { margin: 0; }
.sum-list div { display: flex; justify-content: space-between; padding: .35rem .2rem; border-bottom: 1px solid var(--line); }
.sum-list dt { color: var(--muted); }
.sum-list dd { margin: 0; font-weight: 600; }
.sum-list .sum-total dt, .sum-list .sum-total dd { color: var(--ink); font: 700 1.15rem var(--head); }
.page-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.page-item { display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto; gap: .2rem .75rem; align-items: center; }
.page-item img { grid-row: span 2; width: 72px; height: 96px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); background: #0E1216; }
.page-no { font-weight: 600; }
.page-tools { display: flex; gap: .4rem; flex-wrap: wrap; }
.page-tools .btn-sm { min-width: 44px; }
.page-empty { padding: 1.25rem; border-radius: var(--radius-s); background: var(--bg); text-align: center; }
.page-thumbs { flex-wrap: wrap; }
.thumb-page { position: relative; width: 72px; height: 96px; }
.thumb-page span { position: absolute; right: 4px; bottom: 4px; padding: 0 .35rem; border-radius: 4px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .75rem; }
.item-rows { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .6rem; }
.item-row { padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); display: grid; gap: .5rem; }
.item-row.needs-review { border: 2px solid var(--amber); background: var(--amber-soft); }
.item-main { display: grid; grid-template-columns: 1fr 7.5rem; gap: .5rem; }
.item-main input, .item-meta select, .item-grid input { min-height: 44px; padding: .5rem .6rem; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: 400 1rem var(--body); width: 100%; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.item-meta select { width: auto; }
.item-opt { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.item-opt input { width: 20px; height: 20px; }
.item-more summary { cursor: pointer; color: var(--green); font-size: .88rem; font-weight: 600; }
.item-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .5rem; }
.item-grid label { display: grid; gap: .2rem; font-size: .8rem; color: var(--muted); }
@media (min-width: 640px) { .item-grid { grid-template-columns: repeat(4, 1fr); } }
.svc-form .form-section { margin-top: 1rem; } .svc-form .item-rows + .btn-sm { justify-self: start; }

/* Desktop: the top bar (logo + gear) must not cover the sidebar menu. */
@media (min-width: 900px) {
  .topbar { bottom: auto; height: 76px; }
  .nav { z-index: 22; }
}
.item-opt-wide { grid-column: 1 / -1; color: var(--ink); font-size: .9rem; }

/* Example photos shown in empty photo slots */
.photo-examples { position: relative; display: flex; gap: .5rem; justify-content: center; align-items: center; width: 100%; height: 100%; padding: .4rem; }
.photo-examples a { height: 100%; display: block; }
.photo-examples img { height: 100%; width: auto; max-width: 100%; object-fit: contain; border-radius: 4px; opacity: .55; filter: grayscale(.3); }
.example-tag { position: absolute; left: .5rem; top: .5rem; padding: .1rem .5rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .75rem; font-weight: 600; }

/* Thumbnails are buttons now (open the in-app viewer) */
button.thumb { padding: 0; cursor: zoom-in; font: inherit; }
.photo-examples button { height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }

/* In-app image viewer */
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr; background: rgba(8, 10, 12, .96); color: #fff; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; }
.viewer-count { font-weight: 600; }
.viewer-stage { overflow: auto; display: grid; place-items: center; touch-action: pinch-zoom pan-x pan-y; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-btn { min-width: 48px; min-height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.5rem; cursor: pointer; }
.viewer-prev, .viewer-next { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-prev { left: .5rem; }
.viewer-next { right: .5rem; }

/* ---- Brand (logo colours: deep green + leaf green) ---- */
.brand-mark { border-radius: 8px; background: #fff; }
.brand-g { color: var(--ink); }
.brand-k { color: var(--leaf); }
.logo-plate { justify-self: center; display: grid; place-items: center; width: min(100%, 300px); padding: .5rem; border-radius: 16px; background: #fff; box-shadow: 0 1px 0 var(--line); }
.logo-plate img { width: 100%; height: auto; }
.logo-plate-sm { width: min(100%, 220px); margin: 0 auto 1rem; }
.login .page-title { text-align: center; }
.login .lead { text-align: center; }
body.signed-out .topbar-gear { display: none; }

/* Sign-in: logo sized to support the page, not dominate it */
.login .logo-plate { width: min(62vw, 210px); padding: .35rem; border-radius: 14px; }
.login { gap: .9rem; margin-top: .5rem; }
@media (min-width: 900px) { .login { margin-top: 3rem; } }

/* No grey tap flash on phones; a gentle press effect instead */
a, button, label, summary { -webkit-tap-highlight-color: transparent; }
.nav a:active .icon, .btn:active { transform: scale(.96); }
.nav a.nav-add .icon { box-shadow: 0 0 0 4px var(--surface); }
.nav a:focus:not(:focus-visible) { outline: none; }

/* Smart entry: compact photo slots */
.slot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.slot-head h2 { display: flex; align-items: center; gap: .3rem; }
.slot-head h2 .icon { width: 20px; height: 20px; color: var(--green); }
.slot-examples { display: flex; align-items: center; gap: .35rem; flex: none; }
.slot-examples span { font-size: .75rem; color: var(--muted); }
.slot-examples button { padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; overflow: hidden; width: 44px; height: 44px; }
.slot-examples img { width: 100%; height: 100%; object-fit: cover; display: block; }
.btn-camera { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn-camera:hover { background: var(--green-hover); color: var(--on-green); border-color: var(--green-hover); }
.photo-actions .btn { flex: 1 1 8rem; min-height: 46px; }
.photo-slot .photo-preview { height: 150px; }

/* =====================================================================
   v1.0 design system: bold green app header, calm cards, logo colours
   ===================================================================== */
:root {
  --bg: #F3F5F2;
  --line: #E1E6E1;
  --band: linear-gradient(160deg, #0C6B32 0%, #0A5A2B 60%, #08481F 100%);
  --band-ink: #FFFFFF;
  --band-soft: rgba(255, 255, 255, .78);
  --leaf-on-band: #A9E36B;
  --shadow: 0 1px 2px rgba(12, 40, 22, .06), 0 6px 18px rgba(12, 40, 22, .07);
  --radius-m: 14px;
  --req: #C2410C;
}
@media (prefers-color-scheme: dark) {
  :root {
    --band: linear-gradient(160deg, #0E4A26 0%, #0B3A1E 100%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25);
    --req: #FDBA74;
    --bg: #0F1418;
    --line: #26303A;
  }
}

/* Green top bar flows into a green title band */
.topbar { background: #0C6B32; border-bottom: 0; color: #fff; }
@media (prefers-color-scheme: dark) { .topbar { background: #0E4A26; } }
body::before { background: #0C6B32; }
.brand { color: #fff; }
.brand-g { color: #fff; }
.brand-k { color: var(--leaf-on-band); }
.topbar-gear { color: rgba(255, 255, 255, .85); }
.topbar-gear:hover, .topbar-gear.active { color: #fff; background: rgba(255, 255, 255, .14); }

.page { padding-top: 0; }
main > .page-title, main > .back {
  margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem;
  background: var(--band); color: var(--band-ink);
}
main > .page-title { margin-top: 0; margin-bottom: 1rem; padding-top: .9rem; padding-bottom: 1.1rem; font-size: 1.55rem; border-radius: 0 0 22px 22px; }
main > .back { display: flex; margin-top: 0; margin-bottom: 0; padding-top: .7rem; padding-bottom: 0; color: var(--band-soft); }
main > .back .icon { color: var(--band-soft); }
main > .back + .page-title { padding-top: .25rem; }
main > .page-title .tag { vertical-align: middle; }
.title-row { margin-left: -1rem; margin-right: -1rem; padding: .9rem 1rem 1.1rem; background: var(--band); border-radius: 0 0 22px 22px; }
.title-row .page-title { color: #fff; font-size: 1.55rem; }
.title-row .btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
@media (min-width: 900px) {
  .page { padding-top: 0; }
  main > .page-title, main > .back, .title-row { margin-left: -2.5rem; margin-right: -2.5rem; padding-left: 2.5rem; padding-right: 2.5rem; }
  main > .page-title, .title-row { border-radius: 0 0 0 26px; }
  .topbar { background: #0C6B32; }
  .nav a { color: var(--ink); }
}

/* Calm surfaces: shadows instead of borders */
.panel-card, .vcard, .chart, .hero-odo, .stats, .photo-slot, .svc-link, .empty, .item-row, .choose-main { box-shadow: var(--shadow); }
.vcard, .chart, .hero-odo, .photo-slot, .svc-link, .item-row { border-color: transparent; }
.empty { border: 0; }
.photo-slot.has-photo { border: 2px solid var(--leaf); }
h2 { font-size: 1.15rem; }
.block { margin-bottom: 1.5rem; }

/* Calculated values: quiet, no link-like underline */
.calc { color: var(--green); text-decoration: none; font-weight: 600; }
.legend { display: none; }

/* Odometer: brand colours (amber stays for warnings only) */
.odo-frac { background: var(--leaf); color: #fff; }

/* Required fields */
.req { color: var(--req); font-weight: 700; margin-left: .15rem; }

/* Slim sample-data / import strip above the bottom bar */
.banner { position: fixed; z-index: 19; left: .5rem; right: .5rem; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + .5rem); margin: 0; padding: .5rem .75rem; border-radius: 12px; font-size: .82rem; box-shadow: var(--shadow); }
body.has-banner .page { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 6rem); }
@media (min-width: 900px) { .banner { left: calc(220px + 1rem); right: 1rem; bottom: 1rem; max-width: 640px; } }

/* Dashboard: month summary inside the green band */
.dash-band { margin: 0 -1rem 1rem; padding: .9rem 1rem 1.4rem; background: var(--band); color: #fff; border-radius: 0 0 22px 22px; }
.dash-band h1 { color: #fff; margin: 0 0 .9rem; font-size: 1.1rem; font-weight: 600; opacity: .9; }
.dash-band .big { display: block; font: 700 2.6rem/1 var(--head); letter-spacing: .01em; }
.dash-band .sub { display: block; margin-top: .35rem; color: var(--band-soft); font-size: .92rem; }
.dash-band .delta { display: inline-block; margin-top: .6rem; padding: .15rem .55rem; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .82rem; }
@media (min-width: 900px) { .dash-band { margin: 0 -2.5rem 1.25rem; padding: 1.25rem 2.5rem 1.6rem; border-radius: 0 0 0 26px; } }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 .6rem; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; font-size: .92rem; }

/* Vehicle tiles */
.vtiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.vtile { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: .2rem .8rem; align-items: center; padding: .85rem .9rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.vtile-link { position: absolute; inset: 0; border-radius: inherit; }
.vtile .vrow-icon { grid-row: span 2; }
.vtile-name { font: 600 1.1rem var(--head); }
.vtile-meta { grid-column: 2; color: var(--muted); font-size: .85rem; }
.vtile-mileage { grid-row: span 2; text-align: right; }
.vtile-mileage b { display: block; font: 700 1.4rem/1 var(--head); color: var(--green); }
.vtile-mileage small { color: var(--muted); font-size: .75rem; }
.vtile-hint { color: var(--muted); font-size: .78rem; max-width: 7rem; text-align: right; }
.vtile-add { position: relative; z-index: 1; }

/* Compact fill rows */
.rows { list-style: none; margin: 0; padding: 0; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.row-link { display: grid; grid-template-columns: 3.1rem 1fr auto; gap: .1rem .75rem; align-items: center; padding: .7rem .9rem; color: var(--ink); text-decoration: none; }
.row-link:active { background: var(--green-soft); }
.row-date { grid-row: span 2; text-align: center; line-height: 1.05; }
.row-date b { display: block; font: 700 1.25rem var(--head); }
.row-date span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.row-title { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { grid-column: 2; color: var(--muted); font-size: .82rem; }
.row-amt { grid-row: span 2; text-align: right; }
.row-amt b { display: block; font: 700 1.1rem var(--head); }
.row-amt .mchip { display: inline-block; margin-top: .15rem; padding: 0 .45rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .75rem; font-weight: 600; }
.row-flag { color: var(--amber-ink); font-weight: 600; }

/* Collapsible filter */
.filter-box { margin: 0 0 1rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.filter-box > summary { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .75rem .9rem; cursor: pointer; font-weight: 600; list-style: none; }
.filter-box > summary::-webkit-details-marker { display: none; }
.filter-box > summary span { color: var(--muted); font-weight: 500; font-size: .88rem; }
.filter-box .filters { padding: 0 .9rem .9rem; margin: 0; }
.summary-bar { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 0 0 1rem; padding: .75rem .9rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); font-size: .9rem; }
.summary-bar b { font: 700 1.05rem var(--head); }
.summary-bar span { color: var(--muted); }
.vcard-tap { position: relative; }
.vcard-meta { margin: .5rem 0 0; color: var(--muted); font-size: .88rem; }
.vcard-actions { position: relative; z-index: 1; }
.month-head { padding: .2rem .25rem .45rem; font-size: .92rem; }
.month-group { margin-bottom: 1rem; }
.row-amt .mchip { white-space: nowrap; line-height: 1.6; padding: 0 .5rem; }
.row-link:hover .row-title { color: var(--ink); }

@media (prefers-color-scheme: dark) {
  .chart .bar { fill: #2E3A44; }
  .row-amt .mchip { background: rgba(63, 180, 106, .16); }
}
.row-amt .mchip { display: inline-block; margin-top: .15rem; padding: 0 .5rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .75rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .row-amt .mchip { background: rgba(63, 180, 106, .16); } }

/* =====================================================================
   v1.1 "Hybrid" look: white app bar and page headers; the month card is
   the one bold green element.
   ===================================================================== */
:root { --bg: #F7F8F6; }
@media (prefers-color-scheme: dark) { :root { --bg: #0F1418; } }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink); }
@media (prefers-color-scheme: dark) { .topbar { background: var(--surface); } }
body::before { background: var(--surface); }
.brand, .brand-g { color: var(--ink); }
.brand-k { color: var(--leaf); }
.topbar-gear { color: var(--muted); }
.topbar-gear:hover, .topbar-gear.active { color: var(--green); background: var(--green-soft); }
@media (min-width: 900px) { .topbar { background: transparent; border-bottom: 0; } }

main > .page-title, main > .back, .title-row { background: transparent; color: var(--ink); border-radius: 0; }
main > .page-title { padding-top: 1rem; padding-bottom: .25rem; }
main > .back { color: var(--muted); }
main > .back .icon { color: var(--muted); }
.title-row { padding-top: 1rem; padding-bottom: .5rem; }
.title-row .page-title { color: var(--ink); }
.title-row .btn { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* Month card: the single green highlight, tappable */
.dash-band { position: relative; margin: 1rem 0 1.25rem; border-radius: 20px; box-shadow: 0 10px 24px rgba(12, 107, 50, .25); }
@media (min-width: 900px) { .dash-band { margin: 1.25rem 0 1.5rem; border-radius: 20px; } }
.dash-band .band-link { position: absolute; inset: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.dash-band .band-link:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.dash-band .more { position: absolute; right: 1rem; bottom: 1rem; font-size: .82rem; color: var(--band-soft); }
.dash-band:active { transform: scale(.99); }
#spend-chart:focus { outline: none; }

/* Compact vehicle picker */
.field-inline { grid-template-columns: auto 1fr; align-items: center; gap: .3rem .75rem; padding: .35rem .35rem .35rem .9rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.field-inline label { color: var(--muted); font-weight: 500; }
.field-inline .vehicle-select { min-height: 44px; border: 0; background: var(--green-soft); color: var(--green); font-weight: 600; border-radius: 10px; }
.field-inline .field-error { grid-column: 1 / -1; }

/* Choosers: main option, OR, smaller manual option */
.or-divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .82rem; font-weight: 600; letter-spacing: .08em; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.choose-alt { justify-self: center; display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.choose-alt .icon { width: 18px; height: 18px; }
.choose-main + .choose-main { margin-top: 0; }
.choose-second { background: var(--surface); color: var(--ink); border: 1.5px solid var(--green); }
.choose-second:hover { background: var(--green-soft); color: var(--ink); }
.choose-second .choose-icon { background: var(--green-soft); color: var(--green); }
.choose-second span span { color: var(--muted); opacity: 1; }

/* Service reminders */
.rem { position: relative; padding: .8rem .9rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); margin-bottom: .6rem; }
.rem-centre { border-left: 4px solid var(--green); }
.rem-generic { border-left: 4px solid var(--line); }
.rem-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.rem-src { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rem-src small { text-transform: none; font-weight: 500; letter-spacing: 0; }
.rem-due { margin: .35rem 0 0; font: 600 1.05rem var(--head); }
.rem-meta { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.rem-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: .45rem 0 0; font-size: .92rem; }
.rem-link { display: inline-block; margin-top: .45rem; font-size: .85rem; font-weight: 600; text-decoration: none; }
.st { flex: none; padding: .1rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.st-ok { background: var(--green-soft); color: var(--green); }
.st-soon { background: var(--amber-soft); color: var(--amber-ink); }
.st-overdue { background: var(--red-soft); color: var(--red); }
.alerts { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .5rem; }
.alerts a { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; border-left: 4px solid var(--amber); }
.alerts a.al-overdue { border-left-color: var(--red); }
.alerts .icon { color: var(--amber-ink); }
.alerts .al-overdue .icon { color: var(--red); }
.alerts span { flex: 1; font-size: .92rem; }
.alerts small { display: block; color: var(--muted); }
.rec-box .choice-row { gap: .4rem; }
.rec-box .choice span { min-height: 42px; padding: .3rem .7rem; }
.read-tag { display: inline-block; margin: 0 0 .5rem; padding: .15rem .6rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .78rem; font-weight: 600; }
.interval { margin: .75rem 0 0; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px; } .interval legend { font-weight: 600; padding: 0 .3rem; }
.legend-sub { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.interval { min-width: 0; }
.interval .grid-2 { grid-template-columns: 1fr 1fr; gap: .6rem; }
.interval .field, .interval input { min-width: 0; }
@media (max-width: 519px) { .interval .grid-2 { grid-template-columns: 1fr; } }
fieldset, fieldset *, input, select, textarea { box-sizing: border-box; }

/* Scan button: gradient from the logo's deep green to leaf green */
.nav a.nav-add .icon {
  background: linear-gradient(140deg, #0C6B32 0%, #2E8F2A 55%, #4BA707 100%);
  color: #fff; stroke-width: 1.9;
  box-shadow: 0 0 0 4px var(--surface), 0 6px 14px rgba(12, 107, 50, .35);
}
@media (min-width: 900px) {
  .nav a.nav-add { background: linear-gradient(140deg, #0C6B32 0%, #2E8F2A 60%, #4BA707 100%); }
  .nav a.nav-add .icon { background: none; box-shadow: none; }
}

/* Instagram button: a slowly rotating Instagram-coloured border so it reads as tappable */
@property --insta-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.btn-insta {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--insta-angle), #F58529, #FEDA77, #DD2A7B, #8134AF, #515BD4, #F58529) border-box;
  animation: insta-spin 3.5s linear infinite;
  color: var(--ink); font-weight: 600;
}
.btn-insta .icon { color: #DD2A7B; }
.btn-insta:hover { color: var(--ink); }
.btn-insta:active { transform: scale(.97); }
@keyframes insta-spin { to { --insta-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .btn-insta { animation: none; } }

/* Stacked monthly bars: one colour per vehicle, from the logo's greens */
.chart .seg { stroke: var(--surface); stroke-width: 1; }
.seg-0 { fill: #0C6B32; background: #0C6B32; }
.seg-1 { fill: #6CC24A; background: #6CC24A; }
.seg-2 { fill: #1F9E8F; background: #1F9E8F; }
.seg-3 { fill: #A7D98B; background: #A7D98B; }
.seg-4 { fill: #3D7D5B; background: #3D7D5B; }
.seg-5 { fill: #C9A227; background: #C9A227; }
.chart .stack { opacity: .78; }
.chart .stack-now { opacity: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; justify-content: center; padding: .35rem .5rem .1rem; font-size: .78rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.seg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.txt-red { color: var(--red); }
.challan-check { margin-top: .75rem; }
.challan-check-body { padding: 0 .9rem .9rem; }
.challan-check-body p { margin: 0 0 .5rem; }
.portal-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.row-amt .st { display: inline-block; margin-top: .15rem; }

/* ---- Scan: full-screen camera ---- */
body.cam-open { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto 1fr auto; background: #0B0F0D; color: #fff;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.cam-top { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; }
.cam-top strong { display: block; font: 700 1.25rem var(--head); }
.cam-top span { display: block; font-size: .85rem; color: rgba(255, 255, 255, .7); }
.cam-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; }
.cam-stage { position: relative; overflow: hidden; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 9%; right: 9%; top: 14%; bottom: 14%; border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
.cam-frame i { position: absolute; width: 44px; height: 44px; border: 5px solid #6CC24A; }
.cam-frame i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.cam-frame i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 22px; }
.cam-frame i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 22px; }
.cam-frame i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.cam-msg { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; margin: 0; padding: .6rem .8rem; border-radius: 12px; background: rgba(0, 0, 0, .6); text-align: center; font-size: .9rem; }
.cam-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 1rem 1.5rem 1.4rem; }
.cam-side { position: relative; justify-self: center; display: grid; justify-items: center; gap: .3rem; border: 0; background: none; color: #fff; font: 500 .82rem var(--body); cursor: pointer; }
.cam-side .icon { width: 50px; height: 50px; padding: 13px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.cam-side input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cam-shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.cam-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(140deg, #0C6B32, #4BA707); }
.cam-shutter:active span { transform: scale(.9); }
.cam-torch { position: absolute; right: 1rem; top: calc(env(safe-area-inset-top, 0px) + .75rem); width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; }
.cam-torch.on, .cam-side.on .icon { background: #FEDA77; color: #1E2630; }
.cam-fallback { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: .5rem; padding: 1.2rem 1.6rem; border-radius: 18px; background: linear-gradient(140deg, #0C6B32, #4BA707); font-weight: 700; cursor: pointer; }
.cam-fallback .icon { width: 40px; height: 40px; }
.cam-fallback input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cam.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: cam-flash .25s ease-out forwards; pointer-events: none; }
@keyframes cam-flash { from { opacity: .8; } to { opacity: 0; } }

/* ---- Scan: step 2 sheet ---- */
.scan-sheet { display: grid; gap: .8rem; }
.scan-sheet h2 { margin: .4rem 0 0; font-size: 1.05rem; }
.scan-thumb { position: relative; height: 150px; border-radius: 16px; overflow: hidden; background: #0E1216; box-shadow: var(--shadow); }
.scan-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.read-state { position: absolute; left: .7rem; bottom: .7rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .82rem; font-weight: 600; }
.read-state:not(.ok)::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: #FEDA77; animation: pulse 1s ease-in-out infinite alternate; }
.read-state.ok { background: #0C6B32; }
.vchips { display: flex; gap: .5rem; flex-wrap: wrap; }
.vchip { display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; padding: 0 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .95rem var(--body); cursor: pointer; }
.vchip .icon { width: 20px; height: 20px; }
.vchip.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.odo-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.odo-row input { min-height: 52px; padding: .5rem .9rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: 600 1.2rem var(--head); min-width: 0; }
.odo-row .btn { min-height: 52px; }

/* Start-up splash: shown until we know whether you are signed in */
.splash { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; align-content: center; gap: 1.2rem; background: #fff; transition: opacity .25s; }
body.booting .splash { display: grid; }
body:not(.booting) .splash { opacity: 0; pointer-events: none; }
.splash img { width: min(56vw, 220px); height: auto; }
.splash span { width: 40px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #0C6B32, #4BA707); animation: splash-bar 1s ease-in-out infinite alternate; }
@keyframes splash-bar { from { transform: scaleX(.4); opacity: .5; } to { transform: scaleX(1.4); opacity: 1; } }
body.booting .topbar, body.booting .nav, body.booting .page { visibility: hidden; }

/* v1.6: less scrolling. Grids stay side by side on phones too */
.grid-2 { grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.grid-2 > .field, .grid-3 > .field { min-width: 0; }
.grid-3 .field input { padding-left: .55rem; padding-right: .45rem; }
.grid-2 .field label, .grid-3 .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.grid-2 .field .hint, .grid-3 .field .hint { font-size: .76rem; }
.field input[type="date"] { padding-left: .55rem; padding-right: .3rem; font-size: 1rem; }
.form { gap: .85rem; }
.interval .grid-2 { grid-template-columns: 1fr 1fr; }
/* "Tank full?" on one line: question left, two buttons right */
.inline-choice .field { grid-template-columns: auto 1fr; align-items: center; gap: .5rem .75rem; }
.inline-choice legend { float: left; margin: 0; padding-top: .7rem; }
.inline-choice .choice-row { flex-wrap: nowrap; justify-content: flex-end; }
.inline-choice .choice span { min-height: 44px; padding: .3rem .9rem; }
.inline-choice .field-error { grid-column: 1 / -1; }

/* Scanner zoom */
.cam-stage { touch-action: none; }
.cam-stage video { transform-origin: center center; transition: transform .08s linear; }
.cam-zoom { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; gap: .3rem; padding: .25rem; border-radius: 999px; background: rgba(0, 0, 0, .45); }
.cam-zoom button { min-width: 44px; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: #fff; font: 700 .9rem var(--body); }
.cam-zoom button.on { background: #fff; color: #0B0F0D; }
.scan-sheet .field-inline { margin-top: .2rem; }
.grid-2, .grid-3 { align-items: end; }

/* =====================================================================
   v1.7: clear section headings, smaller buttons
   ===================================================================== */
/* Section headings: deep green with a leaf-green marker, so they stand apart from text */
main h2, .section-head h2, .form-section {
  display: flex; align-items: center; gap: .5rem;
  color: var(--green); font-weight: 700; letter-spacing: .01em;
}
main h2::before, .form-section::before {
  content: ""; flex: none; width: 4px; height: 1.05em; border-radius: 4px; background: var(--leaf);
}
/* Headings inside cards and dialogs keep their own look */
.photo-slot h2, .slot-head h2, .empty h2, .rem h2, .dash-band h1, .dialog h2, .vcard-name, .scan-sheet h2 { color: var(--ink); }
.photo-slot h2::before, .slot-head h2::before, .empty h2::before, .dialog h2::before, .vcard-name::before, .scan-sheet h2::before { content: none; }
.danger h2 { color: var(--red); }
.danger h2::before { background: var(--red); }
/* Month headers in History */
.month-head { color: var(--green); font-weight: 700; padding: .3rem .25rem .45rem; border-bottom: 2px solid var(--green-soft); margin-bottom: .45rem; }
.month-head span:last-child, .month-head > :last-child { color: var(--ink); }
@media (prefers-color-scheme: dark) { .month-head > :last-child { color: var(--ink); } }

/* Smaller buttons throughout */
.btn { min-height: 40px; padding: 0 .95rem; font-size: .95rem; border-radius: 10px; }
.btn .icon { width: 18px; height: 18px; }
.btn-sm { min-height: 34px; padding: 0 .7rem; font-size: .86rem; border-radius: 9px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-block { min-height: 46px; font-size: 1rem; }
.vcard-actions .btn { min-height: 32px; padding: 0 .75rem; font-size: .85rem; }
.photo-actions .btn { min-height: 40px; }
.choose-alt { min-height: 36px; font-size: .88rem; }
.choice span { min-height: 42px; }

/* Rich two-tone icons: colour pairs */
.ricon { width: 30px; height: 30px; flex: none; }
.tone-green { --c1: #0C6B32; --c2: #9BDB7C; --tile: #E6F5E7; }
.tone-amber { --c1: #E07B00; --c2: #FFD27A; --tile: #FFF3DE; }
.tone-purple { --c1: #6D3FD1; --c2: #C9B5FF; --tile: #F0EAFF; }
.tone-red { --c1: #3A3F47; --c2: #F2A09A; --tile: #FFE9E7; }
.tone-blue { --c1: #1F64D6; --c2: #A9C8FF; --tile: #E6F0FF; }
.tone-teal { --c1: #0E8C7E; --c2: #93E0D5; --tile: #E1F6F3; }
.tone-slate { --c1: #445064; --c2: #C3CBD8; --tile: #EEF1F5; }
.tone-pink { --c1: #D6286E; --c2: #FFB2CE; --tile: #FFEAF2; }
@media (prefers-color-scheme: dark) {
  .tone-green { --tile: rgba(63, 180, 106, .16); } .tone-amber { --tile: rgba(255, 176, 50, .16); } .tone-purple { --tile: rgba(140, 100, 255, .18); }
  .tone-red { --tile: rgba(255, 110, 100, .16); --c1: #C9D1DC; } .tone-blue { --tile: rgba(80, 140, 255, .18); } .tone-teal { --tile: rgba(30, 190, 170, .16); }
  .tone-slate { --tile: rgba(200, 210, 225, .12); --c1: #C3CBD8; --c2: #6B778A; } .tone-pink { --tile: rgba(255, 90, 150, .16); }
}

/* =====================================================================
   v1.8: mobile-app layout. App bar, Home tiles, menus
   ===================================================================== */
.appbar-back, .appbar-title, .appbar-bell { display: none; }
@media (max-width: 899px) {
  .topbar { display: flex; align-items: center; gap: .4rem; min-height: 56px; padding: .4rem .6rem .4rem .9rem; }
  .appbar-bell { display: grid; position: relative; place-items: center; width: 42px; height: 42px; margin-left: auto; border-radius: 50%; color: var(--ink); }
  .appbar-bell .icon { width: 24px; height: 24px; }
  .appbar-bell:active { background: var(--green-soft); }
  .bell-badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #E5484D; color: #fff; font: 700 .7rem/18px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
  /* Sub-pages: ‹ Back + title in the bar; the in-page heading and back link become screen-reader only */
  body.sub-page .topbar .brand { display: none; }
  body.sub-page .appbar-title { display: block; flex: 1; min-width: 0; font: 700 1.15rem var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.sub-page .appbar-back:not([hidden]) { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -.35rem; border-radius: 50%; color: var(--ink); }
  body.sub-page .appbar-back .icon { width: 24px; height: 24px; }
  body.sub-page main > .back { display: none; }
  body.sub-page main > .page-title, body.sub-page .title-row > .page-title {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0;
  }
  body.sub-page .title-row { padding-top: .25rem; justify-content: flex-end; }
  body.sub-page main > .subtitle, body.sub-page main > .lead { margin-top: .5rem; }
  body.signed-out .appbar-bell { display: none; }
}
.sr-only.page-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Home: this month's spend card with mini bars */
.spend-card { display: flex; align-items: stretch; justify-content: space-between; gap: 1rem; margin: 1rem 0 .9rem; padding: 1.1rem 1.1rem 1rem; border-radius: 22px;
  background: linear-gradient(150deg, #0C6B32 0%, #13853D 55%, #3E9E1F 100%); color: #fff; text-decoration: none; box-shadow: 0 10px 24px rgba(12, 107, 50, .25); }
.spend-card:active { transform: scale(.99); }
.spend-text { display: grid; gap: .15rem; align-content: start; }
.spend-label { font-size: .9rem; opacity: .85; font-weight: 600; }
.spend-amt { font: 800 2.35rem/1.1 var(--head); letter-spacing: .01em; }
.spend-sub { font-size: .82rem; opacity: .85; }
.spend-prev { justify-self: start; margin-top: .45rem; padding: .12rem .55rem; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .76rem; }
.minibars { display: flex; align-items: flex-end; gap: 5px; width: 96px; height: 74px; align-self: center; }
.minibars i { flex: 1; border-radius: 4px 4px 2px 2px; background: rgba(255, 255, 255, .38); }
.minibars i.now { background: #FFD24A; }

/* Home: vehicle chips (scroll sideways) */
.vchip-row { display: flex; gap: .6rem; overflow-x: auto; margin: 0 -1rem .9rem; padding: .15rem 1rem .4rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.vchip-row::-webkit-scrollbar { display: none; }
.vchip-card { flex: none; display: flex; align-items: center; gap: .6rem; min-width: 150px; padding: .6rem .9rem .6rem .6rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; scroll-snap-align: start; }
.vchip-card strong { display: block; font-size: .95rem; white-space: nowrap; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.vchip-card small { color: var(--muted); font-weight: 600; }
.vchip-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--tile); }
.vchip-add { min-width: 0; justify-content: center; padding: 0 1rem; color: var(--green); }

/* Home: quick action tiles */
.qgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: .5rem; margin: 0 0 1.2rem; }
.qtile { display: grid; justify-items: center; align-content: start; gap: .45rem; min-height: 86px; padding: .75rem .1rem .6rem; border-radius: 16px; background: var(--tile); color: var(--ink); text-decoration: none; font: 600 .78rem var(--body); text-align: center; white-space: nowrap; letter-spacing: -.01em; }
.qtile span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.2; }
.qtile-img { --tile: #EEF1F5; }
@media (prefers-color-scheme: dark) { .qtile-img { --tile: rgba(200, 210, 225, .12); } }
.qtile-img img { width: 40px; height: 40px; border-radius: 11px; background: #fff; }
.qtile .ricon { width: 40px; height: 40px; }
.qtile:active { transform: scale(.96); }
@media (min-width: 900px) { .qgrid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* Menus (More, Challans check) */
.menu { list-style: none; margin: 1rem 0; padding: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; gap: .85rem; padding: .75rem .9rem; color: var(--ink); text-decoration: none; }
.menu-item:active { background: var(--green-soft); }
.menu-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; background: var(--tile); }
.menu-text { flex: 1; min-width: 0; }
.menu-text strong { display: block; font-size: 1rem; }
.menu-text small { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-chev { color: var(--muted); font-size: 1.4rem; }
.center { text-align: center; } .small { font-size: .82rem; }

/* Reminders list */
.remind-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.remind-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.remind-row .ricon { width: 34px; height: 34px; }
.remind-row span:not(.st) { flex: 1; min-width: 0; }
.remind-row strong { display: block; font-size: .93rem; }
.remind-row small { display: block; color: var(--muted); font-size: .82rem; }

/* Bottom bar: icon above label, app style */
@media (max-width: 899px) {
  .nav a span { font-size: .72rem; }
  .nav a.active { color: var(--green); }
  .nav a.active .icon { stroke-width: 2.3; }
}

/* One-tap save after scanning: two big buttons pinned above the bottom bar */
.quick-save { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + .6rem); z-index: 5; display: grid; grid-template-columns: 1.25fr 1fr; gap: .6rem; margin-top: .4rem; padding: .6rem; border-radius: 20px; background: var(--surface); box-shadow: 0 -4px 20px rgba(12, 40, 22, .10), var(--shadow); }
.qs-btn { min-height: 62px; border-radius: 16px; justify-content: center; gap: .55rem; font-size: 1.05rem; }
.qs-btn .icon { width: 22px; height: 22px; }
.qs-btn span { display: grid; text-align: left; line-height: 1.15; }
.qs-btn small { font-size: .78rem; font-weight: 600; opacity: .85; }
.qs-partial { border: 1.5px solid var(--green); color: var(--green); background: var(--green-soft); }
.review-first { justify-self: center; margin: .2rem 0 0; font-size: .86rem; color: var(--muted); text-decoration: underline; background: none; border: 0; }
body.has-banner .quick-save { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 3.6rem); }
@media (min-width: 900px) { .quick-save { bottom: 1rem; } }
/* Review screen: Confirm and save always visible */
.sticky-save { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + .6rem); z-index: 5; box-shadow: 0 6px 20px rgba(12, 107, 50, .35); }
@media (min-width: 900px) { .sticky-save { bottom: 1rem; } }
/* Toast with an action (Edit) */
.toast-action { display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.toast-action a { flex: none; color: #9BE07A; font-weight: 700; text-decoration: none; padding: .2rem .4rem; }

/* Quick-save buttons: green = full tank, orange = partial (easy to tell apart at a glance) */
.quick-save { grid-template-columns: 1fr 1fr; }
.qs-full { background: linear-gradient(150deg, #0C6B32, #2E8F2A); border: 0; color: #fff; }
.qs-partial { background: linear-gradient(150deg, #E07B00, #F2A21B); border: 0; color: #fff; }
.qs-full:hover, .qs-full:active { color: #fff; filter: brightness(1.06); }
.qs-partial:hover, .qs-partial:active { color: #fff; filter: brightness(1.06); }
.qs-btn .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.qs-btn small { opacity: .95; }

/* =====================================================================
   v1.9.2: review screen fits on one screen; late messages never push Confirm
   ===================================================================== */
.review-head { display: flex; align-items: center; gap: .7rem; margin: .6rem 0 .5rem; }
.review-head .thumbs { display: flex; gap: .35rem; margin: 0; flex: none; }
.review-head .thumb { width: 44px; height: 44px; border-radius: 10px; }
.review-head .thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-head p { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.notice-slim { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; padding: .45rem .7rem; font-size: .86rem; }
.notice-slim .icon { width: 18px; height: 18px; flex: none; }
.notice-demo { padding: .45rem .7rem; font-size: .86rem; display: flex; gap: .5rem; align-items: center; }
/* Checks as small one-line chips (a reserved row, so arriving checks don't shift the form) */
.checks-slim { min-height: 30px; margin: 0 0 .6rem; }
.checks-slim ul { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.checks-slim .check { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; margin: 0; padding: .2rem .6rem; border-radius: 999px; border: 0; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.checks-slim .check span { overflow: hidden; text-overflow: ellipsis; }
.checks-slim .check .icon { width: 15px; height: 15px; flex: none; }
.checks-slim .check-ok { background: var(--green-soft); color: var(--green); }
.checks-slim .check-info { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.checks-slim .check-warn { background: var(--amber-soft); color: var(--amber-ink); }
.field label small { font-weight: 500; font-size: .8em; }
/* Confirm pinned; Change photos / Cancel as a slim row under it */
.form-actions-stack .split { gap: .5rem; }
.form-actions-stack .split .btn { min-height: 36px; font-size: .88rem; }

/* Scan sheet: shorter photo strip, one-line hints */
.scan-thumb { height: 108px; }
.scan-sheet [data-odo-hint] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.scan-sheet { gap: .65rem; }

/* =====================================================================
   v1.9.3: action buttons FIXED above the bottom bar on phones.
   Nothing above them (late messages, big fonts) can move them; content
   scrolls underneath when it has to.
   ===================================================================== */
@media (max-width: 899px) {
  .quick-save, .form-actions.review-footer {
    position: fixed; z-index: 30; left: .6rem; right: .6rem; margin: 0;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + .5rem);
  }
  body.has-banner .quick-save, body.has-banner .form-actions.review-footer { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 3.4rem); }
  .form-actions.review-footer { display: grid; gap: .45rem; padding: .55rem; border-radius: 20px; background: var(--surface); box-shadow: 0 -4px 20px rgba(12, 40, 22, .10), var(--shadow); }
  .review-footer .sticky-save { position: static; box-shadow: none; }
  /* Room for the fixed bars so the last fields can scroll above them */
  .scan-sheet { padding-bottom: 6.6rem; }
  form:has(.review-footer) { padding-bottom: 8.6rem; }
}

/* =====================================================================
   v2.0: iPhone (Safari) alignment fixes
   ===================================================================== */
/* iOS draws date pickers centred and taller than other inputs; make them match */
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; min-height: 48px; text-align: left; line-height: 1.2; background-color: var(--surface); }
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { margin-left: auto; }
select { -webkit-appearance: none; appearance: none; min-height: 48px; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 18px; }
.field input, .field select, .field textarea { min-height: 48px; }
/* An odd field at the end of a 2-column row takes the full width (e.g. Service centre) */
.grid-2 > .field:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* Section headings keep clear of the cards below them */
.form-section, main h2.form-section { margin: 1.3rem 0 .7rem; }
.item-row { margin-top: .2rem; }
/* "Optional services" tick: box and text on one line */
.item-opt { display: flex; align-items: center; gap: .55rem; font-size: .9rem; color: var(--ink); }
.item-opt input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; accent-color: var(--green); }
/* Fields the photo did not show: amber box with "Not found" inside (no extra line) */
.not-found-field input, .not-found-field select { border-color: var(--amber); background: var(--amber-soft); }
.not-found-field input::placeholder { color: var(--amber-ink); opacity: .9; font-size: .9em; }
/* Cancel / Check details row on the scan sheet */
.sheet-links { display: flex; justify-content: space-between; align-items: center; margin-top: .1rem; }
.sheet-links .link-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .2rem; font-size: .9rem; color: var(--muted); text-decoration: underline; background: none; border: 0; }
.sheet-links .link-btn .icon { width: 16px; height: 16px; }
.sheet-links [data-cancel-scan] { color: var(--red); text-decoration: none; font-weight: 600; }

/* Install GaadiKhata */
.install-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .4rem .8rem; margin: 0 0 .9rem; padding: .8rem .9rem; border-radius: 18px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--green-soft) 100%); box-shadow: var(--shadow); border: 1.5px solid rgba(12, 107, 50, .18); }
.install-card img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); background: #fff; }
.install-text strong { display: block; font-size: 1.02rem; }
.install-text span { display: block; color: var(--muted); font-size: .84rem; }
.install-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: .9rem; }
.install-actions .btn { min-height: 40px; padding: 0 1.1rem; font-size: .95rem; }
.install-actions .link-btn { background: none; border: 0; color: var(--muted); font-size: .88rem; text-decoration: underline; }
button.menu-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.menu-icon img { border-radius: 9px; }
/* Bottom sheet with install steps */
.sheet-modal { position: fixed; inset: 0; z-index: 90; display: grid; align-items: end; justify-items: center; background: rgba(8, 12, 10, .45); }
.sheet-box { width: min(100%, 520px); max-height: 88vh; overflow: auto; padding: 1.1rem 1.1rem calc(1rem + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: 0 -8px 30px rgba(0, 0, 0, .2); }
@media (min-width: 700px) { .sheet-modal { align-items: center; } .sheet-box { border-radius: 22px; } }
.sheet-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.sheet-head img { border-radius: 12px; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; color: var(--ink); }
.sheet-head h2::before { content: none; }
.sheet-head p { margin: 0; color: var(--muted); font-size: .86rem; }
.sheet-x { margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); }
.install-steps { margin: .4rem 0 .8rem; padding-left: 1.3rem; display: grid; gap: .55rem; font-size: 1rem; }
.install-steps .icon { width: 18px; height: 18px; vertical-align: -3px; color: #1F64D6; }
.install-steps .key { display: inline-block; padding: 0 .35rem; border-radius: 6px; background: var(--bg); }
/* Dropdowns: full width with a visible arrow everywhere (incl. service lines) */
select:not([multiple]) { background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right .6rem center / 18px; padding-right: 2rem; }
.field-inline .vehicle-select { background-color: var(--green-soft); }
.install-steps .share-ico { width: 20px; height: 20px; color: #1F64D6; vertical-align: -4px; }

/* Service lines: [Part ▾] and Remove on one row; tick box beside its text */
.item-meta select { flex: 1 1 auto; width: auto; min-width: 0; max-width: 65%; }
.item-grid .item-opt { display: flex; flex-direction: row; align-items: center; gap: .55rem; }
.item-grid .item-opt input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; flex: none; padding: 0; margin: 0; }

/* Capture button: camera with a fuel pump in the lens */
.cam-shutter { display: grid; place-items: center; padding: 4px; }
.cam-shutter svg { width: 100%; height: 100%; display: block; }
.cam-shutter:active svg { transform: scale(.92); }
/* Cancel: red outline button (scan sheet and Check the details) */
.btn-cancel { border: 1.5px solid var(--red); color: var(--red); background: var(--surface); }
.btn-cancel:hover, .btn-cancel:active { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.btn-cancel .icon { width: 17px; height: 17px; }
.quick-save .qs-cancel { grid-column: 1 / -1; min-height: 40px; }
.sheet-links { justify-content: flex-end; }
.scan-sheet { padding-bottom: 9.6rem; }

/* Install button on the sign-in screen */
.login-install { gap: .5rem; border: 1.5px solid rgba(12, 107, 50, .3); color: var(--green); background: var(--green-soft); }
.login-install img { border-radius: 6px; }

/* iPhone: pointer to the Share button */
.install-pointer { position: fixed; inset: 0; z-index: 95; background: rgba(8, 12, 10, .62); }
.ptr-card { position: absolute; left: 1rem; right: 1rem; display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); flex-wrap: wrap; }
.ptr-card img { border-radius: 11px; flex: none; }
.ptr-card p { margin: 0; flex: 1; min-width: 12rem; }
.ptr-card strong { display: flex; align-items: center; gap: .35rem; font-size: 1.12rem; }
.ptr-card strong .share-ico { width: 22px; height: 22px; color: #1F64D6; }
.ptr-card span { display: block; color: var(--muted); font-size: .95rem; margin-top: .15rem; }
.ptr-card .link-btn { background: none; border: 0; color: var(--green); font-weight: 600; text-decoration: underline; padding: .3rem 0; }
.ptr-arrow { position: absolute; width: 40px; height: 64px; }
.ptr-arrow svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
.ptr-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + .8rem); right: .8rem; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; }
/* Safari on iPhone: Share is at the bottom middle → card above, arrow pointing down */
.ptr-bottom .ptr-card { bottom: calc(env(safe-area-inset-bottom, 0px) + 6.5rem); }
.ptr-bottom .ptr-arrow { left: calc(50% - 20px); bottom: calc(env(safe-area-inset-bottom, 0px) + .6rem); animation: ptr-down 1s ease-in-out infinite; }
/* Chrome/Edge on iPhone, and iPad: Share is at the top right → arrow pointing up-right */
.ptr-top .ptr-card { top: calc(env(safe-area-inset-top, 0px) + 6rem); }
.ptr-top .ptr-arrow { right: 1.4rem; top: calc(env(safe-area-inset-top, 0px) + .4rem); transform: rotate(180deg); animation: ptr-up 1s ease-in-out infinite; }
.ptr-top .ptr-close { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 1.2rem); right: calc(50% - 21px); }
@keyframes ptr-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes ptr-up { 0%, 100% { transform: rotate(180deg) translateY(0); } 50% { transform: rotate(180deg) translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .ptr-arrow { animation: none !important; } }

/* Pay with UPI app */
.toast-pay { flex-wrap: wrap; }
.toast-pay > span { flex: 1 1 100%; }
.toast-pay button { min-height: 40px; padding: 0 .9rem; border: 0; border-radius: 999px; background: #9BE07A; color: #0B2A14; font: inherit; font-weight: 700; }
.upi-grid { display: grid; gap: .6rem; margin: .4rem 0 .8rem; }
.upi-app { display: grid; place-items: center; min-height: 60px; border: 1px solid #DDE3DD; border-radius: 14px; background: #fff; } /* always white: the logos have dark text */
.upi-app img { display: block; height: 32px; max-width: 70%; }
.upi-note { margin: .4rem 0 1rem; font-size: 1.05rem; }
.upi-payee { margin: .2rem 0 0; color: var(--muted); }
.upi-payee strong { color: var(--ink); }
.upi-payee small { display: block; font-size: .8rem; word-break: break-all; }
.upi-choose { margin: .6rem 0 .5rem; text-decoration: none; }
.upi-or { margin: .3rem 0 .6rem; text-align: center; color: var(--muted); font-size: .92rem; }
.upi-or a { color: var(--green); font-weight: 600; }
.upi-any { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 600; text-decoration: none; }
.upi-warn { display: flex; gap: .45rem; align-items: flex-start; margin: .5rem 0; padding: .6rem .75rem; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: .92rem; }
.upi-warn .icon { flex: none; width: 18px; height: 18px; margin-top: .1rem; }
.qr-scan { position: fixed; inset: 0; z-index: 95; background: #111; color: #fff; }
.qr-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qr-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: .9rem; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 1rem; }
.qr-top strong { display: block; font: 700 1.45rem/1.2 var(--head); }
.qr-top span { display: block; margin-top: .15rem; color: #C8F0D4; font-size: 1rem; }
.qr-back { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; }
.qr-back .icon { width: 26px; height: 26px; }
/* PhonePe-style: a clear rounded window over a dimmed camera, with corner brackets */
.qr-frame { position: absolute; top: 46%; left: 50%; width: min(80vw, 360px); aspect-ratio: 1; transform: translate(-50%, -58%); border-radius: 26px; box-shadow: 0 0 0 100vmax rgba(20, 22, 24, .62); }
.qr-frame b { position: absolute; width: 18%; height: 18%; border: 0 solid #4ADE80; }
.qr-frame b:nth-child(1) { top: 6%; left: 6%; border-top-width: 5px; border-left-width: 5px; border-top-left-radius: 18px; }
.qr-frame b:nth-child(2) { top: 6%; right: 6%; border-top-width: 5px; border-right-width: 5px; border-top-right-radius: 18px; }
.qr-frame b:nth-child(3) { bottom: 6%; left: 6%; border-bottom-width: 5px; border-left-width: 5px; border-bottom-left-radius: 18px; }
.qr-frame b:nth-child(4) { bottom: 6%; right: 6%; border-bottom-width: 5px; border-right-width: 5px; border-bottom-right-radius: 18px; }
.qr-frame i { position: absolute; left: 12%; right: 12%; top: 14%; height: 3px; border-radius: 3px; background: #4ADE80; box-shadow: 0 0 10px 3px rgba(74, 222, 128, .6); animation: qr-sweep 1.8s ease-in-out infinite alternate; }
@keyframes qr-sweep { from { top: 14%; } to { top: 84%; } }
.qr-failed .qr-frame { display: none; }
.qr-tools { position: absolute; left: 0; right: 0; top: calc(46% + min(80vw, 360px) * .42 + 1.6rem); display: flex; justify-content: center; gap: 3rem; }
.qr-tool { display: grid; justify-items: center; gap: .45rem; padding: 0; border: 0; background: none; color: #fff; font: 500 1rem var(--body); }
.qr-tool span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.qr-tool svg { width: 28px; height: 28px; }
.qr-tool.qr-on span { background: #fff; color: #111; }
.qr-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: .5rem; justify-items: center; padding: 1rem 1rem calc(1.3rem + env(safe-area-inset-bottom, 0px)); text-align: center; }
.qr-hint { margin: 0; font-size: .98rem; color: #E8ECEF; }
.qr-other { min-height: 44px; padding: 0 1rem; border: 0; background: none; color: #C8F0D4; font: 600 .95rem var(--body); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .qr-frame i { animation: none; top: 50%; } }

/* Documents */
.doc-add { margin-bottom: 1.25rem; }
.doc-group { margin-bottom: .7rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.doc-group summary { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1rem; cursor: pointer; }
.doc-group summary span { color: var(--muted); font-size: .85rem; }
.doc-group .doc-tiles { padding: 0 .75rem .75rem; }
.doc-tiles { display: flex; flex-wrap: wrap; gap: .45rem; }
.doc-tile { padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.doc-added { background: var(--green-soft); color: var(--green); }
.doc-missing { background: var(--amber-soft); color: var(--amber-ink); }
.doc-expired { background: var(--red-soft); color: var(--red); }
.doc-sides { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.doc-side { display: grid; justify-items: center; gap: .2rem; min-height: 104px; padding: .7rem .5rem; border: 1.5px dashed var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: center; cursor: pointer; }
.doc-side[hidden] { display: none; }
.doc-side .icon { width: 24px; height: 24px; color: var(--green); }
.doc-side small { max-width: 100%; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.doc-side-done { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.vcard-mileage { margin: .5rem 0 0; font-size: .95rem; }
.vcard-mileage span { color: var(--muted); font-size: .84rem; }
.doc-facts p { margin: 0 0 .3rem; }
.doc-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }

/* Admin (owner only) */
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.admin-stat { padding: .6rem .5rem; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.admin-stat b { display: block; font-size: 1.2rem; }
.admin-stat span { color: var(--muted); font-size: .74rem; }
.admin-users { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.admin-user { padding: .8rem .9rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.admin-user strong, .admin-user small { display: block; }
.admin-user small { color: var(--muted); }
.admin-user dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem .6rem; margin: .6rem 0 0; }
.admin-user dt { color: var(--muted); font-size: .72rem; }
.admin-user dd { margin: 0; font-size: .86rem; font-weight: 600; }

/* My vehicles: small coloured buttons */
.vbtn { display: inline-flex; align-items: center; gap: .15rem; min-height: 24px; padding: 0 .5rem; border-radius: 7px; font-size: .72rem; font-weight: 600; text-decoration: none; }
.vbtn .icon { width: 11px; height: 11px; }
.vbtn-fuel { background: var(--green-soft); color: var(--green); }
.vbtn-service { background: #EFE8FB; color: #5A31A8; }
.vbtn-docs { background: #E3EEFC; color: #1A56B8; }
@media (prefers-color-scheme: dark) {
  .vbtn-service { background: #2E2547; color: #CDB8F5; }
  .vbtn-docs { background: #1C2C47; color: #A9C8F5; }
}

/* Add fuel after a scan (beta) */
body.af-open .topbar, body.af-open .nav { display: none; }
body.af-open #main { padding-bottom: 0; }
.af-bar { display: flex; align-items: center; gap: .5rem; margin: -.25rem 0 1rem; }
.af-bar .page-title { margin: 0; font-size: 1.35rem; }
.af-x { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -.5rem; border: 0; border-radius: 50%; background: none; color: var(--ink); }
.af-x .icon { width: 24px; height: 24px; }
.af-card { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: .8rem; padding: .75rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.af-card.af-warn { border: 2px solid var(--amber); }
.af-thumb { width: 92px; height: 100px; padding: 0; border: 0; border-radius: 12px; background: #0B0F0D; overflow: hidden; cursor: zoom-in; }
.af-thumb img { width: 100%; height: 100%; object-fit: contain; }
.af-body { display: grid; align-content: start; gap: .2rem; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.af-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.af-amt { font-size: 1.85rem; font-weight: 800; line-height: 1.1; }
.af-line { font-size: .98rem; }
.af-muted { color: var(--muted); font-size: .9rem; }
.af-chip { display: inline-flex; align-items: center; gap: .25rem; flex: none; padding: .2rem .6rem; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .8rem; font-weight: 700; }
.af-chip .icon { width: 14px; height: 14px; }
.af-chip-ok { background: var(--green-soft); color: var(--green); }
.af-chip-warn { background: var(--amber-soft); color: var(--amber-ink); }
.af-edit { display: inline-flex; align-items: center; gap: .35rem; margin-top: .15rem; color: var(--muted); font-size: .9rem; }
.af-edit .icon { width: 15px; height: 15px; }
.af-edit-warn { color: var(--amber-ink); font-weight: 700; }
.af-flag { padding: 0 .2rem; border-radius: 4px; background: var(--amber-soft); color: var(--amber-ink); text-decoration: underline dotted; }
.af-skel { display: block; height: .9rem; width: 75%; border-radius: 6px; background: var(--line); animation: af-pulse 1.2s ease-in-out infinite; }
.af-skel-amt { height: 1.7rem; width: 45%; }
.af-skel-short { width: 55%; }
@keyframes af-pulse { 50% { opacity: .45; } }
.af-paise { font-size: .55em; font-weight: 700; }
.af-thumb { position: relative; }
.af-reading .af-thumb::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(12, 107, 50, .0), rgba(12, 107, 50, .18)); z-index: 1; }
.af-reading .af-thumb::after { content: ''; position: absolute; left: 6%; right: 6%; top: 8%; height: 3px; border-radius: 3px; background: #4ADE80; box-shadow: 0 0 10px 3px rgba(74, 222, 128, .75); z-index: 2; animation: af-sweep 1.6s ease-in-out infinite alternate; }
.af-reading { border-color: var(--green); }
.af-chip-live { background: var(--green-soft); color: var(--green); }
.af-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: af-blink 1s ease-in-out infinite; }
.af-step { color: var(--green); font-weight: 700; font-size: .92rem; }
.af-step-in { animation: af-rise .35s ease-out; }
.af-read-done .af-chip, .af-read-done .af-amt { animation: af-pop .4s ease-out; }
@keyframes af-sweep { from { top: 8%; } to { top: 88%; } }
@keyframes af-blink { 50% { opacity: .25; } }
@keyframes af-rise { from { opacity: .35; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes af-pop { 0% { transform: scale(.85); opacity: .3; } 70% { transform: scale(1.06); } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .af-skel, .af-dot, .af-step-in, .af-read-done .af-chip, .af-read-done .af-amt { animation: none; } .af-reading .af-thumb::after { animation: none; top: 50%; } }
.af-row { position: relative; display: flex; align-items: center; min-height: 54px; margin-top: .9rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.af-row > span { color: var(--muted); }
.af-row select { flex: 1; min-height: 52px; padding: 0 2rem 0 .5rem; border: 0; background: transparent; color: var(--ink); font: 600 1rem var(--body); text-align: right; text-align-last: right; appearance: none; -webkit-appearance: none; }
.af-row .icon { position: absolute; right: .9rem; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.af-km { margin-top: 1rem; }
.af-km label { display: block; margin-bottom: .4rem; }
.af-km label .muted { font-weight: 400; }
.af-km-field { display: flex; align-items: center; gap: .55rem; min-height: 60px; padding: 0 .45rem 0 .85rem; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.af-km-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.af-km-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.af-km-ico svg { width: 22px; height: 22px; }
.af-km-field input { flex: 1; min-width: 0; min-height: 56px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 700 1.3rem var(--head); letter-spacing: .02em; font-variant-numeric: tabular-nums; box-shadow: none; }
.af-km-field input::placeholder { font: italic 400 .98rem var(--body); letter-spacing: 0; }
.af-km-unit { flex: none; color: var(--muted); font-weight: 700; font-size: .9rem; }
.af-km-field input:placeholder-shown + .af-km-unit { display: none; }
.af-km-cam { display: inline-flex; align-items: center; gap: .3rem; flex: none; height: 44px; padding: 0 .8rem; border: 0; border-radius: 12px; background: var(--green-soft); color: var(--green); font: 700 .9rem var(--body); }
.af-km-cam .icon { width: 19px; height: 19px; }
.af-km .hint { margin: .4rem 0 0; }
.af-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: 0 -6px 24px rgba(0, 0, 0, .12); text-align: center; }
.af-typing .af-panel { position: static; margin: 1.2rem -1rem 0; }
.af-panel h2 { margin: 0 0 .7rem; font-size: 1rem; font-weight: 600; color: var(--ink); text-align: center; display: block; }
.af-panel h2::before { content: none; }
.af-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin: 0 auto; }
.af-choice { position: relative; display: grid; justify-items: center; align-content: center; gap: .25rem; min-height: 96px; padding: .5rem; border-radius: 16px; font: 700 1.05rem var(--body); cursor: pointer; }
.af-choice:disabled { opacity: .7; }
.af-gauge { width: 52px; height: 42px; }
.af-full { border: 2px solid var(--green); background: var(--green); color: #fff; }
.af-partial { border: 2px solid #C25E00; background: transparent; color: #A34F00; }
.af-usual { position: absolute; top: -.7rem; right: .6rem; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; letter-spacing: .04em; }
.af-partial .af-usual { border: 1.5px solid #C25E00; background: #FFE8D1; color: #7A3B00; }
.af-full .af-usual { border: 1.5px solid var(--green); background: var(--green-soft); color: var(--green); }
.af-history { margin: .6rem 0 0; color: var(--muted); font-size: .86rem; }
.af-km, .af-row, .af-card { scroll-margin-bottom: 240px; }
#main:has(.af-panel) { padding-bottom: 250px; }
.af-typing#main:has(.af-panel) { padding-bottom: 1rem; }
.af-saved .sheet-box { text-align: center; }
.af-saved .sheet-box { position: relative; }
.af-edit-ic { position: absolute; top: .7rem; right: .7rem; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); }
.af-edit-ic .icon { width: 20px; height: 20px; }
.af-pay .icon { width: 20px; height: 20px; }
.af-done strong { color: var(--green); }
.af-cash { margin-top: .6rem; }
/* "All set" after paying */
.af-allset { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 1.2rem; background: rgba(8, 12, 10, .55); animation: af-fade .2s ease-out; }
.af-allset-out { opacity: 0; transition: opacity .25s; }
.af-allset-box { width: min(100%, 380px); padding: 1.6rem 1.3rem 1.2rem; border-radius: 24px; background: var(--surface); text-align: center; animation: af-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.af-allset h2 { margin: .6rem 0 .2rem; font-size: 1.6rem; color: var(--ink); }
.af-allset h2::before { content: none; }
.af-allset-main { margin: 0; font-size: 1.05rem; }
.af-allset-chip { display: inline-block; margin: .7rem 0 .4rem; padding: .3rem .8rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: .92rem; }
.af-allset-msg { margin: .3rem 0 1.1rem; color: var(--muted); }
.af-burst { position: relative; width: 96px; height: 96px; margin: 0 auto; }
.af-check { position: relative; z-index: 1; width: 96px; height: 96px; }
.af-check circle { fill: var(--green); }
.af-check path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: af-draw .45s .25s ease-out forwards; }
.af-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--green); animation: af-ring .9s .15s ease-out forwards; opacity: 0; }
.af-burst i { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 2px; background: #F5B301; opacity: 0; transform: rotate(var(--a)) translateY(0); animation: af-confetti .9s calc(.2s + var(--d)) ease-out forwards; }
.af-burst i:nth-child(3n+2) { background: #3FB46A; border-radius: 50%; }
.af-burst i:nth-child(3n) { background: #1F64D6; width: 6px; height: 10px; }
@keyframes af-draw { to { stroke-dashoffset: 0; } }
@keyframes af-ring { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes af-confetti { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-78px); } }
@keyframes af-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .af-allset, .af-allset-box, .af-ring, .af-burst i { animation: none; } .af-check path { animation: none; stroke-dashoffset: 0; } }
.af-type-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .9rem; }
.af-type-head h2 { margin: 0 0 .2rem; font-size: 1.2rem; }
.af-type-head h2::before { content: none; }
.af-type-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.af-type-photo { flex: none; width: 56px; height: 64px; padding: 0; border: 0; border-radius: 10px; background: #0B0F0D; overflow: hidden; cursor: zoom-in; }
.af-type-photo img { width: 100%; height: 100%; object-fit: cover; }
.af-type-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; }
.af-type-field > span:first-child { display: block; margin-bottom: .3rem; font-weight: 700; }
.af-type-box { display: flex; align-items: center; gap: .35rem; min-height: 58px; padding: 0 .8rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.af-type-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.af-type-box.af-type-bad { border-color: var(--red); }
.af-type-box b { color: var(--muted); font-weight: 700; }
.af-type-box input::placeholder { font: italic 400 .98rem var(--body); letter-spacing: 0; color: var(--muted); opacity: 1; }
.af-type-box input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 700 1.35rem var(--head); font-variant-numeric: tabular-nums; box-shadow: none; }
.af-type-rate { min-height: 1.4em; margin: .55rem 0 .8rem; color: var(--green); font-weight: 700; font-size: .95rem; }
.af-type-rate.af-type-err { color: var(--red); }
.af-type-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .6rem; }
.af-tick { display: inline-grid; place-items: center; width: 64px; height: 64px; margin: .3rem auto .4rem; border-radius: 50%; background: var(--green); color: #fff; }
.af-tick .icon { width: 34px; height: 34px; stroke-width: 2.6; }
.af-saved h2 { margin: 0; font-size: 1.5rem; color: var(--ink); }
.af-saved h2::before { content: none; }
.af-saved-main { margin: .3rem 0 0; font-size: 1.02rem; }
.af-saved-sub { margin: .15rem 0 1rem; color: var(--muted); font-size: .88rem; }
.af-saved-row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .7rem; }
.af-saved-row.af-one { grid-template-columns: 1fr; }
.af-done { display: block; margin: .8rem auto 0; padding: .6rem 1.2rem; color: var(--muted); font-size: 1rem; text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .af-partial { border-color: #FFB347; color: #FFB347; }
  .af-partial .af-usual { border-color: #FFB347; background: #3A2410; color: #FFB347; }
  .af-full .af-usual { background: #17351F; }
}

/* Beta: Week / Month spend card and mileage highlights */
.spend-side { display: grid; justify-items: end; align-content: space-between; gap: .5rem; }
.spend-seg { display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.spend-seg button { min-height: 32px; padding: 0 .7rem; border: 0; border-radius: 999px; background: transparent; color: inherit; font: 700 .8rem var(--body); }
.spend-seg button[aria-pressed="true"] { background: #fff; color: #0C6B32; }
.spend-link { color: inherit; font-size: .78rem; font-weight: 700; text-decoration: none; }
.vchip-card small.vchip-mil { display: block; color: var(--green); font-size: 1rem; font-weight: 800; }
.vchip-mil .vchip-dec { font-size: .7em; }
.af-tank { margin: -.6rem 0 1rem; color: var(--green); font-weight: 700; }
.mil-trend { display: flex; align-items: flex-end; gap: .5rem; height: 150px; margin: .4rem 0 .3rem; padding: .8rem .8rem .5rem; list-style: none; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.mil-trend li { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .25rem; height: 100%; min-width: 0; }
.mil-trend i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--green-soft); }
.mil-trend li.now i { background: var(--green); }
.mil-trend li.low i { background: var(--amber-soft); }
.mil-trend li.low.now i { background: var(--amber); }
.mil-trend b { font-size: .74rem; }
.mil-trend small { color: var(--muted); font-size: .68rem; white-space: nowrap; }

/* Placeholders look like hints, never like typed text */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; font-style: italic; }

/* Add challan: scan once, save every challan */
.cq-vehicle { margin: 0 0 .9rem; }
.cq-scan { display: flex; align-items: center; gap: .9rem; width: 100%; padding: 1rem; border: 0; border-radius: 18px; background: var(--green); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.cq-scan-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .18); }
.cq-scan-icon .icon { width: 28px; height: 28px; }
.cq-scan strong { display: block; font-size: 1.15rem; }
.cq-scan small { display: block; opacity: .9; font-size: .85rem; }
.cq-title { margin: 1.2rem 0 .6rem; }
.cq-list { display: grid; gap: .55rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.cq-item { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .85rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.cq-item.on { border-color: var(--green); background: var(--green-soft); }
.cq-item.off { opacity: .75; cursor: default; }
.cq-item input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--green); }
.cq-body { display: grid; gap: .15rem; flex: 1; min-width: 0; }
.cq-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cq-top b { font-size: 1.15rem; }
.cq-warn { color: var(--amber-ink); font-weight: 700; }
.cq-links { display: grid; gap: .6rem; margin-top: 1rem; }
.cq-empty { padding: .9rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.cq-empty p { margin: 0 0 .7rem; }

/* Check challans online (sheet) */
.cc-reg { display: flex; align-items: baseline; gap: .5rem; margin: .2rem 0 .6rem; }
.cc-reg strong { font-size: 1.35rem; letter-spacing: .04em; }
.cc-reg span { color: var(--green); font-weight: 700; font-size: .85rem; }
.cc-steps { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .4rem; }
.cc-scan { margin-top: .6rem; }

/* Coming soon */
.menu-icon-img { background: #fff; overflow: hidden; }
.menu-icon-img img { width: 40px; height: 40px; border-radius: 10px; }
.soon { display: grid; justify-items: center; gap: .4rem; margin-top: 1.5rem; padding: 2rem 1.2rem; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.soon img { width: 128px; height: 128px; border-radius: 24px; background: #fff; }
.soon h2 { margin: .6rem 0 0; font-size: 1.5rem; }
.soon h2::before { content: none; }
.soon p { margin: 0 0 1rem; color: var(--muted); font-size: 1.05rem; }

/* Home: features on the way */
