/* iOS-style theme */
:root {
  --bg: #f2f2f7;
  --bg-elevated: #ffffff;
  --bg-grouped: #ffffff;
  --bg-input: #ffffff;
  --separator: rgba(60, 60, 67, 0.18);
  --separator-strong: rgba(60, 60, 67, 0.36);
  --text: #000000;
  --text-secondary: rgba(60, 60, 67, 0.6);
  --text-tertiary: rgba(60, 60, 67, 0.3);
  --accent: #007aff;          /* iOS blue */
  --accent-green: #34c759;    /* iOS green */
  --accent-orange: #ff9500;   /* iOS orange */
  --accent-red: #ff3b30;      /* iOS red */
  --accent-indigo: #5856d6;
  --accent-purple: #af52de;
  --accent-pink: #ff2d55;
  --accent-teal: #5ac8fa;

  --tier-ac: #5ac8fa;
  --tier-std: #34c759;
  --tier-fast: #ff9500;
  --tier-ultra: #ff2d55;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-system:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Twitter Dim — soft dark slate */
    --bg: #15202b;
    --bg-elevated: #1e2732;
    --bg-grouped: #1e2732;
    --bg-input: #273340;
    --separator: rgba(82, 100, 116, 0.4);
    --separator-strong: rgba(82, 100, 116, 0.7);
    --text: #f7f9f9;
    --text-secondary: #8b98a5;
    --text-tertiary: rgba(139, 152, 165, 0.6);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-system);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt", "ss01";
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
header {
  background: var(--bg);
  border-bottom: 0.5px solid var(--separator);
  padding: 20px 0 0;
  position: sticky; top: 0; z-index: 1500;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background-color: rgba(242, 242, 247, 0.85);
}
header h1 {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}
header h1 .bolt {
  display: inline-block;
  margin-right: 2px;
  transform: translateY(1px);
  color: #f5a623;
}
header h1 .tld {
  color: var(--text-tertiary);
  font-weight: 400;
}
header .sub {
  font-style: italic;
  opacity: 0.75;
  font-weight: 400;
}
.tab {
  font-weight: 500;
  letter-spacing: -0.005em;
  background: transparent !important;
  border: 0 !important;
  padding: 8px 14px !important;
  position: relative;
}
.tab.active {
  font-weight: 700;
  color: var(--accent) !important;
}
.tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 14px; right: 14px;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px;
}
@media (prefers-color-scheme: dark) {
  header { background-color: rgba(21, 32, 43, 0.88); }
}

header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.5px;
  font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
header h1 .bolt { color: var(--accent); }
header h1 .tld { color: var(--accent); font-weight: 400; }
header .sub {
  margin: 4px 0 16px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}
header .sub b { color: var(--text); font-weight: 600; }

/* Segmented control tabs */
.tabs {
  display: flex; gap: 2px;
  background: rgba(118, 118, 128, 0.12);
  padding: 2px; border-radius: 9px;
  margin-bottom: 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 1; min-width: max-content;
  background: transparent; border: 0;
  color: var(--text-secondary);
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 7px;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ===== Panels ===== */
.tab-panel { display: none; padding: 24px 0 56px; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-h {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.intro {
  color: var(--text-secondary);
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
}
.intro b { color: var(--text); font-weight: 600; }

/* ===== Controls ===== */
.controls {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 14px;
}
.filter-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filter-group label { color: var(--text-secondary); font-size: 13px; font-weight: 500; }

.chip {
  background: var(--bg-elevated);
  color: var(--text);
  border: 0.5px solid var(--separator);
  border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s;
  min-height: 32px;
}
.chip:hover { background: rgba(0, 122, 255, 0.08); }
.chip.active {
  background: var(--accent); color: white;
  border-color: var(--accent);
}
.chip.primary {
  background: var(--accent); color: white; border: 0;
  font-weight: 600; padding: 9px 16px;
}
.chip.primary:hover { background: #0066d6; }

select, input[type=search] {
  background: var(--bg-input);
  color: var(--text);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 14px;
  font-family: inherit;
  min-height: 36px;
}
input[type=search] { min-width: 200px; }
input[type=search]:focus, select:focus { outline: none; border-color: var(--accent); }
.check {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
}

.legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.legend b { color: var(--text); font-weight: 600; }

.updated {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.updated::before { content: "●"; color: var(--accent-orange); font-size: 8px; }
.updated.fresh::before { color: var(--accent-green); }

/* ===== Price LIST (table-like) ===== */
.price-list {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.price-row {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr 24px 0.8fr;
  gap: 8px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 0.5px solid var(--separator);
  font-size: 14px;
}
.price-row .price-divider {
  width: 1px; height: 28px;
  background: var(--separator-strong);
  margin: 0 auto;
  opacity: 0.5;
}
.price-row:last-child { border-bottom: 0; }
.price-row.header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(118, 118, 128, 0.05);
  padding-top: 10px; padding-bottom: 10px;
}
.price-row.row {
  transition: background 0.12s;
}
.price-row.row:hover { background: rgba(0, 122, 255, 0.04); }

.price-name {
  font-weight: 600; font-size: 15px;
  display: flex; flex-direction: column; gap: 2px;
}
.price-name a {
  color: var(--text);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.price-name a:hover { color: var(--accent); }
.price-name .price-src {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.price-name .price-src.operator { color: var(--accent-green); }

.price-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
  text-align: right;
}
.price-cell .unit {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-top: -2px;
}
.price-cell.empty { color: var(--text-tertiary); font-weight: 400; }
.price-cell.cheap {
  color: var(--accent-green);
}
.price-cell.cheap::after { content: " ⬇"; font-size: 11px; }

.price-cell.ac { border-left: 3px solid var(--tier-ac); padding-left: 8px; }
.price-cell.std { border-left: 3px solid var(--tier-std); padding-left: 8px; }
.price-cell.fast { border-left: 3px solid var(--tier-fast); padding-left: 8px; }
.price-cell.ultra { border-left: 3px solid var(--tier-ultra); padding-left: 8px; }

.price-src-cell {
  text-align: right;
}
.price-src {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  background: rgba(118, 118, 128, 0.15);
  color: var(--text-secondary);
}
.price-src.operator { background: rgba(52, 199, 89, 0.20); color: var(--accent-green); }
.price-src.aggregator-voltmeta { background: rgba(0, 122, 255, 0.18); color: var(--accent); }
.price-src.aggregator-araclo { background: rgba(88, 86, 214, 0.18); color: var(--accent-indigo); }
.price-src.seed { background: rgba(142, 142, 147, 0.20); color: var(--text-secondary); }

.skel-row {
  height: 48px; background: var(--bg-elevated);
  border-radius: var(--radius-md); margin-bottom: 8px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }

/* ===== Location Permission Modal ===== */
.loc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  padding: 16px;
  animation: locFadeIn 0.18s ease-out;
}
@keyframes locFadeIn { from { opacity: 0; } to { opacity: 1; } }
.loc-modal {
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  max-width: 420px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  text-align: center;
  animation: locSlideUp 0.22s ease-out;
}
@keyframes locSlideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.loc-modal-icon {
  font-size: 44px;
  margin-bottom: 8px;
  line-height: 1;
}
.loc-modal h3 {
  margin: 4px 0 12px;
  font-size: 19px;
  font-weight: 700;
}
.loc-modal p {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: left;
}
.loc-modal ol {
  text-align: left;
  margin: 12px 0;
  padding-left: 22px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
.loc-modal ol li { margin: 4px 0; }
.loc-modal ol li b { color: var(--accent); font-weight: 700; }
.loc-modal-hint {
  font-size: 12px !important;
  color: var(--text-tertiary) !important;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-top: 10px !important;
}
.loc-modal-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 18px;
}
.loc-modal-btn {
  flex: 1; min-width: 130px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  transition: opacity 0.15s;
}
.loc-modal-btn.primary {
  background: var(--accent);
  color: white;
}
.loc-modal-btn.secondary {
  background: var(--bg);
  color: var(--text);
  border: 0.5px solid var(--separator);
}
.loc-modal-btn:hover { opacity: 0.85; }

/* ===== 3D Web Navigation Overlay — iOS Apple Maps style ===== */
.webnav-overlay {
  position: fixed; inset: 0;
  background: #000;
  z-index: 99998;
  display: flex; flex-direction: column;
  perspective: 1200px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
/* Floating round corner buttons (replaces old top HUD) */
.webnav-fab-tl, .webnav-fab-tr {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  z-index: 13;
  width: 42px; height: 42px;
  flex: none;
  background: rgba(30,30,32,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: rgba(255,255,255,0.95);
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; line-height: 1;
  padding: 0;
  transition: transform 0.15s, background 0.2s;
}
.webnav-fab-tl { left: 12px; }
.webnav-fab-tr { right: 12px; }
.webnav-fab-tl:active, .webnav-fab-tr:active { transform: scale(0.92); background: rgba(60,60,62,0.85); }
.webnav-progress-header {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 38px; /* leave room for floating fabs */
}
.webnav-map-tilt-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.webnav-map-tilt {
  width: 130%; height: 130%;
  transform: rotateX(55deg) scale(1.05);
  transform-origin: center 60%;
  transition: transform 0.3s;
}
.webnav-map {
  width: 100%; height: 100%;
  background: #15202b;
}
/* Stop popup in 3D nav */
.webnav-stop-popup {
  font-size: 13px;
  color: #111;
  min-width: 240px;
}
.webnav-stop-popup-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.webnav-stop-popup-rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: #ff9500; color: #fff;
  border-radius: 50%;
  font-weight: 800; font-size: 12px;
}
.webnav-stop-popup-head strong {
  font-size: 14px; line-height: 1.2;
}
.webnav-stop-popup-meta {
  font-size: 11px; color: #666;
  margin-bottom: 8px;
}
.webnav-stop-popup-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  background: #f5f5f7;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.webnav-stop-popup-grid > div { display: flex; flex-direction: column; }
.webnav-stop-popup-grid .lbl {
  font-size: 9px; text-transform: uppercase;
  color: #888; font-weight: 600; letter-spacing: 0.4px;
}
.webnav-stop-popup-grid b {
  font-size: 12px; color: #111; font-weight: 700;
}
.webnav-stop-popup-grid b.dc { color: #ff9500; }
.webnav-stop-popup-grid b.ac { color: #5856d6; }
.webnav-stop-popup-btn {
  width: 100%;
  padding: 8px 12px;
  background: #007aff;
  color: #fff; border: 0;
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.webnav-stop-popup-btn:hover { opacity: 0.9; }
@media (prefers-color-scheme: dark) {
  .webnav-stop-popup, .webnav-stop-popup-head strong, .webnav-stop-popup-grid b { color: #111; }
}

/* Ahead-stations FAB + panel — iOS frosted glass */
.webnav-charge-fab {
  position: absolute;
  right: 14px;
  bottom: 100px;
  z-index: 11;
  width: 54px; height: 54px;
  background: rgba(30,30,32,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #ffcc00;
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.2s;
}
.webnav-charge-fab:active { transform: scale(0.92); background: rgba(60,60,62,0.85); }
.webnav-charge-panel {
  position: absolute;
  right: 12px;
  bottom: 94px;
  z-index: 12;
  width: 230px; max-width: calc(100vw - 24px);
  max-height: 50vh;
  background: rgba(30,30,32,0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  color: #fff;
  display: flex; flex-direction: column;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.webnav-charge-panel[hidden] { display: none !important; }
.webnav-charge-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  font-size: 11px; font-weight: 700;
  border-bottom: 0.5px solid rgba(255,255,255,0.12);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  opacity: 0.85;
}
.webnav-charge-panel-close,
.ios-close {
  background: rgba(120,120,128,0.34);
  border: 0;
  color: rgba(235,235,245,0.78);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: transform 0.12s, background 0.15s;
  padding: 0;
  flex: 0 0 28px;
}
.webnav-charge-panel-close:hover,
.ios-close:hover { background: rgba(120,120,128,0.5); }
.webnav-charge-panel-close:active,
.ios-close:active { transform: scale(0.92); }
.webnav-charge-panel-list {
  overflow-y: auto;
  padding: 4px;
}
.webnav-charge-item {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: 0; border-radius: 8px;
  padding: 7px 8px;
  color: #fff;
  cursor: pointer; font-family: inherit;
  text-align: left;
  transition: background 0.15s;
  font-size: 12px;
}
.webnav-charge-item:hover, .webnav-charge-item:active { background: rgba(255,255,255,0.10); }
.webnav-charge-item-rank {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  background: #ff9500;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  border: 1.5px solid #fff;
}
.webnav-charge-item-rank.ac { background: #5856d6; }
.webnav-charge-item-rank.direct { background: #34c759; color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 6px rgba(52,199,89,0.5); }
.webnav-charge-item-rank.quick { background: #ffcc00; color: #222; }
.webnav-charge-item-rank.slow { background: #ff9500; color: #fff; }
.webnav-charge-item.cat-slow { opacity: 0.82; }
.webnav-charge-item.cat-slow .webnav-charge-item-dist { color: #ff9500; }
.webnav-charge-item.cat-quick .webnav-charge-item-dist { color: #ffcc00; }
.webnav-charge-item.cat-direct { background: rgba(52,199,89,0.08); }
.webnav-charge-item.cat-direct .webnav-charge-item-dist { color: #34c759; }
.webnav-charge-detour {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.webnav-charge-detour.direct { background: rgba(52,199,89,0.22); color: #34c759; }
.webnav-charge-detour.quick { background: rgba(255,204,0,0.22); color: #ffcc00; }
.webnav-charge-detour.slow { background: rgba(255,149,0,0.22); color: #ffae3a; }
.webnav-charge-item-body {
  flex: 1; min-width: 0;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.webnav-charge-item-dist {
  flex: 0 0 auto;
  font-size: 12px; font-weight: 800;
  color: #34c759;
}

/* Small map pins for ahead stations */
.webnav-ahead-pin {
  width: 22px; height: 22px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

@media (max-width: 480px) {
  .webnav-charge-fab { width: 50px; height: 50px; right: 10px; bottom: 88px; font-size: 22px; }
  .webnav-charge-panel { width: 190px; right: 8px; max-height: 45vh; }
  .webnav-charge-item { padding: 6px 7px; font-size: 11px; }
}

.webnav-stop-icon-wrap {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}
.webnav-stop-pin {
  position: relative;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #ff9500, #ff5e3a);
  color: #fff; font-weight: 800;
  border-radius: 50%; border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}
.webnav-stop-pin-bolt {
  font-size: 18px;
  line-height: 1;
}
.webnav-stop-pin-num {
  position: absolute;
  top: -4px; right: -6px;
  width: 18px; height: 18px;
  background: #007aff;
  color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 50%; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
}
.webnav-stop-pin-label {
  margin-top: 2px;
  background: #fff;
  color: #ff5e3a;
  font-size: 10px; font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.webnav-hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  color: #fff;
}
.webnav-next-stop {
  flex: 1; min-width: 0;
  background: rgba(30,30,32,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255,255,255,0.15);
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.webnav-recenter {
  flex: 0 0 50px;
  width: 50px; height: 50px;
  padding: 0;
  background: rgba(30,30,32,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: rgba(255,255,255,0.95);
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.webnav-recenter:active { transform: scale(0.92); }
.webnav-recenter.active {
  background: rgba(31, 142, 255, 0.95);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  box-shadow: 0 4px 16px rgba(31, 142, 255, 0.55);
}

.join-status {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: var(--bg-elevated);
  padding: 20px 28px;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  color: var(--text);
  font-size: 15px; font-weight: 600;
  text-align: center;
  max-width: 90vw;
  border: 0.5px solid var(--separator);
}
.join-status small { font-weight: 400; font-size: 12px; }

.resume-nav-banner {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--accent);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  max-width: 92vw;
  animation: resumeNavIn 0.3s ease-out;
}
@keyframes resumeNavIn {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.resume-nav-icon {
  font-size: 28px;
  background: rgba(0, 122, 255, 0.15);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 44px;
}
.resume-nav-text { flex: 1; min-width: 0; }
.resume-nav-title { font-size: 14px; font-weight: 700; color: var(--text); }
.resume-nav-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.resume-nav-yes {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.resume-nav-no {
  background: rgba(118, 118, 128, 0.24);
  border: 0;
  color: rgba(60, 60, 67, 0.7);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px; font-weight: 700; line-height: 1;
  cursor: pointer; font-family: inherit;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 28px;
  transition: transform 0.12s, background 0.15s;
}
.resume-nav-no:hover { background: rgba(118, 118, 128, 0.4); }
.resume-nav-no:active { transform: scale(0.92); }
@media (prefers-color-scheme: dark) {
  .resume-nav-no { background: rgba(118, 118, 128, 0.34); color: rgba(235, 235, 245, 0.78); }
  .resume-nav-no:hover { background: rgba(118, 118, 128, 0.5); }
}

/* (Eski webnav-invite kuralı kullanım dışı — floating tr fab kullanıyor) */
.webnav-progress {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 64px; right: 64px;
  z-index: 9;
  background: rgba(30,30,32,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 14px;
  padding: 10px 14px 12px;
  border: 0.5px solid rgba(255,255,255,0.15);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  letter-spacing: -0.01em;
}
.webnav-progress-bar {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: visible;
  margin-bottom: 6px;
}
.webnav-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1f8eff, #5ac8fa);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(31,142,255,0.55);
}
.webnav-progress-friends {
  position: absolute; top: -2px; left: 0; right: 0;
  height: 12px; pointer-events: none;
}
.webnav-progress-friend-dot {
  position: absolute;
  top: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: left 0.6s ease-out;
}
.webnav-progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  gap: 8px;
  flex-wrap: wrap;
}
.webnav-progress-stats span { white-space: nowrap; }
.webnav-progress-stats b { color: #fff; font-weight: 800; }

@media (max-width: 480px) {
  .webnav-progress {
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: 60px; right: 60px;
    padding: 8px 12px 10px;
  }
  .webnav-progress-stats { font-size: 10px; gap: 6px; }
  .webnav-progress-header { font-size: 12px; padding: 0 4px; }
  .webnav-participants {
    top: calc(118px + env(safe-area-inset-top, 0px));
    max-width: 160px;
  }
  .webnav-fab-tl, .webnav-fab-tr { width: 40px; height: 40px; font-size: 16px; }
}

.webnav-participants {
  position: absolute; top: calc(120px + env(safe-area-inset-top, 0px)); right: 12px;
  z-index: 9;
  display: flex; flex-direction: column; gap: 4px;
  max-width: 200px;
  background: rgba(30,30,32,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 14px;
  padding: 10px 12px;
  border: 0.5px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  letter-spacing: -0.01em;
}
.webnav-participants-title {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 2px;
}
.webnav-part-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 2px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.webnav-part-chip > span:first-child {
  width: 10px; height: 10px; border-radius: 50%;
  flex: 0 0 10px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.webnav-part-chip-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis;
  max-width: 90px;
}
.webnav-part-chip-dist {
  color: rgba(255,255,255,0.7);
  font-size: 11px; font-weight: 500;
}
.webnav-part-chip-arrow {
  font-size: 10px; opacity: 0.6;
}
.webnav-part-pin {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}
.webnav-part-label {
  margin-top: 2px;
  background: #fff; color: #111;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 6px;
  text-align: center; max-width: 70px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Tesla/iOS-style silver+blue user marker */
.user-arrow-icon {
  position: relative;
  width: 60px !important; height: 60px !important;
  pointer-events: auto;
}
.user-arrow-rot {
  position: absolute;
  top: 5px; left: 5px;
  width: 50px; height: 50px;
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.user-arrow-pulse {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 142, 255, 0.35) 0%, rgba(31, 142, 255, 0) 70%);
  animation: userPulseIOS 2s ease-out infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes userPulseIOS {
  0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* Nearby filter pins */
.nearby-pin-wrap {
  display: flex; flex-direction: column; align-items: center;
  pointer-events: auto;
}
.nearby-pin {
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  border: 2px solid #fff;
  cursor: pointer;
}
.nearby-pin-price {
  margin-top: 2px;
  background: #fff;
  color: #111;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Charging stop pin on route map — bolt icon, no emoji */
.route-stop-pin {
  position: relative;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #ff9500, #ff5e3a);
  color: #fff;
  border-radius: 50%;
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}
.route-stop-pin svg {
  width: 16px !important; height: 16px !important;
  vertical-align: 0 !important;
}
.route-stop-pin span {
  position: absolute;
  top: -5px; right: -7px;
  width: 18px; height: 18px;
  background: #007aff;
  color: #fff;
  font-size: 11px; font-weight: 800;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ===== Route alternatives picker (Google-Maps style 3-route chooser) ===== */
.route-alt-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.route-alt-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border-light, rgba(255,255,255,0.08));
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 4px;
  color: var(--text-primary);
  font-family: inherit;
}
.route-alt-card:hover {
  transform: translateY(-1px);
  border-color: #5c8eff;
}
.route-alt-card.selected {
  border-color: #007aff;
  background: linear-gradient(135deg, rgba(0,122,255,0.18), rgba(0,122,255,0.08));
}
.route-alt-title {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex; gap: 6px; align-items: center;
  text-transform: uppercase; letter-spacing: .3px;
}
.route-alt-badge {
  background: #34c759; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  text-transform: none; letter-spacing: 0;
}
.route-alt-badge.fast {
  background: #ff9500;
}
.route-alt-stats {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
}
.route-alt-tag {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.route-alt-card.selected .route-alt-tag {
  color: #34c759; font-weight: 700;
}
/* On-map label for non-selected alternative routes */
.route-alt-label {
  background: rgba(255,255,255,0.95);
  color: #333;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.15);
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: background .15s, transform .15s;
}
.route-alt-label:hover {
  background: #fff;
  transform: scale(1.05);
}
@media (prefers-color-scheme: dark) {
  .route-alt-label {
    background: rgba(30,30,32,0.95);
    color: #f0f0f0;
    border-color: rgba(255,255,255,0.2);
  }
  .route-alt-label:hover {
    background: rgba(50,50,55,0.98);
  }
}

/* Alternative station hover pin on route map */
.alt-hover-pin {
  display: inline-flex; align-items: center;
  background: #ff9500;
  color: #fff;
  font-weight: 800; font-size: 12px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(255,149,0,0.7);
  white-space: nowrap;
  animation: altHoverPulse 1s ease-out infinite;
}
.alt-hover-pin span {
  margin-left: 4px;
  max-width: 80px;
  overflow: hidden; text-overflow: ellipsis;
}
@keyframes altHoverPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Alt button action label */
.stop-alt-action {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.2px;
}
.stop-alt {
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.stop-alt:hover {
  transform: translateX(2px);
  border-color: var(--accent);
  background: rgba(0,122,255,0.05);
}
.stop-alt:active { transform: translateX(2px) scale(0.99); }

/* Car search wrapper — absolute-positioned dropdown so it doesn't push layout */
.car-search-wrap {
  position: relative;
}
.car-search-wrap > input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}
.car-search-wrap > .autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 200;
  background: var(--bg-elevated);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.car-search-wrap > .autocomplete-dropdown[hidden] { display: none !important; }
.car-search-wrap .autocomplete-item {
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer;
  transition: background 0.1s;
  line-height: 1.3;
}
.car-search-wrap .autocomplete-item:last-child { border-bottom: 0; }
.car-search-wrap .autocomplete-item:hover { background: rgba(0,122,255,0.08); }
.car-search-wrap .autocomplete-item b {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.car-search-wrap .autocomplete-item small {
  font-size: 10.5px !important;
  color: var(--text-tertiary) !important;
  margin-top: 1px;
}

/* Twemoji — render emojis inline at text-baseline like real emojis */
img.twemoji {
  height: 1em;
  width: 1em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.15em;
  display: inline-block;
}

/* High-quality map rendering — smoother zoom + retina sharp */
.leaflet-container {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", -apple-system, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}
.leaflet-tile {
  filter: contrast(1.02) saturate(1.05);
  image-rendering: -webkit-optimize-contrast;
}
.leaflet-tile-container img {
  width: 256.5px !important;
  height: 256.5px !important;
}
.leaflet-fade-anim .leaflet-tile {
  transition: opacity 0.35s linear;
}
.leaflet-control-zoom a {
  background: rgba(255,255,255,0.92) !important;
  color: #333 !important;
  border: 0 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border-radius: 8px !important;
  margin-bottom: 4px !important;
  font-weight: 500 !important;
}
.leaflet-control-zoom a:hover { background: #fff !important; }
@media (prefers-color-scheme: dark) {
  .leaflet-control-zoom a {
    background: rgba(40,40,42,0.92) !important;
    color: #fff !important;
  }
  .leaflet-control-zoom a:hover { background: rgba(60,60,62,0.95) !important; }
}

/* ===== Map ===== */
.map-shell-wrap {
  max-width: 1180px;
  margin: 14px auto 30px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}
.map-shell {
  display: flex;
  gap: 14px;
  margin: 0;
  align-items: stretch;
}
.map-shell #map {
  flex: 1 1 auto;
  min-width: 0;
  height: 70vh; min-height: 520px; max-height: 780px;
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg);
  position: relative;
  z-index: 1;
}
.map-shell .nearby-sidebar {
  flex: 0 0 320px;
}
.map-shell .nearby-sidebar[hidden] { display: none !important; }
.nearby-sidebar {
  height: calc(100vh - 240px); min-height: 500px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow-y: auto; padding: 16px;
  box-shadow: var(--shadow-md);
}
.nearby-sidebar h3 {
  font-size: 13px; margin: 0 0 14px;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600;
}
.nearby-card {
  display: block; width: 100%; text-align: left;
  background: var(--bg);
  border: 0;
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px; cursor: pointer;
  margin-bottom: 8px;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.nearby-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.nearby-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.nearby-name { font-weight: 600; font-size: 14px; }
.nearby-dist {
  color: var(--accent-orange);
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nearby-meta {
  color: var(--text-secondary); font-size: 12px;
  margin-top: 4px;
  display: flex; justify-content: space-between; gap: 8px;
}
.nearby-price {
  font-weight: 700; font-variant-numeric: tabular-nums;
}

.stats {
  color: var(--text-secondary); font-size: 13px;
  margin-left: auto; font-variant-numeric: tabular-nums;
}

/* ===== Cities ===== */
.city-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.city-card {
  background: var(--bg-elevated);
  border: 0;
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s;
}
.city-card:hover { transform: translateY(-1px); }
.city-name { font-weight: 600; font-size: 14px; }
.city-count { font-size: 12px; color: var(--text-secondary); }
.city-fast {
  color: var(--accent-orange);
  font-weight: 700; font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ===== FAQ ===== */
details {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px 18px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
details summary {
  cursor: pointer; font-weight: 600; font-size: 15px;
  list-style: none; position: relative; padding-right: 28px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+"; position: absolute; right: 0; top: -1px;
  color: var(--accent); font-weight: 400; font-size: 22px; line-height: 1;
  transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(45deg); }
details[open] summary { margin-bottom: 8px; }
details p {
  color: var(--text-secondary);
  margin: 0; line-height: 1.55; font-size: 14px;
}
details a { color: var(--accent); }

/* ===== Hesaplama araçları ===== */
.subtabs {
  display: flex; gap: 4px;
  background: rgba(118, 118, 128, 0.12);
  padding: 3px; border-radius: 10px;
  margin-bottom: 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.subtab {
  flex: 1; min-width: max-content;
  background: transparent; border: 0;
  color: var(--text-secondary);
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 7px;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.subtab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.subpanel { display: none; }
.subpanel.active { display: block; animation: fadeIn 0.2s ease; }

.form-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.form-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
}
.form-grid input, .form-grid select {
  font-size: 15px; padding: 9px 12px;
  background: var(--bg);
  color: var(--text);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.form-grid input:focus, .form-grid select:focus {
  outline: none; border-color: var(--accent);
}
.form-grid button {
  grid-column: 1 / -1;
  min-height: 44px;
  font-size: 15px;
}

.result {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  display: none;
}
.result.show { display: block; }
.result h3 { margin: 0 0 12px; font-size: 17px; }
.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.result-stat {
  background: rgba(118, 118, 128, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.result-stat-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.result-stat-value {
  font-size: 22px; font-weight: 700;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.result-stat-value .unit {
  font-size: 12px; color: var(--text-secondary); font-weight: 400; margin-left: 4px;
}
.result-stat.green .result-stat-value { color: var(--accent-green); }
.result-stat.orange .result-stat-value { color: var(--accent-orange); }
.result-stat.red .result-stat-value { color: var(--accent-red); }
.result-stat.blue .result-stat-value { color: var(--accent); }

.stops-list { display: flex; flex-direction: column; gap: 8px; }
.stop-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
}
.stop-num {
  width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.stop-info { display: flex; flex-direction: column; gap: 2px; }
.stop-name { font-weight: 600; font-size: 14px; }
.stop-meta { font-size: 12px; color: var(--text-secondary); }
.stop-cost {
  text-align: right;
  font-weight: 700; font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-green);
}
.stop-cost small { display: block; color: var(--text-secondary); font-weight: 400; font-size: 11px; }

/* Quick finder */
.quick-finder {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.quick-finder .chip { min-height: 40px; padding: 0 16px; font-size: 13px; }
#qf-results {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.qf-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: rgba(118, 118, 128, 0.08);
  font-weight: 700; font-size: 14px;
  border-bottom: 0.5px solid var(--separator);
}
.qf-close { background: transparent; border: 0; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 0 6px; }
.qf-close:hover { color: var(--accent-red); }
.qf-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer;
  transition: background 0.12s;
}
.qf-item:hover { background: rgba(0, 122, 255, 0.05); }
.qf-item:last-child { border-bottom: 0; }
.qf-rank {
  font-weight: 800; color: var(--accent-green); font-size: 14px;
  background: rgba(52, 199, 89, 0.18); border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.qf-item-name { font-weight: 600; font-size: 14px; }
.qf-item-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.qf-item-price {
  font-weight: 800; font-size: 16px; color: var(--accent-green);
  font-variant-numeric: tabular-nums;
}
.qf-item-price small { display: block; font-size: 10px; color: var(--text-secondary); font-weight: 400; }

/* Saved trips (collapsible) */
.saved-trips-bar {
  display: block;
  margin-bottom: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.saved-trips-bar[hidden] { display: none !important; }
.saved-trips-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  user-select: none;
  display: flex; align-items: center; gap: 8px;
  position: relative;
}
.saved-trips-summary::-webkit-details-marker { display: none; }
.saved-trips-summary::after {
  content: "▸";
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.15s;
  color: var(--text-tertiary);
}
.saved-trips-bar[open] .saved-trips-summary::after {
  transform: rotate(90deg);
}
.saved-trips-bar[open] .saved-trips-summary {
  border-bottom: 0.5px solid var(--separator);
}
.saved-trips-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap;
}
.saved-trips-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px;
}
.saved-trip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 12px;
  background: var(--bg);
  border: 0.5px solid var(--separator);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.saved-trip:hover { border-color: var(--accent); color: var(--accent); }
.saved-trip-del {
  background: rgba(118, 118, 128, 0.24); border: 0; color: rgba(60, 60, 67, 0.7);
  width: 22px; height: 22px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer; font-size: 11px; line-height: 1; font-weight: 700;
  transition: transform 0.12s, background 0.15s;
}
.saved-trip-del:hover { background: rgba(255, 59, 48, 0.55); color: #fff; }
.saved-trip-del:active { transform: scale(0.9); }
@media (prefers-color-scheme: dark) {
  .saved-trip-del { background: rgba(118, 118, 128, 0.34); color: rgba(235, 235, 245, 0.78); }
}
.save-trip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; margin-bottom: 14px;
  background: var(--bg-elevated);
  border: 0.5px dashed var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.save-trip-btn:hover { background: rgba(0, 122, 255, 0.10); }

/* Route Timeline (Diagram) */
.route-timeline {
  position: relative;
  padding-left: 0;
}
.tl-marker {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--separator);
}
.tl-marker-start { border-left: 4px solid var(--accent); }
.tl-marker-end { border-left: 4px solid var(--accent-green); }
.tl-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.tl-marker-start .tl-icon { background: rgba(0, 122, 255, 0.15); border-color: var(--accent); }
.tl-marker-end .tl-icon { background: rgba(52, 199, 89, 0.15); border-color: var(--accent-green); }
.tl-content { flex: 1; }
.tl-title { font-weight: 700; font-size: 14px; }
.tl-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.route-timeline {
  display: flex; flex-direction: column; gap: 10px;
}
.tl-leg {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 0 26px;
  padding: 0;
  min-height: 36px;
}
.tl-leg-line {
  width: 3px; min-height: 36px;
  background: repeating-linear-gradient(to bottom, var(--seg, var(--accent)) 0 5px, transparent 5px 10px);
  flex-shrink: 0;
  border-radius: 2px;
}
.tl-leg-info {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  padding: 8px 12px;
  background: rgba(118, 118, 128, 0.08);
  border-left: 3px solid var(--seg, var(--accent));
  border-radius: var(--radius-sm);
}
.tl-leg-info b { color: var(--seg, var(--text)); font-weight: 800; }

.route-timeline .stop-card {
  margin: 0;
}

.soc-change {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 6px 12px;
  background: rgba(52, 199, 89, 0.15);
  border-radius: 999px;
  border: 1px solid rgba(52, 199, 89, 0.35);
  font-size: 13px;
}
.soc-from { color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.soc-arrow { color: var(--accent-green); font-weight: 700; }
.soc-to { color: var(--accent-green); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }
.soc-kwh { color: var(--accent-green); font-size: 11px; opacity: 0.85; margin-left: 4px; }

.leg-segment {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(118, 118, 128, 0.06);
  border-radius: var(--radius-sm);
  margin: 6px 0;
  display: flex; align-items: center; gap: 6px;
  font-weight: 500;
}

.stop-alts {
  margin-top: 8px; padding: 8px 12px;
  background: rgba(118, 118, 128, 0.05);
  border-radius: var(--radius-sm);
}
.stop-alts summary {
  cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--accent); list-style: none;
}
.stop-alts summary::-webkit-details-marker { display: none; }
.stop-alts[open] summary { margin-bottom: 6px; }
.stop-alts-list { display: flex; flex-direction: column; gap: 4px; }
.stop-alt {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  text-align: left;
  background: var(--bg-elevated);
  border: 0.5px solid var(--separator);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}
.stop-alt:hover { border-color: var(--accent); }
.stop-alt-name { font-weight: 600; font-size: 13px; }
.stop-alt-meta { font-size: 11px; color: var(--text-secondary); grid-column: 1; }
.stop-alt-price {
  grid-row: 1 / span 2; grid-column: 2;
  align-self: center;
  font-weight: 700; font-size: 13px;
  color: var(--accent-green);
  white-space: nowrap;
}

.route-map {
  height: 360px; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 12px;
}
.alt-pin {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(142, 142, 147, 0.85);
  color: white; font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s;
}
.alt-pin:hover { transform: scale(1.3); background: var(--accent); }

.map-leg-label {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0, 122, 255, 0.95);
  color: white; font-weight: 700; font-size: 11px;
  font-family: var(--font-system);
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.content-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 18px 22px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.content-card h3 { margin: 0 0 10px; font-size: 17px; }
.content-card p { margin: 8px 0; line-height: 1.55; color: var(--text-secondary); font-size: 14px; }
.content-card ul, .content-card ol { margin: 8px 0; padding-left: 20px; color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.content-card b { color: var(--text); }

/* Station status overlay marker colors */
.status-pin-working { background: var(--accent-green); }
.status-pin-broken  { background: var(--accent-red); }
.status-pin-busy    { background: var(--accent-orange); }
.status-pin-partial { background: #ffd60a; color: black; }

.station-status-tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
  margin-left: 4px;
}
.station-status-tag.working { background: var(--accent-green); color: white; }
.station-status-tag.broken { background: var(--accent-red); color: white; }
.station-status-tag.busy { background: var(--accent-orange); color: white; }
.station-status-tag.partial { background: #ffd60a; color: black; }

/* ===== Mola TV ===== */
.tv-controls { margin-bottom: 12px; }
.tv-form {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.tv-form input {
  flex: 1; min-height: 44px;
  font-size: 15px;
  border-radius: var(--radius-md);
}
.tv-form button { min-height: 44px; padding: 0 22px; font-size: 15px; border-radius: var(--radius-md); }

.tv-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px; align-items: center;
}
.tv-quick-label { color: var(--text-secondary); font-size: 13px; margin-right: 4px; }

.tv-results {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 16px;
}
.tv-result {
  background: var(--bg-elevated);
  border: 0; color: var(--text);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
}
.tv-result:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tv-result-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: #000 50% / cover no-repeat;
  position: relative;
}
.tv-result-dur {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0, 0, 0, 0.85); color: white;
  font-size: 11px; font-weight: 600;
  padding: 2px 5px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.tv-result-dur.live { background: var(--accent-red); }
.tv-result-info { padding: 10px 12px; }
.tv-result-title {
  font-weight: 600; font-size: 13px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tv-result-meta {
  color: var(--text-secondary); font-size: 11px;
  margin-top: 4px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tv-loading {
  display: flex; align-items: center; gap: 8px;
  padding: 16px; color: var(--text-secondary); font-size: 14px;
}
.tv-loading::before {
  content: ""; width: 16px; height: 16px;
  border: 2px solid var(--separator); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tv-player {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.tv-frame-wrap {
  position: relative; width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.tv-frame-wrap iframe,
.tv-frame-wrap video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.tv-meta {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px;
  background: var(--bg-elevated);
}
.tv-meta-text {
  color: var(--text-secondary); font-size: 13px;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tv-loading-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  color: white; font-size: 14px; font-weight: 500;
  z-index: 10;
}
.tv-loading-spin {
  width: 36px; height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tv-warning {
  color: var(--accent-orange);
  font-size: 12px; line-height: 1.5;
  padding: 12px 14px;
  background: rgba(255, 149, 0, 0.08);
  border-left: 3px solid var(--accent-orange);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}
.tv-warning b { color: var(--text); }

.compat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.compat-table th, .compat-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 0.5px solid var(--separator);
}
.compat-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  background: rgba(118, 118, 128, 0.05);
  font-weight: 600;
}
.compat-table td.ok { color: var(--accent-green); font-weight: 600; }
.compat-table td.no { color: var(--accent-red); font-weight: 600; }
.compat-table td.meh { color: var(--accent-orange); font-weight: 600; }
.compat-table tr:last-child td { border-bottom: 0; }
.compat-table tr:hover td { background: rgba(0, 122, 255, 0.04); }
@media (max-width: 640px) {
  .compat-table { font-size: 12px; }
  .compat-table th, .compat-table td { padding: 8px 10px; }
}

/* Bigger touch targets in landscape (car screen mode) */
@media (orientation: landscape) and (max-height: 800px) {
  .tv-form input, .tv-form button { min-height: 52px; font-size: 16px; }
  .tv-quick .chip { min-height: 44px; padding: 10px 16px; font-size: 14px; }
}

/* Kiosk mode: hide everything except player */
body.tv-kiosk header,
body.tv-kiosk footer,
body.tv-kiosk .tab-panel:not(#tab-tv),
body.tv-kiosk #tab-tv .page-h,
body.tv-kiosk #tab-tv .intro,
body.tv-kiosk #tab-tv .tv-controls,
body.tv-kiosk #tab-tv .tv-form,
body.tv-kiosk #tab-tv .tv-quick,
body.tv-kiosk #tab-tv .tv-warning,
body.tv-kiosk #tab-tv .tv-meta { display: none !important; }
body.tv-kiosk { background: #000; }
body.tv-kiosk .tv-player { border-radius: 0; margin: 0; min-height: 100vh; }
body.tv-kiosk .tv-frame-wrap { aspect-ratio: auto; height: 100vh; }
body.tv-kiosk .wrap { padding: 0; max-width: none; }
body.tv-kiosk .tab-panel { padding: 0; }
body.tv-kiosk::after {
  content: "Kiosk modundan çıkmak için sayfayı yenileyin";
  position: fixed; bottom: 8px; right: 12px;
  color: rgba(255,255,255,0.4); font-size: 11px;
  pointer-events: none; z-index: 9999;
}

/* ===== Footer ===== */
footer {
  border-top: 0.5px solid var(--separator);
  padding: 20px 0 32px; margin-top: 32px;
  color: var(--text-secondary); font-size: 12px;
}
footer p { margin: 4px 0; }
footer a { color: var(--accent); text-decoration: none; }
footer b { color: var(--text); }

/* ===== Leaflet overrides ===== */
.leaflet-container {
  font-family: var(--font-system);
  background: var(--bg-elevated);
}
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md); padding: 4px;
  background: var(--bg-elevated); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.leaflet-popup-content { font-size: 13px; margin: 10px 14px; line-height: 1.45; }
.leaflet-popup-content b { font-size: 14px; }
.leaflet-popup-tip { background: var(--bg-elevated); }
.leaflet-control-attribution {
  background: rgba(255,255,255,0.85) !important;
  font-size: 10px !important;
}
@media (prefers-color-scheme: dark) {
  .leaflet-control-attribution { background: rgba(28,28,30,0.85) !important; color: #aaa; }
  .leaflet-control-attribution a { color: var(--accent); }
}

/* Station detail side panel */
.station-panel[hidden] { display: none !important; }
.station-panel {
  position: fixed; inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: stretch; justify-content: flex-start;
  animation: fadeIn 0.18s ease;
}
.station-panel-card {
  background: var(--bg-elevated);
  width: min(420px, 100vw);
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 20px;
  overflow-y: auto;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.35);
  animation: slideInLeft 0.22s ease;
  position: relative;
}
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: none; } }
.station-panel-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: rgba(118, 118, 128, 0.24);
  color: rgba(60, 60, 67, 0.7);
  font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: transform 0.12s, background 0.15s;
}
.station-panel-close:hover { background: rgba(118, 118, 128, 0.4); }
.station-panel-close:active { transform: scale(0.92); }
@media (prefers-color-scheme: dark) {
  .station-panel-close { background: rgba(118, 118, 128, 0.34); color: rgba(235, 235, 245, 0.78); }
  .station-panel-close:hover { background: rgba(118, 118, 128, 0.5); }
}
.sp-header {
  display: flex; gap: 14px; align-items: center;
  margin: 8px 0 16px; padding-right: 32px;
}
.sp-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5edcff);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.sp-headinfo h3 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 700; }
.sp-operator-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.sp-operator-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  background: linear-gradient(135deg, #007aff, #5856d6);
  color: #fff; font-weight: 700; font-size: 12px;
  border-radius: 12px;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.35);
}
.sp-city { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.sp-headinfo p { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.sp-meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px;
}
.sp-meta span {
  font-size: 11px; padding: 4px 10px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.15);
  color: var(--text-secondary); font-weight: 600;
}
.sp-meta span.dc { background: rgba(0, 122, 255, 0.18); color: var(--accent); }
.sp-meta span.ac { background: rgba(52, 199, 89, 0.18); color: var(--accent-green); }
.sp-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary); font-weight: 700;
  border-bottom: 0.5px solid var(--separator);
  padding-bottom: 6px; margin-bottom: 8px;
}
.sp-sockets { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sp-socket {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
}
.sp-socket.ac { border-left-color: var(--accent-green); }
.sp-socket-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent); font-weight: 800; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sp-socket.ac .sp-socket-icon { background: rgba(52, 199, 89, 0.15); color: var(--accent-green); }
.sp-socket-main { flex: 1; }
.sp-socket-type { font-weight: 700; font-size: 14px; }
.sp-socket-kw { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.sp-socket-price {
  font-weight: 700; font-size: 14px;
  background: rgba(118, 118, 128, 0.15);
  padding: 6px 10px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.sp-actions {
  display: flex; gap: 8px;
  margin-top: auto; padding-top: 14px;
  border-top: 0.5px solid var(--separator);
}
.sp-actions .chip { min-height: 44px; padding: 0 16px; font-size: 14px; }
@media (max-width: 640px) {
  .station-panel-card { width: 100vw; }
}

/* Autocomplete dropdown */
.geo-field { position: relative; }
.geo-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-elevated);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 280px; overflow-y: auto;
  margin-top: 4px;
}
.geo-item {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--separator);
  color: var(--text);
}
.geo-item:last-child { border-bottom: 0; }
.geo-item:hover { background: rgba(0, 122, 255, 0.10); }
.geo-item-title { font-weight: 600; font-size: 13px; }
.geo-item-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; line-height: 1.35; }
.geo-loading { padding: 12px 14px; color: var(--text-secondary); font-size: 12px; }

/* Voltla-style pins */
.vmark {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--ring, #007aff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(0,0,0,0.04);
  transition: transform 0.15s ease;
  display: flex; align-items: center; justify-content: center;
}
.vmark span {
  color: var(--ring, #007aff);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.3px;
  font-family: var(--font-system);
  line-height: 1;
}
.vmark:hover { transform: rotate(-45deg) scale(1.15); cursor: pointer; }
@media (prefers-color-scheme: dark) {
  .vmark { background: #1c1c1e; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05); }
}

/* Voltla-style cluster bubbles */
/* iOS minimal cluster — small white pill with count, no gradient bloat */
.vcluster {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #1c1c1e;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: transform 0.15s ease;
  letter-spacing: -0.02em;
}
.vcluster span {
  font-size: 11px;
  line-height: 1;
}
.vcluster:hover { transform: scale(1.06); border-color: #34c759; }
.marker-cluster, .marker-cluster div { background: transparent !important; border: 0 !important; }
@media (prefers-color-scheme: dark) {
  .vcluster {
    background: rgba(28,28,30,0.92);
    color: #fff;
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .map-shell { grid-template-columns: 1fr; gap: 12px; }
  .nearby-sidebar { height: auto; max-height: 360px; min-height: 0; }
  .map-shell #map { height: 60vh; min-height: 360px; }
}

@media (max-width: 720px) {
  .price-row {
    grid-template-columns: 1.4fr 1fr 1fr;
    grid-template-areas:
      "name name source"
      "ac std std"
      "fast ultra ultra";
    row-gap: 6px;
    padding: 14px;
  }
  .price-row.header { display: none; }
  .price-name { grid-area: name; }
  .price-src-cell { grid-area: source; text-align: right; padding-left: 0; }
  .price-divider { display: none; }
  .price-cell.ac { grid-area: ac; }
  .price-cell.std { grid-area: std; }
  .price-cell.fast { grid-area: fast; }
  .price-cell.ultra { grid-area: ultra; }
  .price-cell { text-align: left; padding-left: 8px; }
  .price-cell::before {
    content: attr(data-label);
    display: block;
    font-size: 9px; color: var(--text-tertiary);
    font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px;
  }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  header { padding-top: 14px; }
  header h1 { font-size: 24px; }
  header .sub { font-size: 13px; margin-bottom: 12px; }
  .tabs { gap: 0; }
  .tab { padding: 8px 12px; font-size: 12px; }
  .tab-panel { padding: 16px 0 40px; }
  .page-h { font-size: 22px; }
  .intro { font-size: 13px; margin-bottom: 14px; }

  .controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .filter-group {
    justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding: 4px 0;
  }
  .filter-group label { flex-shrink: 0; }
  .chip { flex-shrink: 0; min-height: 36px; }
  select, input[type=search] { width: 100%; min-width: 0; min-height: 40px; }

  .map-shell #map { height: 65vh; min-height: 360px; }
  .nearby-sidebar { max-height: 340px; padding: 14px; }

  .city-grid { grid-template-columns: 1fr 1fr; }

  details { padding: 14px; }
  details summary { font-size: 14px; }
  details p { font-size: 13px; }
}

@media (max-width: 380px) {
  .city-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MOBILE & IN-CAR DISPLAY OPTIMIZATIONS (phones, Tesla, Togg)
   ============================================================ */

/* Tap targets minimum 44px (Apple HIG) — applied on mobile + touch */
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
  .tab {
    min-height: 44px !important;
    padding: 12px 14px !important;
    display: inline-flex !important;
    align-items: center;
  }
  button, a.chip { min-height: 44px; }
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px;
    padding: 10px 12px;
  }
}

/* Prevent any horizontal scroll bug from dynamic content */
body { overflow-x: clip; }
.tab-panel { overflow-x: hidden; }

/* Bottom safe area for fixed elements + iPhone home indicator */
body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Make all containers respect viewport — no horizontal scroll bugs */
html, body { max-width: 100vw; overflow-x: hidden; }
* { -webkit-tap-highlight-color: transparent; }

/* Touch targets — minimum 44x44 per Apple HIG */
@media (hover: none) and (pointer: coarse) {
  .chip { min-height: 44px; padding: 10px 14px; }
  button, a.chip, .tab { min-height: 44px; }
}

@media (max-width: 800px) {
  /* Header & nav */
  .wrap { padding: 0 14px; }
  header { padding: 10px 0; }
  header h1 { font-size: 22px; }
  header .sub { font-size: 12px; }
  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
    padding-bottom: 4px;
  }
  nav::-webkit-scrollbar { display: none; }
  nav .tab {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Map: full-width, no side sidebar — sidebar becomes bottom drawer */
  .map-shell-wrap {
    max-width: 100%;
    margin: 8px 0 16px;
    padding: 8px;
    border-radius: 12px;
  }
  .map-shell {
    flex-direction: column;
    gap: 8px;
  }
  .map-shell #map {
    height: 62vh; min-height: 380px; max-height: none;
  }
  .map-shell .nearby-sidebar {
    flex: 0 0 auto;
    max-height: 50vh;
    overflow-y: auto;
  }

  /* Forms — single column */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .form-grid label { font-size: 13px; }
  .form-grid input, .form-grid select {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* prevents iOS zoom on focus */
  }
  .form-grid input[type="text"], .form-grid input[type="number"], .form-grid input[type="search"] {
    font-size: 16px;
  }

  /* Buttons row in route result — stack-friendly */
  .route-actions, [class*="action-row"] {
    flex-wrap: wrap !important;
  }
  .route-actions > * {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    font-size: 13px;
  }

  /* Quick finder buttons */
  .quick-finder {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .quick-finder .chip { width: 100%; text-align: center; }

  /* Tables → horizontal scroll if needed */
  .price-row {
    grid-template-columns: minmax(110px,1.4fr) repeat(4, minmax(70px, 1fr)) !important;
    font-size: 12px;
  }
  .price-row > * { padding: 8px 4px; }

  /* Station detail panel → bottom sheet */
  .station-panel {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .station-panel-card {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    margin: 0 !important;
  }
  .sp-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .sp-actions .chip { width: 100%; }

  /* Result summary — 2 cols instead of 4 */
  .result-summary {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .result-stat { padding: 10px !important; }
  .result-stat-value { font-size: 18px !important; }
  .unit { font-size: 11px !important; }

  /* 3D Nav HUD adjustments */
  .webnav-hud-top {
    padding: 10px 12px;
    gap: 10px;
  }
  .webnav-exit { width: 40px; height: 40px; font-size: 20px; }
  .webnav-dest { font-size: 15px; }
  .webnav-stats { font-size: 11px; }
  .webnav-invite { padding: 8px 12px; font-size: 12px; }
  .webnav-participants {
    top: auto;
    bottom: 96px;
    right: 8px; left: auto;
    max-width: 160px;
    padding: 6px 8px;
  }
  .webnav-part-chip { font-size: 11px; }
  .webnav-part-chip-name { max-width: 70px; }
  .webnav-hud-bottom { padding: 10px; gap: 8px; }
  .webnav-next-stop { padding: 10px 12px; font-size: 13px; }
  .webnav-recenter { padding: 10px 14px; font-size: 12px; }

  /* Make tilt less aggressive on small screens (more usable) */
  .webnav-map-tilt {
    transform: rotateX(45deg) scale(1.02);
  }

  /* Saved trips bar */
  .saved-trips-summary { padding: 10px 12px; }
  .saved-trip { padding: 6px 10px 6px 12px; font-size: 11px; }

  /* Loc modal scroll if tall */
  .loc-modal { max-height: 90vh; overflow-y: auto; }

  /* Resume nav banner */
  .resume-nav-banner {
    left: 8px; right: 8px;
    transform: none;
    bottom: 8px;
    width: auto; max-width: none;
  }

  /* Manual waypoint search dropdown wider */
  .autocomplete-dropdown { font-size: 14px; }

  /* QR box smaller */
  #r-qr-box img { width: 200px !important; height: 200px !important; }
}

/* Extra small phones */
@media (max-width: 480px) {
  header h1 { font-size: 20px; }
  header h1 .tld { display: inline; }
  nav .tab { font-size: 12px; padding: 8px 10px; }
  .map-shell #map { height: 58vh; min-height: 340px; }
  .price-row {
    grid-template-columns: minmax(96px,1.3fr) repeat(4, minmax(58px, 1fr)) !important;
    font-size: 11px;
  }
  .result-summary { grid-template-columns: repeat(2, 1fr) !important; }
  .webnav-dest { font-size: 14px; }
  .webnav-invite { font-size: 11px; padding: 7px 10px; }
}

/* In-car displays (Tesla 17", Togg 12.3") — landscape, wide, touch-only */
@media (orientation: landscape) and (pointer: coarse) and (min-width: 1000px) {
  /* Bigger touch targets, slightly larger font */
  body { font-size: 16px; }
  .chip, button { min-height: 48px; padding: 12px 18px; font-size: 14px; }
  .form-grid input, .form-grid select { font-size: 17px; padding: 12px; }
  .webnav-exit { width: 56px; height: 56px; font-size: 26px; }
  .webnav-recenter { padding: 14px 22px; font-size: 15px; }
  .webnav-invite { padding: 14px 22px; font-size: 15px; }
}

/* Very wide displays (Tesla portrait 1200x1920) */
@media (min-width: 1100px) and (orientation: portrait) {
  .map-shell #map { height: 75vh; }
  body { font-size: 17px; }
}

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ IPTV Player UI (TiviMate-style) ============ */
.iptv-app { display: flex; height: 75vh; min-height: 480px; background: #0b0e13; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.4); margin-top: 10px; }
.iptv-side { width: 280px; min-width: 280px; background: #14181f; border-right: 1px solid #20242c; display: flex; flex-direction: column; }
.iptv-side-search { padding: 12px; border-bottom: 1px solid #20242c; }
.iptv-side-search input { width: 100%; box-sizing: border-box; padding: 9px 12px; background: #0b0e13; border: 1px solid #2a2f38; border-radius: 8px; color: #fff; font-size: 13px; outline: none; }
.iptv-side-search input:focus { border-color: #007aff; }
.iptv-side-list { flex: 1; overflow-y: auto; padding: 6px; }
.iptv-side-group { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: transparent; border: 0; color: #c7ccd6; font-size: 13px; text-align: left; cursor: pointer; border-radius: 8px; margin-bottom: 2px; transition: background 0.15s, color 0.15s; }
.iptv-side-group:hover { background: #1c2129; color: #fff; }
.iptv-side-group.active { background: linear-gradient(90deg, #007aff, #0064d4); color: #fff; font-weight: 600; }
.iptv-side-icon { font-size: 16px; }
.iptv-side-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iptv-side-count { background: rgba(255,255,255,0.12); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.iptv-side-group.active .iptv-side-count { background: rgba(255,255,255,0.25); }

.iptv-content { flex: 1; display: flex; flex-direction: column; background: #0b0e13; min-width: 0; }
.iptv-content-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #20242c; }
.iptv-content-head input { flex: 1; padding: 10px 14px; background: #14181f; border: 1px solid #2a2f38; border-radius: 8px; color: #fff; font-size: 13px; outline: none; }
.iptv-content-head input:focus { border-color: #007aff; }
.iptv-info { font-size: 12px; color: #7a7f88; white-space: nowrap; }

.iptv-rows { flex: 1; overflow-y: auto; }
.iptv-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid #181c23; cursor: pointer; transition: background 0.12s; }
.iptv-row:hover { background: #14181f; }
.iptv-row.playing { background: linear-gradient(90deg, rgba(0,122,255,0.18), rgba(0,122,255,0.05)); border-left: 3px solid #007aff; padding-left: 13px; }
.iptv-row-num { font: 600 13px monospace; color: #5a6068; min-width: 38px; letter-spacing: 0.5px; }
.iptv-row.playing .iptv-row-num { color: #007aff; }
.iptv-row-logo { width: 46px; height: 46px; flex-shrink: 0; background: #14181f; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.iptv-row-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; }
.iptv-row-logo-fb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font: 700 18px sans-serif; color: #c7ccd6; background: #2a2f38; }
.iptv-row-info { flex: 1; min-width: 0; }
.iptv-row-name { font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iptv-row-group { font-size: 11px; color: #7a7f88; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iptv-row-play { font: 600 13px sans-serif; color: #007aff; padding: 6px 14px; background: rgba(0,122,255,0.15); border-radius: 6px; opacity: 0; transition: opacity 0.15s; }
.iptv-row:hover .iptv-row-play, .iptv-row.playing .iptv-row-play { opacity: 1; }
.iptv-row.playing .iptv-row-play { background: #007aff; color: #fff; }

@media (max-width: 700px) {
  .iptv-app { flex-direction: column; height: auto; }
  .iptv-side { width: 100%; min-width: 0; max-height: 35vh; }
  .iptv-row-group { display: none; }
}

.iptv-app-fullscreen { position: fixed !important; inset: 0 !important; height: 100vh !important; z-index: 99998 !important; border-radius: 0 !important; }

/* Compact override */
.iptv-app { height: 420px !important; min-height: 420px !important; max-width: 720px; margin: 10px auto !important; }
.iptv-side { width: 180px; min-width: 180px; }
.iptv-side-group { padding: 7px 10px; font-size: 12px; }
.iptv-side-icon { font-size: 13px; }
.iptv-side-count { font-size: 10px; padding: 1px 6px; }
.iptv-content-head { padding: 8px 10px; gap: 8px; }
.iptv-content-head input { padding: 7px 10px; font-size: 12px; }
.iptv-info { font-size: 11px; }
.iptv-row { padding: 7px 12px; gap: 10px; }
.iptv-row-num { font-size: 11px; min-width: 32px; }
.iptv-row-name { font-size: 13px; }
.iptv-row-group { font-size: 10px; }
.iptv-row-play { font-size: 11px; padding: 4px 10px; }
.iptv-side-search { padding: 8px; }
.iptv-side-search input { padding: 6px 10px; font-size: 12px; }
@media (max-width: 700px) {
  .iptv-app { height: 70vh !important; max-width: 100%; }
  .iptv-side { max-height: 28vh; }
}
