/* ===== MillionCharger — premium ivory & gold theme ✨ ===== */
:root {
  --bg: #faf7f0;            /* warm ivory */
  --surface: #ffffff;
  --surface-2: #f4eeda;     /* champagne wash */
  --surface-3: #f1efe8;
  --text: #221f18;          /* warm ink */
  --muted: #8b8470;
  --primary: #0e7a56;       /* deep emerald */
  --primary-dark: #0a5c42;
  --accent: #0284c7;
  --danger: #cf364c;
  --gold: #c9a227;          /* antique gold */
  --gold-deep: #a5790f;
  --ac: #22c55e;
  --dc: #0ea5e9;
  --rapid: #fb923c;
  --ultra: #a855f7;
  --radius: 16px;
  --nav-h: 62px;
  --header-h: 56px;
  --shadow: 0 8px 24px rgba(70, 58, 25, .10);
  --shadow-big: 0 14px 44px rgba(70, 58, 25, .16);
  font-size: 16px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.fineprint { color: var(--muted); font-size: .75rem; margin-top: .6rem; line-height: 1.5; }

/* ===== Coin (golden bolt = points currency) ===== */
.coin { width: 1.15em; height: 1.15em; vertical-align: -0.2em; display: inline-block; }
.coin-lg { width: 2.6rem; height: 2.6rem; filter: drop-shadow(0 3px 6px rgba(180,110,10,.4)); }
.coin-spin { animation: coin-pop .6s ease; }
@keyframes coin-pop { 0% { transform: scale(.3) rotate(-30deg); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ===== Header ===== */
.app-header {
  position: fixed; top: 0; inset-inline: 0; height: var(--header-h);
  display: flex; align-items: center; gap: .6rem;
  padding: 0 .8rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  z-index: 1200;
  border-bottom: 1px solid rgba(161, 124, 26, .16);
  box-shadow: 0 2px 14px rgba(80, 66, 30, .07);
}

.brand {
  display: flex; align-items: center; gap: .35rem; font-weight: 800; font-size: 1.05rem; white-space: nowrap;
  background: linear-gradient(135deg, #c9a227, #8a6a10);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: .01em;
}
.brand-logo { font-size: 1.3rem; filter: drop-shadow(0 0 8px rgba(201,162,39,.65)); }

.header-search { position: relative; flex: 1; min-width: 0; }
.header-search input {
  width: 100%; height: 38px; border-radius: 19px; border: 1.5px solid #e6dbb2;
  background: #faf7ec; color: var(--text); padding: 0 1rem; font-size: .9rem; outline: none;
}
.header-search input::placeholder { color: #a89d82; }
.header-search input:focus { border-color: var(--gold); background: #fff; }

.search-results {
  position: absolute; top: 44px; inset-inline: 0; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-big); overflow: hidden; max-height: 40vh; overflow-y: auto;
}
.search-results button {
  display: block; width: 100%; text-align: start; padding: .7rem 1rem; background: none; border: none;
  color: var(--text); font-size: .88rem; cursor: pointer; border-bottom: 1px solid #f0ebdd;
}
.search-results button:hover { background: var(--surface-2); }
.search-results .sr-sub { display: block; color: var(--muted); font-size: .75rem; }

.lang-select {
  height: 34px; max-width: 92px; border-radius: 17px; background: #faf7ec; color: var(--text);
  border: 1.5px solid #e6dbb2; padding: 0 .4rem; font-size: .8rem;
  flex: 0 0 auto; text-overflow: ellipsis;
}

/* ===== Views ===== */
.views { position: fixed; top: var(--header-h); bottom: var(--nav-h); inset-inline: 0; }
.view { display: none; height: 100%; overflow-y: auto; }
.view.active { display: block; }
#view-map { overflow: hidden; position: relative; }
#map { position: absolute; inset: 0; background: #eaf6ef; }

/* ===== Filter bar ===== */
.filter-bar {
  position: absolute; top: .6rem; inset-inline: .6rem; z-index: 900;
  display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 34px; padding: 0 .9rem; border-radius: 17px; border: 1.5px solid #e8e0c6;
  background: rgba(255,255,255,.95); color: var(--text); font-size: .82rem; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(80,66,30,.09);
}
.chip.active { background: linear-gradient(135deg, #158059, #0a5c42); border-color: transparent; color: #fff; }

/* speed filter chips carry the marker colors */
#filter-bar .chip[data-value="ac"]::before,
#filter-bar .chip[data-value="dc"]::before,
#filter-bar .chip[data-value="ultra"]::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-inline-end: .4rem;
}
#filter-bar .chip[data-value="ac"]::before { background: var(--ac); }
#filter-bar .chip[data-value="dc"]::before { background: var(--dc); }
#filter-bar .chip[data-value="ultra"]::before { background: var(--ultra); }
#filter-bar .chip[data-value="ac"].active { background: var(--ac); border-color: transparent; }
#filter-bar .chip[data-value="dc"].active { background: var(--dc); border-color: transparent; }
#filter-bar .chip[data-value="ultra"].active { background: var(--ultra); border-color: transparent; }
#filter-bar .chip[data-filter="speed"].active::before { background: #fff; }

/* ===== Data banner ===== */
.data-banner {
  position: absolute; top: 3.2rem; left: 50%; right: auto; transform: translateX(-50%);
  z-index: 850; background: rgba(255,255,255,.95); color: var(--muted);
  padding: .35rem .9rem; border-radius: 14px; font-size: .74rem; white-space: nowrap;
  border: 1px solid #e8e0c6; box-shadow: 0 2px 8px rgba(80,66,30,.09);
}

/* ===== FAB / legend ===== */
.fab {
  position: absolute; z-index: 900; width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid #fff; font-size: 1.45rem; cursor: pointer;
  display: grid; place-items: center;
}
/* right-side stack (inline-start in RTL): trip → locate → map layers */
.fab-locate {
  bottom: 10.2rem; inset-inline-start: .9rem;
  background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-big);
}
.fab-locate:active { color: var(--gold); }
.fab-trip {
  bottom: 14rem; inset-inline-start: .9rem;
  background: linear-gradient(135deg, #158059, #0a5c42); color: #fff;
  box-shadow: 0 8px 22px rgba(8, 76, 55, .38);
}
.fab-trip:active { transform: scale(.96); }

/* ===== Trip planner ===== */
.trip-panel {
  position: absolute; top: 3.4rem; inset-inline: .6rem; z-index: 1100;
  max-width: 420px; margin-inline-start: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-big);
  padding: .9rem 1rem 1rem; max-height: calc(100% - 4.4rem); overflow-y: auto;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.trip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.trip-head h3 { font-size: 1rem; }
.trip-field {
  display: flex; align-items: center; gap: .5rem; background: #faf7ec;
  border: 1.5px solid #e6dbb2; border-radius: 12px; padding: 0 .7rem; margin-bottom: .55rem;
}
.trip-field:focus-within { border-color: var(--gold); background: #fff; }
.trip-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.trip-field input {
  flex: 1; min-width: 0; height: 42px; border: none; background: none; outline: none;
  color: var(--text); font-size: .9rem;
}
.trip-loc {
  border: none; background: none; color: var(--primary-dark); font-size: 1.2rem; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
}
.trip-loc:active { background: var(--surface-2); }
.trip-suggest {
  margin: -0.3rem 0 .55rem; background: #fff; border: 1.5px solid #e8e0c6;
  border-radius: 12px; overflow: hidden;
}
.trip-suggest button {
  display: block; width: 100%; text-align: start; padding: .55rem .8rem;
  background: none; border: none; border-bottom: 1px solid #f0ebdd;
  color: var(--text); font-size: .82rem; cursor: pointer;
}
.trip-suggest button:last-child { border-bottom: none; }
.trip-suggest button:active { background: var(--surface-2); }
.trip-route-line { font-size: .8rem; font-weight: 700; color: var(--primary-dark); margin-bottom: .5rem; }

.trip-range-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .82rem; color: var(--muted); margin: .5rem 0 .25rem;
}
.trip-range-row strong { color: var(--primary-dark); font-size: .95rem; }
#trip-range { width: 100%; accent-color: var(--gold); }
.trip-ops-btn {
  width: 100%; text-align: start; border: 1.5px solid #e8e0c6; background: #fff;
  border-radius: 12px; padding: .5rem .7rem; font-size: .78rem; font-weight: 700;
  color: var(--muted); cursor: pointer; margin: .1rem 0 .45rem;
}
.trip-ops-btn strong, #trip-ops-count { color: var(--primary-dark); }
.trip-ops {
  display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .55rem;
  max-height: 9rem; overflow-y: auto; padding: .1rem;
}
.trip-ops .chip { height: 30px; font-size: .74rem; padding: 0 .7rem; }
.trip-car-row {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  font-size: .78rem; color: var(--muted); margin: .1rem 0 .45rem;
}
.trip-car-row select {
  flex: 1; max-width: 63%; height: 36px; border-radius: 12px; border: 1.5px solid #e8e0c6;
  background: #fff; color: var(--text); font-size: .8rem; padding: 0 .5rem;
}
.soc-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .78rem; color: var(--muted); margin: .45rem 0 .1rem;
}
.soc-row strong { color: var(--primary-dark); font-size: .88rem; }
.soc-slider { width: 100%; accent-color: var(--gold); height: 18px; }
.trip-presets { display: flex; gap: .4rem; margin: .45rem 0 .7rem; }
.trip-preset {
  flex: 1; height: 30px; border-radius: 15px; border: 1.5px solid #e8e0c6; background: #fff;
  color: var(--muted); font-size: .78rem; font-weight: 700; cursor: pointer;
}
.trip-preset:active { background: var(--surface-2); }
.trip-actions { display: flex; gap: .5rem; }
.trip-actions .btn { height: 42px; font-size: .88rem; }
.trip-actions .btn-primary { flex: 1.6; }
.trip-actions .btn-ghost { flex: 1; }

.trip-results { margin-top: .8rem; border-top: 1px dashed #e3dabd; padding-top: .7rem; }
.trip-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-bottom: .6rem; }
.ts-cell { background: #faf7ec; border: 1px solid #efe8d2; border-radius: 12px; padding: .45rem .3rem; text-align: center; }
.ts-v { font-weight: 800; font-size: .92rem; color: var(--primary-dark); }
.ts-l { color: var(--muted); font-size: .66rem; margin-top: .1rem; }
.trip-ok { background: rgba(34,197,94,.1); color: #15803d; border-radius: 10px; padding: .55rem .7rem; font-size: .82rem; font-weight: 700; }
.trip-error { background: rgba(244,63,94,.08); color: #be123c; border-radius: 10px; padding: .55rem .7rem; font-size: .82rem; font-weight: 700; }
.trip-stops { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.trip-stop {
  display: flex; align-items: center; gap: .6rem; text-align: start; width: 100%;
  background: #fff; border: 1.5px solid #e8e0c6; border-radius: 12px; padding: .5rem .6rem; cursor: pointer;
}
.trip-stop:active { background: var(--surface-2); }
.tsp-n {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #a5790f); color: #fff; font-weight: 800; font-size: .8rem;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(165,121,15,.4);
}
.tsp-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tsp-name { font-weight: 700; font-size: .84rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsp-sub { color: var(--muted); font-size: .72rem; }
.trip-final { color: var(--muted); font-size: .78rem; font-weight: 700; padding: .35rem .2rem 0; }
.btn-gmaps {
  width: 100%; margin-top: .6rem; height: 44px; border-radius: 22px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #4285F4, #1a73e8); color: #fff; font-weight: 700; font-size: .86rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  box-shadow: 0 5px 14px rgba(26,115,232,.35);
}
.btn-gmaps:active { transform: scale(.98); }

/* route markers on the map */
.route-pin {
  width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 800; font-size: .8rem;
  display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(30,41,59,.4);
}
.route-stop {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #a5790f); color: #fff; font-weight: 800; font-size: .95rem;
  display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(165,121,15,.5);
}


/* ===== Map style switcher (layers, like Google Maps) ===== */
.thumb-standard  { background-image: url("https://tile.openstreetmap.org/6/37/23.png"); }
.thumb-satellite { background-image: url("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/6/23/37"); }
.thumb-terrain   { background-image: url("https://a.tile.opentopomap.org/6/37/23.png"); }
.map-layers-btn {
  position: absolute; bottom: 6.2rem; inset-inline-start: .9rem; z-index: 900;
  width: 54px; height: 54px; border-radius: 12px; border: 2px solid #fff; cursor: pointer;
  padding: 0; overflow: hidden; box-shadow: var(--shadow);
  background-color: #cbd5e1; background-size: cover; background-position: center;
}
.map-layers-btn:active { transform: scale(.96); }
.mlb-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(15,23,42,.55); color: #fff; font-size: .56rem; font-weight: 700; padding: 1px 0 2px;
}
.layers-card {
  position: absolute; bottom: 6.2rem; inset-inline-start: 4.6rem; z-index: 1000;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-big);
  padding: .7rem .8rem .75rem; animation: fade-in .15s ease;
}
.lc-title { font-size: .8rem; font-weight: 800; color: var(--text); margin-bottom: .55rem; }
.lc-options { display: flex; gap: .6rem; }
.lc-opt {
  border: none; background: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  font-size: .7rem; font-weight: 700; color: var(--muted);
}
.lc-thumb {
  width: 58px; height: 58px; border-radius: 10px; border: 2.5px solid transparent;
  background-color: #e2e8f0; background-size: cover; background-position: center;
}
.lc-opt.active { color: var(--primary-dark); }
.lc-opt.active .lc-thumb { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(165,121,15,.28); }

/* attribution line: keep it legal but as discreet as possible */
.leaflet-control-attribution {
  font-size: .55rem !important; line-height: 1.3; opacity: .6;
  background: rgba(255,255,255,.7) !important; padding: 0 .3rem !important;
}
.leaflet-control-attribution:hover { opacity: 1; }

/* ===== Markers ===== */
.st-marker {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 4px;
  color: #fff; font-size: .62rem; font-weight: 800; border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(30,41,59,.35);
}
.st-marker { position: relative; }
.st-st {
  position: absolute; top: -3px; inset-inline-end: -3px; width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid #fff;
}
.st-st-ok { background: #22c55e; }
.st-st-busy { background: #f59e0b; animation: st-pulse 1.2s infinite; }
.st-st-down { background: #ef4444; }
.st-st-unknown { background: #94a3b8; }
@keyframes st-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.55); } 50% { box-shadow: 0 0 0 5px rgba(245,158,11,0); } }
.st-ac { background: var(--ac); }
.st-dc { background: var(--dc); }
.st-rapid { background: var(--rapid); }
.st-ultra { background: var(--ultra); }

.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(16,185,129,.3) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: var(--primary) !important; color: #fff !important; font-weight: 800;
}

/* ===== Bottom sheet ===== */
.sheet {
  position: absolute; bottom: 0; inset-inline: 0; z-index: 1000;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(160,110,20,.25);
  max-height: 68%; overflow-y: auto; padding: .4rem 1rem 1.2rem;
  animation: sheet-up .22s ease;
}
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: #e7dcc2; margin: .4rem auto .6rem; }

.sheet h3 { font-size: 1.05rem; margin-bottom: .15rem; }
.sheet .op-line { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .82rem; margin-bottom: .6rem; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 10px; font-size: .7rem; font-weight: 700;
  background: var(--surface-3); color: var(--muted);
}
.badge-ac { background: rgba(34,197,94,.14); color: #15803d; }
.badge-dc { background: rgba(14,165,233,.14); color: #0369a1; }
.badge-rapid { background: rgba(251,146,60,.16); color: #c2410c; }
.badge-ultra { background: rgba(168,85,247,.14); color: #7e22ce; }
.badge-ok { background: rgba(34,197,94,.14); color: #15803d; }
.badge-warn { background: rgba(244,63,94,.12); color: #be123c; }
.badge-busy { background: rgba(245,158,11,.16); color: #b45309; }

.conn-table { width: 100%; border-collapse: collapse; margin: .5rem 0 .7rem; font-size: .85rem; }
.conn-table td { padding: .45rem .3rem; border-bottom: 1px solid #f0ebdd; }
.conn-table td:last-child { text-align: end; font-weight: 700; }
.price-big { font-size: 1.05rem; font-weight: 800; color: var(--primary-dark); direction: ltr; unicode-bidi: isolate; }
.price-unknown { color: var(--muted); font-weight: 600; font-size: .85rem; }

.sheet-actions { display: flex; gap: .6rem; margin-top: .4rem; }
.nav-choice { display: flex; gap: .5rem; margin-top: .55rem; }
.nav-choice a {
  flex: 1; height: 40px; border-radius: 20px; border: 1.5px solid #e8e0c6; background: #fff;
  color: var(--text); font-size: .82rem; font-weight: 700; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
}
.nav-choice a:active { background: var(--surface-2); }

/* ===== First-launch onboarding ===== */
.onboard {
  position: fixed; inset: 0; z-index: 3000; background: rgba(35,28,8,.45);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
  backdrop-filter: blur(3px);
}
.ob-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 22px;
  box-shadow: var(--shadow-big); padding: 1.6rem 1.3rem 1.1rem; text-align: center;
  animation: fade-in .25s ease;
}
.ob-slide { display: none; }
.ob-slide.active { display: block; animation: fade-in .25s ease; }
.ob-art { font-size: 3.4rem; line-height: 1; margin-bottom: .8rem; }
.ob-art img { width: 84px; height: 84px; }
.ob-slide h3 { font-size: 1.15rem; margin-bottom: .45rem; color: var(--primary-dark); }
.ob-slide p { color: var(--muted); font-size: .88rem; line-height: 1.55; min-height: 3.4em; }
.ob-dots { display: flex; justify-content: center; gap: .4rem; margin: .9rem 0 1rem; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: #ddd3b4; transition: all .2s; }
.ob-dots i.active { background: var(--gold); width: 22px; border-radius: 5px; }
.ob-actions { display: flex; gap: .6rem; }
.ob-actions .btn { flex: 1; height: 44px; }

/* ===== Buttons ===== */
.btn {
  height: 46px; padding: 0 1.2rem; border-radius: 23px; border: none; font-size: .95rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn-primary { background: linear-gradient(135deg, #158059, #084c37); color: #fff; flex: 1; box-shadow: 0 6px 16px rgba(8,76,55,.30); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { background: #fff7e0; color: #92400e; border: 1.5px solid #e6dbb2; }
.btn-danger { background: linear-gradient(135deg, #fb7185, #e11d48); color: #fff; flex: 1; box-shadow: 0 6px 16px rgba(225,29,72,.3); }
.btn[disabled] { opacity: .45; cursor: default; box-shadow: none; }

/* ===== Pages (prices/wallet/account) ===== */
.page { padding: 1rem 1rem 2rem; max-width: 760px; margin: 0 auto; }
.page h2 { margin-bottom: .3rem; font-size: 1.25rem; }
.page h3 { margin: 1.2rem 0 .5rem; font-size: 1rem; }

.seg { display: flex; background: #fff; border-radius: 14px; padding: 4px; margin: .9rem 0; box-shadow: var(--shadow); }
.seg-btn {
  flex: 1; height: 38px; border: none; border-radius: 11px; background: none; color: var(--muted);
  font-size: .9rem; font-weight: 700; cursor: pointer;
}
.seg-btn.active { background: linear-gradient(135deg, #158059, #0a5c42); color: #fff; }

.sort-seg { display: flex; gap: .4rem; margin: 0 0 .9rem; }
.sort-btn {
  flex: 1; height: 34px; border-radius: 17px; border: 1.5px solid #e8e0c6; background: #fff;
  color: var(--muted); font-size: .76rem; font-weight: 700; cursor: pointer;
}
.sort-btn.active { background: var(--text); color: #fff; border-color: transparent; }
.sort-speed { margin-bottom: .45rem; }
.sort-speed .sort-btn::before {
  content: ""; display: none; width: 8px; height: 8px; border-radius: 50%;
  margin-inline-end: .3rem; vertical-align: 1px;
}
.sort-speed .dot-ac::before { display: inline-block; background: var(--ac); }
.sort-speed .dot-dc::before { display: inline-block; background: var(--dc); }
.sort-speed .dot-ultra::before { display: inline-block; background: var(--ultra); }
.sort-speed .sort-btn.active::before { background: #fff; }
.price-cell.hot { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold) inset; border-radius: 12px; }

.price-card {
  background: var(--surface); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .6rem;
  box-shadow: var(--shadow);
}
.price-card .pc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.price-card .pc-name { font-weight: 800; font-size: .95rem; }
.price-card .pc-scope { color: var(--muted); font-size: .72rem; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.price-cell { background: #faf7ec; border: 1px solid #efe8d2; border-radius: 12px; padding: .45rem .5rem; text-align: center; }
.price-cell .pv { font-weight: 800; font-size: .88rem; color: var(--primary-dark); direction: ltr; unicode-bidi: isolate; }
.price-cell .pl { color: var(--muted); font-size: .66rem; margin-top: .1rem; }
.price-cell .pv.unknown { color: var(--muted); font-weight: 600; }
.pc-notes { color: var(--muted); font-size: .74rem; margin-top: .5rem; line-height: 1.45; }

/* ===== Wallet ===== */
.wallet-card {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 55%, #d97706 100%);
  border-radius: 20px; padding: 1.4rem 1.2rem; margin: 1rem 0 1.4rem; text-align: center;
  box-shadow: 0 14px 34px rgba(217,119,6,.35); position: relative; overflow: hidden;
}
.wallet-card::before {
  content: ""; position: absolute; inset: -40% 55% 30% -20%;
  background: radial-gradient(closest-side, rgba(255,255,255,.5), transparent);
}
.wallet-card::after {
  content: "⚡"; position: absolute; inset-inline-end: -6px; top: -20px; font-size: 6.4rem; opacity: .16; color: #fff;
}
.wallet-points { display: flex; align-items: center; justify-content: center; gap: .55rem; position: relative; }
#wallet-points-num { font-size: 3rem; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(146,64,14,.35); }
.wallet-points-label { color: #fff7e0; font-weight: 800; }
.wallet-value { color: #7c2d12; font-weight: 800; margin-top: .2rem; position: relative; }
.wallet-hint { color: #fff7e0; font-size: .8rem; margin-top: .8rem; line-height: 1.5; position: relative; }

.sessions-list .session-row {
  display: flex; justify-content: space-between; align-items: center; background: var(--surface);
  border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .5rem; box-shadow: var(--shadow);
}
.session-row .ss-name { font-weight: 700; font-size: .88rem; }
.session-row .ss-sub { color: var(--muted); font-size: .74rem; margin-top: .15rem; }
.session-row .ss-cost { font-weight: 800; text-align: end; direction: ltr; unicode-bidi: isolate; }
.session-row .ss-pts { color: var(--gold-deep); font-size: .78rem; font-weight: 800; display: flex; align-items: center; gap: .2rem; justify-content: flex-end; }
.empty-state { color: var(--muted); text-align: center; padding: 2rem 1rem; font-size: .9rem; line-height: 1.6; }

/* ===== Cards / fields (account) ===== */
.card { background: var(--surface); border-radius: var(--radius); padding: 1rem; margin-bottom: .9rem; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 .7rem; }
.card p { font-size: .87rem; line-height: 1.6; color: #475569; }
.field { display: block; margin-bottom: .8rem; }
.field span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.field input {
  width: 100%; height: 42px; border-radius: 10px; border: 1.5px solid #e3dabd;
  background: #fffdf6; color: var(--text); padding: 0 .8rem; font-size: .85rem; outline: none;
}
.field input:focus { border-color: var(--gold); }
.card .btn { margin-top: .2rem; }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 1500; background: rgba(120, 80, 10, .3);
  display: grid; place-items: end center;
}
.modal-box {
  width: 100%; max-width: 560px; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 1.2rem 1rem 1.4rem; max-height: 70vh; overflow-y: auto; animation: sheet-up .22s ease;
}
.modal-box h3 { margin-bottom: .8rem; }
.operator-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.operator-list .chip { background: var(--surface-3); box-shadow: none; }
.operator-list .chip.active { background: linear-gradient(135deg, #158059, #0a5c42); color: #fff; }

/* ===== Charging overlay ===== */
.charge-overlay {
  position: fixed; inset: 0; z-index: 2000; background: var(--bg);
  overflow-y: auto; animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.charge-wrap { max-width: 560px; margin: 0 auto; padding: 1.2rem 1.2rem 2.5rem; min-height: 100%; display: flex; flex-direction: column; }
.charge-top { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.charge-top h2 { font-size: 1.1rem; flex: 1; }
.btn-close { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--text); border: 1.5px solid #e3dabd; font-size: 1.1rem; cursor: pointer; }

.charge-station { background: var(--surface); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.charge-station .cs-name { font-weight: 800; }
.charge-station .cs-sub { color: var(--muted); font-size: .8rem; margin-top: .2rem; }

.conn-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.conn-btn {
  background: var(--surface); border: 2px solid #f0e6c8; border-radius: var(--radius); padding: .8rem; color: var(--text);
  cursor: pointer; text-align: center;
}
.conn-btn.active { border-color: var(--primary); background: #ecfdf5; }
.conn-btn .cb-type { font-weight: 800; }
.conn-btn .cb-kw { color: var(--muted); font-size: .78rem; margin-top: .2rem; direction: ltr; unicode-bidi: isolate; }

.qr-box {
  background: var(--surface); border-radius: var(--radius); padding: 1rem; text-align: center; margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.qr-fake {
  width: 120px; height: 120px; margin: .5rem auto; border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, #1e293b 0 8px, transparent 8px 16px),
    repeating-linear-gradient(90deg, #1e293b 0 8px, #f1f5f9 8px 16px);
  border: 8px solid #f1f5f9; box-shadow: 0 2px 10px rgba(30,41,59,.12);
}
.qr-box input {
  width: 100%; height: 44px; border-radius: 10px; border: 1.5px solid #e3dabd; background: #fffdf6;
  color: var(--text); text-align: center; font-size: 1.1rem; letter-spacing: .2em; outline: none;
}
.qr-box input:focus { border-color: var(--gold); }

/* Charging progress ring */
.ring-wrap { display: grid; place-items: center; padding: 1rem 0 .6rem; }
.ring { position: relative; width: 210px; height: 210px; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-bg { stroke: #e8e0c6; }
.ring .ring-fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-center .rc-kwh { font-size: 2rem; font-weight: 900; color: var(--primary-dark); }
.ring-center .rc-label { color: var(--muted); font-size: .75rem; }
.charge-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.stat { background: var(--surface); border-radius: 14px; padding: .6rem; text-align: center; box-shadow: var(--shadow); }
.stat .sv { font-weight: 800; font-size: .95rem; direction: ltr; unicode-bidi: isolate; }
.stat .sl { color: var(--muted); font-size: .68rem; margin-top: .15rem; }

.pulse { animation: pulse 1.6s ease infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* Receipt */
.receipt { background: var(--surface); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.receipt-row { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .9rem; border-bottom: 1px dashed #e3dabd; }
.receipt-row:last-child { border: none; }
.receipt-row.total { font-weight: 900; font-size: 1.05rem; color: var(--primary-dark); }
.receipt-points {
  background: linear-gradient(135deg, #fef3c7, #e6dbb2); border: 1.5px solid #fbbf24;
  border-radius: 12px; padding: .6rem .8rem; text-align: center; color: #92400e; font-weight: 800; margin-top: .6rem;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}

.pay-points-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; font-size: .88rem; box-shadow: var(--shadow); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 13px; background: #e2d8bc; transition: .2s; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(-20px); }
html[dir="ltr"] .switch input:checked + .track::after { transform: translateX(20px); }

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; height: var(--nav-h);
  display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(217,119,6,.12); z-index: 1200;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 14px rgba(180,130,20,.08);
}
.nav-btn {
  flex: 1; border: none; background: none; color: var(--muted); font-size: .68rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
}
.nav-btn.active { color: var(--primary-dark); }
.nav-ico { font-size: 1.25rem; }
.nav-ico .coin { width: 1.25rem; height: 1.25rem; vertical-align: middle; }

/* ===== Leaflet tweaks ===== */
.leaflet-container { font: inherit; }
.leaflet-control-attribution { background: rgba(255,255,255,.8) !important; color: var(--muted) !important; font-size: .6rem !important; }
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-control-zoom { display: none; }

/* Desktop */
@media (min-width: 900px) {
  .fab-locate { bottom: 1rem; }
  .sheet { inset-inline-start: auto; inset-inline-end: 1rem; bottom: 1rem; width: 400px; border-radius: 20px; max-height: 80%; }
  .modal { place-items: center; }
  .modal-box { border-radius: 20px; }
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 1rem); left: 50%; transform: translate(-50%, 16px);
  background: #1e293b; color: #fff; font-size: .84rem; font-weight: 700;
  padding: .6rem 1.1rem; border-radius: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; transition: all .35s ease; z-index: 3000; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Smart assistant plan ===== */
.ai-plan {
  background: linear-gradient(135deg, #fef9e7, #fdf3d3);
  border: 1.5px solid #f5d982; border-radius: 14px;
  padding: .7rem .85rem; margin-bottom: .6rem;
}
.ai-head { font-weight: 800; font-size: .82rem; color: #92400e; margin-bottom: .3rem; }
.ai-text { font-size: .82rem; line-height: 1.6; color: #713f12; }
.tsp-ai { color: #92400e !important; font-weight: 700; }

/* ===== RTL: mixed-script cells always read left-to-right ===== */
.conn-table td:nth-child(2), .conn-table td:nth-child(3) { direction: ltr; unicode-bidi: isolate; }
.pc-notes, .sheet .muted[style*="text-align:end"] { unicode-bidi: plaintext; }

/* ===== iPhone notch / home-bar safe areas ===== */
.app-header { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
.views { top: calc(var(--header-h) + env(safe-area-inset-top)); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.bottom-nav { height: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
