@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── THEMES ─────────────────────────────────────────── */
/* ── iOS Spring tokens (theme-independent) ─────────── */
:root {
  --ios-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ios-fast: cubic-bezier(0.4, 0, 0.2, 1);
  --ios-dur: 0.5s;
  --ios-dur-fast: 0.28s;
  --ios-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --ios-shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --ios-shadow-lg: 0 16px 56px rgba(0,0,0,0.32);
}

[data-theme="dark"] {
  --bg: #0a0a0c; --bg2: #111114; --bg3: #17171b;
  --surface: #111114; --surface2: #17171b;
  --border: rgba(255,255,255,0.06); --border2: rgba(255,255,255,0.12);
  --text: #e7e7ea; --text2: #8a8a92; --text3: #5a5a62;
  --accent: #00d68f; --accent-dim: rgba(0,214,143,0.12);
  --danger: #ff3d71; --danger-dim: rgba(255,61,113,0.12);
  --warn: #ffc870;
  --nav-bg: rgba(18,18,22,0.92); --shadow: 0 18px 56px rgba(0,0,0,0.5);
  --blur: blur(24px); --radius-sm:12px; --radius-md:16px; --radius-lg:22px; --radius-xl:28px;
  --heat-0: #0f0f13; --heat-1: #0f2a1c; --heat-2: #0e4c32; --heat-3: #0b8056; --heat-4: #00d68f; --heat-5: #7effc7;
  --ios-shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --ios-shadow-md: 0 6px 24px rgba(0,0,0,0.5);
  --ios-shadow-lg: 0 20px 64px rgba(0,0,0,0.7);
}
[data-theme="glass"] {
  --bg: #070d1a; --bg2: transparent; --bg3: transparent;
  --surface: rgba(255,255,255,0.08); --surface2: rgba(255,255,255,0.13);
  --border: rgba(255,255,255,0.13); --border2: rgba(255,255,255,0.22);
  --text: #f0f4ff; --text2: rgba(240,244,255,0.58); --text3: rgba(240,244,255,0.32);
  --accent: #64b5ff; --accent-dim: rgba(100,181,255,0.16);
  --danger: #ff7ba0; --danger-dim: rgba(255,123,160,0.15);
  --warn: #ffd98a;
  --nav-bg: rgba(255,255,255,0.08); --shadow: 0 18px 56px rgba(0,0,0,0.4);
  --blur: blur(40px) saturate(180%); --radius-sm:12px; --radius-md:16px; --radius-lg:22px; --radius-xl:28px;
  --heat-0: rgba(255,255,255,0.03); --heat-1: rgba(100,181,255,0.15); --heat-2: rgba(100,181,255,0.3); --heat-3: rgba(100,181,255,0.5); --heat-4: rgba(100,181,255,0.8); --heat-5: #c4dfff;
}
[data-theme="light"] {
  --bg: #fafaf8; --bg2: #f4f4f1; --bg3: #efefec;
  --surface: #ffffff; --surface2: #f8f8f6;
  --border: #ededea; --border2: #dddbd6;
  --text: #1e1e20; --text2: #6b6b72; --text3: #9c9ca3;
  --accent: #16794f; --accent-dim: rgba(22,121,79,0.08);
  --danger: #c8372d; --danger-dim: rgba(200,55,45,0.08);
  --warn: #b8711a;
  --nav-bg: rgba(255,255,255,0.92); --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px -12px rgba(0,0,0,0.1);
  --blur: blur(12px); --radius-sm:12px; --radius-md:16px; --radius-lg:22px; --radius-xl:28px;
  --heat-0: #f6f6f3; --heat-1: #e0ecdf; --heat-2: #bcd8c5; --heat-3: #7fb395; --heat-4: #16794f; --heat-5: #0a3f28;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
button { border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
input, select, textarea { font: inherit; }

html, body { height: 100dvh; width: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--text);
  font-feature-settings: 'cv11', 'ss01', 'ss03'; letter-spacing: -0.005em;
  touch-action: manipulation;
}
[data-theme="glass"] body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(50,90,200,0.55) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 5%, rgba(140,40,200,0.4) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(200,40,130,0.32) 0%, transparent 55%),
    linear-gradient(180deg, #070d1a 0%, #0d0a1f 100%);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 5%, rgba(0,214,143,0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 95%, rgba(0,214,143,0.03) 0%, transparent 40%),
    #0a0a0c;
}

#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto;
  overflow: hidden;
}
@media (min-width: 540px) {
  #app { height: min(100dvh, 900px); top: 50%; transform: translateY(-50%);
    border-radius: 42px; border: 1px solid var(--border2);
    box-shadow: 0 0 0 1px var(--border), 0 40px 100px rgba(0,0,0,0.4);
    overflow: hidden; }
}

/* ── TOP BAR ─────────────────────────────── */
.top-bar {
  flex-shrink: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent;
}
.top-bar.blur { background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--border); }
.top-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.top-actions { display: flex; gap: 6px; }

/* ── TAB VIEWS ───────────────────────────── */
.tab-views { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.tab-view { position: absolute; inset: 0; display: none; flex-direction: column; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.tab-view.active {
  display: flex;
  /* iOS-style fade-up entrance */
  animation: tabFadeIn 0.32s var(--ios-spring) both;
  z-index: 1;
}
.tab-view.exiting {
  display: flex;
  /* Old tab fades out below new one */
  animation: tabFadeOut 0.20s var(--ios-fast) both;
  z-index: 0;
}
.tab-view.no-scroll { overflow: hidden; }

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tabFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

/* Map tab is special: absolute children shouldn't translate. Only fade. */
.tab-view.no-scroll.active {
  animation: tabFadeInOnly 0.28s var(--ios-fast) both;
}
.tab-view.no-scroll.exiting {
  animation: tabFadeOutOnly 0.18s var(--ios-fast) both;
}
@keyframes tabFadeInOnly {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes tabFadeOutOnly {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── TAB BAR ─────────────────────────────── */
.tab-bar {
  flex-shrink: 0;
  display: flex; gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border);
  z-index: 100;
}
.tab-btn {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px; border-radius: 14px;
  color: var(--text3); font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  transition: color 0.15s, background 0.15s;
}
.tab-btn.active { color: var(--accent); background: var(--accent-dim); }
.tab-btn svg { width: 22px; height: 22px; transition: transform 0.15s; }
.tab-btn:active svg { transform: scale(0.88); }

/* ── CARDS / SURFACES ────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
[data-theme="glass"] .card { backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
[data-theme="light"] .card { box-shadow: var(--shadow); }

/* ── PILLS, CHIPS, LABELS ────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface2); border: 1px solid var(--border); color: var(--text2); }
.pill.accent { background: var(--accent-dim); color: var(--accent); border-color: transparent; }
.pill.danger { background: var(--danger-dim); color: var(--danger); border-color: transparent; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text2); }

/* ── SEGMENTED ───────────────────────────── */
.segmented { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 3px; gap: 2px; }
.seg-btn { flex: 1; padding: 7px 8px; border-radius: 11px; font-size: 12px; font-weight: 600; color: var(--text2); text-align: center; transition: all 0.15s; }
.seg-btn.active { background: var(--surface); color: var(--text); }
[data-theme="dark"] .seg-btn.active { background: #222227; color: #fff; }
[data-theme="light"] .seg-btn.active { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ── INPUTS ──────────────────────────────── */
.field {
  width: 100%; padding: 12px 14px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--text3); }

/* ── BUTTONS ─────────────────────────────── */
.btn { padding: 12px 18px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; transition: opacity 0.15s, transform 0.08s; }
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn.primary { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn.primary { color: #0a0a0c; box-shadow: 0 0 24px -6px rgba(0,214,143,0.4); }
.btn.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn.ghost { background: transparent; color: var(--text2); }

/* ── ICON BUTTONS ────────────────────────── */
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--text2); transition: color 0.15s, background 0.15s; }
.icon-btn:hover { color: var(--text); background: var(--surface2); }
.icon-btn.active { color: var(--accent); }

/* ── MAP ─────────────────────────────────── */
#map-container { flex: 1; position: relative; overflow: hidden; background: var(--bg); }
#map { width: 100%; height: 100%; background: #08121d; }
[data-theme="light"] #map { background: #e8eaed; }

.map-top {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 60px);
  left: 12px; right: 12px; z-index: 1000;
  display: flex; gap: 8px;
}
.map-search {
  flex: 1; padding: 11px 14px 11px 40px;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2); border-radius: 20px;
  color: var(--text); font-size: 14px; outline: none;
  position: relative;
}
.map-search-wrap { flex: 1; position: relative; }
.map-search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text2); pointer-events: none; }

.map-ctrls { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 116px); right: 12px; z-index: 1000; display: flex; flex-direction: column; gap: 6px; }
.map-ctrl-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2); border-radius: 14px;
  color: var(--text); transition: border-color 0.15s, color 0.15s;
}
.map-ctrl-btn.active { border-color: var(--accent); color: var(--accent); }
.map-ctrl-btn:active { transform: scale(0.95); }

.surge-pill {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 116px); left: 12px;
  z-index: 1000;
  padding: 8px 12px 8px 10px;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2); border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
}
.surge-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px var(--danger-dim); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Weather card — Dynamic Island stili, üst-orta morph */
.weather-card {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: var(--nav-bg);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  overflow: hidden;
  /* COLUMN: compact üstte (collapsed) / detail aşağıda (expanded) — yan yana değil */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: auto;
  max-width: 120px;
  box-shadow: var(--ios-shadow-sm);
  /* Apple-like spring easing — applies to BOTH expand and collapse */
  transition:
    max-width var(--ios-dur) var(--ios-spring),
    border-radius var(--ios-dur) var(--ios-spring),
    padding var(--ios-dur) var(--ios-spring),
    box-shadow var(--ios-dur) var(--ios-spring),
    background 0.3s ease;
}
.weather-card.expanded {
  max-width: min(360px, calc(100vw - 24px));
  border-radius: 24px;
  padding: 14px 16px;
  box-shadow: var(--ios-shadow-lg);
  cursor: default;
}

/* Compact pill content — visible when collapsed, fades + collapses when expanded */
.weather-compact {
  display: flex; gap: 6px; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap;
  width: 100%;
  justify-content: center;
  overflow: hidden;
  /* Collapsed default — visible */
  max-height: 60px;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.22s ease 0.22s,
    max-height 0.40s var(--ios-spring) 0.05s,
    visibility 0s linear 0s;
}
.weather-card.expanded .weather-compact {
  /* Hidden when expanded — fast fade out + height collapses parallel to morph */
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.14s ease,
    max-height 0.40s var(--ios-spring),
    visibility 0s linear 0.40s;
}
.weather-compact .weather-icon { font-size: 16px; line-height: 1; }
.weather-compact .weather-temp { font-weight: 700; }
.weather-compact .weather-precip {
  background: var(--accent-dim); color: var(--accent);
  padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 700;
}

/* Expanded detail — hidden when collapsed, expands + fades when expanded */
.weather-detail {
  width: 100%;
  overflow: hidden;
  /* Collapsed default — hidden */
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    max-height 0.45s var(--ios-spring),
    visibility 0s linear 0.45s;
}
.weather-card.expanded .weather-detail {
  max-height: 700px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.32s ease 0.16s,
    max-height 0.50s var(--ios-spring) 0.05s,
    visibility 0s linear 0s;
}
/* Inner detail needs scrollable horizontal hourly even when wrapping */
.weather-detail > *:first-child { padding-top: 2px; }

.weather-detail-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
}
.weather-detail-icon {
  font-size: 36px; line-height: 1;
  text-align: center;
}
.weather-detail-temp { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.weather-detail-temp-big {
  font-size: 30px; font-weight: 700; line-height: 1; color: var(--text);
}
.weather-detail-label {
  font-size: 11px; color: var(--text2); font-weight: 500;
  line-height: 1.2;
  /* allow wrap to 2 lines instead of truncating */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.weather-detail-meta {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 10px; color: var(--text2);
  text-align: right;
  white-space: nowrap;
}
.weather-meta-row { display: flex; gap: 6px; justify-content: flex-end; }
.weather-meta-key { color: var(--text3); }
.weather-meta-val { color: var(--text); font-weight: 600; }
.weather-meta-val.accent { color: var(--accent); }

.weather-detail-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0 8px;
}
.weather-detail-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
/* Hourly forecast — horizontal scroll, fixed cell width (iOS Weather pattern) */
.weather-hourly {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin: 0 -4px;
  scroll-snap-type: x proximity;
  /* Subtle fade on right edge to hint scrollability */
  -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to right, black 0, black calc(100% - 24px), transparent 100%);
}
.weather-hourly::-webkit-scrollbar { display: none; }
.weather-hour-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 10px; color: var(--text2);
  min-width: 46px;
  flex-shrink: 0;
  scroll-snap-align: start;
  transition: background 0.2s, transform 0.15s;
}
.weather-hour-cell:first-child { margin-left: 4px; }
.weather-hour-cell:last-child { margin-right: 4px; }
.weather-hour-cell.now {
  background: var(--accent-dim);
  color: var(--accent);
  /* inset box-shadow yerine border — overflow ve scale glitch yok */
  box-shadow: inset 0 0 0 1.5px var(--accent);
  position: relative;
  padding-top: 14px; /* badge'e yer */
}
.weather-hour-cell .h-now-badge {
  position: absolute;
  top: 2px; left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.weather-hour-cell .h-time { font-weight: 600; font-size: 11px; line-height: 1; }
.weather-hour-cell .h-icon { font-size: 18px; line-height: 1; }
.weather-hour-cell .h-temp { font-weight: 700; font-size: 12px; color: var(--text); line-height: 1; }
.weather-hour-cell.now .h-temp { color: var(--accent); }
.weather-hour-cell .h-precip {
  font-size: 9px; color: var(--accent); font-weight: 700; line-height: 1;
}
.weather-hour-cell .h-day {
  font-size: 8px; color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.05em; line-height: 1;
  margin-top: 2px; padding: 2px 4px;
  background: var(--surface2); border-radius: 4px;
}

.stats-chip {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 1000;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2); border-radius: 999px;
  font-size: 11px; font-weight: 600; color: var(--text2);
  white-space: nowrap;
}
.legend-pop { bottom: 56px; left: 12px; }
.stats-chip .badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; }

/* ───────────────────────────────────────────────────
 * Onboarding tour overlay
 * ─────────────────────────────────────────────────── */
.onboard-overlay {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: auto;
  font-family: inherit;
}
.onboard-overlay.onboard-fading { opacity: 0; transition: opacity 0.3s ease; }
.onboard-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.onboard-spotlight {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.65), 0 0 20px 4px rgba(0,214,143,0.4);
  border: 2px solid var(--accent);
  pointer-events: none;
  transition: all 0.4s var(--ios-spring);
  animation: onboardPulse 2s infinite;
}
@keyframes onboardPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.65), 0 0 20px 4px rgba(0,214,143,0.4); }
  50%      { box-shadow: 0 0 0 9999px rgba(0,0,0,0.65), 0 0 32px 8px rgba(0,214,143,0.7); }
}
.onboard-tooltip {
  position: absolute;
  width: 320px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  color: var(--text);
  transition: top 0.4s var(--ios-spring), left 0.4s var(--ios-spring);
  z-index: 10001;
  animation: onboardTipIn 0.35s var(--ios-spring);
}
@keyframes onboardTipIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
.onboard-tooltip.onboard-picker {
  width: 360px;
}
.onboard-tooltip.onboard-emphasis {
  border-color: var(--accent);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 3px rgba(0,214,143,0.3);
}
.onboard-progress {
  font-size: 10px;
  color: var(--text3);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.onboard-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.onboard-body {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 14px;
}
.onboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.onboard-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ios-spring);
}
.onboard-btn.primary {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
}
.onboard-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,214,143,0.3); }
.onboard-btn.secondary {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.onboard-btn.secondary:hover { background: var(--surface); color: var(--text); }
.onboard-skip-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10002;
}
.onboard-skip-btn:hover { background: rgba(255,255,255,0.2); color: white; }

/* Picker grids (lang/theme) */
.onboard-lang-grid, .onboard-theme-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.onboard-lang-grid { grid-template-columns: 1fr 1fr; }
.onboard-theme-grid { grid-template-columns: 1fr 1fr 1fr; }
.onboard-lang-btn, .onboard-theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--surface2);
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ios-spring);
}
.onboard-lang-btn:hover, .onboard-theme-btn:hover {
  background: var(--surface);
  transform: translateY(-2px);
}
.onboard-lang-btn.active, .onboard-theme-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.onboard-lang-flag, .onboard-theme-icon { font-size: 24px; line-height: 1; }
.onboard-lang-label, .onboard-theme-label {
  font-size: 12px; font-weight: 600; color: var(--text);
}

/* Surge refresh chip — bottom-center, above stats-chip */
.refresh-chip {
  position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2); border-radius: 999px;
  font-size: 11px; font-weight: 500; color: var(--text2);
  white-space: nowrap;
  box-shadow: var(--ios-shadow-sm);
}
.refresh-chip .refresh-btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--accent-dim); color: var(--accent);
  border-radius: 50%;
  transition: transform 0.2s var(--ios-spring), background 0.2s;
}
.refresh-chip .refresh-btn:hover { background: var(--accent); color: white; }
.refresh-chip .refresh-btn.spinning {
  animation: refreshSpin 0.6s linear;
  pointer-events: none;
}
.refresh-chip .refresh-btn.cooldown {
  background: var(--surface2); color: var(--text3);
  cursor: not-allowed;
}
.refresh-chip .refresh-btn.shake {
  animation: refreshShake 0.4s ease;
}
@keyframes refreshSpin {
  to { transform: rotate(360deg); }
}
@keyframes refreshShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.refresh-text { font-variant-numeric: tabular-nums; }
.refresh-label { color: var(--text3); }
.badge.surge-on { background: var(--danger-dim); color: var(--danger); }
.badge.drivers { background: var(--accent-dim); color: var(--accent); }

.legend-pop {
  position: absolute; bottom: 56px; left: 12px; z-index: 1001;
  padding: 12px 14px; min-width: 140px;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2); border-radius: var(--radius-md);
}
.legend-pop-title { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text2); margin-bottom: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.legend-sq { width: 11px; height: 11px; border-radius: 3px; }

.cat-sheet {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 68px); right: 12px;
  width: 220px; padding: 6px;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border2); border-radius: 18px;
  z-index: 1100;
  transform: translateX(calc(100% + 20px)); opacity: 0;
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1), opacity 0.2s;
  max-height: 70vh; overflow-y: auto;
}
.cat-sheet.open { transform: translateX(0); opacity: 1; }
.cat-sheet-head { padding: 8px 10px 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.cat-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.cat-row:hover { background: var(--surface2); }
.cat-row .count { font-size: 11px; color: var(--text2); margin-right: 6px; }

/* Toggle */
.toggle { width: 36px; height: 20px; background: var(--border2); border-radius: 999px; position: relative; transition: background 0.2s; cursor: pointer; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* ───────────────────────────────────────────────────
 * iOS Design System — reusable card, list row,
 * collapsible. All animations use --ios-spring.
 * ─────────────────────────────────────────────────── */

/* Base card — frosted, rounded, theme-aware */
.ios-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--ios-shadow-sm);
  overflow: hidden;
}
[data-theme="glass"] .ios-card {
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}

/* Tile — used in compact summary grids (4-up tiles) */
.ios-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  display: flex; flex-direction: column; gap: 2px;
  transition: transform var(--ios-dur-fast) var(--ios-spring),
              box-shadow var(--ios-dur-fast) var(--ios-spring);
}
.ios-tile:hover { transform: translateY(-1px); box-shadow: var(--ios-shadow-sm); }
.ios-tile-value {
  font-size: 17px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.ios-tile-label {
  font-size: 10px; color: var(--text2); font-weight: 500;
  text-transform: none;
}
.ios-tile-sub {
  font-size: 9px; color: var(--text3); margin-top: 1px;
}

/* Section label — uppercase, small, iOS Settings style */
.ios-section-label {
  font-size: 11px; font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 4px 8px;
}

/* List row — icon + content + right value, tappable feel */
.ios-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background var(--ios-dur-fast) var(--ios-fast);
  cursor: pointer;
}
.ios-row:last-child { border-bottom: 0; }
.ios-row:active { background: var(--surface2); }
.ios-row-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.ios-row-content { flex: 1; min-width: 0; }
.ios-row-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ios-row-sub {
  font-size: 11px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ios-row-value {
  font-size: 12px; color: var(--text2); font-weight: 600;
  flex-shrink: 0;
}
.ios-row-chev {
  color: var(--text3); font-size: 14px; flex-shrink: 0;
}

/* Collapsible card — header always visible, body expands w/ spring */
.ios-collapsible {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--ios-dur) var(--ios-spring),
              border-color var(--ios-dur) var(--ios-spring);
}
.ios-collapsible.expanded { box-shadow: var(--ios-shadow-md); }
.ios-collapsible-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.ios-collapsible-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.ios-collapsible-title {
  flex: 1; min-width: 0;
}
.ios-collapsible-title-main {
  font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ios-collapsible-title-sub {
  font-size: 10px; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
}
.ios-collapsible-badge {
  font-size: 9px; color: var(--text3); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface2);
}
.ios-collapsible-chev {
  color: var(--text3); font-size: 12px;
  transition: transform var(--ios-dur-fast) var(--ios-spring);
}
.ios-collapsible.expanded .ios-collapsible-chev { transform: rotate(180deg); }
.ios-collapsible-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height var(--ios-dur) var(--ios-spring),
    opacity var(--ios-dur-fast) var(--ios-fast),
    padding var(--ios-dur) var(--ios-spring);
  padding: 0 14px;
}
.ios-collapsible.expanded .ios-collapsible-body {
  max-height: 400px;
  opacity: 1;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

/* Bottom sheets — iOS spring with shadow elevation */
.sheet {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 1200;
  background: var(--nav-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  box-shadow: 0 -8px 32px rgba(0,0,0,0); /* no shadow when closed */
  transition:
    transform 0.42s var(--ios-spring),
    box-shadow 0.42s var(--ios-spring);
  max-height: 70%;
  display: flex; flex-direction: column;
}
.sheet.open {
  transform: translateY(0);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.32);
}
/* Stagger fade-in for sheet content on open (top-level kids only, max 5) */
.sheet.open .sheet-body > * { animation: sheetItemIn 0.4s var(--ios-spring) both; }
.sheet.open .sheet-body > *:nth-child(1) { animation-delay: 0.10s; }
.sheet.open .sheet-body > *:nth-child(2) { animation-delay: 0.16s; }
.sheet.open .sheet-body > *:nth-child(3) { animation-delay: 0.22s; }
.sheet.open .sheet-body > *:nth-child(4) { animation-delay: 0.28s; }
.sheet.open .sheet-body > *:nth-child(n+5) { animation-delay: 0.32s; }
@keyframes sheetItemIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Airport-specific: stagger the tiles + collapsible cards inside .airport-top */
.sheet.open .airport-top > * { animation: sheetItemIn 0.45s var(--ios-spring) both; }
.sheet.open .airport-top > *:nth-child(1) { animation-delay: 0.12s; }
.sheet.open .airport-top > *:nth-child(2) { animation-delay: 0.18s; }
.sheet.open .airport-top > *:nth-child(3) { animation-delay: 0.24s; }
.sheet.open .airport-top > *:nth-child(4) { animation-delay: 0.30s; }
.sheet.open .airport-top > *:nth-child(n+5) { animation-delay: 0.34s; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border2); margin: 8px auto 0; }
.sheet-header { padding: 10px 18px; display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 18px 18px; }

/* ── ANALYTICS ───────────────────────────── */
.analytics-view { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 16px; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 14px; }
[data-theme="glass"] .kpi-card { backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
[data-theme="light"] .kpi-card { box-shadow: var(--shadow); }
.kpi-label { font-size: 11px; font-weight: 500; color: var(--text2); letter-spacing: 0.02em; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.04em; color: var(--text); line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }
.kpi-delta { font-size: 11px; font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 3px; }
.kpi-delta.up { color: var(--accent); }
.kpi-delta.down { color: var(--danger); }

.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
[data-theme="glass"] .chart-card { backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
[data-theme="light"] .chart-card { box-shadow: var(--shadow); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.chart-title { font-size: 13px; font-weight: 600; }
.chart-sub { font-size: 11px; color: var(--text2); margin-top: 1px; }

/* Heatmap */
.heat-wrap { padding: 6px 0 0; }
.heat-grid { display: grid; grid-template-columns: 24px repeat(24, 1fr); gap: 2px; }
.heat-label { display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; font-size: 9px; font-weight: 600; color: var(--text2); letter-spacing: 0.02em; }
.heat-cell { aspect-ratio: 1; border-radius: 2px; transition: transform 0.1s; cursor: pointer; }
.heat-cell:hover { transform: scale(1.3); outline: 1px solid var(--text); z-index: 1; position: relative; }
.heat-hours { display: grid; grid-template-columns: 24px repeat(24, 1fr); gap: 2px; margin-top: 4px; font-size: 8px; color: var(--text3); }
.heat-hours span { text-align: center; grid-column: span 3; }
.heat-hours span:first-child { grid-column: 1; }
.heat-scale { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 10px; color: var(--text2); }
.heat-scale-bar { flex: 1; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--heat-0), var(--heat-1), var(--heat-2), var(--heat-3), var(--heat-4), var(--heat-5)); }

/* Zone cards */
.zone-list { display: flex; flex-direction: column; gap: 6px; }
.zone-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 13px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: border-color 0.15s; }
[data-theme="light"] .zone-card { box-shadow: var(--shadow); }
.zone-card:active { border-color: var(--accent); }
.zone-rank { width: 24px; height: 24px; border-radius: 7px; background: var(--surface2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.zone-rank.gold { background: var(--accent-dim); color: var(--accent); }
.zone-info { flex: 1; min-width: 0; }
.zone-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-coords { font-size: 10px; color: var(--text3); font-family: ui-monospace, 'SF Mono', Consolas, monospace; margin-top: 1px; }
.zone-stats { font-size: 10px; color: var(--text2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.spark { width: 56px; height: 22px; flex-shrink: 0; color: var(--accent); opacity: 0.85; }
.zone-mult { font-size: 15px; font-weight: 700; color: var(--accent); min-width: 36px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Episode list */
.ep-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ep-row:last-child { border: none; }

/* ── Airport panel — iOS layout, 2-page swipe ───── */
.airport-pager {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.airport-pager::-webkit-scrollbar { display: none; }
.airport-page {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-right: 4px;  /* breathing room between pages */
}
.airport-page-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 0 6px;
  flex-shrink: 0;
}
.airport-page-dots .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border2);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s var(--ios-spring), width 0.25s var(--ios-spring), border-radius 0.25s var(--ios-spring);
}
.airport-page-dots .dot.active {
  background: var(--accent);
  width: 22px;
  border-radius: 999px;
}
.airport-page-dots .dot:hover { background: var(--text2); }
.airport-page-dots .dot.active:hover { background: var(--accent); }

.airport-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
/* Tighter padding inside airport timeline card */
#airport-timeline .ep-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
#airport-timeline .ep-row:last-child { border-bottom: 0; }
#airport-timeline .ep-row:active { background: var(--surface2); }
.ep-time { font-size: 11px; color: var(--text2); font-variant-numeric: tabular-nums; font-family: ui-monospace, 'SF Mono', Consolas, monospace; min-width: 58px; }
.ep-info { flex: 1; min-width: 0; }
.ep-zone { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-dur { font-size: 11px; color: var(--text2); margin-top: 1px; }
.ep-mult { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Forecast */
.forecast-card { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 14px; position: relative; overflow: hidden; }
[data-theme="dark"] .forecast-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 100% 0%, var(--accent-dim) 0%, transparent 50%); pointer-events: none; }
.forecast-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.forecast-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.forecast-row:last-child { border: none; }
.forecast-hour { font-weight: 600; min-width: 48px; font-variant-numeric: tabular-nums; }
.forecast-bar-wrap { flex: 1; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin: 0 12px; }
.forecast-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.forecast-val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 50px; text-align: right; color: var(--accent); }

/* ── PRICE TAB ───────────────────────────── */
.price-view { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.price-inputs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px; position: relative; }
[data-theme="light"] .price-inputs-card { box-shadow: var(--shadow); }
.price-input-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--radius-md); }
.price-input-row + .price-input-row { border-top: 1px solid var(--border); }
.price-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; position: relative; }
.price-dot.pickup { background: var(--accent); }
.price-dot.drop { background: var(--danger); }
.price-dot.drop::before { content:''; position: absolute; top: -16px; left: 4px; width: 2px; height: 12px; background: var(--border2); border-radius: 1px; }
.price-field { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.price-field::placeholder { color: var(--text3); }
.price-swap-btn { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border2); color: var(--text2); z-index: 2; }
[data-theme="dark"] .price-swap-btn { background: var(--surface2); }

.price-result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: border-color 0.15s; }
[data-theme="light"] .price-result { box-shadow: var(--shadow); }
.price-result:active { border-color: var(--accent); }
.price-result.featured { border-color: var(--accent); }
.price-cat-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--surface2); display: grid; place-items: center; flex-shrink: 0; color: var(--text); }
.price-cat-name { font-size: 14px; font-weight: 600; }
.price-cat-meta { font-size: 11px; color: var(--text2); margin-top: 1px; font-variant-numeric: tabular-nums; }
.price-net { font-size: 16px; font-weight: 700; color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.price-gross { font-size: 11px; color: var(--text2); text-align: right; margin-top: 1px; font-variant-numeric: tabular-nums; }

/* ── SAVED ROUTES (Price tab) ────────────── */
.saved-routes-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
[data-theme="light"] .saved-routes-card { box-shadow: var(--shadow); }
.saved-routes-header { padding: 8px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text2); font-weight: 600; }
.saved-route-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: var(--radius-md); cursor: pointer; transition: background-color 0.15s; }
.saved-route-row:hover { background: var(--surface2); }
.saved-route-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-route-sub { font-size: 11px; color: var(--text2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-route-toggle { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); cursor: pointer; letter-spacing: 0.04em; }
.saved-route-toggle.on { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.saved-route-del { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--text2); cursor: pointer; border: none; background: transparent; }
.saved-route-del:hover { color: var(--danger); background: var(--surface2); }
.saved-route-empty { padding: 14px 10px; font-size: 12px; color: var(--text3); text-align: center; }
.saved-route-addbar { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.saved-route-addbar input { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; color: var(--text); font-size: 12px; outline: none; }
.saved-route-addbar button { background: var(--accent); color: #000; border: none; border-radius: var(--radius-md); padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.saved-route-addbar button.secondary { background: var(--surface2); color: var(--text2); }
.saved-route-addbtn { margin: 2px 6px 4px; background: var(--surface2); border: 1px dashed var(--border2); border-radius: var(--radius-md); padding: 10px; color: var(--text2); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.saved-route-addbtn:hover { color: var(--accent); border-color: var(--accent); }
.saved-route-addbtn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ── PROFILE ─────────────────────────────── */
.profile-view { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 16px; }
.profile-header { display: flex; align-items: center; gap: 14px; padding: 4px 0 12px; }
.avatar { width: 58px; height: 58px; border-radius: 18px; background: var(--accent-dim); color: var(--accent); display: grid; place-items: center; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; flex-shrink: 0; border: 1px solid var(--accent); }
.profile-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.profile-sub { font-size: 12px; color: var(--text2); margin-top: 2px; font-variant-numeric: tabular-nums; }

.earnings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
[data-theme="glass"] .earnings-card { backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
[data-theme="light"] .earnings-card { box-shadow: var(--shadow); }
.earnings-big { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; margin-top: 8px; font-variant-numeric: tabular-nums; color: var(--text); }
.earnings-big .currency { font-size: 16px; color: var(--text2); font-weight: 600; margin-left: 4px; }
.earnings-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.earnings-bars { display: flex; align-items: flex-end; gap: 4px; height: 48px; margin-top: 14px; }
.earnings-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.earnings-bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--accent-dim); min-height: 3px; transition: all 0.3s; }
.earnings-bar.today { background: var(--accent); }
.earnings-bar-label { font-size: 9px; color: var(--text3); font-weight: 500; }

.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
[data-theme="light"] .settings-card { box-shadow: var(--shadow); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; gap: 12px; }
.settings-row:last-child { border: none; }
.settings-row-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.settings-row-left svg { color: var(--text2); flex-shrink: 0; }
.settings-row-val { color: var(--text2); font-size: 13px; font-variant-numeric: tabular-nums; }
.settings-row.danger, .settings-row.danger svg { color: var(--danger); }

.theme-swatches { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 14px 16px; }
.theme-sw { padding: 14px 10px; border-radius: var(--radius-md); border: 2px solid var(--border); font-size: 12px; font-weight: 600; text-align: center; cursor: pointer; transition: border-color 0.15s; position: relative; overflow: hidden; }
.theme-sw.dark { background: #111114; color: #e7e7ea; }
.theme-sw.glass { background: linear-gradient(135deg, rgba(50,90,200,0.35), rgba(140,40,200,0.3)); color: #f0f4ff; border-color: rgba(255,255,255,0.15); }
.theme-sw.light { background: #ffffff; color: #1e1e20; border-color: #ededea; }
.theme-sw.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.theme-sw-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.theme-sw.dark .theme-sw-dot { background: #00d68f; }
.theme-sw.glass .theme-sw-dot { background: #64b5ff; }
.theme-sw.light .theme-sw-dot { background: #16794f; }

/* Auth status cards */
.auth-card { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.auth-card:last-child { border: none; }
.auth-card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.auth-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); margin-top: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.ok { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.status-dot.err { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-dim); }

/* ── LOGIN GATE ──────────────────────────── */
#login-gate {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
[data-theme="dark"] #login-gate::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 25% 25%, rgba(0,214,143,0.12) 0%, transparent 45%), radial-gradient(circle at 75% 75%, rgba(0,214,143,0.06) 0%, transparent 40%), #0a0a0c; z-index: -1; }
[data-theme="glass"] #login-gate::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, rgba(50,90,200,0.6) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(140,40,200,0.4) 0%, transparent 50%), #070d1a; z-index: -1; }
[data-theme="light"] #login-gate::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 25% 25%, rgba(22,121,79,0.04) 0%, transparent 50%), var(--bg); z-index: -1; }

.login-card {
  width: min(100%, 380px); z-index: 1;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 32px; padding: 32px 26px;
}
[data-theme="glass"] .login-card { backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
[data-theme="light"] .login-card { box-shadow: var(--shadow); }
.login-logo { width: 48px; height: 48px; border-radius: 15px; background: var(--accent); display: grid; place-items: center; margin-bottom: 22px; }
[data-theme="dark"] .login-logo svg { color: #0a0a0c; }
[data-theme="glass"] .login-logo svg { color: #070d1a; }
.login-logo svg { color: #fff; }
.login-title { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--text2); line-height: 1.55; margin-bottom: 22px; }
.login-stack { display: flex; flex-direction: column; gap: 10px; }
.login-error { font-size: 12px; color: var(--danger); margin-top: 4px; min-height: 16px; }

/* ── TWEAKS PANEL ────────────────────────── */
#tweaks-panel {
  position: fixed; right: 12px; bottom: 100px; z-index: 8000;
  width: 240px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 18px;
  display: none; flex-direction: column; gap: 10px;
}
[data-theme="glass"] #tweaks-panel { backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
[data-theme="light"] #tweaks-panel { box-shadow: var(--shadow); }
#tweaks-panel.visible { display: flex; }
.tweaks-head { display: flex; justify-content: space-between; align-items: center; }
.tweaks-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text2); }
.tweaks-group { display: flex; flex-direction: column; gap: 6px; }
.tweaks-group-label { font-size: 10px; font-weight: 600; color: var(--text3); letter-spacing: 0.05em; text-transform: uppercase; }

/* ── LEAFLET OVERRIDES ───────────────────── */
.leaflet-control-zoom { display: none !important; }
.leaflet-control-attribution { background: transparent !important; color: rgba(255,255,255,0.14) !important; font-size: 8px !important; padding: 0 6px !important; }
.leaflet-control-attribution a { color: rgba(255,255,255,0.22) !important; }
[data-theme="light"] .leaflet-control-attribution { color: rgba(0,0,0,0.2) !important; }
[data-theme="light"] .leaflet-control-attribution a { color: rgba(0,0,0,0.35) !important; }
/* Surge multiplier labels — frosted glass pill, theme-aware */
.surge-label-div { background: none !important; border: none !important; }
.surge-label-inner {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surge-label-bg, rgba(20,20,24,0.72));
  color: var(--surge-label-text, #fff);
  border: 1px solid var(--surge-label-border, rgba(255,255,255,0.18));
  font-weight: 700; font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  text-shadow: 0 1px 1px rgba(0,0,0,0.20);
}
.surge-label-inner.low-mult {
  padding: 1px 6px;
  font-size: 10px; font-weight: 600;
  background: var(--surge-label-bg-low, rgba(20,20,24,0.50));
  border-color: var(--surge-label-border-low, rgba(255,255,255,0.10));
  text-shadow: none;
}
/* Light theme: dark text on light frosted pill — much friendlier */
[data-theme="light"] .surge-label-inner {
  --surge-label-bg: rgba(255,255,255,0.92);
  --surge-label-text: #1e1e20;
  --surge-label-border: rgba(0,0,0,0.08);
  text-shadow: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
[data-theme="light"] .surge-label-inner.low-mult {
  --surge-label-bg-low: rgba(255,255,255,0.78);
  --surge-label-border-low: rgba(0,0,0,0.05);
  color: #6b6b72;
}
/* Glass theme: extra blur for that liquid feel */
[data-theme="glass"] .surge-label-inner {
  --surge-label-bg: rgba(255,255,255,0.18);
  --surge-label-text: #fff;
  --surge-label-border: rgba(255,255,255,0.32);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
}
.driver-car { width: 22px; height: 22px; display: grid; place-items: center; }
.driver-car svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.gps-pulse { width: 14px; height: 14px; border-radius: 50%; background: #4aa6ff; border: 2px solid #fff; box-shadow: 0 0 0 8px rgba(74,166,255,0.2); }

/* ── History Explorer ── */
.history-card { padding: 14px; }
.history-card .chart-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 10px; }
.history-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.history-date-label { font-size: 11px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; text-align: right; }
.history-date-label .weekday { color: var(--accent); margin-right: 4px; }
.history-day-picker { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.history-day-picker .day-chip { cursor: pointer; padding: 4px 10px; font-size: 11px; }
.history-day-picker .day-chip.active { background: var(--accent-dim); color: var(--accent); border-color: transparent; }
.history-day-picker .calendar-chip { position: relative; overflow: hidden; padding: 4px 8px; }
.history-day-picker .calendar-chip input[type="date"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 12px; border: none; }

.history-map-wrap { position: relative; height: 220px; border-radius: var(--radius-md); overflow: hidden; background: var(--surface2); margin-bottom: 8px; }
#history-mini-map { width: 100%; height: 100%; }
.history-map-wrap.drawing #history-mini-map { cursor: crosshair; }
.history-overlay {
  position: absolute; inset: 0; background: var(--surface2); color: var(--text2);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  z-index: 400; pointer-events: none; text-align: center; padding: 0 16px;
}
.history-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff; font-size: 11px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; z-index: 500; white-space: nowrap;
  pointer-events: none;
}
[data-theme="light"] .history-hint { background: rgba(30,30,32,0.88); }
.history-done-btn, .history-cancel-btn {
  position: absolute; bottom: 10px; z-index: 500;
  padding: 6px 12px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px;
}
.history-done-btn { right: 10px; }
.history-cancel-btn { left: 10px; }

.history-intensity {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px;
  height: 16px; margin-top: 4px;
}
.history-intensity .tick {
  border-radius: 2px; background: var(--heat-0);
  transition: transform 0.1s, box-shadow 0.1s;
  cursor: pointer;
}
.history-intensity .tick:hover { transform: scaleY(1.4); box-shadow: 0 0 0 1px var(--text); }
.history-intensity.loading .tick { animation: pulse-dim 1.2s ease-in-out infinite; }
@keyframes pulse-dim { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
.history-speed-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; padding: 0 2px;
  font-size: 10px; color: var(--text2);
}
.history-speed-label { font-size: 11px; opacity: 0.6; }
.history-speed { flex: 1; height: 4px; -webkit-appearance: none; appearance: none; background: var(--surface2); border-radius: 2px; cursor: pointer; outline: none; }
.history-speed::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.history-speed::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }
.history-speed-value { font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; font-weight: 600; color: var(--accent); }
.history-hours {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text3); margin: 2px 0 10px; padding: 0 2px;
}

.history-slider-row { display: flex; align-items: center; gap: 8px; }
.history-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--surface2); border-radius: 2px; outline: none;
}
.history-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.history-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.history-slider:disabled { opacity: 0.5; }
.history-play-btn { width: 32px; height: 32px; color: var(--accent); background: var(--accent-dim); }
.history-play-btn:hover { color: var(--accent); background: var(--accent-dim); }

.history-readout {
  text-align: center; font-size: 12px; color: var(--text2);
  font-variant-numeric: tabular-nums; margin-top: 6px; min-height: 18px;
}
.history-readout strong { color: var(--text); font-weight: 700; }

/* ── Custom Zones ── */
.zones-section { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.zones-section-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.zones-section-actions { display: flex; gap: 6px; }
.zones-section-actions .pill { cursor: pointer; padding: 4px 10px; }
.zones-section-actions .pill.accent { background: var(--accent-dim); color: var(--accent); border-color: transparent; }
.zones-section-actions .zones-toggle-btn.off { opacity: 0.6; }

.zones-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.zones-grid .zone-card.custom {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: 10px 12px; min-height: 74px; position: relative;
}
.zones-grid .zone-card.custom .zone-head {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.zones-grid .zone-card.custom .zone-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.zones-grid .zone-card.custom .zone-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }
.zones-grid .zone-card.custom .zone-del-btn {
  width: 22px; height: 22px; border-radius: 6px; color: var(--text3); flex-shrink: 0;
  display: grid; place-items: center; opacity: 0.7;
}
.zones-grid .zone-card.custom .zone-del-btn:hover { color: var(--danger); opacity: 1; background: var(--danger-dim); }
.zones-grid .zone-card.custom .zone-stats-line { font-size: 10px; color: var(--text2); font-variant-numeric: tabular-nums; }
.zones-grid .zone-card.custom .zone-stats-line.secondary { color: var(--text3); }
.zones-grid .zone-card.custom .zone-stats-loading { color: var(--text3); opacity: 0.6; }
.zones-grid .zones-empty {
  grid-column: 1 / -1; padding: 16px 10px; text-align: center; font-size: 12px; color: var(--text2);
  background: var(--surface2); border-radius: var(--radius-md);
}

.zone-name-form {
  margin-top: 10px; padding: 12px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 10px;
}
.zone-name-form .zone-name-input { padding: 10px 12px; font-size: 13px; }
.zone-color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.zone-color-swatches .swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform 0.15s, border-color 0.15s;
}
.zone-color-swatches .swatch.active { border-color: var(--text); transform: scale(1.1); }
.zone-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.zone-form-actions .btn { padding: 6px 14px; font-size: 12px; }

/* custom zone map label */
.zone-name-label { background: none !important; border: none !important; }
.zone-name-label-inner {
  display: inline-flex; align-items: center; padding: 2px 8px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 11px; font-weight: 600; border-radius: 6px;
  white-space: nowrap;
}
[data-theme="light"] .zone-name-label-inner { background: rgba(30,30,32,0.85); }

/* Fix C11: sticky headers for zone detail + route detail drawers */
#zone-detail .top-bar,
#route-detail .top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
}

/* Routes-list cards: sabit name kolonu (130px) + stats kolonu (1fr) */
/* Route adı dikey wrap olabilir, kategori kolonları her kartta aynı pozisyonda */
#routes-list .zone-card.custom {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: stretch;
  padding: 14px 16px;
  margin-bottom: 8px;
}
#routes-list .zone-card.custom .zone-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}
#routes-list .zone-card.custom .zone-dot {
  display: none;  /* dot gereksiz, route adı zaten net */
}
#routes-list .zone-card.custom .zone-name {
  font-size: 14px;
  font-weight: 700;
  white-space: normal;       /* dikey wrap OK */
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
  word-wrap: break-word;
  color: var(--text);
}
#routes-list .zone-card.custom .zone-head [data-icon] {
  width: 14px; height: 14px; opacity: 0.5; margin-top: 2px;
}
#routes-list .zone-card.custom .zone-stats-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  width: 100%;
  min-width: 0;
}

/* Per-category mini table rows inside route cards — sabit kolon genişlikleri */
.route-stat-row {
  display: grid;
  grid-template-columns: 1fr 78px 90px;
  gap: 10px;
  padding: 3px 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  align-items: center;
}
.route-cat-name {
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}
.route-cat-gross {
  font-weight: 700; color: var(--text);
  text-align: right;
  font-size: 13px;
}
.route-cat-count {
  color: var(--text3);
  text-align: right;
  font-size: 10px;
  white-space: nowrap;       /* "1500 samples" tek satır */
}

/* ── Admin Panel ───────────────────────────────────────── */
.btn.small { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.btn.danger { background: var(--danger, #e53935); color: #fff; }
.btn.danger:hover { opacity: 0.9; }

.admin-view { padding: 12px; overflow-y: auto; height: 100%; }
.admin-section { margin-bottom: 18px; }
.admin-section-title {
  font-size: 13px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0 4px 8px; display: flex; align-items: center; justify-content: space-between;
}
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
.admin-form { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.admin-form .field { width: 100%; padding: 10px 12px; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.admin-msg { font-size: 12px; min-height: 16px; padding: 4px 0; }
.user-row { transition: background 0.1s; }
.user-row:hover { background: var(--surface2); }

/* Login button disabled state */
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Map fullscreen button (history-mini-map sag ust kose) */
.history-map-wrap { position: relative; }
.map-fullscreen-btn {
  position: absolute; top: 8px; right: 8px; z-index: 500;
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.15s;
}
.map-fullscreen-btn:hover { background: rgba(0,0,0,0.8); }

/* Fullscreen mode — harita max, sadece slider/intensity/speed gozuksun */
.history-card.fullscreen {
  position: fixed; inset: 0; z-index: 9999;
  border-radius: 0; max-height: 100vh;
  margin: 0; padding: 12px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
}
.history-card.fullscreen .chart-head { flex-shrink: 0; }
.history-card.fullscreen .history-map-wrap {
  flex: 1; min-height: 0;
  border-radius: 8px; overflow: hidden;
}
.history-card.fullscreen #history-mini-map {
  width: 100%; height: 100%;
}
.history-card.fullscreen .history-intensity,
.history-card.fullscreen .history-hours,
.history-card.fullscreen .history-slider-row,
.history-card.fullscreen .history-speed-row,
.history-card.fullscreen .history-readout {
  flex-shrink: 0;
}
/* Gizlenecekler */
.history-card.fullscreen .zones-section { display: none !important; }
/* Day picker'i kompakt yap — chart-head'de kalsin ama daralsin */
.history-card.fullscreen .history-day-picker { gap: 4px; }
.history-card.fullscreen .chart-sub { display: none; }

/* Route addresses (pickup → dropoff) — compact, ellipsis */
.route-addresses {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text2);
  min-width: 0;  /* shrinks within parent */
}
.route-addr {
  display: inline-flex; align-items: center; gap: 5px;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.route-addr-icon {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}
.route-addr-arrow {
  color: var(--text3);
  font-size: 14px; flex-shrink: 0;
}
.route-edit-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
}
.route-edit-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* Map price sheet — pickup → dropoff strip + distance */
.price-route-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text2);
}
.price-route-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 500;
}
.price-route-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.price-route-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.price-route-arrow {
  color: var(--text3);
  font-size: 14px;
  flex-shrink: 0;
}
.price-route-distance {
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim, rgba(0, 214, 143, 0.12));
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Route Detail — Modern Net + Brut + snapshot timeline ──────── */
.route-cat-grid {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  margin-bottom: 18px;
}

.route-cat-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.route-cat-card::before {
  /* Sol köşede ince renk şeridi (kategori rengi) */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--cat-color, var(--accent));
}
.route-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.route-cat-header {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px;
  padding-left: 4px;
}
.route-cat-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  opacity: 0.9;
}
.route-cat-name-big {
  font-weight: 700;
  font-size: 17px;
  flex: 1; min-width: 0;
  letter-spacing: -0.01em;
}
.route-cat-samples {
  font-size: 11px; color: var(--text2);
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.route-cat-prices {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.price-block {
  padding: 16px 14px;
  border-radius: 12px;
  background: var(--bg, var(--surface2));
  text-align: center;
  position: relative;
  transition: background 0.15s;
}
.price-block.net {
  border: 1.5px solid var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 100%);
}
.price-block.gross {
  border: 1px solid var(--border);
}
.price-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  font-weight: 700;
  margin-bottom: 8px;
}
.price-block.net .price-label { color: var(--accent); }
.price-value {
  font-size: 26px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.price-block.net .price-value { color: var(--accent); }
.price-unit {
  font-size: 13px; font-weight: 500;
  color: var(--text2);
}
.price-stddev {
  font-size: 11px; color: var(--text3);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.route-cat-range {
  display: flex; justify-content: space-between;
  gap: 8px;
  font-size: 11px; color: var(--text3);
  font-variant-numeric: tabular-nums;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.route-cat-range span { font-weight: 500; }
.route-cat-range strong { color: var(--text2); }

.route-chart-toggle {
  display: flex; gap: 4px;
}
.route-chart-toggle .pill {
  padding: 4px 10px; font-size: 11px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); cursor: pointer;
  border-radius: 4px;
}
.route-chart-toggle .pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.route-day-picker {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 6px 0 0 0;
}
.route-day-picker .day-chip {
  padding: 4px 10px; font-size: 11px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); cursor: pointer;
  border-radius: 14px;
  display: inline-flex; align-items: center; gap: 4px;
}
.route-day-picker .day-chip.active {
  background: var(--accent-dim); color: var(--accent); border-color: var(--accent);
}
.route-day-picker .calendar-chip { position: relative; cursor: pointer; }
.route-day-picker .calendar-chip input[type="date"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* ── Info button + modal (her tablo basinda kucuk ? butonu) ─────────────── */
.info-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  padding: 0;
  transition: all 0.15s;
}
.info-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}
.section-with-info {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px 8px;
}
.section-with-info .section-label { margin: 0; padding: 0; }

/* KPI grid floating info button (üstte tablo başlığı yok, sadece sağ üst köşede ?) */
.kpi-grid-wrap { position: relative; }
.info-btn-floating {
  position: absolute; top: -6px; right: -6px; z-index: 5;
  width: 24px; height: 24px;
  background: var(--bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.info-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: info-fade-in 0.15s;
}
@keyframes info-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.info-modal-card {
  background: var(--bg2, var(--bg));
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 480px; width: 100%;
  max-height: 80vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.info-modal-head {
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.info-modal-title {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.info-modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: transparent;
  color: var(--text2);
  font-size: 18px; line-height: 1;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.info-modal-close:hover { background: var(--surface2); color: var(--text); }
.info-modal-body {
  padding: 16px 18px;
  font-size: 13px; line-height: 1.6;
  color: var(--text);
  overflow-y: auto;
  flex: 1;
}

/* Zone detail drawer — fixed header (her zaman üstte, kapatma erisilebilir) */
.zone-detail-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.zone-detail-close-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text);
  font-size: 22px; line-height: 1; font-weight: 300;
  border: 1px solid var(--border);
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.zone-detail-close-btn:hover {
  background: var(--danger, #e53935);
  color: #fff;
  border-color: var(--danger, #e53935);
}

/* User chips (admin online history table) */
.user-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  max-width: 220px;
}
.user-chip {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.user-chip:hover {
  transform: scale(1.05);
  background: var(--accent);
  color: #fff;
}
.user-chip.more {
  background: var(--surface2);
  color: var(--text3);
  cursor: default;
}

/* Usage modal — hourly chart bars */
.usage-section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.hourly-chart {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  height: 90px;
  align-items: end;
  padding: 6px 0;
  margin-bottom: 14px;
}
.hourly-bar-wrap {
  display: flex; flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
  cursor: help;
}
.hourly-bar {
  width: 100%; min-height: 2px;
  border-radius: 2px 2px 0 0;
  transition: opacity 0.15s;
}
.hourly-bar-wrap:hover .hourly-bar {
  opacity: 0.7;
}
.hourly-label {
  font-size: 8px; color: var(--text3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Online status pulse animation (admin panel green dot) */
@keyframes pulse-online {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--success, #00d68f); }
  50% { opacity: 0.5; box-shadow: 0 0 16px var(--success, #00d68f); }
}

/* History modal — detaylı login geçmişi */
.history-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.history-modal-card {
  background: var(--bg2, var(--bg)); border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 560px; width: 100%;
  max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.history-modal-head {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-modal-body {
  padding: 8px 16px 14px;
  overflow-y: auto; flex: 1;
}
.history-day-block {
  margin-top: 14px;
}
.history-day-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  font-size: 12px; font-weight: 700; color: var(--text);
  border-bottom: 2px solid var(--border);
  margin-bottom: 6px;
  position: sticky; top: 0;
  background: var(--bg2, var(--bg));
}
.history-entry {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.history-entry.new-device {
  background: rgba(255, 165, 0, 0.05);
  border-left: 3px solid var(--warning, #ffa500);
  padding-left: 8px;
}
.history-entry-time {
  text-align: right;
}
.history-entry-time .time-clock {
  font-family: ui-monospace, monospace;
  font-size: 13px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.history-entry-time .time-ago {
  font-size: 10px; color: var(--text3); margin-top: 2px;
}
.history-entry-detail {
  display: flex; flex-direction: column; gap: 4px;
}
.history-entry-device {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
}
.device-icon {
  font-size: 14px;
}
.new-device-badge {
  font-size: 9px;
  background: var(--warning, #ffa500); color: #fff;
  padding: 2px 6px; border-radius: 4px;
  font-weight: 700; letter-spacing: 0.05em;
}
.history-entry-meta {
  display: flex; gap: 12px;
  font-size: 10px; color: var(--text2);
}
.history-entry-meta code {
  background: var(--surface2);
  padding: 1px 4px; border-radius: 3px;
  font-family: ui-monospace, monospace;
}

/* Airport source picker (FR24 / OpenSky / Both toggle) */
.airport-source-picker {
  display: inline-flex; gap: 2px;
  padding: 2px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.airport-source-picker .seg-btn {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  border: none;
  font-weight: 600;
  cursor: pointer;
}
.airport-source-picker .seg-btn.active {
  background: var(--accent);
  color: #fff;
}

.route-snapshots-section { margin-top: 14px; }
.route-snapshots-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding: 0 4px;
}
.route-snapshots-controls {
  display: flex; align-items: center; gap: 8px;
}
.route-snapshots-controls .field {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px;
}

.route-snap-list {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 65vh; overflow-y: auto;
  padding-right: 4px;
}

.snap-card {
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 90%, var(--accent)) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: transform 0.12s, border-color 0.15s;
}
.snap-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.snap-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.snap-time {
  font-family: ui-monospace, monospace;
  font-size: 16px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 6px;
}
.snap-time::before {
  content: '🕐'; font-size: 14px; opacity: 0.7;
}
.snap-count {
  font-size: 11px; color: var(--text2);
  padding: 3px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 600;
}

.snap-cats {
  display: flex; flex-direction: column; gap: 8px;
}
.snap-cat-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--bg, var(--surface2));
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}
.snap-cat-row:hover {
  border-color: var(--accent);
}
.snap-cat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}
.snap-cat-name {
  color: var(--text); font-weight: 600;
  font-size: 13px;
}
.snap-net, .snap-gross {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.2;
  min-width: 70px;
}
.snap-net b {
  color: var(--accent);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.snap-gross {
  color: var(--text2);
}
.snap-gross {
  font-weight: 600;
}
.snap-net small, .snap-gross small {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 2px;
}
