/* kiri admin: same dark ambient look as the website and Kiri Services.
   Tokens below mirror the shared "Water" spec (kiri-tokens.css names), so this file can later
   import the shared token/motion files without renaming anything. */

/* =================== Tokens =================== */
:root {
  /* palette (SPEC 4.1) */
  --kiri-night: #0A0C12; --kiri-night-deep: #07080C;
  --surface-glass: rgba(24, 27, 35, .82); --surface-raised: rgba(30, 33, 42, .94); --surface-solid: #1C1F26;
  --line: rgba(255, 255, 255, .09); --stroke: rgba(255, 255, 255, .14); --stroke-strong: rgba(255, 255, 255, .24);
  --text: #F4F4F6; --label2: rgba(235, 235, 245, .70); --label3: rgba(235, 235, 245, .62); --label-disabled: rgba(235, 235, 245, .38);
  --kiri-yellow: #FFD60A; --kiri-yellow-deep: #E8B800; --kiri-yellow-hover: #FFE04D; --yellow-ink: #FFE9A6; --on-yellow: #111111;
  --green: #30D158; --green-deep: #24AA48; --green-text: #5BE07F;
  --orange: #FF9F0A; --orange-text: #FFB340;
  --red: #FF453A; --red-text: #FF6961;
  --blue: #0A84FF; --link: #0A84FF; --cyan: #64D2FF; --cyan-text: #8EDCFF;
  /* legacy aliases used in this file */
  --bg: var(--kiri-night); --card: var(--surface-glass); --muted: var(--label2); --yellow: var(--kiri-yellow);
  /* radii (SPEC 4.2) */
  --r-xs: 6px; --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-xl: 28px; --r-sheet: 36px; --r-pill: 999px;
  /* elevation (SPEC 4.4) */
  --elev-1: 0 6px 16px rgba(0, 0, 0, .35); --elev-2: 0 10px 30px rgba(0, 0, 0, .45); --elev-3: 0 30px 70px rgba(0, 0, 0, .45);
  --glow-yellow: 0 10px 30px rgba(255, 214, 10, .20);
  --cta-h: 56px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* motion (SPEC 1) */
  --dur-0: 100ms; --dur-1: 180ms; --dur-2: 320ms; --dur-3: 480ms; --dur-4: 700ms; --dur-hero: 900ms;
  --dur-ambient-a: 30s; --dur-ambient-b: 38s;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1); --ease-sine: cubic-bezier(.37, 0, .63, 1);
  --ease: var(--ease-out);
  --spring-soft: cubic-bezier(.22, 1.12, .36, 1); --spring-bouncy: cubic-bezier(.34, 1.4, .64, 1); --spring-press: cubic-bezier(.3, 1.5, .6, 1);
  --spring: var(--spring-bouncy);
  --stagger: 40ms; --stagger-cap: 240ms;
  --rise: 20px; --rise-sm: 8px; --rise-lg: 40px; --slide-x: 28px;
  --blur-in: 6px; --scale-in: .96; --press-scale: .965; --press-scale-card: .98;
  --side-w: 240px;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-soft: linear(0, .06 2.5%, .23 6%, .5 11%, .76 17%, .92 23%, 1.01 30%, 1.03 36%, 1.02 45%, 1.005 58%, .999 72%, 1);
    --spring-bouncy: linear(0, .08 2.5%, .3 6%, .64 11%, .95 17%, 1.1 23%, 1.12 27%, 1.08 33%, 1 41%, .97 48%, .985 56%, 1.005 66%, 1.002 78%, 1);
    --spring-press: linear(0, .52 9%, .93 18%, 1.07 28%, 1.03 40%, .99 55%, 1);
  }
}
html.lite { --blur-in: 0px; }
html.lite body::before, html.lite body::after,
html.calm body::before, html.calm body::after { animation: none !important; }
html.calm .streaks, html.lite .streaks { display: none; }
html.calm { --dur-2: 140ms; --dur-3: 170ms; --dur-4: 200ms; --rise: 0px; --rise-sm: 0px; --blur-in: 0px; --stagger: 0ms;
  --spring-soft: var(--ease-out); --spring-bouncy: var(--ease-out); }

/* =================== Base =================== */
* { box-sizing: border-box; }
html { background: var(--kiri-night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; color: var(--text); background: var(--kiri-night); font: 500 15px/1.45 var(--font);
  position: relative; isolation: isolate; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
a { color: var(--link); }
h1 { font-size: clamp(24px, 7vw, 30px); letter-spacing: -.02em; margin: 0; font-weight: 800; }
h2 { font-size: 18px; margin: 28px 2px 12px; font-weight: 700; }
.muted { color: var(--muted); }
.error { color: var(--red-text); margin: 12px 0 0; }
:focus-visible { outline: 3px solid rgba(255, 214, 10, .6); outline-offset: 2px; }

/* =================== Ambient (SPEC 2.10): two drifting light layers, no blend modes =================== */
body::before, body::after { content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none; contain: strict; will-change: transform; }
body::before { background: radial-gradient(closest-side at 25% 25%, rgba(92, 70, 255, .40), transparent 70%),
    radial-gradient(closest-side at 75% 70%, rgba(0, 168, 160, .26), transparent 70%),
    radial-gradient(closest-side at 50% 95%, rgba(30, 60, 140, .32), transparent 70%);
  animation: kiriDriftA var(--dur-ambient-a) var(--ease-in-out) infinite alternate; }
body::after { background: radial-gradient(closest-side at 80% 15%, rgba(200, 40, 140, .22), transparent 70%),
    radial-gradient(closest-side at 15% 85%, rgba(255, 214, 10, .10), transparent 70%),
    radial-gradient(closest-side at 60% 45%, rgba(10, 132, 255, .16), transparent 70%);
  animation: kiriDriftB var(--dur-ambient-b) var(--ease-in-out) infinite alternate; }
@keyframes kiriDriftA { from { transform: translate3d(-5%, -4%, 0) rotate(0) } to { transform: translate3d(5%, 6%, 0) rotate(20deg) scale(1.1) } }
@keyframes kiriDriftB { from { transform: translate3d(6%, 4%, 0) } to { transform: translate3d(-6%, -6%, 0) rotate(-25deg) scale(1.12) } }
/* Gentle scroll parallax where supported (uses the separate `translate` property, so it stacks with the drift). */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    body::before { animation: kiriDriftA var(--dur-ambient-a) var(--ease-in-out) infinite alternate, kParaA linear both; animation-timeline: auto, scroll(root); }
    body::after { animation: kiriDriftB var(--dur-ambient-b) var(--ease-in-out) infinite alternate, kParaB linear both; animation-timeline: auto, scroll(root); }
  }
}
@keyframes kParaA { from { translate: 0 0 } to { translate: 0 -8vh } }
@keyframes kParaB { from { translate: 0 0 } to { translate: 0 -4vh } }
html.lite body::before, html.lite body::after { opacity: .5; }
html.paused body::before, html.paused body::after, html.paused .streaks i, html.paused .dot.on::before, html.paused .dot.on::after { animation-play-state: paused !important; }

/* Light streaks behind the sign-in card (same as the Kiri Services sign-in pages). */
.streaks { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.streaks i { position: absolute; left: 0; width: 55vmax; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--c, rgba(255, 214, 10, .9)) 55%, rgba(255, 255, 255, .95) 70%, transparent);
  box-shadow: 0 0 18px 2px var(--g, rgba(255, 214, 10, .35));
  transform: translate3d(-60vmax, 0, 0) rotate(-18deg);
  animation: kStreak var(--d, 7s) linear var(--delay, 0s) infinite; }
.streaks i:nth-child(1) { top: 12%; --d: 7.5s; --delay: 0s; }
.streaks i:nth-child(2) { top: 30%; --d: 9s; --delay: 2.2s; --c: rgba(124, 104, 255, .95); --g: rgba(124, 104, 255, .45); }
.streaks i:nth-child(3) { top: 48%; --d: 6.5s; --delay: 4.1s; --c: rgba(48, 216, 200, .9); --g: rgba(48, 216, 200, .4); height: 1.5px; }
.streaks i:nth-child(4) { top: 64%; --d: 8.5s; --delay: 1.2s; --c: rgba(230, 70, 170, .9); --g: rgba(230, 70, 170, .4); }
.streaks i:nth-child(5) { top: 80%; --d: 10s; --delay: 5.5s; height: 3px; }
.streaks i:nth-child(6) { top: 22%; --d: 11s; --delay: 6.8s; --c: rgba(10, 132, 255, .9); --g: rgba(10, 132, 255, .4); height: 1.5px; }
.streaks i:nth-child(7) { top: 92%; --d: 8s; --delay: 3.3s; --c: rgba(124, 104, 255, .9); --g: rgba(124, 104, 255, .4); }
@keyframes kStreak {
  0% { transform: translate3d(-60vmax, 18vmax, 0) rotate(-18deg); opacity: 0; }
  12% { opacity: .85; }
  70% { opacity: .6; }
  100% { transform: translate3d(140vw, -26vmax, 0) rotate(-18deg); opacity: 0; }
}
html.lite .streaks i:nth-child(n+4) { display: none; }

/* =================== Water motion primitives (SPEC 2.1-2.3) =================== */
@keyframes kSurface {
  from { opacity: 0; translate: 0 var(--rise); scale: .985; filter: blur(var(--blur-in)); }
  60% { opacity: 1; filter: blur(0); }
  to { opacity: 1; translate: 0 0; scale: 1; filter: none; }
}
@keyframes kSink { to { opacity: 0; translate: 0 -6px; scale: .98; filter: blur(3px); } }
@keyframes kFade { from { opacity: 0 } }
.fx-in { animation: kSurface var(--dur-3) var(--spring-soft) both; }
.fx-in-sm { --rise: var(--rise-sm); --blur-in: 3px; animation: kSurface var(--dur-2) var(--spring-soft) both; }
html.lite .fx-in-sm { --blur-in: 0px; }
.fx-out { animation: kSink var(--dur-1) var(--ease-in) forwards; pointer-events: none; }
.cascade { animation-delay: min(calc(var(--i, 0) * var(--stagger)), var(--stagger-cap)); }

/* Show/hide that animates both ways. Browsers without @starting-style / allow-discrete simply toggle. */
.fx { transition: opacity var(--dur-2) var(--ease-out), translate var(--dur-3) var(--spring-soft), scale var(--dur-3) var(--spring-soft),
    filter var(--dur-2) var(--ease-out), display var(--dur-3) allow-discrete; }
.fx[hidden] { opacity: 0; translate: 0 -6px; scale: .98; filter: blur(3px); pointer-events: none;
  transition-duration: var(--dur-1); transition-timing-function: var(--ease-in); }
@starting-style { .fx:not([hidden]) { opacity: 0; translate: 0 10px; scale: .98; filter: blur(4px); } }
/* Full-screen layers: opacity + a small scale only (no filter on big surfaces). */
.fx-big { transition: opacity var(--dur-3) var(--ease-out), scale var(--dur-3) var(--spring-soft), display var(--dur-3) allow-discrete; }
.fx-big[hidden] { opacity: 0; scale: 1.02; pointer-events: none; transition-duration: var(--dur-2); transition-timing-function: var(--ease-in); }
@starting-style { .fx-big:not([hidden]) { opacity: 0; scale: .99; } }
/* The app holds the fixed bottom tab bar: any scale on it would make the bar position against the app
   (off-screen on long pages) while it fades. Opacity only. */
.app.fx-big, .app.fx-big[hidden] { scale: none; }
@starting-style { .app.fx-big:not([hidden]) { scale: none; } }
html.lite .fx, html.lite .fx[hidden] { filter: none; }

/* =================== Liquid press (SPEC 2.4) =================== */
.btn, .chip, .tab { position: relative; overflow: hidden; isolation: isolate; transition: scale var(--dur-0) var(--ease-out), background-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out); }
.btn:active:not(:disabled), .chip:active, .tab:active { scale: var(--press-scale); }
.btn:not(:active), .chip:not(:active), .tab:not(:active) { transition: scale 420ms var(--spring-press), background-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out); }
.btn::after, .chip::after, .tab::after { content: ""; position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: var(--d, 200%); aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, var(--ripple, rgba(255, 255, 255, .22)) 0 40%, transparent 70%);
  scale: 0; opacity: 0; pointer-events: none; z-index: -1; }
.rippling::after { animation: kRipple 550ms var(--ease-out); }
@keyframes kRipple { 0% { scale: 0; opacity: 1 } 100% { scale: 1; opacity: 0 } }
.btn.yellow, .btn.green { --ripple: rgba(255, 255, 255, .45); }
.btn.google { --ripple: rgba(0, 0, 0, .10); }
/* A button that is also .fx (Set off duty) keeps both the press and the two-way show/hide transitions. */
.btn.fx, .btn.fx:not(:active) { transition: scale 420ms var(--spring-press), opacity var(--dur-2) var(--ease-out), translate var(--dur-3) var(--spring-soft),
    filter var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out), display var(--dur-3) allow-discrete; }
.btn.fx[hidden] { transition-duration: var(--dur-1); transition-timing-function: var(--ease-in); }

/* =================== Buttons =================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--cta-h); padding: 0 22px; border-radius: var(--r-pill);
  font-weight: 800; font-size: 15px; max-width: 100%; text-align: center; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn.yellow { background: linear-gradient(180deg, var(--kiri-yellow), var(--kiri-yellow-deep)); color: var(--on-yellow); box-shadow: var(--glow-yellow); }
.btn.ghost { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.btn.danger { background: rgba(255, 69, 58, .16); color: var(--red-text); border: 1px solid rgba(255, 69, 58, .45); }
.btn.green { background: linear-gradient(180deg, var(--green), var(--green-deep)); color: #06210f; }
.btn.google { width: 100%; background: #fff; color: #1f1f1f; font-size: 17px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.is-busy { opacity: .75; cursor: progress; }
.btn.is-busy::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .22) 50%, transparent 80%); background-size: 220% 100%;
  animation: kShimmer 1.1s var(--ease-in-out) infinite; }
@keyframes kShimmer { from { background-position: 120% 0 } to { background-position: -120% 0 } }
.link { position: relative; color: var(--link); font-weight: 700; padding: 12px 0; min-height: 44px; }
@media (hover: hover) and (pointer: fine) {
  .btn.yellow:hover:not(:disabled) { background: linear-gradient(180deg, var(--kiri-yellow-hover), var(--kiri-yellow-deep)); }
  .btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
  .btn.danger:hover:not(:disabled) { background: rgba(255, 69, 58, .24); }
}

/* =================== Sign-in gate =================== */
.gate { position: fixed; inset: 0; overflow: hidden auto; isolation: isolate; z-index: 5; background: var(--kiri-night-deep);
  display: grid; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.gate::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 50% at 30% 25%, rgba(92, 70, 255, .30), transparent 70%), radial-gradient(55% 45% at 75% 80%, rgba(0, 168, 160, .20), transparent 70%); }
.gate-card { position: relative; margin: auto; width: min(420px, 100%); text-align: center; padding: clamp(26px, 7vw, 34px) clamp(18px, 6vw, 28px); border-radius: var(--r-xl);
  background: var(--surface-glass); border: 1px solid var(--line); box-shadow: var(--elev-3);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform var(--dur-3) var(--ease-out); }
html.lite .gate-card, html.calm .gate-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(30, 33, 42, .97); }
.gate-logo { height: 46px; }
.gate-card h1 { margin: 18px 0 8px; }
.gate-card p { color: var(--muted); margin: 0 0 22px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 14px; color: var(--muted); text-decoration: none; }
/* Gate entrance: card surfaces, then logo, title, text and button cascade in. */
/* backwards fill (not both): once landed, the button's own press scale works again. */
.gate:not([hidden]) .gate-card { animation: kCardIn var(--dur-4) var(--spring-soft) backwards; }
.gate:not([hidden]) .gate-card > * { --rise: 14px; animation: kSurface var(--dur-3) var(--spring-soft) backwards; animation-delay: calc(120ms + var(--i, 0) * 60ms); }
.gate-card > :nth-child(1) { --i: 0 } .gate-card > :nth-child(2) { --i: 1 } .gate-card > :nth-child(3) { --i: 2 }
.gate-card > :nth-child(4) { --i: 3 } .gate-card > :nth-child(5) { --i: 4 } .gate-card > :nth-child(6) { --i: 5 }
@keyframes kCardIn { from { opacity: 0; translate: 0 32px; scale: var(--scale-in); } to { opacity: 1; translate: 0 0; scale: 1; } }

/* =================== Layout: sidebar on wide screens, bottom tabs on phones =================== */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 22px;
  padding: 26px 16px max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(10, 12, 18, .6); border-right: 1px solid var(--line); scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.side-logo { height: 34px; align-self: flex-start; margin-left: 10px; flex: none; }
.tabs { position: relative; display: flex; flex-direction: column; gap: 4px; isolation: isolate; }
.tab { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md); color: var(--muted); font-weight: 700;
  text-align: left; z-index: 1; min-width: 0; }
.tab svg { width: 22px; height: 22px; fill: currentColor; flex: none; transition: scale var(--dur-3) var(--spring-bouncy); }
.tab.on { color: var(--yellow); }
.tab.on svg { scale: 1.08; }
.tabs:not(.has-ink) .tab.on { background: rgba(255, 214, 10, .14); }
.tab .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .short { display: none; }
/* The droplet indicator: one pill that stretches as it flows between tabs (moved by admin.js). */
.tab-ink { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: var(--r-md); background: rgba(255, 214, 10, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 10, .18); pointer-events: none; z-index: 0; opacity: 0; transition: opacity var(--dur-2) var(--ease-out); }
.tabs.has-ink .tab-ink { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .tab:hover:not(.on) { background: rgba(255, 255, 255, .05); color: var(--text); } }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--orange); color: #111; font-size: 12px; font-weight: 800;
  display: grid; place-items: center; font-variant-numeric: tabular-nums; flex: none; }
.me { margin-top: auto; flex: none; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.me img { width: 36px; height: 36px; border-radius: 50%; grid-row: span 2; background: #333; }
.me small { color: var(--muted); font-size: 12px; display: block; }
.me b { font-size: 13px; overflow-wrap: anywhere; }
.me .link { grid-column: 2; justify-self: start; font-size: 13px; padding: 8px 0; min-height: 36px; }
.me .link::before { content: ""; position: absolute; inset: -6px -8px; }
.main { padding: 30px max(clamp(16px, 4vw, 44px), env(safe-area-inset-right)) 120px clamp(16px, 4vw, 44px); max-width: 1100px; width: 100%; margin-inline: auto; min-width: 0; }
/* Pages slide ±28px while switching: clip sideways so that never creates a horizontal scroll. */
/* The 14px padding/negative margin gives focus rings, glows and hover shadows room inside the clip
   (overflow-clip-margin is ignored on one-axis clip in several browsers). */
.pages { display: grid; min-width: 0; overflow-x: clip; margin-inline: -14px; padding-inline: 14px; }
.page { grid-area: 1 / 1; min-width: 0; }
.page.leaving { pointer-events: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 20px; margin-bottom: 18px; }
.page-head h1 { min-width: 0; }
.page-head p { color: var(--muted); margin: 0; width: 100%; }

.card { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); padding: 18px; }

/* =================== Dashboard =================== */
.driver { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.driver .dot { position: relative; width: 14px; height: 14px; border-radius: 50%; flex: none; background: #777; transition: background-color var(--dur-3) var(--ease-out); }
.driver .dot.on { background: var(--green); }
.driver .dot.busy { background: var(--orange); }
.driver .dot.on::before, .driver .dot.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); opacity: 0;
  animation: kPing 2s var(--ease-out) infinite; }
.driver .dot.on::after { animation-delay: 1s; }
@keyframes kPing { 0% { scale: 1; opacity: .5 } 100% { scale: 2.6; opacity: 0 } }
.driver .who { flex: 1; min-width: min(200px, 100%); }
.driver .who b { font-size: 19px; display: block; }
.driver .who small { color: var(--muted); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(165px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.stat { padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); min-width: 0;
  transition: translate var(--dur-3) var(--spring-soft), box-shadow var(--dur-3) var(--ease-out), border-color var(--dur-2) var(--ease-out); }
.stat small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; overflow-wrap: anywhere; }
.stat b { display: block; font-size: clamp(22px, 6vw, 28px); letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; transform-origin: left center; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.money b { color: var(--yellow); }

/* =================== Lists =================== */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; flex: none; }
.chip.on { background: rgba(255, 214, 10, .16); color: var(--yellow); border-color: rgba(255, 214, 10, .45); }
@media (hover: hover) and (pointer: fine) { .chip:hover:not(.on) { color: var(--text); border-color: var(--stroke); } }
.search { flex: 1 1 240px; min-width: 0; max-width: 360px; height: 48px; padding: 0 18px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line); outline: none; transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.search:focus, textarea:focus, .num-row input:focus { border-color: rgba(255, 214, 10, .6); box-shadow: 0 0 0 4px rgba(255, 214, 10, .12); background-color: rgba(255, 255, 255, .09); }
.list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.list > * { min-width: 0; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: 20px; margin: 0; }
.ride { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.ride .top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ride .when { font-weight: 800; }
.ride .name { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.ride .where { color: #D4D4DA; overflow-wrap: anywhere; }
.ride .meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ride .side-col { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ride .fare { font-size: 20px; font-weight: 800; color: var(--yellow); font-variant-numeric: tabular-nums; }
.ride .actions, .bizcard .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.st { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out); }
.st.orange { background: rgba(255, 159, 10, .16); color: var(--orange-text); }
.st.green { background: rgba(48, 209, 88, .16); color: var(--green-text); }
.st.cyan { background: rgba(100, 210, 255, .16); color: var(--cyan-text); }
.st.grey { background: rgba(255, 255, 255, .08); color: var(--muted); }
.st.red { background: rgba(255, 69, 58, .14); color: var(--red-text); }
.st.biz { background: rgba(255, 214, 10, .16); color: var(--yellow); }
.person { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 14px 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.person .av { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(180deg, var(--kiri-yellow), var(--kiri-yellow-deep)); color: var(--on-yellow); font-weight: 800; display: grid; place-items: center; grid-row: span 2; }
.person > b { font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
.person small { color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.person .num { text-align: right; grid-row: span 2; }
.person .num b { color: var(--yellow); display: block; font-variant-numeric: tabular-nums; }
.bizcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.bizcard b { font-size: 17px; overflow-wrap: anywhere; }
.bizcard small { color: var(--muted); overflow-wrap: anywhere; }
.bizcard .st { align-self: start; }
.ride, .person, .bizcard { transition: translate var(--dur-3) var(--spring-soft), box-shadow var(--dur-3) var(--ease-out), border-color var(--dur-2) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ride:hover, .person:hover, .stat:hover, .bizcard:hover { translate: 0 -2px; box-shadow: 0 14px 30px rgba(0, 0, 0, .3); border-color: var(--stroke); }
}
/* Newly arrived row: surfaces, with one soft yellow ring. */
.row-new { animation: kSurface var(--dur-3) var(--spring-soft) both, kGlow 900ms var(--ease-out) both; }
@keyframes kGlow { from { box-shadow: 0 0 0 0 rgba(255, 214, 10, .35) } to { box-shadow: 0 0 0 10px rgba(255, 214, 10, 0) } }
/* Changed row: a quick shimmer of the border so the eye finds it. */
.row-changed { animation: kChanged 900ms var(--ease-out); }
@keyframes kChanged { from { border-color: rgba(255, 214, 10, .55); } }
.row-leaving { pointer-events: none; }

/* Skeletons while the first data loads */
.skel { position: relative; overflow: hidden; height: 112px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.skel.short { height: 72px; }
.skel::after, .stat.loading b::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .06) 50%, transparent 80%);
  background-size: 220% 100%; animation: kShimmer 1.4s var(--ease-in-out) infinite; }
.stat.loading b { position: relative; overflow: hidden; color: transparent !important; width: 60%; border-radius: 8px; background: rgba(255, 255, 255, .06); }

/* Rolling digits (SPEC 2.9) */
.roll { display: inline-flex; overflow: clip; vertical-align: bottom; line-height: 1.15; }
.roll .d { display: inline-block; height: 1.15em; overflow: clip;
  -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent); mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent); }
.roll .col { display: flex; flex-direction: column; translate: 0 calc(-1.15em * var(--n, 0)); transition: translate var(--dur-3) var(--spring-soft); }
.roll .col > span { height: 1.15em; }

/* =================== Settings =================== */
.setting { margin-bottom: 12px; }
.setting-top { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.setting-top > span { min-width: 0; }
.setting-top b { display: block; font-size: 16px; }
.setting-top small { color: var(--muted); }
textarea { display: block; width: 100%; margin-top: 14px; padding: 14px 16px; min-height: 52px; border-radius: var(--r-md); background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  resize: vertical; outline: none; transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out); }
.preview { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(90deg, rgba(255, 214, 10, .16), rgba(255, 214, 10, .06));
  border: 1px solid rgba(255, 214, 10, .35); color: var(--yellow-ink); font-weight: 700; text-align: center; overflow-wrap: anywhere; }
/* Switch: the knob stretches like a droplet while pressed and springs across. */
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch::before { content: ""; position: absolute; inset: -8px; }
.switch input { position: absolute; opacity: 0; inset: -8px; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: rgba(255, 255, 255, .16);
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  transition: translate var(--dur-3) var(--spring-bouncy), width var(--dur-2) var(--spring-soft); }
.switch input:active + i::after { width: 32px; }
.switch input:checked + i { background: var(--green); box-shadow: 0 0 16px rgba(48, 209, 88, .35); }
.switch input:checked + i::after { translate: 24px 0; }
.switch input:checked:active + i::after { translate: 18px 0; }
.switch input:focus-visible + i { outline: 3px solid rgba(255, 214, 10, .6); outline-offset: 2px; }
.num-row { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 14px; color: var(--muted); font-weight: 700; }
.num-row label { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.num-row input { width: 84px; height: 48px; margin: 0 6px; padding: 0 10px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--text); font: inherit; text-align: center; outline: none; transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 0 26px; }
.saved { display: inline-flex; align-items: center; gap: 8px; }
.saved svg { width: 20px; height: 20px; flex: none; }
.saved svg path { fill: none; stroke: var(--green); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: kDraw var(--dur-3) var(--ease-out) 80ms forwards; }
@keyframes kDraw { to { stroke-dashoffset: 0 } }
.info p { color: var(--muted); margin: 6px 0 0; }

/* =================== Confirm dialog (SPEC 2.5 "tide") =================== */
.modal { padding: 0; border: 0; background: transparent; color: var(--text); max-width: none; max-height: none; overflow: visible; }
.modal:not([open]) { display: none; }
.modal.nomodal { z-index: 50; background: rgba(0, 0, 0, .6); } /* browsers without showModal() */
.modal[open] { position: fixed; inset: 0; width: 100%; height: 100%; margin: 0; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.modal::backdrop { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: kFade var(--dur-2) var(--ease-out) both; }
html.lite .modal::backdrop, html.calm .modal::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, .7); }
.modal.closing::backdrop { animation: kFadeOut var(--dur-2) var(--ease-in) forwards; }
@keyframes kFadeOut { to { opacity: 0 } }
.modal-card { width: min(440px, 100%); padding: 26px 22px 20px; border-radius: var(--r-xl); background: var(--surface-solid); border: 1px solid var(--line); text-align: center; box-shadow: var(--elev-3); }
.modal[open] .modal-card { animation: kModalIn var(--dur-3) var(--spring-soft) both; }
.modal.closing .modal-card { animation: kModalOut var(--dur-1) var(--ease-in) forwards; pointer-events: none; }
@keyframes kModalIn { from { opacity: 0; scale: var(--scale-in); filter: blur(var(--blur-in)); } to { opacity: 1; scale: 1; filter: none; } }
@keyframes kModalOut { to { opacity: 0; scale: var(--scale-in); } }
.modal[open] .warn { animation: kPop var(--dur-3) var(--spring-bouncy) 80ms both; }
@keyframes kPop { from { scale: .4; opacity: 0 } }
.warn { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 69, 58, .16); border: 1px solid rgba(255, 69, 58, .45); color: var(--red-text); font-size: 30px; font-weight: 800; }
.modal-card h2 { margin: 0 0 8px; font-size: 22px; overflow-wrap: anywhere; }
.modal-card p { color: var(--muted); margin: 0 0 18px; overflow-wrap: anywhere; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Phones: the dialog rises as a bottom sheet. */
@media (max-width: 599px) {
  .modal[open] { place-items: end stretch; padding: 0; }
  .modal-card { width: 100%; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); border-bottom: 0; }
  .modal-card::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--stroke-strong); margin: 0 auto 16px; }
  .modal[open] .modal-card { animation: kSheetIn var(--dur-3) var(--spring-soft) both; }
  .modal.closing .modal-card { animation: kSheetOut var(--dur-2) var(--ease-in) forwards; }
}
@keyframes kSheetIn { from { translate: 0 100%; } to { translate: 0 0; } }
@keyframes kSheetOut { to { translate: 0 100%; } }
@media (max-width: 340px) { .modal-btns { grid-template-columns: 1fr; } .modal-btns #cYes { order: -1; } }

/* =================== Toast (SPEC 2.7 "droplet") =================== */
.toast { position: fixed; z-index: 60; left: 0; right: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 32px);
  bottom: 28px; padding: 13px 20px 15px; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-raised); border: 1px solid var(--line); box-shadow: var(--elev-2); font-weight: 700; text-align: center;
  visibility: hidden; opacity: 0; pointer-events: none; touch-action: none; }
.toast.show { visibility: visible; opacity: 1; pointer-events: auto; }
.toast span { display: block; }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 214, 10, .7); transform-origin: left center; scale: 0 1; }
@media (min-width: 900px) and (min-height: 501px), (min-width: 900px) and (pointer: fine) { .app:not([hidden]) ~ .toast { left: var(--side-w); } }

/* =================== Phones and small tablets: tabs along the bottom =================== */
/* Base rule first, so the !important override inside the media query below wins (phones have no sidebar Sign out). */
.phone-signout { display: none !important; }
@media (max-width: 899px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; overflow: visible; z-index: 20;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-right: 0; border-top: 1px solid var(--line); background: rgba(14, 16, 22, .9);
    -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 -10px 30px rgba(0, 0, 0, .35); }
  html.lite .side, html.calm .side { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(14, 16, 22, .97); }
  .side-logo, .me { display: none; }
  .tabs { flex-direction: row; gap: 2px; max-width: 640px; width: 100%; margin-inline: auto; }
  .tab { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px; text-align: center;
    font-size: clamp(10px, 3vw, 12px); border-radius: 14px; }
  .tab .lbl { max-width: 100%; display: block; }
  .tab-ink { border-radius: 14px; }
  .badge { position: absolute; top: 2px; right: calc(50% - 24px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; border-radius: 9px; }
  .main { padding-top: 22px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .phone-signout { display: inline-flex !important; }
  .ride { grid-template-columns: minmax(0, 1fr); }
  .ride .side-col { flex-direction: row; justify-content: space-between; align-items: center; }
  .ride .side-col:empty { display: none; }
  .toast { bottom: calc(env(safe-area-inset-bottom) + 84px); }
}
@media (max-width: 599px) {
  /* Filter chips scroll sideways instead of stacking into several rows. */
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; flex-basis: 100%;
    margin-inline: -16px; padding: 2px 16px; scroll-padding-inline: 16px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent); }
  .toolbar .chips::-webkit-scrollbar { display: none; }
  .search { max-width: none; flex-basis: 100%; }
  .page-head .btn.small { flex: 1 1 auto; }
  .bizcard { grid-template-columns: minmax(0, 1fr); }
  .bizcard .st { justify-self: start; grid-row: 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .card { padding: 16px; }
}
@media (max-width: 360px) {
  .tab .long { display: none; }
  .tab .short { display: inline; }
  .person { grid-template-columns: 40px minmax(0, 1fr); }
  .person .av { width: 40px; height: 40px; }
  .person .num { grid-row: auto; grid-column: 2; text-align: left; display: flex; gap: 8px; align-items: baseline; }
  .person .num b { display: inline; }
  .person > small { grid-column: 2; } /* otherwise auto-placement drops it into the 40px avatar column */
}
@media (max-width: 300px) { .stats { grid-template-columns: minmax(0, 1fr); } }

/* =================== Readable spacing (owner: "the app looks squished, so is the web admin") ===================
   Same fix as the passenger site: Plus Jakarta Sans at 700–800 with negative tracking packs letters
   together. Neutral tracking on big text, a little air on body text, roomier lines. */
body { line-height: 1.5; letter-spacing: .01em; }
h1, h2, .page-head h1, .gate-card h1, .stat b, .driver .who b { letter-spacing: 0; line-height: 1.2; }
.stat small, .st, .svc-note { letter-spacing: .05em; }
.stat span, .health small, .page-head p, .driver .who small, .muted { line-height: 1.5; }
.stat b { margin-top: 6px; }
.stat span { display: block; margin-top: 2px; }
.health b { margin-bottom: 2px; }

/* Phones: one step smaller and roomier, and short tab names so six tabs fit side by side. */
@media (max-width: 599px) {
  body { font-size: 14.5px; }
  h1 { font-size: 26px; }
  h2 { font-size: 17px; margin: 24px 2px 10px; }
  .page-head { margin-bottom: 14px; }
  .page-head p { font-size: 14px; }
  /* Title on its own line; its button (CSV, Sign out) sits under the text instead of squeezing beside it. */
  .page-head h1 { flex: 1 1 100%; }
  .page-head .btn.small { order: 3; flex: 0 1 auto; min-height: 40px; font-size: 13.5px; }
  .driver .who b { font-size: 17px; }
  .driver .who small { font-size: 13.5px; }
  .stat { padding: 14px 14px 13px; border-radius: 18px; }
  .stat small { font-size: 11px; letter-spacing: .06em; line-height: 1.35; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 12.5px; }
  .health { padding: 12px 14px; gap: 10px; }
  .health small { font-size: 13px; }
  .svc-pill { font-size: 13px; min-height: 34px; }
}
@media (max-width: 899px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  .tab { font-size: 11px; letter-spacing: .01em; gap: 4px; min-height: 52px; padding: 6px 1px; }
  .tab svg { width: 21px; height: 21px; }
}
@media (max-width: 520px) {
  /* Six tabs on a phone: "Home, Stats, Rides, People, Biz, Settings" instead of full names. */
  .tab .long { display: none; }
  .tab .short { display: inline; }
}
/* Short sidebars (laptop windows): tighten so Sign out stays reachable; the sidebar also scrolls. */
/* (Not for landscape phones, which use the bottom bar.) */
@media (min-width: 900px) and (min-height: 501px) and (max-height: 640px), (min-width: 900px) and (max-height: 500px) and (pointer: fine) {
  .side { gap: 12px; padding-top: 16px; } .tab { min-height: 44px; padding: 10px 14px; } }
/* Wide desktops: lists flow into columns, content stays centred. */
@media (min-width: 1500px) {
  .main { max-width: 1240px; }
  .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; align-items: start; }
  .list > .empty { grid-column: 1 / -1; }
}
@media (min-width: 2200px) { .main { max-width: 1400px; } }

/* =================== Reduced motion: 150 ms fades, no movement (SPEC 3) =================== */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 1ms; --dur-2: 150ms; --dur-3: 150ms; --dur-4: 150ms; --dur-hero: 150ms;
    --spring-soft: linear; --spring-bouncy: linear; --spring-press: linear;
    --rise: 0px; --rise-sm: 0px; --rise-lg: 0px; --slide-x: 0px; --blur-in: 0px; --stagger: 0ms; }
  body::before, body::after, .streaks i, .dot.on::before, .dot.on::after { animation-play-state: paused !important; }
  .streaks { display: none; }
  .gate-card { transform: none !important; }
  *, *::before, *::after { animation-iteration-count: 1 !important; transition-delay: 0s !important; }
  .btn.is-busy::before, .skel::after, .stat.loading b::after { animation: none; }
  .gate:not([hidden]) .gate-card > * { animation-delay: 0s; --rise: 0px; }
  :root { --scale-in: 1; }
  /* Opacity only: no card rise, no sheet slide, no nudge on .fx show/hide. */
  .gate:not([hidden]) .gate-card { animation-name: kFade; }
  .modal[open] .modal-card { animation-name: kFade !important; }
  .modal.closing .modal-card { animation-name: kFadeOut !important; }
  .fx[hidden] { translate: none; scale: none; filter: none; }
  @starting-style { .fx:not([hidden]) { translate: none; scale: none; filter: none; } }
}

/* =================== Analytics (owner: proper dashboard) =================== */
.an-toolbar { flex-direction: column; align-items: stretch; }
.an-dates { display: flex; flex-wrap: wrap; gap: 10px; }
.an-dates label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 14px; }
.an-dates input { height: 44px; padding: 0 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--text); font: inherit; color-scheme: dark; min-width: 0; }
.an-sub { margin: -6px 2px 12px; }
.kpis { margin-top: 0; }
.kpis .stat span { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.kpis.inner { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.kpis.inner .stat { background: rgba(255, 255, 255, .04); }
.delta { font-style: normal; font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--green-text); }
.delta.down { color: var(--red-text); }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 14px; margin-top: 28px; }
.an-card { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.an-card.wide { grid-column: 1 / -1; }
.an-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.an-head b { font-size: 16px; }
.an-head small { color: var(--muted); font-size: 13px; }
.bars { display: flex; align-items: stretch; gap: 3px; height: 210px; padding-top: 20px; min-width: 0; }
.legend + .meter { margin-top: 18px; }
.bars.small { height: 170px; }
.bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar i { font-style: normal; position: relative; display: block; width: min(100%, 34px); height: max(var(--h), 3px); border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--kiri-yellow), var(--kiri-yellow-deep)); opacity: .9; transition: height var(--dur-3) var(--ease-out); }
.bar i[style*="--h:0%"] { background: rgba(255, 255, 255, .08); opacity: 1; }
.bar.hl i { background: linear-gradient(180deg, #FFF1A8, var(--kiri-yellow)); opacity: 1; }
.bar i span { position: absolute; bottom: calc(100% + 3px); left: 50%; translate: -50% 0; font-size: 11px; font-weight: 800; white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.bar small { height: 15px; font-size: 11px; color: var(--label3); white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .bar:hover i { opacity: 1; filter: brightness(1.08); } }
.meter { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .06); gap: 2px; }
.meter i, .legend i { display: block; }
.legend { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 44px; gap: 10px; align-items: center; font-size: 14px; }
.legend li i { width: 12px; height: 12px; border-radius: 4px; }
.legend b { font-variant-numeric: tabular-nums; }
.legend small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.meter .green, .legend .green { background: var(--green); }
.meter .cyan, .legend .cyan { background: var(--cyan); }
.meter .orange, .legend .orange { background: var(--orange); }
.meter .yellow, .legend .yellow { background: var(--kiri-yellow); }
.meter .red, .legend .red { background: var(--red); }
.meter .blue, .legend .blue { background: var(--blue); }
.meter .grey, .legend .grey { background: rgba(255, 255, 255, .3); }
.toplist { margin: 0; padding: 0; list-style: none; counter-reset: top; display: grid; gap: 2px; }
.toplist li { counter-increment: top; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.toplist li:last-child { border-bottom: 0; }
.toplist li::before { content: counter(top); color: var(--label3); font-weight: 800; font-variant-numeric: tabular-nums; }
.toplist li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist li small { color: var(--muted); }
.toplist li b { font-variant-numeric: tabular-nums; }
.toplist li.none { grid-template-columns: 1fr; color: var(--muted); }
.toplist li.none::before { content: none; }
.health { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line); }
.health i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; }
.health.ok i { background: rgba(48, 209, 88, .16); color: var(--green-text); }
.health.attn { border-color: rgba(255, 159, 10, .45); }
.health.attn i { background: rgba(255, 159, 10, .18); color: var(--orange-text); }
.health b { display: block; }
/* Backend services (Firebase, Cloudflare, Mapbox) */
.health.down { border-color: rgba(255, 69, 58, .5); }
.health.down i { background: rgba(255, 69, 58, .18); color: var(--red-text); }
.health.wait i { background: rgba(255, 255, 255, .08); color: var(--muted); }
.svc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin: 28px 2px 8px; }
.svc-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-head h2 { margin: 0; }
.svc-head + .an-sub { margin: 0 2px 12px; }
@media (max-width: 599px) { .svc-head { margin-top: 24px; } .svc-head .btn.small { min-height: 38px; font-size: 13.5px; padding: 0 14px; } }
.svc-note { font-weight: 700; white-space: nowrap; }
.svc-note.good { color: var(--green-text); }
.svc-note.bad { color: var(--orange-text); }
.svc-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text, #fff); }
.svc-pill[hidden] { display: none; }
.svc-pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.svc-pill.good { color: var(--green-text); border-color: rgba(48, 209, 88, .35); }
.svc-pill.bad { color: var(--red-text); border-color: rgba(255, 69, 58, .45); background: rgba(255, 69, 58, .10); }
.health small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.ride .side-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ride .src { color: var(--label3); font-size: 12px; font-weight: 700; }
.person b .st { font-size: 11px; vertical-align: 2px; margin-left: 4px; }
@media (max-width: 599px) {
  .bars { height: 180px; gap: 2px; }
  .bars.small { height: 150px; }
  .bar small { font-size: 10px; }
  .an-grid { gap: 12px; }
}

/* Passengers: Guests / Google / Businesses tabs, real profile pictures and logos */
.person .av.pic { background: rgba(255, 255, 255, .08); overflow: hidden; }
.person .av.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip .cnt { margin-left: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.chip .cnt:empty { display: none; }
.person .who { color: var(--muted); font-weight: 600; }
.bizcard .bizlogo { float: left; width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #fff; margin: 2px 12px 4px 0; }
