/* Kemet-Tron app theme (Claude, 2026-11-29): the kemettron.com look plus its two switches.
   Loads AFTER kemet.css and only overrides it. Nothing in kemet.css is edited.
   - Pill buttons and rounder cards, as on the site.
   - Dark / Light switch: html[data-theme="light"].
   - Simple / Advanced switch: html[data-mode="simple"] hides anything marked .adv-only
     (kt-toggles.js marks those elements per page; no ids or hooks are renamed). */

/* ---------- Site shapes ---------- */
button, .btn { border-radius: 999px; transition: transform .12s ease, background .15s ease; }
button:active, .btn:active { transform: scale(.97); }
button.ghost, .btn.ghost { border-width: 2px; border-color: #555b64; }
.card { border-radius: 22px; }
input, select { border-radius: 14px; }
.status-line { border-radius: 14px; }
.pill { border-radius: 999px; }
.ra-card button, .pin-gate button { border-radius: 999px; }
/* These are list rows and tabs, not buttons: keep them square. */
.shell button.res, .shell button.place-row, nav.tabs button, .seg button, button.link, button.back { border-radius: 0; transform: none; }

/* ---------- The switch strip (same sliding switch as the site's .mode) ---------- */
.kt-bar { flex: none; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: calc(2px + env(safe-area-inset-top)) 8px 2px; }
.kt-bar + .top { padding-top: 8px; }
.kt-bar .mode { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 40px; margin: 0; padding: 0 4px;
  background: none; border: 0; border-radius: 0; font: 700 12.5px var(--sans); color: #7d828a; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transform: none; }
.kt-bar .mode .track { position: relative; width: 48px; height: 28px; border-radius: 999px; background: #33373e; border: 1px solid #4a4f57;
  transition: background .22s, border-color .22s; flex: none; }
.kt-bar .mode .track i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text);
  transition: transform .22s cubic-bezier(.3,1.4,.5,1), background .22s; }
.kt-bar .mode .l-s { color: var(--text); }
.kt-bar .mode.adv .l-s { color: #7d828a; }
.kt-bar .mode.adv .l-a { color: var(--gold); }
.kt-bar .mode.adv .track { background: var(--gold); border-color: var(--gold); }
.kt-bar .mode.adv .track i { transform: translateX(20px); background: var(--bg); }
@media (max-width: 359px) { .kt-bar { gap: 0 6px; } .kt-bar .mode { font-size: 11.5px; gap: 5px; padding: 0 2px; } .kt-bar .mode .track { width: 42px; } .kt-bar .mode.adv .track i { transform: translateX(14px); } }
/* While a ride is on the map, the map gets the whole screen. */
/* ...and comes back with the ride details drawer, so nobody is stuck on one side during a ride. */
body:has(.stage.riding:not(.drawer-open)) .kt-bar { display: none; }
body:has(.stage.riding:not(.drawer-open)) .top { padding-top: calc(8px + env(safe-area-inset-top)); }
.wrap > .kt-bar, body > .kt-bar.flat { border-radius: 0; }
@media (prefers-reduced-motion: reduce) { .kt-bar .mode .track, .kt-bar .mode .track i, button, .btn { transition: none; } }

/* ---------- Simple / Advanced ---------- */
html[data-mode="simple"] .adv-only { display: none !important; }
/* Simple puts the map first, like a ride app's home screen. Phones only; the unfolded layout already splits 50/50. */
@media (max-width: 599px) {
  html[data-mode="simple"] .stage:not(.no-map):not(.riding) .map-pane { flex-basis: 46%; }
}

/* ---------- Light: white page; filled boxes go black with gold writing;
   outlined things get black writing with gold trim; headings and big numbers stay black. ---------- */
html[data-theme="light"] {
  --bg: #ffffff; --surface: #ffffff; --raised: #ffffff; --line: #dcd8cf;
  --text: #0c0d0f; --muted: #54585e; --gold: #0c0d0f; --gold-ink: #d9a441;
  --green: #1d7a4f; --red: #b3362f;
}
[data-theme="light"] .kt-bar { background: #f4f2ec; }
[data-theme="light"] .kt-bar .mode { color: #8a8d92; }
[data-theme="light"] .kt-bar .mode .track { background: #cfcabf; border-color: #b9b5ab; }
[data-theme="light"] .kt-bar .mode.adv .track { background: #0c0d0f; border-color: #0c0d0f; }
[data-theme="light"] .kt-bar .mode.adv .track i { background: #d9a441; }
[data-theme="light"] .kt-bar .mode.adv .l-s { color: #8a8d92; }
[data-theme="light"] .top svg { color: #d9a441; }                       /* the logo stays gold */
[data-theme="light"] .pill { background: #fff; border: 2px solid #d9a441; color: #0c0d0f; }
[data-theme="light"] button.ghost, [data-theme="light"] .btn.ghost { border-color: #d9a441; color: #0c0d0f; }
[data-theme="light"] button.danger { border-color: var(--red); color: var(--red); }
[data-theme="light"] button:disabled { background: #e7e3da; color: #8a8d92; border-color: transparent; }
[data-theme="light"] .card { border: 2px solid #d9a441; }
[data-theme="light"] .card.sel { border-left-width: 6px; }
[data-theme="light"] input, [data-theme="light"] select { border-color: #b9b5ab; }
[data-theme="light"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%230c0d0f' stroke-width='2'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E"); }
[data-theme="light"] input[type="date"], [data-theme="light"] input[type="time"] { color-scheme: light; }
[data-theme="light"] input[type="checkbox"] { accent-color: #0c0d0f; }
[data-theme="light"] :focus-visible { outline-color: #d9a441; }
[data-theme="light"] .status-line { background: #f4f2ec; }
[data-theme="light"] .status-line.ok { border-color: #1d7a4f; }
[data-theme="light"] .status-line.err { border-color: #b3362f; }
[data-theme="light"] .dot { background: #9a9ea5; }
[data-theme="light"] .badge.booked, [data-theme="light"] .badge.forming { color: #0c0d0f; border: 2px solid #d9a441; }
[data-theme="light"] .num, [data-theme="light"] .pin-num { border-color: #d9a441; color: #0c0d0f; background: #fff; }
[data-theme="light"] .pin-num.here { background: #0c0d0f; color: #d9a441; border-color: #fff; box-shadow: 0 0 0 2px #d9a441; }
[data-theme="light"] nav.tabs button.on { color: #0c0d0f; border-top-color: #d9a441; }
[data-theme="light"] .seg button.on { border-bottom-color: #d9a441; }
[data-theme="light"] button.place-row svg { color: #d9a441; }
[data-theme="light"] .steps i.on { background: #d9a441; }
[data-theme="light"] .panel { box-shadow: 0 -6px 18px rgba(12,13,15,.08); }
[data-theme="light"] .fab, [data-theme="light"] .shell .fab2, [data-theme="light"] .map-chip { border: 2px solid #d9a441; box-shadow: 0 3px 10px rgba(12,13,15,.18); }
[data-theme="light"] .fab2.gold { background: #0c0d0f; color: #d9a441; border-color: #0c0d0f; }
[data-theme="light"] .nav-banner, [data-theme="light"] .handoff { border: 2px solid #d9a441; box-shadow: 0 4px 14px rgba(12,13,15,.18); }
[data-theme="light"] .stage.riding.drawer-open .panel { box-shadow: -10px 0 28px rgba(12,13,15,.2); }
[data-theme="light"] .ride-bar button { box-shadow: 0 6px 18px rgba(12,13,15,.25); }
/* The map: real daylight tiles instead of the darkened set. */
[data-theme="light"] .map-pane, [data-theme="light"] .map.leaflet-container { background: #e9eaec; }
[data-theme="light"] .map .leaflet-tile-pane { filter: saturate(.75); }
[data-theme="light"] .leaflet-control-attribution { background: rgba(255,255,255,.85) !important; }
[data-theme="light"] .car-dot { background: #0c0d0f; border-color: #d9a441; }
[data-theme="light"] .dest-pin { border-color: #fff; }
[data-theme="light"] #hub-map { border: 2px solid #d9a441; }
/* The ride alarm keeps its gold/black flash in both themes: it must look the same every time. */
[data-theme="light"] .ra-card { background: #fff; color: #0c0d0f; }

/* ---------- Driving: once a ride is on, everything folds away and the map is the screen ---------- */
/* On-demand ride (#stage.riding): header, switch strip and tabs go; they come back while the details drawer is open. */
html[data-page="driver"] body:has(.stage.riding:not(.drawer-open)) .top,
html[data-page="driver"] body:has(.stage.riding:not(.drawer-open)) nav.tabs { display: none; }
html[data-page="driver"] .stage.riding .nav-banner,
html[data-page="driver"] .stage.riding .ride-fabs { top: calc(10px + env(safe-area-inset-top)); }
/* Keep the action button where it sat before the tabs were hidden (above the tab row's height). On the
   Z Fold 5 the very bottom edge of the screen was not reliably visible (Eric, 2026-11-29: had to rotate the
   open phone to see "I've arrived"), so nothing a driver must tap sits in the bottom 64px. */
html[data-page="driver"] .stage.riding .ride-bar { bottom: calc(68px + env(safe-area-inset-bottom)); }
html[data-page="driver"] .stage.riding .leaflet-bottom { bottom: 150px; }
/* Big enough to read at a glance from a dash mount. */
html[data-page="driver"] .stage.riding .nav-banner { padding: 12px 16px; border-radius: 18px; }
html[data-page="driver"] .stage.riding .nav-banner .dist { font-size: 30px; }
html[data-page="driver"] .stage.riding .nav-banner .txt { font-size: 21px; font-weight: 700; }
html[data-page="driver"] .stage.riding .nav-banner .sub { font-size: 15px; }
html[data-page="driver"] .stage.riding .nav-banner .prompt { font-size: 18px; }
html[data-page="driver"] .stage.riding .fab2 { width: 58px; height: 58px; min-height: 58px; }
html[data-page="driver"] .stage.riding .fab2 svg { width: 28px; height: 28px; }
html[data-page="driver"] .stage.riding .nav-banner { right: 80px; }
html[data-page="driver"] .stage.riding .handoff { right: 80px; top: calc(78px + env(safe-area-inset-top)); }
html[data-page="driver"] .stage.riding .ride-bar button { min-height: 68px; font-size: 21px; }
@media (min-width: 600px) { html[data-page="driver"] .stage.riding .nav-banner { right: auto; } }
/* Scheduled run in progress (#active showing): the header and strip go and the map takes most of the phone;
   the pickup list stays reachable in a short sheet that scrolls. */
html[data-page="driver"] body:has(#active:not(.hidden)) .top,
html[data-page="driver"] body:has(#active:not(.hidden)) .kt-bar,
html[data-page="driver"] body:has(#active:not(.hidden)) #panel > details { display: none; }
@media (max-width: 599px) {
  html[data-page="driver"] body:has(#active:not(.hidden)) .stage:not(.no-map) .map-pane { flex-basis: 62%; padding-top: env(safe-area-inset-top); }
}

/* "Turn on your location" card (KT.askLocation in api.js). Not shown over the agreement screen. */
.loc-ask strong { display: block; font-size: 17px; }
.loc-ask .meta { margin-top: 4px; }
.stage.agreeing #panel > .loc-ask { display: none; }

/* Next ride offered during a ride (driver.html offerNext): slides in from the right over the map. */
.next-offer { position: absolute; top: calc(104px + env(safe-area-inset-top)); right: 0; width: min(88%, 360px); z-index: 850;
  background: var(--surface); border: 2px solid #d9a441; border-right: 0; border-radius: 22px 0 0 22px; padding: 16px 16px 14px;
  box-shadow: -10px 0 28px rgba(0, 0, 0, .5); transform: translateX(106%); transition: transform .35s cubic-bezier(.2, .9, .3, 1); }
.next-offer.in { transform: none; }
.next-offer .no-top { font: 700 13px var(--sans); letter-spacing: .14em; color: #d9a441; }
.next-offer .no-name { font: 400 26px/1.15 var(--display); margin: 4px 0 6px; }
.next-offer .no-line { font-size: 17px; font-weight: 600; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.next-offer .no-line span { display: block; font-size: 13px; color: var(--muted); }
.next-offer .meta { margin: 6px 0 2px; }
.next-offer button { min-height: 56px; }
.next-chip { position: absolute; left: 10px; bottom: calc(148px + env(safe-area-inset-bottom)); z-index: 800; max-width: calc(100% - 20px);
  background: var(--surface); border: 2px solid #d9a441; border-radius: 999px; padding: 6px 14px; font: 600 14px var(--sans);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="light"] .next-offer { box-shadow: -10px 0 28px rgba(12, 13, 15, .2); }
[data-theme="light"] .next-offer .no-top { color: #0c0d0f; }
@media (prefers-reduced-motion: reduce) { .next-offer { transition: none; } }

/* Three switches on a phone: show only the word for the side each switch is on, so they stay on one row
   and the map keeps its height. From 600px up (unfolded, tablet, desktop) both words show, as on the website. */
@media (max-width: 599px) {
  .kt-bar { flex-wrap: nowrap; gap: 0 8px; }
  .kt-bar .mode:not(.adv) .l-a, .kt-bar .mode.adv .l-s { display: none; }
  .kt-bar .mode .track { order: -1; }
  .kt-bar .mode .l-s, .kt-bar .mode.adv .l-a { color: var(--text); }
}
