/* ==========================================================================
   DEEPAL CONNECT — PURE BORDERLESS AUTOMOTIVE MINIMALISM (v2 PWA)
   Zero borders anywhere. Pure tonal elevation, generous air, real S07 renders.
   ========================================================================== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;

  /* Dark Theme (Obsidian) */
  --app-bg: #0A0C10;
  --surface: #14171F;
  --surface-2: #1C202B;
  --surface-3: #252A38;
  --ink: #F5F7FA;
  --ink-2: rgba(245, 247, 250, 0.56);
  --ink-3: rgba(245, 247, 250, 0.34);
  --divider: rgba(255, 255, 255, 0.055);

  --accent-fill: #F5F7FA;
  --accent-ink: #0A0C10;

  --warm: #F59E0B;
  --warm-bg: rgba(245, 158, 11, 0.16);
  --cool: #38BDF8;
  --cool-bg: rgba(56, 189, 248, 0.16);
  --green: #34D399;
  --green-bg: rgba(52, 211, 153, 0.14);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.14);

  --card-shadow: none;
  --float-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
  --car-shadow: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.32) 48%, transparent 74%);
  --map-bg: #11151E;
  --map-block: #181D29;
  --map-road: #232A3A;
  --map-river: #131B2B;
  --cabin-tint: brightness(0.95) contrast(1.04);
  color-scheme: dark;
}

html[data-theme="light"] {
  --app-bg: #F2F4F7;
  --surface: #FFFFFF;
  --surface-2: #EAECEF;
  --surface-3: #DFE3EA;
  --ink: #101218;
  --ink-2: rgba(16, 18, 24, 0.54);
  --ink-3: rgba(16, 18, 24, 0.35);
  --divider: rgba(16, 18, 24, 0.06);

  --accent-fill: #101218;
  --accent-ink: #FFFFFF;

  --warm: #D97706;
  --warm-bg: rgba(245, 158, 11, 0.14);
  --cool: #0284C7;
  --cool-bg: rgba(14, 165, 233, 0.13);
  --green: #059669;
  --green-bg: rgba(16, 185, 129, 0.12);
  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.1);

  --card-shadow: 0 2px 14px rgba(15, 23, 42, 0.045);
  --float-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  --car-shadow: radial-gradient(ellipse at 50% 50%, rgba(15, 23, 42, 0.32) 0%, rgba(15, 23, 42, 0.1) 50%, transparent 74%);
  --map-bg: #E6EBF2;
  --map-block: #DCE2EC;
  --map-road: #FFFFFF;
  --map-river: #D1DFF0;
  --cabin-tint: brightness(1.06) contrast(0.96);
  color-scheme: light;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100dvh;
  height: 100%;
  height: 100dvh;
  background: var(--app-bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.num { font-variant-numeric: tabular-nums; }
.km-unit { font-size: 20px; font-weight: 560; }
.ink-3 { color: var(--ink-3); }
.text-green { color: var(--green); }
.row-divider-top { padding: 12px 0 0; box-shadow: inset 0 1px 0 var(--divider); }

button {
  font-family: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

/* ==========================================================================
   FULLSCREEN MOBILE PWA SHELL (100dvh + iOS Safe Area Insets)
   ========================================================================== */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.25s ease;
}

.app-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px calc(108px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}
.app-scroll::-webkit-scrollbar { display: none; }

.pane {
  display: none;
  flex-direction: column;
  gap: 13px;
}
.pane.active { display: flex; }

/* Smooth Bottom Backdrop Under Dock (prevents cards peeking below capsule) */
.dock-backdrop {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, 480px);
  height: calc(84px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    to top,
    var(--app-bg) 0%,
    var(--app-bg) 44%,
    color-mix(in srgb, var(--app-bg) 84%, transparent) 72%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 24;
  transition: background 0.25s ease;
}

/* Floating 4-Tab Capsule Navigation (Zero borders, iOS Home Indicator aware) */
.dock-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  padding: 0 20px;
  bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) - 12px));
  z-index: 25;
  pointer-events: none;
  display: flex;
  justify-content: center;
}
.dock {
  pointer-events: auto;
  width: 100%;
  height: 62px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: var(--float-shadow);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
}
.dock-btn {
  height: 50px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  transition: background 0.18s ease, color 0.18s ease;
}
.dock-btn svg { width: 20px; height: 20px; stroke-width: 1.85; }
.dock-btn span { font-size: 10px; font-weight: 580; letter-spacing: -0.01em; }
.dock-btn:hover { color: var(--ink-2); }
.dock-btn.active {
  background: var(--surface-2);
  color: var(--ink);
}

/* ==========================================================================
   COMMON BORDERLESS SURFACES & CONTROLS
   ========================================================================== */
.card {
  background: var(--surface);
  border-radius: 26px;
  padding: 17px 19px;
  box-shadow: var(--card-shadow);
  transition: background 0.25s ease;
}
.card.compact { padding: 13px 18px; }
.card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-link-btn {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 2px;
}
.page-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.back-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: var(--card-shadow);
  transition: background 0.15s ease;
}
.back-circle:hover { background: var(--surface-2); }
.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.03em;
}
.page-meta {
  font-size: 13px;
  font-weight: 540;
  color: var(--ink-2);
}

/* iOS Borderless Switch */
.sw {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-2);
  flex: none;
  transition: background 0.2s ease;
}
.sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.26);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0.25, 1);
}
.sw.on { background: var(--accent-fill); }
html[data-theme="dark"] .sw.on::after { background: #0A0C10; }
.sw.on::after { transform: translateX(20px); }
.sw.on.green { background: var(--green); }
html[data-theme="dark"] .sw.on.green::after { background: #07130E; }

/* Clean Divider-separated List Rows */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  width: 100%;
  text-align: left;
}
.list-row:first-child { padding-top: 2px; }
.list-row:last-child { padding-bottom: 2px; }
.list-row + .list-row {
  box-shadow: inset 0 1px 0 var(--divider);
}
.row-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.row-ico {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}
.row-ico svg { width: 18px; height: 18px; }
.row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.row-text b {
  font-size: 14.5px;
  font-weight: 580;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.row-text span {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chev { color: var(--ink-3); flex: none; }

/* Borderless Smooth Range Slider */
.slider-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slider-block + .slider-block {
  margin-top: 13px;
  padding-top: 13px;
  box-shadow: inset 0 1px 0 var(--divider);
}
.slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.slider-head span { font-size: 14px; font-weight: 550; color: var(--ink); }
.slider-head b { font-size: 15px; font-weight: 650; color: var(--ink); }
input[type="range"].clean-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
}
input[type="range"].clean-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-fill);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease;
}
input[type="range"].clean-range::-webkit-slider-thumb:active { transform: scale(1.1); }

/* ==========================================================================
   SCREEN 1: HOME (TESLA / LI AUTO SERENE AIRY HERO)
   ========================================================================== */
.hero-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 2px 0;
}
.hero-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hero-car-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-quiet-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 540;
  color: var(--ink-2);
  flex: none;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
.status-dot.amber { background: var(--warm); }
.status-dot.danger { background: var(--danger); }

.hero-range-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
}
.hero-km {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.hero-km-sub {
  font-size: 13px;
  font-weight: 540;
  color: var(--ink-2);
}
.thin-energy-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  gap: 3px;
}
.thin-ev {
  width: 28%;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: width 0.3s ease;
}
.thin-fuel {
  width: 56%;
  height: 100%;
  border-radius: 999px;
  background: var(--ink-3);
  transition: width 0.3s ease;
}

/* Floating Photorealistic Deepal S07 (NO CARD, PURE AIR!) */
.car-hero-float {
  position: relative;
  margin: 2px -8px 0;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.car-ground-shadow {
  position: absolute;
  bottom: 6px;
  left: 8%;
  right: 8%;
  height: 30px;
  background: var(--car-shadow);
  pointer-events: none;
}
.car-ambient-aura {
  position: absolute;
  inset: 6px 14px 16px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.car-hero-float.clim-cool .car-ambient-aura {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 52%, rgba(56, 189, 248, 0.16), transparent 68%);
}
.car-hero-float.clim-warm .car-ambient-aura {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 52%, rgba(245, 158, 11, 0.16), transparent 68%);
}
.car-hero-img {
  position: relative;
  z-index: 2;
  width: 96%;
  max-height: 162px;
  object-fit: contain;
  transition: transform 0.35s ease, filter 0.35s ease;
}
.car-hero-img.color-black { filter: brightness(0.72) contrast(1.18) saturate(0.7); }
.car-hero-img.color-white { filter: brightness(1.18) contrast(0.95) saturate(0.75); }
.car-hero-img.color-blue { filter: hue-rotate(195deg) saturate(1.35) brightness(0.94); }
.car-hero-img.color-orange { filter: sepia(0.55) hue-rotate(-18deg) saturate(2.1) brightness(0.98); }

.car-hero-float.flashing .car-hero-img {
  animation: carFlash 0.55s ease-in-out 3;
}
@keyframes carFlash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18) drop-shadow(-14px 2px 18px rgba(125, 211, 252, 0.55)); }
}

/* 4 Clean Round Tesla-Style Quick Actions */
.quick-circles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 2px 4px;
}
.q-circle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.q-circle-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.14s ease, background 0.2s ease, color 0.2s ease;
}
.q-circle-btn:active { transform: scale(0.92); }
.q-circle-btn svg { width: 22px; height: 22px; stroke-width: 1.85; }
.q-circle-btn.active {
  background: var(--accent-fill);
  color: var(--accent-ink);
}
.q-circle-btn.warm {
  background: var(--warm-bg);
  color: var(--warm);
}
.q-circle-lbl {
  font-size: 11.5px;
  font-weight: 540;
  color: var(--ink-2);
  text-align: center;
}

/* Interactive Slide-to-Unlock / Slide-to-Lock Capsule (NO BORDERS!) */
.slide-track {
  position: relative;
  height: 58px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  padding: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.slide-track.in-sheet { background: var(--surface-2); }
.slide-track:active { cursor: grabbing; }
.slide-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--surface-2);
  border-radius: 999px;
  pointer-events: none;
}
.slide-track.in-sheet .slide-fill { background: var(--surface-3); }
.slide-thumb {
  position: relative;
  z-index: 3;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
  flex: none;
}
.slide-track.dragging .slide-thumb { transition: none; }
.slide-track.unlocked .slide-thumb {
  background: var(--warm);
  color: #FFFFFF;
}
.slide-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 34px;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink-2);
  pointer-events: none;
  transition: opacity 0.12s ease;
}

/* ==========================================================================
   SCREEN 2: CLIMATE (REAL DEEPAL S07 CABIN RENDER)
   ========================================================================== */
.cabin-hero {
  position: relative;
  background: var(--surface);
  border-radius: 28px;
  height: 286px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
}
.cabin-img {
  height: 98%;
  width: auto;
  object-fit: contain;
  filter: var(--cabin-tint);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
}
.seat-glow {
  position: absolute;
  width: 68px;
  height: 92px;
  border-radius: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
  filter: blur(16px);
}
.seat-glow.fl { top: 98px; left: calc(50% - 76px); }
.seat-glow.fr { top: 98px; right: calc(50% - 76px); }
.seat-glow.heat { opacity: 0.72; background: var(--warm); }
.seat-glow.vent { opacity: 0.72; background: var(--cool); }

.cab-chip {
  position: absolute;
  padding: 7px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.cab-chip:active { transform: scale(0.94); }
.cab-chip.heat { background: var(--warm); color: #FFFFFF; }
.cab-chip.vent { background: var(--cool); color: #041524; }
.cab-chip.top-def { top: 14px; left: 50%; transform: translateX(-50%); }
.cab-chip.top-def:active { transform: translateX(-50%) scale(0.94); }
.cab-chip.wheel { top: 64px; left: 16px; }
.cab-chip.seat-l { top: 142px; left: 14px; }
.cab-chip.seat-r { top: 142px; right: 14px; }
.cab-chip.rear-def { bottom: 14px; left: 50%; transform: translateX(-50%); }
.cab-chip.rear-def:active { transform: translateX(-50%) scale(0.94); }

.temp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.temp-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 24px;
  font-weight: 380;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.15s ease;
}
.temp-btn:active { transform: scale(0.92); background: var(--surface-3); }
.temp-big {
  font-size: 40px;
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1;
}
.mode-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mode-pill {
  padding: 11px 8px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.16s ease;
}
.mode-pill.on { background: var(--accent-fill); color: var(--accent-ink); }
.mode-pill.cool.on { background: var(--cool-bg); color: var(--cool); }
.mode-pill.warm.on { background: var(--warm-bg); color: var(--warm); }

/* ==========================================================================
   SCREEN 3: CHARGING
   ========================================================================== */
.charge-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 11px;
}
.charge-pct {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.charge-eta {
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.35;
}
.charge-bar-bg {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 13px;
}
.charge-bar-fill {
  height: 100%;
  width: 64%;
  border-radius: 999px;
  background: var(--green);
  transition: background 0.25s ease, width 0.3s ease;
}
.charge-bar-fill.paused { background: var(--ink-3); }

.action-pill-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.12s ease;
}
.action-pill-btn:active { transform: scale(0.98); }
.action-pill-btn.primary { background: var(--accent-fill); color: var(--accent-ink); }
.action-pill-btn.danger { background: var(--danger-bg); color: var(--danger); }
.two-col-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.two-col-btns.tight { margin-top: 4px; }

.metrics-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.m3-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.m3-cell b { font-size: 17px; font-weight: 680; letter-spacing: -0.02em; }
.m3-cell span { font-size: 11.5px; color: var(--ink-2); }

/* ==========================================================================
   SCREEN 4: STATUS, TPMS & MAP (REAL TOP-DOWN S07)
   ========================================================================== */
.tpms-grid {
  display: grid;
  grid-template-columns: 1fr 118px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.tpms-side {
  display: flex;
  flex-direction: column;
  gap: 44px;
}
.tpms-side.right { text-align: right; }
.wheel-val {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wheel-val b { font-size: 18px; font-weight: 680; letter-spacing: -0.02em; }
.wheel-val span { font-size: 12.5px; color: var(--ink-2); }
.tpms-car-img {
  width: 104px;
  height: auto;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}
.contour-summary {
  margin-top: 14px;
  padding-top: 14px;
  box-shadow: inset 0 1px 0 var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-2);
}
.contour-summary b { color: var(--ink); font-weight: 600; }

.map-card {
  padding: 0;
  overflow: hidden;
}
.map-canvas {
  position: relative;
  height: 152px;
  background: var(--map-bg);
}
.map-canvas > svg { width: 100%; height: 100%; display: block; }
.map-body {
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.map-addr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.soft-pill {
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.soft-pill.primary { background: var(--accent-fill); color: var(--accent-ink); }

/* ==========================================================================
   SCREEN 5: CAMERAS 360 & SENTRY
   ========================================================================== */
.cam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cam-tile {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 9.2;
  background: #0D1119;
  transition: transform 0.14s ease, opacity 0.18s ease;
}
.cam-tile:active { transform: scale(0.96); }
.cam-tile svg { width: 100%; height: 100%; display: block; }
.cam-tile-lbl {
  position: absolute;
  left: 10px;
  bottom: 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: #F5F7FA;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cam-sel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}
.cam-tile.selected .cam-sel-dot { background: #FFFFFF; }
.cam-tile:not(.selected) { opacity: 0.72; }
.cam-caption {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
}

/* ==========================================================================
   SCREEN 6: PRIVACY (E2EE), GARAGE & SETTINGS
   ========================================================================== */
.privacy-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.privacy-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.privacy-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--green-bg);
  color: var(--green);
  display: grid;
  place-items: center;
  flex: none;
}
.privacy-ico.pending {
  background: var(--warm-bg);
  color: var(--warm);
}
.privacy-hero p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.seg-inline {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  gap: 2px;
  flex: none;
}
.seg-inline button {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}
.seg-inline button.active {
  background: var(--accent-fill);
  color: var(--accent-ink);
}
.text-action {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--danger-bg);
}
.text-action.restore {
  color: var(--ink);
  background: var(--surface-2);
}

/* ==========================================================================
   TOAST & MODAL SHEETS (Borderless, Safe Area Aware)
   ========================================================================== */
.toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  width: max-content;
  max-width: min(calc(100% - 40px), 360px);
  z-index: 60;
  background: var(--accent-fill);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
html[data-theme="light"] .toast {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.sheet-bg.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.sheet {
  width: 100%;
  max-width: 448px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 30px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--float-shadow);
  transform: translateY(24px);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }
.sheet-bg.open .sheet { transform: translateY(0); }
.sheet h3 { margin: 0; font-size: 18px; font-weight: 680; letter-spacing: -0.02em; }
.sheet p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

.qr-card {
  align-self: center;
  width: 156px;
  height: 156px;
  border-radius: 20px;
  background: #FFFFFF;
  padding: 12px;
  display: grid;
  place-items: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.field-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  user-select: text;
  -webkit-user-select: text;
}
.field-input::placeholder { color: var(--ink-3); }
textarea.field-input {
  min-height: 74px;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 11.5px;
  line-height: 1.4;
}
.mono-pill {
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 11.5px;
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
}

.color-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: relative;
  transition: transform 0.14s ease;
}
.color-dot:active { transform: scale(0.92); }
.color-dot.active {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-fill);
}
.color-dot.c-silver { background: linear-gradient(145deg, #D5DAE2, #8B93A1); }
.color-dot.c-black  { background: linear-gradient(145deg, #2D323E, #0B0D12); }
.color-dot.c-white  { background: linear-gradient(145deg, #FFFFFF, #D8DEE9); }
.color-dot.c-blue   { background: linear-gradient(145deg, #3B82F6, #1D4ED8); }
.color-dot.c-orange { background: linear-gradient(145deg, #FB923C, #C2410C); }

/* ==========================================================================
   EXTENDED BORDERLESS CONTROLS (WINDOWS, SCHEDULES, DTC, SENTRY SENSITIVITY)
   ========================================================================== */
.seg-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  gap: 2px;
  width: 100%;
}
.seg-full button {
  padding: 8px 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}
.seg-full button.active {
  background: var(--accent-fill);
  color: var(--accent-ink);
}

.sentry-sens-wrap {
  margin-top: 10px;
  padding-top: 12px;
  box-shadow: inset 0 1px 0 var(--divider);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sentry-sens-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 560;
  color: var(--ink-2);
}

.row-tap-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.contour-pills {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.contour-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 580;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.contour-pill.on {
  background: var(--green-bg);
  color: var(--green);
}
.contour-pill.warn {
  background: var(--warm-bg);
  color: var(--warm);
}
.contour-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.sheet-group {
  background: var(--surface-2);
  border-radius: 20px;
  padding: 6px 14px;
}
.sheet-group .list-row {
  padding: 10px 0;
}
.sheet-group .seg-inline {
  background: var(--surface);
}
.sheet-group .sw {
  background: var(--surface-3);
}
.sheet-group .sw.on {
  background: var(--accent-fill);
}

.win-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
}
.win-row + .win-row {
  box-shadow: inset 0 1px 0 var(--divider);
}
.win-lbl {
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink);
  white-space: nowrap;
}
.seg-inline.win-seg button {
  padding: 5px 8px;
  font-size: 10.5px;
}

.day-pills {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day-pill {
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.day-pill:active { transform: scale(0.93); }
.day-pill.active {
  background: var(--accent-fill);
  color: var(--accent-ink);
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stepper-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.step-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  font-weight: 450;
  display: grid;
  place-items: center;
}
.step-mini:active { transform: scale(0.92); }
.step-val {
  min-width: 42px;
  text-align: center;
  font-size: 14.5px;
  font-weight: 640;
}

.dtc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}
.dtc-row + .dtc-row {
  box-shadow: inset 0 1px 0 var(--divider);
}
.dtc-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green);
  white-space: nowrap;
}
.dtc-badge.warn {
  background: var(--danger-bg);
  color: var(--danger);
}
.dtc-meta {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}
.card.tappable {
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}
.card.tappable:active { transform: scale(0.985); }

/* ==========================================================================
   PULL-TO-REFRESH & BORDERLESS REFRESH BUTTON
   ========================================================================== */
@keyframes dc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ptr-indicator {
  height: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 540;
  transition: height 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  margin-top: -6px;
}
.ptr-indicator.pulling {
  transition: none;
}
.ptr-indicator.refreshing {
  height: 36px;
  opacity: 1;
}
.ptr-spinner {
  width: 15px;
  height: 15px;
  flex: none;
  transition: transform 0.16s ease;
}
.ptr-indicator.ready .ptr-spinner {
  transform: rotate(180deg);
}
.ptr-indicator.refreshing .ptr-spinner {
  animation: dc-spin 0.8s linear infinite;
}

.hero-status-group,
.page-top-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.hero-car-title {
  min-width: 0;
}
.page-top-left {
  min-width: 0;
}
.page-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.refresh-ico-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--card-shadow);
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.refresh-ico-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.refresh-ico-btn:active {
  transform: scale(0.92);
}
.refresh-ico-btn svg {
  width: 15px;
  height: 15px;
}
.refresh-ico-btn.spinning {
  color: var(--ink);
}
.refresh-ico-btn.spinning svg {
  animation: dc-spin 0.8s linear infinite;
}

.hero-updated-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  min-height: 0;
  line-height: 1.3;
  margin-top: 2px;
}
.hero-updated-meta:empty {
  display: none;
}

.sheet-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
  margin: -2px 2px 2px;
}

/* ==========================================================================
   ONBOARDING OVERLAYS (WELCOME / PAIRING + iOS SAFARI INSTALL) — ZERO BORDERS
   ========================================================================== */
.settings-exit-btn {
  margin-top: 2px;
}

.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--app-bg);
  display: flex;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease, background 0.25s ease;
}
.onboard-overlay.install-overlay {
  z-index: 45;
}
.onboard-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.onboard-inner {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 22px calc(max(20px, env(safe-area-inset-bottom, 0px)) + 10px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  overflow-y: auto;
  scrollbar-width: none;
}
.onboard-inner::-webkit-scrollbar { display: none; }

.onboard-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.welcome-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 8px 0;
}
.welcome-car-stage {
  position: relative;
  width: 100%;
  height: 186px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-car-img {
  position: relative;
  z-index: 2;
  width: 96%;
  max-height: 176px;
  object-fit: contain;
}
.welcome-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}
.welcome-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.welcome-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
}
.welcome-title {
  margin: 0;
  font-size: 28px;
  font-weight: 720;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.welcome-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: -0.01em;
}
.welcome-desc {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.onboard-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.onboard-btn {
  padding: 15px 18px;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 620;
}

/* iOS Safari Install Screen */
.install-inner {
  justify-content: space-between;
}
.install-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}
.install-logo {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--float-shadow);
  margin-bottom: 4px;
}
.install-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.install-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.install-desc {
  margin: 0;
  max-width: 310px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 18px;
  margin-bottom: auto;
}
.install-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}
.install-step + .install-step {
  box-shadow: inset 0 1px 0 var(--divider);
}
.install-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.install-step-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}
.install-step-ico svg {
  width: 19px;
  height: 19px;
}
.install-step .row-text span {
  white-space: normal;
  line-height: 1.35;
}

.install-skip-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 15px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 560;
  text-align: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.install-skip-btn:active {
  background: var(--surface);
  color: var(--ink);
}
