/* ==========================================================================
   Vroom Rider — design system
   Tokens lifted directly from the Vroom Rider design prototype.
   ========================================================================== */

:root {
  /* brand */
  --brand: #E11D2A;
  --brand-dark: #B3131D;
  --brand-deep: #8E0F17;
  --brand-tint: #FDECEC;
  --brand-glow: #ff5b47;

  /* ink & surface */
  --ink: #16130F;
  --ink-soft: #7A7268;
  --ink-faint: #9A9086;
  --ink-ghost: #B4ADA4;
  --line: #ECE8E3;
  --line-soft: #F1EDE8;
  --surface: #fff;
  --canvas: #F6F4F1;
  --canvas-warm: #FAF8F6;

  /* status */
  --good: #1F9D57;
  --good-tint: #E8F6EE;
  --warn: #C77700;
  --warn-tint: #FFF4E5;
  --warn-deep: #C0620E;
  --info: #2A6DF5;
  --info-tint: #EEF3FF;
  --muted: #C9C3BC;

  /* type */
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* geometry */
  --r-sm: 11px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 76px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font-family: inherit; }
a { color: var(--brand); }

.scr::-webkit-scrollbar { display: none; }
.scr { scrollbar-width: none; -ms-overflow-style: none; }

/* animations ------------------------------------------------------------- */
@keyframes pop   { 0% { transform: scale(.8); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
@keyframes ring  { 0% { transform: scale(1); opacity: .55 }  100% { transform: scale(2.1); opacity: 0 } }
@keyframes rise  { 0% { transform: translateY(14px); opacity: 0 } 100% { transform: translateY(0); opacity: 1 } }
@keyframes check { 0% { stroke-dashoffset: 40 } 100% { stroke-dashoffset: 0 } }
@keyframes spin  { to { transform: rotate(360deg) } }
@keyframes fade  { from { opacity: 0 } to { opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   Shell
   ========================================================================== */

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.pane {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.screen {
  padding: calc(24px + var(--safe-t)) 20px calc(var(--nav-h) + 28px + var(--safe-b));
  max-width: 640px;
  margin: 0 auto;
  animation: fade .22s ease;
}

.screen--flush { padding-left: 0; padding-right: 0; }
.screen--flush > .screen__head { padding: 0 20px; }

.screen--full {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(28px + var(--safe-b));
}

/* ==========================================================================
   Typography
   ========================================================================== */

.t-title    { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.t-display  { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin: 6px 0 0; }
.t-section  { font-size: 15px; font-weight: 800; margin: 0; }
.t-eyebrow  { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-faint); }
.t-meta     { font-size: 13px; font-weight: 600; color: var(--ink-faint); }
.t-body     { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.t-mono     { font-family: var(--mono); font-weight: 700; }

/* ==========================================================================
   Primitives
   ========================================================================== */

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

.card--tap { cursor: pointer; box-shadow: 0 8px 24px -16px rgba(0,0,0,.3); }
.card--tap:active { transform: scale(.985); }
.card, .card--tap { transition: transform .12s ease; }

.btn {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 17px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(225,29,42,.7);
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn--ghost {
  height: 50px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand-dark);
  font-size: 14px;
  box-shadow: none;
}

.btn--dark { background: var(--ink); box-shadow: none; }

.btn-row { display: flex; gap: 12px; }
.btn-row .btn { height: 52px; border-radius: 15px; font-size: 15px; }
.btn-row .grow-2 { flex: 2; }
.btn-row .grow-1 { flex: 1; }

.pill {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  background: var(--line-soft);
  color: var(--ink-faint);
}
.pill--good  { background: var(--good-tint); color: var(--good); }
.pill--warn  { background: var(--warn-tint); color: var(--warn); }
.pill--brand { background: var(--brand-tint); color: var(--brand); }
.pill--cod   { background: var(--warn-tint); color: var(--warn); font-size: 11px; padding: 5px 8px; }

.stat-row { display: flex; gap: 12px; margin-top: 22px; }
.stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
}
.stat__value { font-size: 22px; font-weight: 800; }
.stat__value small { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.stat__label { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }

.avatar {
  border-radius: 13px;
  background: repeating-linear-gradient(45deg, var(--brand) 0 6px, #c81824 6px 12px);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  color: #fff;
  flex: none;
}
.avatar--sm { width: 44px; height: 44px; font-size: 14px; }
.avatar--lg { width: 88px; height: 88px; border-radius: 26px; font-size: 28px;
              background: repeating-linear-gradient(45deg, var(--brand) 0 8px, #c81824 8px 16px); }

/* ==========================================================================
   Login
   ========================================================================== */

.login {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(72px + var(--safe-t)) 32px calc(40px + var(--safe-b));
  background: linear-gradient(165deg, var(--brand) 0%, var(--brand-dark) 55%, var(--brand-deep) 100%);
}

.login__brand { animation: rise .6s ease both; }
.login__mark {
  width: 52px; height: 52px; border-radius: 15px;
  background: #fff; display: grid; place-items: center;
}
.login__wordmark { font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.login__tagline {
  margin: 22px 0 0; font-size: 19px; line-height: 1.45;
  font-weight: 600; color: rgba(255,255,255,.92); max-width: 250px;
}

.login__card {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 24px 20px;
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.5);
  animation: rise .7s ease .1s both;
}

.field { margin-top: 14px; }
.field:first-of-type { margin-top: 18px; }
.field__label {
  font-size: 11px; font-weight: 800; color: var(--ink-faint);
  letter-spacing: .5px; text-transform: uppercase;
}
.field__box {
  margin-top: 7px; height: 50px;
  border: 1.5px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; background: var(--canvas-warm);
  transition: border-color .15s;
}
.field__box:focus-within { border-color: var(--brand); }
.field__box input {
  border: none; outline: none; background: transparent;
  width: 100%; font-size: 16px; color: var(--ink); font-weight: 600;
}
.field__box input[type="password"] { letter-spacing: 3px; }
.field__box input#riderId { font-family: var(--mono); font-size: 14px; }
.field__reveal {
  font-size: 12px; font-weight: 700; color: var(--ink-faint);
  background: none; border: none; cursor: pointer; padding: 4px;
}

.login__error {
  margin-top: 14px; font-size: 13px; font-weight: 700;
  color: var(--brand-dark); text-align: center; min-height: 18px;
}
.login__hub {
  margin-top: 14px; display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-faint);
}
.login__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.login__foot { text-align: center; margin: 16px 0 0; font-size: 12px; color: rgba(255,255,255,.7); }

/* ==========================================================================
   Dashboard
   ========================================================================== */

.dash__head { display: flex; align-items: center; justify-content: space-between; }

.batch-card {
  margin-top: 18px;
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(150deg, var(--ink), #2a2622);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.batch-card::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(225,29,42,.5), transparent 70%);
}
.batch-card__top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; }
.batch-card__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .6px; color: rgba(255,255,255,.6); }
.batch-card__id { font-size: 20px; font-weight: 800; font-family: var(--mono); margin-top: 3px; }
.batch-card__aside { text-align: right; font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; }
.batch-card__count { margin-top: 20px; display: flex; align-items: flex-end; justify-content: space-between; position: relative; }
.batch-card__count b { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.batch-card__count b span { font-size: 18px; color: rgba(255,255,255,.55); }
.batch-card__pct { font-size: 12px; font-weight: 700; color: #7FE0A6; }

.bar { margin-top: 10px; height: 8px; border-radius: 6px; background: rgba(255,255,255,.14); overflow: hidden; position: relative; }
.bar__fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--brand-glow)); transition: width .5s ease; }

.section-head {
  margin-top: 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.link {
  font-size: 13px; font-weight: 700; color: var(--brand);
  background: none; border: none; cursor: pointer; padding: 0;
}

.next-stop { margin-top: 10px; }
.next-stop__row { display: flex; align-items: center; gap: 12px; }
.next-stop__seq {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--brand-tint); color: var(--brand);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; font-family: var(--mono);
}
.next-stop__name { font-size: 16px; font-weight: 800; }
.next-stop__addr { font-size: 13px; color: var(--ink-soft); font-weight: 500; margin-top: 1px; }
.next-stop__actions { margin-top: 14px; display: flex; gap: 10px; }
.next-stop__actions > * {
  flex: 1; height: 44px; border-radius: 13px; border: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none;
  background: var(--canvas); color: var(--ink);
}
.next-stop__actions .is-primary { background: var(--brand); color: #fff; font-weight: 800; }

.empty {
  margin-top: 12px; text-align: center; padding: 32px 20px;
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--r-lg); color: var(--ink-soft);
  font-weight: 600; font-size: 14px;
}

/* ==========================================================================
   Route list
   ========================================================================== */

.route__hint { margin-top: 8px; font-size: 12px; color: var(--ink-faint); font-weight: 600; }

.timeline { margin-top: 16px; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 39px; top: 14px; bottom: 14px;
  width: 2px; background: var(--line);
}

.stop-wrap { position: relative; padding: 0 20px; margin-bottom: 12px; overflow: hidden; }

.stop-wrap__action {
  position: absolute; right: 20px; top: 0; bottom: 0; width: 110px;
  border-radius: 18px; background: #E08A1E;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13px;
}

.stop {
  position: relative;
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px;
  cursor: pointer; touch-action: pan-y;
  text-align: left; width: 100%; font: inherit; color: inherit;
  transition: transform .25s ease;
}
.stop.is-swiping { transition: none; }

.stop__dot {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; font-family: var(--mono); z-index: 2;
  background: var(--brand-tint); color: var(--brand);
}
.stop__dot--done   { background: var(--good); color: #fff; }
.stop__dot--failed { background: var(--warn-tint); color: var(--warn); }

.stop__main { flex: 1; min-width: 0; }
.stop__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stop__name { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop__addr { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; margin-top: 2px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop__meta { margin-top: 7px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stop__track { font-size: 11px; font-family: var(--mono); color: var(--ink-faint); font-weight: 600; }
.stop__sep { font-size: 11px; color: var(--muted); }
.stop__parcel { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
.stop__cod { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px;
             background: var(--warn-tint); color: var(--warn); }

/* ==========================================================================
   Stop detail
   ========================================================================== */

.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--ink);
  background: none; border: none; cursor: pointer; padding: 0;
}

.detail__head { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }

.map-card { margin-top: 16px; background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--r-lg); overflow: hidden; }
/* The Leaflet map lives here. Kept short — it orients the rider, the actual
   turn-by-turn happens in Google Maps. */
.map-card__canvas {
  height: 170px; position: relative;
  background: repeating-linear-gradient(45deg, #EDE8E2 0 12px, #F4F0EB 12px 24px);
  z-index: 0; /* keep tiles under the app's own overlays */
}
/* Shown only when Leaflet fails to load, so the card still reads as a map. */
.map-card__canvas--flat { display: grid; place-items: center; }

.map-card__label {
  position: absolute; bottom: 10px; left: 12px; z-index: 500;
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  background: rgba(255,255,255,.85); padding: 3px 6px; border-radius: 6px;
  pointer-events: none;
}

/* Brand pin — a divIcon, so no Leaflet marker images to ship. */
.map-pin i {
  display: block; width: 24px; height: 24px; margin: 2px;
  border-radius: 50% 50% 50% 0; background: var(--brand); rotate: 45deg;
  box-shadow: 0 6px 14px -4px rgba(225,29,42,.7);
  border: 2.5px solid #fff;
}

.map-card__open {
  display: flex; align-items: center; justify-content: center;
  height: 44px; background: var(--canvas-warm);
  border-top: 1px solid var(--line);
  font-size: 13px; font-weight: 800; color: var(--brand);
  text-decoration: none;
}
.map-card__open:active { background: var(--brand-tint); }

/* Leaflet's own chrome, restyled to match. */
.map-card .leaflet-container { font-family: var(--sans); background: #EDE8E2; }
.map-card .leaflet-control-attribution {
  font-size: 9px; background: rgba(255,255,255,.75);
  padding: 1px 5px; color: var(--ink-faint);
}
.map-card .leaflet-control-attribution a { color: var(--ink-soft); }
.map-card__body { padding: 16px; }
.map-card__addr { font-size: 15px; font-weight: 700; }
.map-card__landmark { font-size: 13px; color: var(--ink-soft); font-weight: 500; margin-top: 3px; }
.map-card__actions { margin-top: 14px; display: flex; gap: 10px; }
.map-card__actions > * {
  flex: 1; height: 46px; border-radius: 13px; border: none;
  background: var(--canvas); color: var(--ink);
  font-weight: 700; font-size: 14px;
  display: grid; place-items: center; text-decoration: none; cursor: pointer;
}

.mini-row { margin-top: 14px; display: flex; gap: 12px; }
.mini {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px;
}
.mini__label { font-size: 11px; color: var(--ink-faint); font-weight: 700;
               text-transform: uppercase; letter-spacing: .4px; }
.mini__value { font-size: 15px; font-weight: 800; margin-top: 3px; }
.mini__sub { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.pin-card {
  margin-top: 14px; background: var(--ink); border-radius: var(--r-md);
  padding: 16px; display: flex; align-items: center; justify-content: space-between;
}
.pin-card__label { font-size: 11px; color: rgba(255,255,255,.55); font-weight: 700;
                   text-transform: uppercase; letter-spacing: .5px; }
.pin-card__value { font-family: var(--mono); font-size: 22px; font-weight: 700;
                   color: #fff; letter-spacing: 6px; margin-top: 4px; white-space: nowrap; }
.pin-card__note { margin-top: 8px; font-size: 11.5px; color: var(--ink-faint);
                  font-weight: 600; text-align: center; }

.attempt {
  margin-top: 14px; background: #FFF6F0; border: 1px solid #F6D9C4;
  border-radius: 14px; padding: 13px;
}
.attempt__title { font-size: 12px; font-weight: 800; color: var(--warn-deep); }
.attempt__note { font-size: 12.5px; color: #8A6A4E; font-weight: 500; margin-top: 2px; }

.detail__actions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }

/* ==========================================================================
   Delivery flow
   ========================================================================== */

.flow { min-height: 100%; display: flex; flex-direction: column;
        padding: calc(24px + var(--safe-t)) 20px calc(28px + var(--safe-b)); }
.flow__bar { display: flex; align-items: center; justify-content: space-between; }
.flow__dots { margin-top: 16px; display: flex; gap: 6px; }
.flow__dot { flex: 1; height: 5px; border-radius: 4px; background: #E0DAD3; transition: background .3s; }
.flow__dot.is-active { background: var(--brand); }
.flow__label { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.flow__step { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.flow__title { text-align: center; }
.flow__title h2 { font-size: 22px; font-weight: 800; margin: 0; }
.flow__title p { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; margin: 6px 0 0; }

/* PIN pad */
.pin-cells { display: flex; gap: 12px; justify-content: center; margin-top: 26px; }
.pin-cell {
  width: 56px; height: 66px; border-radius: var(--r-md);
  background: var(--surface); border: 2px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  transition: border-color .15s;
}
.pin-cell.is-filled { border-color: var(--ink); }
.pin-cell.is-next { border-color: var(--brand); }
.pin-msg { height: 22px; text-align: center; margin-top: 14px;
           font-size: 13px; font-weight: 800; color: var(--brand); }

.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 6px; max-width: 300px; align-self: center; width: 100%;
}
.key {
  height: 60px; border-radius: var(--r-md); border: none;
  background: var(--surface); color: var(--ink);
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700; cursor: pointer; user-select: none;
  transition: transform .1s, background .1s;
}
.key:active { transform: scale(.94); background: var(--line-soft); }
.key--blank { background: transparent; cursor: default; pointer-events: none; }

/* camera */
.camera {
  position: relative; border-radius: 22px; overflow: hidden;
  background: #0b0b0d; height: 340px; display: grid; place-items: center;
}
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; }
.camera__frame { position: absolute; inset: 22px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.25); }
.camera__corner { position: absolute; width: 22px; height: 22px; }
.camera__corner--tl { top: 18px; left: 18px;  border-top: 3px solid var(--brand); border-left: 3px solid var(--brand); border-radius: 4px 0 0 0; }
.camera__corner--tr { top: 18px; right: 18px; border-top: 3px solid var(--brand); border-right: 3px solid var(--brand); border-radius: 0 4px 0 0; }
.camera__corner--bl { bottom: 18px; left: 18px;  border-bottom: 3px solid var(--brand); border-left: 3px solid var(--brand); border-radius: 0 0 0 4px; }
.camera__corner--br { bottom: 18px; right: 18px; border-bottom: 3px solid var(--brand); border-right: 3px solid var(--brand); border-radius: 0 0 4px 0; }
.camera__hint { color: rgba(255,255,255,.5); font-size: 13px; font-weight: 600; font-family: var(--mono); position: absolute; }
.camera__stamp {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,.6); color: #fff; font-family: var(--mono);
  font-size: 11px; padding: 4px 8px; border-radius: 8px;
}

.shutter {
  margin: 18px auto 0; display: grid; place-items: center;
  width: 74px; height: 74px; border-radius: 50%;
  background: #fff; border: 5px solid var(--brand); cursor: pointer;
}
.shutter__inner { width: 52px; height: 52px; border-radius: 50%; background: var(--brand); }
.shutter:active { transform: scale(.94); }
.shot-hint { text-align: center; margin-top: 10px; font-size: 12px; color: var(--ink-faint); font-weight: 600; }

.file-fallback {
  display: block; text-align: center; margin-top: 12px;
  font-size: 13px; font-weight: 700; color: var(--brand); cursor: pointer;
}
.file-fallback input { display: none; }

/* signature */
.sign-pad {
  position: relative; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); padding: 14px;
}
.sign-pad canvas { width: 100%; height: 200px; touch-action: none; display: block; }
.sign-pad__line { position: absolute; left: 24px; right: 24px; bottom: 44px;
                  border-bottom: 1.5px dashed #D8D2CA; pointer-events: none; }
.sign-pad__hint { position: absolute; left: 26px; bottom: 22px; font-size: 12px;
                  color: #C0B9B0; font-weight: 600; pointer-events: none; font-family: var(--mono); }

/* COD */
.cod-total {
  background: var(--ink); border-radius: var(--r-lg);
  padding: 24px; text-align: center; color: #fff;
}
.cod-total__label { font-size: 12px; color: rgba(255,255,255,.55); font-weight: 700; letter-spacing: .5px; }
.cod-total__amount { font-size: 44px; font-weight: 800; letter-spacing: -1px; margin-top: 4px; }

.choice-group {
  margin-top: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px;
}
.choice {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 14px; border-radius: 12px; border: none;
  background: var(--canvas); cursor: pointer; margin: 4px 0;
  font-size: 15px; font-weight: 700; color: var(--ink); text-align: left;
  transition: background .15s;
}
.choice.is-picked { background: var(--brand-tint); }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex: none; transition: all .15s; }
.choice.is-picked .radio { border-color: var(--brand); background: var(--brand); }

/* confirm */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.summary__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 2px; border-bottom: 1px solid var(--line-soft);
}
.summary__row:last-child { border-bottom: none; }
.summary__k { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.summary__v { font-size: 13.5px; font-weight: 800; }

.slider {
  margin-top: 26px; position: relative; height: 64px;
  border-radius: var(--r-lg); background: #EDE8E2; overflow: hidden; user-select: none;
}
.slider__fill { position: absolute; inset: 0 auto 0 0; width: 8%;
                background: linear-gradient(90deg, var(--brand), var(--brand-glow)); border-radius: var(--r-lg); }
.slider__label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: var(--ink-faint); pointer-events: none;
}
.slider__label.is-over { color: rgba(255,255,255,.9); }
.slider__knob {
  position: absolute; top: 6px; left: 6px; width: 52px; height: 52px;
  border-radius: var(--r-md); background: #fff;
  box-shadow: 0 6px 14px -4px rgba(0,0,0,.4);
  display: grid; place-items: center; cursor: grab; touch-action: none;
  font-size: 22px; color: var(--brand); font-weight: 800; border: none;
}
.slider__knob:active { cursor: grabbing; }

/* done */
.done { flex: 1; display: flex; flex-direction: column; align-items: center;
        justify-content: center; text-align: center; }
.done__mark { position: relative; width: 110px; height: 110px; display: grid; place-items: center; }
.done__ring { position: absolute; inset: 0; border-radius: 50%; background: var(--good);
              opacity: .25; animation: ring 1.2s ease-out infinite; }
.done__disc { width: 96px; height: 96px; border-radius: 50%; background: var(--good);
              display: grid; place-items: center; animation: pop .4s ease; }
.done__disc path { stroke-dasharray: 40; animation: check .5s ease .15s both; }
.done__title { font-size: 24px; font-weight: 800; margin-top: 24px; }
.done__sub { font-size: 14px; color: var(--ink-soft); font-weight: 600; margin-top: 6px; max-width: 260px; }
.done__count {
  margin-top: 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 22px;
  font-size: 13px; color: var(--ink-soft); font-weight: 700;
}
.done .btn { margin-top: 26px; }

/* ==========================================================================
   Problem report
   ========================================================================== */

.reason-list { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.reason {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px; border-radius: 15px;
  background: var(--surface); border: 2px solid var(--line);
  cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink); text-align: left;
  transition: border-color .15s;
}
.reason.is-picked { border-color: var(--brand); }
.reason.is-picked .radio { border-color: var(--brand); background: var(--brand); }

.date-row { margin-top: 10px; display: flex; gap: 10px; }
.date-opt {
  flex: 1; padding: 13px 6px; border-radius: 14px; text-align: center;
  background: var(--surface); border: 2px solid var(--line);
  cursor: pointer; color: var(--ink); transition: all .15s;
}
.date-opt.is-picked { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }
.date-opt__label { font-size: 12px; font-weight: 700; }
.date-opt__date { font-size: 14px; font-weight: 800; margin-top: 2px; }

.note-box {
  margin-top: 10px; width: 100%; min-height: 84px; resize: vertical;
  border: 1px solid var(--line); border-radius: 14px; padding: 13px;
  background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink);
  outline: none;
}
.note-box:focus { border-color: var(--brand); }

/* ==========================================================================
   Earnings / alerts / batches / profile
   ========================================================================== */

.earn-card {
  margin-top: 16px; border-radius: 22px; padding: 22px;
  background: linear-gradient(150deg, var(--brand), var(--brand-dark));
  color: #fff; position: relative; overflow: hidden;
}
.earn-card::after {
  content: ''; position: absolute; right: -20px; bottom: -30px;
  width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.1);
}
.earn-card__label { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: rgba(255,255,255,.8); }
.earn-card__total { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin-top: 4px; }
.earn-card__stats { display: flex; gap: 20px; margin-top: 14px; position: relative; }
.earn-card__stats b { font-size: 19px; font-weight: 800; display: block; }
.earn-card__stats span { font-size: 11px; color: rgba(255,255,255,.8); font-weight: 600; }

.list { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }

.row-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px; position: relative;
}
.row-card__icon {
  width: 40px; height: 40px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}
.row-card__icon--cod   { background: var(--warn-tint); color: var(--warn); }
.row-card__icon--brand { background: var(--brand-tint); color: var(--brand); }
.row-card__icon--info  { background: var(--info-tint);  color: var(--info); }
.row-card__icon--warn  { background: var(--warn-tint);  color: var(--warn); }
.row-card__icon--good  { background: var(--good-tint);  color: var(--good); }
.row-card__body { flex: 1; min-width: 0; }
.row-card__title { font-size: 15px; font-weight: 800; }
.row-card__sub { font-size: 12px; color: var(--ink-faint); font-weight: 600; font-family: var(--mono); }

.notif { align-items: flex-start; }
.notif__title { font-size: 14px; font-weight: 800; }
.notif__body { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; margin-top: 2px; }
.notif__time { font-size: 11px; color: var(--ink-ghost); font-weight: 600; margin-top: 4px; }
.notif__unread { position: absolute; top: 14px; right: 14px; width: 8px; height: 8px;
                 border-radius: 50%; background: var(--brand); }

.batch-row { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.batch-row__head { display: flex; align-items: center; justify-content: space-between; }
.batch-row__id { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.batch-row__meta { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-top: 4px; }
.batch-row__stats { margin-top: 12px; display: flex; gap: 16px; }
.batch-row__stats b { font-size: 16px; font-weight: 800; }
.batch-row__stats span { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.batch-row__bar { margin-top: 10px; height: 6px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.batch-row__bar i { display: block; height: 100%; border-radius: 5px; background: var(--good); }
.batch-row__bar i.is-active { background: var(--brand); }

.profile__head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile__name { font-size: 22px; font-weight: 800; margin-top: 14px; }
.profile__code { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); font-weight: 600; }
.profile__tags { margin-top: 8px; display: flex; gap: 8px; }
.profile__tags .pill { font-size: 11px; padding: 5px 10px; border-radius: 9px; }
.kv { margin-top: 22px; background: var(--surface); border: 1px solid var(--line);
      border-radius: 18px; overflow: hidden; }
.kv__row { display: flex; align-items: center; justify-content: space-between;
           padding: 15px 16px; border-bottom: 1px solid var(--line-soft); }
.kv__row:last-child { border-bottom: none; }
.kv__k { font-size: 13px; color: var(--ink-faint); font-weight: 700; }
.kv__v { font-size: 14px; font-weight: 800; }
.version { text-align: center; margin-top: 16px; font-size: 11px;
           color: var(--ink-ghost); font-weight: 600; font-family: var(--mono); }

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(12px + var(--safe-b));
  display: flex; justify-content: space-around; align-items: center;
}
.nav[hidden] { display: none; }

.nav__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 4px 10px; flex: 1;
  background: none; border: none; color: var(--ink-ghost);
  transition: color .2s;
  position: relative;
}
.nav__item.is-active { color: var(--brand); }
.nav__item span { font-size: 10.5px; font-weight: 700; }
.nav__badge {
  position: absolute; top: 2px; right: 50%; translate: 14px 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
}
/* `display` beats the hidden attribute, so restore it explicitly. */
.nav__badge[hidden] { display: none; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + var(--safe-b));
  translate: -50% 0; z-index: 90;
  background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 14px;
  font-size: 13.5px; font-weight: 700;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  animation: rise .25s ease both;
  max-width: min(90vw, 420px); text-align: center;
}
.toast--error { background: var(--brand-dark); }
.toast[hidden] { display: none; }

.offline-flag {
  position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; translate: -50% 0;
  z-index: 95; background: var(--warn); color: #fff;
  font-size: 11.5px; font-weight: 800; padding: 6px 14px; border-radius: 20px;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.4);
}
.offline-flag[hidden] { display: none; }

/* ==========================================================================
   Desktop gate
   ========================================================================== */

.gate {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 40px;
  background: radial-gradient(120% 120% at 50% 0%, #EFEBE6 0%, #E3DED8 60%, #D9D3CC 100%);
}
.gate[hidden] { display: none; }

.gate__card {
  max-width: 460px; text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.4);
  animation: rise .5s ease both;
}
.gate__mark {
  width: 68px; height: 68px; margin: 0 auto;
  border-radius: 20px; background: var(--brand-tint);
  display: grid; place-items: center;
}
.gate__title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 20px 0 0; }
.gate__body { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); font-weight: 500; margin: 12px 0 0; }
.gate__hint {
  margin-top: 24px; padding: 16px;
  background: var(--canvas); border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 4px;
}
.gate__hint strong { font-size: 14px; font-weight: 800; }
.gate__hint span { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.gate__anyway {
  margin-top: 20px; background: none; border: none;
  font-size: 12.5px; font-weight: 700; color: var(--ink-ghost);
  cursor: pointer; text-decoration: underline; padding: 4px;
}
.gate__anyway:hover { color: var(--ink-soft); }

/* ==========================================================================
   Install prompt
   ========================================================================== */

.install {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding: 14px;
  background: var(--ink); color: #fff;
  border-radius: var(--r-md);
  animation: rise .3s ease both;
}
.install__icon {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 18px;
}
.install__body { flex: 1; min-width: 0; }
.install__title { font-size: 14px; font-weight: 800; }
.install__sub { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; margin-top: 2px; line-height: 1.4; }
.install__go {
  flex: none; border: none; border-radius: 11px;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 800; padding: 10px 14px; cursor: pointer;
}
.install__dismiss {
  flex: none; background: none; border: none;
  color: rgba(255,255,255,.45); font-size: 18px; cursor: pointer; padding: 4px 6px;
}

/* ==========================================================================
   Tablet — split view (≥768px)
   The route list pins left; detail and the delivery flow live on the right.
   ========================================================================== */

@media (min-width: 768px) {
  :root { --nav-h: 0px; }

  #app { flex-direction: row; }

  /* Bottom bar becomes a left rail. */
  .nav {
    position: static;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    width: 96px;
    flex: none;
    padding: calc(20px + var(--safe-t)) 8px 20px;
    border-top: none;
    border-right: 1px solid var(--line);
    background: rgba(255,255,255,.9);
  }
  .nav__item { flex: none; padding: 12px 6px; border-radius: 14px; width: 100%; }
  .nav__item.is-active { background: var(--brand-tint); }
  .nav__badge { right: 24px; translate: 0 0; }

  .split { flex: 1; display: flex; min-width: 0; }

  .split__list {
    width: 400px; flex: none;
    border-right: 1px solid var(--line);
    overflow-y: auto;
    background: var(--canvas);
  }

  .split__detail {
    flex: 1; min-width: 0;
    overflow-y: auto;
    background: var(--canvas-warm);
  }

  .split__empty {
    height: 100%; display: grid; place-items: center;
    color: var(--ink-ghost); font-weight: 700; font-size: 15px;
    text-align: center; padding: 40px;
  }

  /* Screens that are not split still centre nicely. */
  .screen { max-width: 720px; padding-top: calc(32px + var(--safe-t)); padding-bottom: 40px; }
  .flow { padding-top: calc(32px + var(--safe-t)); max-width: 560px; margin: 0 auto; width: 100%; }

  /* On tablet the detail pane owns the back button — it's redundant. */
  .split__detail .back { display: none; }

  .toast { bottom: 24px; }

  .login { padding: 0; align-items: center; justify-content: center; }
  .login__inner {
    width: 100%; max-width: 420px;
    display: flex; flex-direction: column; gap: 40px;
    padding: 40px;
  }

  .keypad { max-width: 340px; }
  .key { height: 68px; font-size: 26px; }
  .pin-cell { width: 64px; height: 74px; }
}

@media (min-width: 1100px) {
  .split__list { width: 440px; }
  .split__detail .screen { max-width: 640px; }
}
