/* Fareit: a dashboard instrument. Dark by default (night driving), light follows the phone. */
:root {
  --bg: #131615;
  --surface: #1c201e;
  --raised: #262b28;
  --ink: #eef1ee;
  --muted: #9aa39e;
  --line: #343a36;
  --accent: #5fb3d3;
  --go: #2fbf6a;
  --go-ink: #04140a;
  --tada: #e0a84a; --tada-ink: #241c00;
  --stop: #ef5b4f;
  --stop-ink: #1d0503;
  --warn: #e0a84a;
  --dead: #ef5b4f;
  --sel: #5fb3d3;
  --sel-ink: #04121a;
  --log: #8fd3f0; --log-ink: #06202c;
  --display: "Archivo", "SF Pro Display", system-ui, -apple-system, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f4f1; --surface: #ffffff; --raised: #e8ece7; --ink: #151917; --muted: #5a635e; --line: #d3d8d2;
    --accent: #1d6f8f; --go: #1f9a52; --go-ink: #ffffff; --tada: #a86a12; --tada-ink: #ffffff; --stop: #cf3a2f; --stop-ink: #ffffff;
    --warn: #a86a12; --dead: #cf3a2f; --sel: #1d6f8f; --sel-ink: #ffffff; --log: #7cc8ea; --log-ink: #06202c; color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, label.button { font: inherit; color: inherit; }
h2 { font-family: var(--display); font-size: 17px; margin: 8px 0 0; font-weight: 700; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
/* Logo: Aga · rat · ion as three small cards in the app's red, amber and green. */
.logo { display: inline-flex; align-items: baseline; position: relative; overflow: hidden; padding: 1px 10px 5px; border-radius: 10px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 800; line-height: 1.15; }
/* the three states as solid blocks along the bottom: bad, normal, good */
.logo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--stop) 0 33.34%, var(--warn) 33.34% 66.67%, var(--go) 66.67%); }
/* the "A": three slim up-arrows rising from bad to good, red at the bottom, green on top */
.logo-up { width: 0.6em; height: 0.73em; margin-right: 0.04em; align-self: baseline; overflow: visible;
  fill: none; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.logo-up .up-r { stroke: var(--stop); }
.logo-up .up-a { stroke: var(--warn); }
.logo-up .up-g { stroke: var(--go); }
.brand { white-space: nowrap; }
@media (max-width: 360px) { .logo { padding: 1px 7px 5px; } .brand { font-size: 16px; } .beta-tag { font-size: 10px; padding: 1px 4px; } }

/* Formula tab */
.lab-formula .k, .lab-predict .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.lab-formula .f { font-family: var(--mono); font-size: 15px; line-height: 1.5; margin: 6px 0; }
.lab-formula .s, .lab-predict .s { font-size: 13px; color: var(--muted); line-height: 1.35; }
.lab-predict { border: 2px solid var(--accent); border-radius: 16px; padding: 14px 16px; display: grid; gap: 4px; background: var(--surface); }
.lab-predict .v { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.lab-check { font-size: 15px; min-height: 20px; }
.lab-check .cmp { display: grid; gap: 4px; }
.lab-check .r { display: grid; grid-template-columns: 1.15fr 0.8fr 0.8fr 1.45fr; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.lab-check .r.h { background: none; border: 0; padding: 0 10px; font-size: 12px; color: var(--muted); }
.lab-check .r .l { font-weight: 700; }
.lab-check .d { display: grid; gap: 2px; font-size: 13px; }
.lab-check .d b { font-size: 13px; }
.lab-check .close { color: var(--go); }
.lab-check .off { color: var(--warn); }
.lab-check .far { color: var(--stop); }
.lab-check .kept { margin-top: 8px; font-size: 14px; }
.lab-check .key { margin-top: 6px; font-size: 12px; color: var(--muted); }
.lab-check .key span { font-weight: 700; }
/* Whole rows and the prediction card take their colour: border plus a light tint. */
.lab-check .r.close { border-color: var(--go); background: color-mix(in srgb, var(--go) 12%, var(--surface)); }
.lab-check .r.off { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.lab-check .r.far { border-color: var(--stop); background: color-mix(in srgb, var(--stop) 12%, var(--surface)); }
.lab-predict.normal { border-color: var(--muted); }
.lab-predict.good { border-color: var(--go); background: color-mix(in srgb, var(--go) 12%, var(--surface)); }
.lab-predict.bad { border-color: var(--stop); background: color-mix(in srgb, var(--stop) 12%, var(--surface)); }
.lab-check .surge-hint { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--warn); font-size: 14px; display: grid; gap: 8px; }
.lab-check .surge-hint button { justify-self: start; }
.lab-predict .surge-est { color: var(--warn); }
/* Beta Window: earnings by distance band */
.band-cards { display: grid; gap: 10px; }
.band-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.band-card { border-radius: 16px; padding: 14px 16px; display: grid; gap: 4px; border: 2px solid var(--line); background: var(--surface); }
.band-card.normal { border-color: var(--muted); }
.band-card.good { background: color-mix(in srgb, var(--go) 22%, var(--surface)); border-color: var(--go); }
.band-card.bad { background: color-mix(in srgb, var(--stop) 22%, var(--surface)); border-color: var(--stop); }
.band-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.band-name { font-weight: 800; font-size: 18px; }
.band-tag { font-size: 13px; font-weight: 700; }
.band-card.good .band-tag { color: var(--go); }
.band-card.bad .band-tag { color: var(--stop); }
.band-card.normal .band-tag { color: var(--muted); }
.band-now { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.band-sub { font-size: 14px; color: var(--muted); }
.band-km { font-size: 12px; }
.band-note { font-size: 12px; }
.band-latest { font-size: 14px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.band-latest.good { border-color: var(--go); }
.band-latest.bad { border-color: var(--stop); }
.got-job { min-height: 60px; font-size: 19px; font-weight: 800; }
/* Always reachable: sticks just above the tab bar when the cards need scrolling. */
.got-job { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 70px); z-index: 4; box-shadow: 0 -8px 16px var(--bg); }
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; border-bottom: 1px solid var(--line); }
.sheet-title { font-family: var(--display); font-weight: 800; font-size: 20px; }
.sheet-sub { font-size: 13px; color: var(--muted); }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 24px); flex: 1; }
body.sheet-open { overflow: hidden; }
.band-basis { font-size: 13px; color: var(--muted); margin-top: -4px; }
@media (max-height: 720px) {
  .band-cards { gap: 6px; }
  .band-card { padding: 8px 12px; gap: 2px; border-radius: 12px; }
  .band-name { font-size: 16px; }
  .band-now { font-size: 30px; }
  .band-sub { font-size: 13px; }
  .band-note { display: none; }
  .band-now { font-size: 26px; }
  .band-sub, .band-basis { font-size: 12px; }
  .band-latest { font-size: 12px; padding: 6px 10px; }
  .got-job { min-height: 50px; }
}
.q-open { display: grid; gap: 8px; border-color: var(--accent); }
.q-open button { min-height: 52px; font-size: 17px; }
.lab-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; align-items: end; }
.lab-predict .v.sm { font-size: 30px; }
.lab-check { line-height: 1.5; }
.lab-table { display: grid; gap: 4px; }
.lab-table .row { display: grid; grid-template-columns: 1.3fr 0.7fr 1.2fr; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-family: var(--mono); font-size: 14px; }
.lab-table .up { color: var(--warn); font-weight: 700; }
.lab-table .down { color: var(--accent); font-weight: 700; }
.beta-tag { font-family: var(--body); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; vertical-align: middle; padding: 2px 6px; border-radius: 6px; background: var(--warn); color: #1a1003; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--go); }
.chip.warn { color: var(--warn); }

main {
  padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 88px) max(16px, env(safe-area-inset-left, 0px));
  max-width: 560px; margin: 0 auto;
}
.view { display: grid; gap: 14px; }
.stack { display: grid; gap: 12px; }
.group { display: grid; gap: 8px; }
.label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.note, .sub, .hint { color: var(--muted); font-size: 14px; margin: 0; }
.hint { color: var(--warn); min-height: 0; }

.grid { display: grid; gap: 8px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tap {
  min-height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-size: 19px; font-weight: 700; padding: 6px 4px; cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1;
}
.tap.mono { font-family: var(--mono); font-size: 18px; }
.tap.sel { background: var(--sel); color: var(--sel-ink); border-color: var(--sel); }
.tap.sel.dead::after { background: var(--sel-ink); }
.tap:active { transform: scale(0.97); }

/* Window: prediction at the top, every tap at the bottom just above the tab bar. The view fills
   the screen between the header and the tabs, and the thumb area is pushed to the bottom. */
#view-window:not([hidden]) {
  display: flex; flex-direction: column; gap: 12px;
  min-height: calc(100dvh - var(--top-h, 78px) - 168px - env(safe-area-inset-bottom, 0px));
}
#view-window .thumb { margin-top: auto; display: grid; gap: 12px; }
#view-window .group { gap: 6px; }

/* Distance slider: 1 km steps from 1 to 50 (50 means 50 or more). Touch anywhere on the track
   to jump there and drag; − / + nudge by 1 km. */
.km-row { display: grid; grid-template-columns: 72px 1fr 72px; gap: 8px; align-items: center; }
.km-read { text-align: center; font-family: var(--mono); font-size: 22px; color: var(--muted); }
.km-read span { font-size: 40px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.nudge {
  min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 30px; font-weight: 700; cursor: pointer; line-height: 1;
}
.nudge:active { background: var(--raised); }
/* The touch area is the full width; the drawn rail is inset so the thumb stays on screen at the ends. */
.km-track { position: relative; height: 64px; touch-action: none; cursor: pointer; outline: none; --pos: 0; }
.km-rail { position: absolute; left: 22px; right: 22px; top: 50%; height: 12px; margin-top: -6px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; }
.km-fill { height: 100%; width: calc(var(--pos) * 100%); background: var(--sel); }
.km-thumb {
  position: absolute; top: 50%; left: calc(22px + (100% - 44px) * var(--pos)); width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: var(--sel); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.km-track.empty .km-thumb { background: var(--muted); }
.km-track:focus-visible .km-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.km-ticks { position: relative; height: 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.km-ticks span { position: absolute; transform: translateX(-50%); }
/* Keep the thumb and end labels inside the screen at 1 and 50+. */
.km-ticks { margin: 0 22px; }
.verdict {
  border-radius: 16px; padding: 14px 16px; min-height: 150px; display: grid; gap: 4px; align-content: center;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
}
.verdict .top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.verdict .clear { font-size: 13px; background: none; border: 0; color: inherit; opacity: 0.85; text-decoration: underline; cursor: pointer; padding: 6px 0 6px 10px; }
.decide { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.decide button {
  min-height: 52px; border-radius: 12px; font-weight: 800; font-size: 17px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
}
.decide button:active { background: var(--raised); }
.pill.took { background: var(--raised); color: var(--go); }
.pill.cancelled { background: var(--raised); color: var(--stop); }
.verdict.idle p { margin: 0; color: var(--muted); font-size: 17px; text-align: center; }
.verdict.fare { border-width: 2px; border-color: var(--accent); }
.verdict.fare.surge { background: var(--warn); color: #1a1003; border-color: var(--warn); }
.verdict.fare.bad { border-color: var(--stop); }
.verdict .word { font-family: var(--display); font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -0.02em; }
.verdict .nums { display: flex; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.verdict .big { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.verdict .rng { font-family: var(--mono); font-size: 13px; opacity: 0.85; }
.verdict .why { font-size: 13px; opacity: 0.9; line-height: 1.35; }

button.ghost, label.button.ghost, button.primary, button.danger, label.button {
  min-height: 46px; border-radius: 10px; padding: 10px 14px; cursor: pointer; border: 1px solid var(--line);
  background: transparent; display: inline-flex; align-items: center; justify-content: center; text-align: center;
}
button.primary { background: var(--accent); color: var(--sel-ink); border-color: var(--accent); font-weight: 700; }
button.danger { color: var(--stop); border-color: color-mix(in srgb, var(--stop) 50%, var(--line)); }
button.small { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.wide { width: 100%; }
button:disabled { opacity: 0.55; }
button:focus-visible, input:focus-visible, label.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head h2 { margin: 0; }
.empty { color: var(--muted); margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; min-width: 0; }
.card .line1 { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.card .when { font-weight: 600; }
.card .meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.card .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.surge { background: var(--warn); color: #1a1003; }
.pill.wait { background: var(--raised); color: var(--warn); }

.form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.form-head h2 { margin: 0; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .flabel { font-size: 13px; color: var(--muted); }
.field input {
  width: 100%; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 10px 12px; font-size: 17px;
}
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.small-fields .field input { min-height: 42px; font-size: 16px; padding: 8px; }
.small-fields .field label { font-size: 12px; }
.suggest { display: grid; gap: 4px; }
.suggest:empty { display: none; }
.suggest button {
  text-align: left; border: 1px solid var(--line); background: var(--raised); border-radius: 8px; padding: 8px 10px;
  cursor: pointer; display: grid; gap: 2px;
}
.suggest small { color: var(--muted); }
.seg { display: grid; gap: 6px; }
.seg button { min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; }
.seg button.sel { background: var(--sel); color: var(--sel-ink); border-color: var(--sel); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.msg { margin: 0; min-height: 1.2em; color: var(--muted); font-size: 14px; }
.msg.err { color: var(--stop); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.tile .v { font-family: var(--mono); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--muted); font-size: 13px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 6px) max(8px, env(safe-area-inset-left, 0px));
  background: var(--bg); border-top: 1px solid var(--line);
}
.tabs button { position: relative; min-height: 50px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 2px 0; }
.tabs .ti { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs .ti .dot { fill: currentColor; stroke: none; }
.tabs button.on .ti { stroke-width: 2.2; }
.tabs .badge { position: absolute; top: 2px; left: calc(50% + 8px); }
.tabs button.on { color: var(--ink); }
/* Log: the main tab, in the middle, baby blue (the reverse of the dark app) and raised above the bar. */
.tabs .tab-main { color: var(--ink); font-weight: 800; font-size: 13px; overflow: visible; }
.tabs .tab-disc { position: relative; display: grid; place-items: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%;
  background: var(--log); color: var(--log-ink); border: 4px solid var(--bg); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.tabs .tab-main .ti { width: 27px; height: 27px; stroke-width: 2.2; }
.tabs .tab-main.on .tab-disc { box-shadow: 0 0 0 2px var(--log), 0 4px 14px rgba(0, 0, 0, 0.35); }
/* On the Log tab: a slow breathing glow, same cheap method as the OneMap dot. Off on other tabs. */
.tabs .tab-main.on .tab-disc::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--log) 60%, transparent) 40%, transparent 70%);
  animation: glow-breathe 3s ease-in-out infinite; will-change: opacity, transform; }
.tabs .tab-main:active .tab-disc { transform: scale(0.95); }
.badge { background: var(--warn); color: #1b1300; border-radius: 999px; font-size: 11px; padding: 1px 6px; font-weight: 800; }

.toast {
  /* Top of the screen, under the header: the bottom is where the slider and buttons are, and a
     message there would block the next job. Touches pass through it. */
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--top-h, 78px) + 4px); z-index: 7; pointer-events: none;
  background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  width: min(92vw, 480px); font-size: 14px;
}

/* Shorter screens (Safari tab, older phones): keep the whole decision on one screen. */
@media (max-height: 720px) {
  .top { padding-top: calc(env(safe-area-inset-top, 0px) + 6px); padding-bottom: 6px; }
  main { padding-top: 8px; }
  #view-window:not([hidden]), #view-window .thumb { gap: 8px; }
  #view-window .group { gap: 4px; }
  #view-window .label { font-size: 11px; }
  .km-read span { font-size: 32px; }
  .nudge { min-height: 48px; }
  .km-track { height: 56px; }
  .tap { min-height: 50px; }
  .verdict { min-height: 0; padding: 10px 14px; gap: 2px; }
  .verdict .word { font-size: 36px; }
  .verdict .big { font-size: 20px; }
  .decide button { min-height: 44px; }
  .tabs button { min-height: 44px; }
}
@media (max-height: 600px) {
  .brand { font-size: 17px; }
  .tap { min-height: 42px; font-size: 17px; border-radius: 10px; }
  .tap.mono { font-size: 16px; }
  .verdict .why { font-size: 12px; }
  .verdict .word { font-size: 30px; }
  .decide button { min-height: 40px; }
  .tabs button { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) { .tap:active { transform: none; } }

/* Invite-only screen, shown until a phone is let in */
body.gated > :not(.gate):not(script) { visibility: hidden; }
.gate { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; display: grid; place-items: start center;
  padding: max(40px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.gate-card { width: 100%; max-width: 420px; }
.gate-logo { font-family: var(--display); font-size: 30px; margin-bottom: 8px; }
.gate-logo .logo { padding: 4px 18px 12px; border-radius: 16px; border-width: 3px; }
.gate-logo .logo::after { height: 7px; }
.gate h2 { margin: 0; font-size: 20px; }
.gate-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.4; }
.gate-code { font-family: var(--mono); letter-spacing: 1px; user-select: all; }
.gate-owner summary { color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 0; }
.gate-owner .row2 { margin-top: 8px; }
.invite-new { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 2px solid var(--go); background: color-mix(in srgb, var(--go) 12%, var(--surface)); }
.invite-link { font-family: var(--mono); font-size: 13px; word-break: break-all; user-select: all; }
.invite-list { display: grid; gap: 6px; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.invite-row.off { opacity: 0.55; }
.invite-row .note { margin: 2px 0 0; font-size: 13px; }

/* Radar at the airport: queue first, then arrivals by terminal */
.ap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ap-term { border-radius: 14px; padding: 10px 12px; border: 2px solid var(--line); background: var(--surface); display: grid; gap: 1px; }
.ap-term.busy { border-color: var(--go); background: color-mix(in srgb, var(--go) 10%, var(--surface)); }
.ap-term.quiet { opacity: 0.7; }
.ap-name { font-weight: 800; font-size: 15px; }
.ap-big { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ap-k { font-size: 13px; color: var(--muted); }
.ap-sub { font-size: 12px; color: var(--muted); }

/* Info tab */
#view-info section { gap: 8px; }
.ev-card { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); }
.ev-card.soon { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.ev-card.out { border-color: var(--go); background: color-mix(in srgb, var(--go) 10%, var(--surface)); }
.ev-card .note { margin: 2px 0 0; }
.ev-when { font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ev-add summary { color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 0; }
.ev-add .stack { margin-top: 8px; }
#view-info input[type=date], #view-info input[type=time] { min-width: 0; width: 100%; }

/* From JB rows (Info and Radar) */
.jb-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.jb-row .note { margin: 1px 0 0; font-size: 13px; }
.jb-eta { text-align: right; font-family: var(--mono); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jb-eta .note { font-family: var(--body); font-weight: 400; font-size: 12px; }
#radar-place { gap: 6px; }
.ev-more summary { color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; }
.ev-more .stack { margin-top: 6px; }
.jb-row.compact { padding: 6px 10px; gap: 8px; border-radius: 10px; }
.jb-row.compact b { min-width: 34px; }
.jb-row.compact .note { flex: 1; margin: 0; font-size: 13px; }
.jb-row.compact .jb-eta { font-size: 16px; }
.q-wait { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.q-wait-min { font-family: var(--mono); font-size: 26px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-wait .note { margin: 0; }

/* Likely surging nearby (top of Radar) */
.surge-alert { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--go);
  background: color-mix(in srgb, var(--go) 16%, var(--surface)); }
.surge-up { font-size: 28px; font-weight: 800; color: var(--go); line-height: 1; }
.surge-alert .note { margin: 2px 0 0; }

/* LTA: MRT disruptions, floods, road incidents */
.alert-card { display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.alert-card.bad { border-color: var(--stop); background: color-mix(in srgb, var(--stop) 12%, var(--surface)); }
.alert-card .note { margin: 0; }
.inc-row { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.inc-row .note { margin: 0; }
.inc-type { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.inc-type.t-accident, .inc-type.t-roadblock, .inc-type.t-fire { color: var(--stop); }
.inc-type.t-vehiclebreakdown, .inc-type.t-heavytraffic { color: var(--warn); }
#info-travel .jb-row.compact .note { line-height: 1.5; }
.alert-card.compact { padding: 7px 10px; gap: 1px; border-width: 1.5px; }
.alert-card.compact .note { font-size: 13px; }
#radar-alerts { gap: 6px; }

/* At a glance: one-line alerts at the top of Radar */
.glance-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); font-size: 16px; line-height: 1.3; }
.glance-line.bad { border-color: var(--stop); background: color-mix(in srgb, var(--stop) 14%, var(--surface)); }
.glance-line.good { border-color: var(--go); background: color-mix(in srgb, var(--go) 16%, var(--surface)); }
.glance-line .surge-up { font-size: 20px; font-weight: 800; color: var(--go); }
.glance-sub { font-size: 13px; color: var(--muted); margin-left: auto; }
.band-head b, .note b { color: var(--ink); }
.inc-row .inc-type { margin-right: 2px; }
.q-open { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-open .meta { margin: 0; font-size: 15px; }

/* Form controls sized to the screen, iPhone date / time / select included (iOS gives them a fixed
   minimum width and its own look otherwise, which pushed them past the edge). */
.field select, .field input[type=date], .field input[type=time] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background-color: var(--surface); color: var(--ink);
  padding: 10px 12px; font-size: 17px; font-family: inherit; text-align: left;
}
.field input[type=date]::-webkit-date-and-time-value, .field input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.field select { padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field input { box-sizing: border-box; max-width: 100%; }

/* Events on Radar: banner and the cards' Event pill */
.glance-line.event { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.glance-line.event .surge-up { color: var(--accent); font-size: 18px; }
.band-card.event { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.band-card.event .band-tag { background: var(--accent); color: var(--sel-ink); padding: 2px 10px; border-radius: 999px; }

.kept .close { color: var(--go); } .kept .off { color: var(--warn); } .kept .far { color: var(--stop); }

.invite-row .reliab.warn { color: var(--stop); font-weight: 600; }
.invite-row { flex-wrap: wrap; }

/* Header: date and weekday between the logo and the status */
.today { flex: 1; min-width: 0; text-align: center; line-height: 1.15; }
.today-date { font-size: 13px; font-weight: 700; white-space: nowrap; }
.today-date .ph { color: var(--warn); font-weight: 800; }
.today-day { font-size: 12px; color: var(--muted); }
@media (max-width: 390px) { .today .yr { display: none; } }
@media (max-width: 360px) { .top { gap: 6px; } .today-date { font-size: 12px; } .today-day { font-size: 11px; } .chip { padding: 4px 8px; font-size: 11px; } }

/* Home Screen app: the header sits a little lower, clear of the iPhone status bar. */
.standalone .top { padding-top: calc(env(safe-area-inset-top, 0px) + 10px + 1vh); }
/* "● OneMap": a green dot that glows softly, like a recording light. */
.chip.ok { display: inline-flex; align-items: center; gap: 6px; }
/* Battery: the glow is drawn once on its own layer; only its opacity and size are animated, which
   the phone's graphics chip does without repainting. */
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--go); }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--go) 75%, transparent) 0, transparent 70%);
  animation: glow-breathe 2s ease-in-out infinite; will-change: opacity, transform; }
@keyframes glow-breathe { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .live-dot::after, .tabs .tab-main.on .tab-disc::after { animation: none; } }

/* Settings */
.st-rows { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.st-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface); font-size: 15px; }
.st-row + .st-row { border-top: 1px solid var(--line); }
.st-row span { color: var(--muted); }
.st-row b { text-align: right; }
.st-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.st-owner-unlock summary { color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 0; }
.st-owner-unlock .row2 { margin-top: 8px; }
.tile.warn { border-color: var(--stop); }
.tile.warn .v { color: var(--stop); }

/* Earnings */
.ea-head { display: grid; gap: 6px; }
.ea-total { font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ea-sub { color: var(--muted); font-size: 14px; }
.ea-sub b { color: var(--ink); }
.ea-goal { display: grid; gap: 4px; }
.ea-goal .note { margin: 0; }
.ea-bar { height: 10px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.ea-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--warn), var(--go)); }
.ea-plats { display: grid; gap: 6px; }
.ea-plat { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.ea-plat .note { margin: 0; font-size: 13px; }
.ea-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.ea-amt { font-family: var(--mono); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ea-amt.cost { color: var(--stop); }
.ea-add { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.ea-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ea-chips button { border: 1px solid var(--line); background: var(--raised); color: var(--ink); border-radius: 99px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.ea-chips button.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.ea-row { display: grid; grid-template-columns: 46px 1fr auto 34px; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ea-time { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.ea-tips { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.seg.g2 { grid-template-columns: repeat(2, 1fr); }
.st-legacy summary { color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 0; }
.st-legacy .stack { margin-top: 8px; }

.st-ver-r { display: inline-flex; align-items: center; gap: 10px; }
.st-ver-row { align-items: center; }

/* Log: three numbers, big boxes, numbered steps */
.log-head h2 { margin: 0; font-size: 24px; }
.log-head .note { margin: 2px 0 0; }
.log-step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: end; }
.log-n { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 9px; border-radius: 50%;
  background: var(--log); color: var(--log-ink); font-weight: 800; font-size: 15px; }
.log-big { font-size: 19px !important; font-weight: 700; min-height: 50px; font-variant-numeric: tabular-nums; }
.log-big::placeholder { font-size: 15px; font-weight: 500; }
.log-save { min-height: 56px; font-size: 18px; }
.log-more summary { color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 0; }
.log-more > .stack { margin-top: 8px; }
.log-tip { margin: 0; }
.lab-check .close { color: var(--go); } .lab-check .off { color: var(--warn); } .lab-check .far { color: var(--stop); }
.log-label b { color: var(--ink); font-weight: 800; font-size: 15px; }
.log-from { color: var(--warn); font-weight: 700; font-size: 13px; }
.log-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.log-mode { flex: none; width: 168px; }
.log-mode button { min-height: 36px; font-size: 13px; padding: 0 6px; }
.log-adv { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); }
.log-adv .hint { margin: 0; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.row3 label { font-size: 12px; }
.log-clear { justify-self: start; }

/* Log guide (folded) and the A B C marks */
.log-n.sm { width: 22px; height: 22px; margin: 0; font-size: 12px; display: inline-grid; vertical-align: -5px; }
.log-adv { margin: 0; min-width: 0; }
.log-adv legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.log-adv label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.log-guide { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; background: var(--surface); }
.log-guide summary { color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 0; }
.log-guide-key { display: grid; gap: 6px; font-size: 14px; margin: 4px 0 10px; }
.log-guide-key > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.log-guide-key .log-n:not(.sm) { width: 24px; height: 24px; margin: 0; font-size: 13px; }
.log-guide-key .adv { color: var(--muted); }
.log-guide-shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 8px; }
.log-shot { margin: 0; display: grid; gap: 4px; }
.log-shot-img { position: relative; }
.log-shot-img img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.log-shot-img .log-n { position: absolute; transform: translate(-50%, -50%); margin: 0; box-shadow: 0 0 0 2px var(--bg); }
.log-shot figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.log-shot figcaption b { color: var(--ink); }
.log-guide-key .adv-h { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.log-shot-img .log-n, .log-shot-img .log-n.sm { width: 26px; height: 26px; font-size: 13px; }
.log-guide-key > span:not(.adv-h) { display: grid; grid-template-columns: 26px 1fr; flex-wrap: nowrap; }
.log-guide-key .adv-h { color: var(--warn); font-weight: 800; }


.mono-s { font-family: var(--mono); font-size: 11px; font-weight: 600; text-align: right; }

/* Tab bar: part of the page, stuck to the bottom of the screen. The page is at least one screen
   tall, so on a short page the bar still sits at the very bottom; on a long page it sticks there
   while you scroll. (A fixed bar moved around on the iPhone Home Screen app.) */
body { min-height: 100vh; min-height: 100lvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; padding-bottom: 36px; }
.tabs { position: sticky; bottom: 0; left: auto; right: auto; }

/* Rain: baby blue, like the Log tab */
.glance-line.rain { border-color: var(--log); background: color-mix(in srgb, var(--log) 14%, var(--surface)); }
.glance-line.rain .surge-up { font-size: 18px; }
.band-card.rain { border-color: var(--log); background: color-mix(in srgb, var(--log) 12%, var(--surface)); }
.band-card.rain .band-tag { background: var(--log); color: var(--log-ink); padding: 2px 10px; border-radius: 999px; }
.rain-note { color: var(--log); font-weight: 600; }

/* Green arrow test (owner's phone) */
.arrow-tog { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.arrow-tog b { color: var(--go); font-size: 16px; }
.arrow-box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--muted); display: inline-grid; place-items: center; }
.arrow-tog.on { border-color: var(--go); color: var(--ink); background: color-mix(in srgb, var(--go) 16%, var(--surface)); }
.arrow-tog.on .arrow-box { border-color: var(--go); background: var(--go); }
.arrow-tog.on .arrow-box::after { content: "✓"; color: var(--go-ink); font-size: 12px; font-weight: 800; line-height: 1; }
.arrow-test { display: grid; gap: 6px; }
.arrow-test .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.arrow-test .r { display: grid; grid-template-columns: 64px 60px 1fr; gap: 8px; align-items: baseline; }
.arrow-test .r b { font-family: var(--mono); }
.band-pills { display: inline-flex; align-items: center; gap: 6px; }
.band-rain { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--log); color: var(--log-ink); }
.arrow-fix.on { border-color: var(--go); color: var(--go); }
.ea-shift { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--go); background: color-mix(in srgb, var(--go) 10%, var(--surface)); font-size: 14px; }
.log-shot-img { cursor: zoom-in; }
.shot-big { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.88); display: grid; place-items: center; align-content: center; gap: 8px; padding: 16px; cursor: zoom-out; }
.shot-big-in { position: relative; width: min(92vw, calc(80vh * 0.486)); }
.shot-big-in img { display: block; width: 100%; height: auto; border-radius: 14px; }
.shot-big-in .log-n { position: absolute; transform: translate(-50%, -50%); margin: 0; width: 30px; height: 30px; font-size: 15px; box-shadow: 0 0 0 3px #000; }
.shot-big .note { color: #ddd; text-align: center; max-width: 92vw; }
.log-km-note { margin: 4px 0 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid var(--warn); font-size: 14px; }
/* thumbnails: small marks so they don't crowd; full size when the photo is opened */
.log-shot-img .log-n, .log-shot-img .log-n.sm { width: 15px; height: 15px; font-size: 9px; box-shadow: 0 0 0 1.5px var(--bg); }
.log-shot { align-content: start; } .log-shot-img { align-self: start; line-height: 0; }

/* Grab | TADA switch: above the tab bar, on Radar and Log */
.plat-bar { display: none; position: sticky; bottom: var(--tabs-h, 70px); z-index: 6; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); background: linear-gradient(transparent, var(--bg) 35%); }
body[data-view="window"] .plat-bar, body[data-view="lab"] .plat-bar { display: grid; }
.plat-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 16px; font-weight: 800; cursor: pointer; }
.plat-bar button .d { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.plat-bar button.sel { color: var(--ink); border-color: var(--pc); background: color-mix(in srgb, var(--pc) 22%, var(--surface)); }
/* TADA's colours: grey normal, yellow surge, orange super surge */
.lv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lv button { border-radius: 10px; padding: 10px 4px; font-weight: 800; font-size: 14px; border: 2px solid transparent; cursor: pointer; opacity: .55; }
.lv .g { background: #3a403d; color: #e8ece9; } .lv .y { background: #e9c53a; color: #241c00; } .lv .o { background: #f08a24; color: #2a1200; }
.lv button.on { opacity: 1; border-color: var(--ink); }
.band-card.tgrey { border-color: #6b726e; }
.band-card.tgrey .band-tag { background: #3a403d; color: #e8ece9; padding: 2px 10px; border-radius: 999px; }
.band-card.tyellow { border-color: #e9c53a; background: color-mix(in srgb, #e9c53a 16%, var(--surface)); }
.band-card.tyellow .band-tag { background: #e9c53a; color: #241c00; padding: 2px 10px; border-radius: 999px; }
.band-card.torange { border-color: #f08a24; background: color-mix(in srgb, #f08a24 20%, var(--surface)); }
.band-card.torange .band-tag { background: #f08a24; color: #2a1200; padding: 2px 10px; border-radius: 999px; }
.band-card.learning .band-now { color: var(--muted); }
.learn { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px dashed var(--muted); color: var(--muted); }
.offer { border: 1px solid #e0a84a; background: color-mix(in srgb, #e0a84a 12%, var(--surface)); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.got-job { bottom: calc(var(--tabs-h, 70px) + 64px); }

body[data-apps="1"] .plat-bar { display: none !important; }
.plat-bar button { flex-direction: column; gap: 0; padding: 4px; }
.plat-bar .pn { display: inline-flex; align-items: center; gap: 7px; }
.plat-bar.many button { font-size: 14px; }
.plat-bar button.soon { opacity: .5; border-style: dashed; cursor: default; }
.plat-bar button small { font-size: 11px; font-weight: 700; color: var(--muted); }
.st-apps button small { color: var(--muted); font-weight: 600; }
.st-apps { display: flex; flex-wrap: wrap; gap: 8px; }
.st-apps button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 15px; cursor: pointer; }
.st-apps button .box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--muted); display: inline-grid; place-items: center; }
.st-apps button.on { color: var(--ink); border-color: var(--pc); background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.st-apps button.on .box { border-color: var(--pc); background: var(--pc); }
.st-apps button.on .box::after { content: "\2713"; color: #06120b; font-size: 12px; font-weight: 800; line-height: 1; }
.st-apps button:disabled { opacity: .4; cursor: default; }

/* each card: the price line, and on the right how many jobs back it */
.band-mid { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.band-n { flex: none; text-align: right; font-size: 12px; line-height: 1.3; color: var(--muted); }
.band-n b { color: var(--ink); }

.bookmark { margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line); font-size: 13px; display: grid; gap: 4px; }
.bookmark.drift { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.qj-ask { display: grid; gap: 6px; }
.qj-ask-b { display: flex; gap: 8px; flex-wrap: wrap; }

/* You: Animal#1234, points, leaderboard */
.me-chip { cursor: pointer; gap: 5px; font-size: 14px; }
.me-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.me-picker { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.75); display: grid; place-items: center; padding: 16px; }
.me-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.me-card h2 { margin: 0; font-size: 22px; }
.me-card p { margin: 0; }
.me-pick { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.me-pick select, .me-change select { min-height: 50px; font-size: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); padding: 0 10px; }
.me-num { font-family: var(--mono); font-size: 22px; }
.me-preview b { font-size: 18px; }
.me-head { display: grid; gap: 2px; }
.me-big { font-family: var(--display); font-weight: 800; font-size: 22px; }
.me-h3 { margin: 6px 0 0; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.me-top { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 4px; }
.me-top li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.me-top .rk { color: var(--muted); font-weight: 700; }
.me-top li.gap { margin-top: 10px; position: relative; }
.me-top li.gap::before { content: "⋮"; position: absolute; top: -14px; left: 14px; color: var(--muted); line-height: 1; }
.me-top li:first-child { border-color: var(--warn); }
.me-top li.you { border-color: var(--accent); }
.me-top li b { font-family: var(--mono); }
.me-how summary { color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; }

.me-code { font-family: var(--mono); font-size: 26px; font-weight: 800; letter-spacing: 2px; text-align: center; padding: 12px; border-radius: 12px; border: 2px dashed var(--accent); user-select: all; }
.me-code.sm { font-size: 14px; letter-spacing: 1px; padding: 2px 6px; border-width: 1px; }
.st-rec #st-recovery { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.job-edit { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

.ea-cpf { font-size: 14px; color: var(--muted); }
.ea-cpf b { color: var(--ink); }
.ea-cpf-box { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }

/* Radar cards open in place: what you'd earn at each distance */
.band-card[data-band] { cursor: pointer; }
.band-hint { font-size: 11px; color: var(--muted); opacity: .75; text-align: right; margin-top: -2px; }
.band-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: grid; gap: 4px; }
.bd-row { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px; align-items: baseline; font-variant-numeric: tabular-nums; font-size: 15px; }
.bd-row b { font-family: var(--mono); font-size: 17px; }
.bd-row span { color: var(--muted); }
.bd-h span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.band-detail .note { margin: 4px 0 0; font-size: 12px; }
.band-chev { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Radar notices: ✕ to dismiss */
.notice { position: relative; }
.notice > .glance-line, .notice > .band-head { padding-right: 40px; }
.notice-x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--muted); font-size: 14px; cursor: pointer; line-height: 1; }
#radar-alerts .notice + .notice { margin-top: 8px; }

/* Info: surging now */
.surging-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--go) 14%, var(--surface)); }
.surging-price { text-align: right; }
.surging-price b { font-family: var(--mono); font-size: 18px; }
#st-notices { --pc: var(--accent); }

/* Radar at the airport: riders per terminal */
.ap-unit { font-size: 13px; font-weight: 600; color: var(--muted); }
.ap-riders { font-weight: 800; color: var(--go); font-size: 15px; }

/* Info: my routes */
.route-chips { --pc: var(--accent); }
.route-chips button { font-size: 14px; padding: 7px 12px; }
.route-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; cursor: pointer; }
.route-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 16px; }
.route-min { font-family: var(--mono); font-weight: 700; font-size: 18px; }
.route-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rt { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--raised); color: var(--muted); }
.rt.erp { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); color: var(--warn); }
.rt.bad { background: color-mix(in srgb, var(--stop) 22%, var(--surface)); color: var(--stop); }
.rt.rain { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent); }
.route-chev { margin-left: auto; color: var(--muted); font-size: 12px; }
.route-more { border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 5px; }
.rd-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.rd-line b { color: var(--ink); white-space: nowrap; }
.rd-line.bad { color: var(--ink); display: block; }

/* Info: folded sections (title + one-line summary) */
details.fold { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
details.fold > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
.fold-title { font-family: var(--display); font-weight: 800; font-size: 16px; white-space: nowrap; }
.fold-sum { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.fold-chev::after { content: "▾"; color: var(--muted); font-size: 12px; }
details.fold[open] .fold-chev::after { content: "▴"; }
details.fold[open] > summary { border-bottom: 1px dashed var(--line); }
.fold-body { padding: 10px 14px 14px; }
.sum-hot, .sum-rain { color: var(--accent); }
.sum-bad { color: var(--stop); }
#view-info details.fold + details.fold { margin-top: -4px; }
/* Radar notices: easier to dismiss (bigger ✕, swipe), at most two shown */
.notice-x { width: 36px; height: 36px; top: 4px; right: 4px; font-size: 16px; background: color-mix(in srgb, var(--ink) 14%, transparent); color: var(--ink); }
.notice { touch-action: pan-y; transition: transform .15s ease, opacity .15s ease; }
.notice.gone { transform: translateX(110%); opacity: 0; }
.notice.extra { display: none; }
.notices-more { width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 12px; padding: 8px; font-weight: 700; font-size: 13px; cursor: pointer; }
/* folded summaries must never widen the page: shrink and cut with … */
#view-info > *, details.fold, details.fold > summary { min-width: 0; max-width: 100%; }
/* summary on its own line under the title: room for the where */
details.fold > summary { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title chev" "sum chev"; align-items: center; row-gap: 2px; }
.fold-title { grid-area: title; }
.fold-sum { grid-area: sum; text-align: left; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; }
.fold-sum:empty { display: none; }
.fold-chev { grid-area: chev; padding-left: 8px; }

/* Info: airport queue per app */
.q-app { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 4px; }
.q-app-name { font-weight: 800; font-size: 14px; }
.q-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.q-line > span:first-child { color: var(--muted); }

.q-done { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.q-done b { color: var(--ink); }
.q-done button { white-space: nowrap; flex: none; }

/* Jobs to finish: the bell takes the animal chip's place, and opens a speech bubble */
.chip.bell { display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer; color: var(--ink); background: color-mix(in srgb, var(--warn) 22%, var(--raised)); font-weight: 800; position: relative; }
.chip.bell svg { width: 16px; height: 16px; fill: none; stroke: var(--warn); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--stop); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.bubble-wrap { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, #000 45%, transparent); padding: calc(env(safe-area-inset-top, 0px) + 58px) max(12px, env(safe-area-inset-right, 0px)) 16px max(12px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.bubble { position: relative; margin-left: auto; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; box-shadow: 0 18px 50px -12px rgb(0 0 0 / .6); }
.bubble::before { content: ""; position: absolute; top: -9px; right: 26px; width: 16px; height: 16px; background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.bubble-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 16px; }
.bubble-list { display: flex; flex-wrap: wrap; gap: 6px; }
.bubble-list button { font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--raised); color: var(--muted); border-radius: 999px; padding: 5px 11px; cursor: pointer; }
.bubble-list button.sel { color: var(--ink); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }
#bubble-slot .sheet-body { padding: 0; }
#bubble-drop { justify-self: start; }
.job-earlier { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 16px; }

.bubble-pickup { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 12px; background: var(--raised); font-size: 14px; }
.bubble-pickup .bp-k { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bubble-remind { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 8px 10px; }
.bubble-remind span { flex: 1 1 180px; }

/* My routes picker: one row per expressway, directions side by side; folds to one line once picked */
.rp-grid { display: grid; gap: 6px; }
.rp-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; }
.rp-name { font-family: var(--display); font-weight: 800; font-size: 15px; }
.rp-dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rp-dirs button { font: inherit; font-size: 13px; font-weight: 700; padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-dirs button.on { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.rp-dirs button:only-child { grid-column: 1 / -1; }
.rp-foot { display: flex; align-items: center; gap: 8px; }
.rp-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rp-mine { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.rp-mine span { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--ink); }
.rp-acts { display: flex; gap: 6px; flex: none; }
body[data-platform="tada"] #lab-adv .row3 { grid-template-columns: 1fr; }

/* Waiting for a second tap: the button's colours are reversed */
button.armed { background: var(--ink) !important; color: var(--bg) !important; border-color: var(--ink) !important; }
button.danger.armed { background: var(--stop) !important; color: #fff !important; border-color: var(--stop) !important; }
button.primary.armed { background: var(--bg) !important; color: var(--sel) !important; border-color: var(--sel) !important; box-shadow: inset 0 0 0 2px var(--sel); }

/* Settings: the top card */
.st-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ss { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.ss-v { font-family: var(--display); font-weight: 900; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ss-k { font-size: 12px; color: var(--muted); line-height: 1.3; }
.ss.good { border-color: var(--go); background: color-mix(in srgb, var(--go) 12%, var(--surface)); } .ss.good .ss-v { color: var(--go); }
.ss.ok { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); } .ss.ok .ss-v { color: var(--warn); }
.ss.bad { border-color: var(--stop); background: color-mix(in srgb, var(--stop) 12%, var(--surface)); } .ss.bad .ss-v { color: var(--stop); }
@media (max-width: 360px) { .ss-v { font-size: 20px; } }
/* Settings: Radar notices grid (like the routes picker) */
.nt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.nt-grid button { font: inherit; font-size: 13px; font-weight: 700; padding: 9px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; text-align: center; }
.nt-grid button.on { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
#st-notices-fold { margin-top: 4px; }

#st-privacy .st-list li { margin-bottom: 6px; }
.st-row.st-rec { flex-direction: column; align-items: stretch; gap: 8px; }
.st-rec > span:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-row.st-rec > #st-recovery { justify-content: flex-start; text-align: left; width: 100%; margin: 0; }

/* Log in the colour of the app you're logging for: the title, the step circles and Save (Grab green, TADA yellow) */
body[data-platform="grab"] #view-lab .log-head h2 { color: var(--go); }
body[data-platform="tada"] #view-lab .log-head h2 { color: var(--tada); }
body[data-platform="grab"] #view-lab .log-step .log-n, body[data-platform="grab"] #view-lab .log-guide-key .log-n:not(.sm) { background: var(--go); color: var(--go-ink); }
body[data-platform="tada"] #view-lab .log-step .log-n, body[data-platform="tada"] #view-lab .log-guide-key .log-n:not(.sm) { background: var(--tada); color: var(--tada-ink); }
body[data-platform="grab"] #view-lab #lab-save:not(.armed) { background: var(--go); border-color: var(--go); color: var(--go-ink); }
body[data-platform="tada"] #view-lab #lab-save:not(.armed) { background: var(--tada); border-color: var(--tada); color: var(--tada-ink); }
body[data-platform="grab"] #view-lab #lab-save.armed { color: var(--go) !important; border-color: var(--go) !important; box-shadow: inset 0 0 0 2px var(--go); }
body[data-platform="tada"] #view-lab #lab-save.armed { color: var(--tada) !important; border-color: var(--tada) !important; box-shadow: inset 0 0 0 2px var(--tada); }
