/* ============================================================================
   Cloud Sim SuperApp — Premium Light
   One family (IBM Plex Sans Arabic, bundled), porcelain ground, graphite ink,
   Gulf-teal accent reserved for "on" states. Logical properties for RTL/LTR.
   ============================================================================ */

@font-face { font-family: "Plex"; src: url("fonts/plex-arabic-400.woff2") format("woff2"); font-weight: 400; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-arabic-500.woff2") format("woff2"); font-weight: 500; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-arabic-600.woff2") format("woff2"); font-weight: 600; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-arabic-700.woff2") format("woff2"); font-weight: 700; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-latin-400.woff2") format("woff2"); font-weight: 400; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-latin-500.woff2") format("woff2"); font-weight: 500; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-latin-600.woff2") format("woff2"); font-weight: 600; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-latin-700.woff2") format("woff2"); font-weight: 700; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; font-display: swap; }

:root {
  --paper: #EEF0F1;
  --surface: #FFFFFF;
  --sunk: #E4E7E9;
  --ink: #16191D;
  --ink-2: #3A3F45;
  --muted: #6B7178;
  --faint: #9AA0A6;
  --line: #DADDE0;
  --line-soft: #E9EBED;
  --accent: #0B7A75;
  --accent-soft: #E1F1EF;
  --warn: #B45309;
  --warn-soft: #FBEEDD;
  --bad: #B42318;
  --bad-soft: #FBE7E5;
  --good: #1F7A4D;

  --r-group: 18px;
  --r-surface: 26px;
  --r-sheet: 28px;

  --t-hero: 34px;
  --t-title: 26px;
  --t-h: 17px;
  --t-body: 15px;
  --t-small: 13px;
  --t-tiny: 11.5px;

  --btn-bg: #16191D;
  --btn-fg: #FFFFFF;
  --ev: #0E9FBF;
  --nav-bg: rgba(255, 255, 255, .92);
  --sheet-bg: #EEF0F1;
  --toast-bg: #16191D;
  --floor: #E6E9EB;
  --shadow-car: rgba(22, 25, 29, .22);

  --nav-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--t-body);
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 18px; height: 18px; }
.ic-lg { width: 26px; height: 26px; }
[dir="rtl"] .flip { transform: scaleX(-1); }

.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* -------------------------------------------------------------------------- */
/* Shell                                                                       */
/* -------------------------------------------------------------------------- */
.app { height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 28px);
}
.scroll::-webkit-scrollbar { display: none; }

/* Bottom navigation — Fixed, Right-to-Left, Flush to Bottom with Zero Gap */
.nav,
.nav.sr-pill-nav {
  position: fixed;
  left: 0;
  right: 0;
  inset-inline: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding: 4px 8px env(safe-area-inset-bottom, 0px);
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg2, #0d1220) 96%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(22px);
  backdrop-filter: saturate(1.8) blur(22px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.36);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  direction: rtl;
  z-index: 45;
}
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: var(--t-tiny); font-weight: 500; }
.nav-item.active { color: var(--ink); }
.nav-item.active .ic { stroke-width: 2.2; }
.nav-item .cn { margin: 0; font-size: 9.5px; }

/* Original-language reference labels: hidden unless the owner turns them on */
.cn { display: none; color: var(--faint); font-size: var(--t-tiny); font-weight: 400; margin-top: 1px; }
body.show-cn .cn { display: block; }
body.show-cn span.cn.inline { display: inline; margin-inline-start: 6px; }

/* -------------------------------------------------------------------------- */
/* Top bar (Home)                                                              */
/* -------------------------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.car-switch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 600; font-size: var(--t-small); max-width: 62%;
}
[dir="rtl"] .car-switch { padding: 6px 6px 6px 12px; }
.car-switch img { width: 26px; height: 26px; border-radius: 8px; }
.car-switch span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-switch .ic { width: 16px; height: 16px; color: var(--muted); }
.ver-pill { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); letter-spacing: 0.01em; flex: none; }

.conn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--t-small); font-weight: 600; color: var(--ink-2); white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px rgba(31, 122, 77, .14); }
.dot.wait { background: var(--warn); }
.dot.off { background: var(--bad); }

/* -------------------------------------------------------------------------- */
/* Hero                                                                        */
/* -------------------------------------------------------------------------- */
.hero { padding-top: 14px; }
.hero-brand { font-size: var(--t-small); color: var(--muted); font-weight: 500; }
.hero-model { font-size: var(--t-hero); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
[dir="rtl"] .hero-model { letter-spacing: 0; line-height: 1.2; }
.hero-state { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--ink-2); font-size: var(--t-small); font-weight: 500; flex-wrap: wrap; }
.hero-state .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.hero-state .lockstate { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.hero-state .lockstate.open { color: var(--warn); }
.hero-state .ic { width: 16px; height: 16px; }

.stage { position: relative; margin: 4px -18px 0; height: 262px; }
.stage::before { /* showroom floor */
  content: ""; position: absolute; inset-inline: 0; bottom: 18px; height: 46%;
  background: linear-gradient(180deg, transparent 0%, var(--floor) 62%, var(--floor) 78%, transparent 100%);
}
.stage .cs-car { position: absolute; inset: 0 0 0 0; color: var(--ink-2); }
.stage .cs-stage { bottom: 30px; }
.stage .cs-nav { background: var(--sunk); }
.stage .cs-nav button.on { background: var(--surface); color: var(--ink); opacity: 1; }
.stage-note { position: absolute; bottom: 8px; inset-inline-end: 18px; font-size: 10.5px; color: var(--faint); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 22px; }
.stat { padding: 0 12px; border-inline-start: 1px solid var(--line); }
.stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stat-v { font-size: 22px; font-weight: 600; line-height: 1.1; }
.stat-v small { font-size: var(--t-small); font-weight: 500; color: var(--muted); margin-inline-start: 2px; }
.stat-l { font-size: var(--t-tiny); color: var(--muted); margin-top: 3px; }
.bar { height: 3px; border-radius: 3px; background: var(--sunk); margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.bar.ev i { background: var(--ev); }

/* Primary round actions */
.primary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 22px; }
@media (max-width: 390px) { .primary { grid-template-columns: repeat(3, 1fr); row-gap: 12px; } }
.pa { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); text-align: center; line-height: 1.2; }
.pa-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink);
  transition: transform .15s var(--ease), background .2s, color .2s;
}
.pa:active .pa-btn { transform: scale(.94); }
.pa.on .pa-btn { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.pa.warn .pa-btn { background: var(--warn-soft); color: var(--warn); border-color: #F1D3AE; }
.pa.danger .pa-btn { background: var(--bad-soft); color: var(--bad); border-color: rgba(217, 45, 32, .35); }
.pa-sub { font-size: var(--t-tiny); color: var(--muted); margin-top: -6px; }

/* -------------------------------------------------------------------------- */
/* Climate surface                                                             */
/* -------------------------------------------------------------------------- */
.surface { background: var(--surface); border-radius: var(--r-surface); padding: 18px; margin-bottom: 22px; }
.clim-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clim-label { font-weight: 600; font-size: var(--t-h); }
.clim-sub { font-size: var(--t-small); color: var(--muted); }
.clim-dial { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 16px; }
.step-btn { width: 52px; height: 52px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; color: var(--ink); }
.step-btn:active { background: var(--sunk); }
.temp { font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
.temp sup { font-size: 22px; font-weight: 500; vertical-align: top; position: relative; top: 6px; margin-inline-start: 2px; }
.temp.off { color: var(--faint); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; font-size: var(--t-small); font-weight: 500;
  background: var(--paper); color: var(--ink-2);
}
.chip .ic { width: 16px; height: 16px; }
.chip.on { background: var(--accent); color: #fff; }

/* Switch */
.switch { display: inline-block; vertical-align: middle; width: 50px; height: 30px; border-radius: 999px; background: var(--sunk); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
[dir="rtl"] .switch.on::after { transform: translateX(-20px); }

/* -------------------------------------------------------------------------- */
/* Grouped lists                                                               */
/* -------------------------------------------------------------------------- */
.page-title { font-size: var(--t-title); font-weight: 700; letter-spacing: -0.01em; margin: 6px 0 4px; }
[dir="rtl"] .page-title { letter-spacing: 0; }
.page-sub { color: var(--muted); font-size: var(--t-small); margin-bottom: 20px; }

.group-h { font-size: var(--t-small); font-weight: 600; color: var(--muted); margin: 0 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.group-h button { color: var(--accent); font-weight: 600; font-size: var(--t-small); }
.group { background: var(--surface); border-radius: var(--r-group); margin-bottom: 22px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; min-height: 58px; width: 100%; text-align: start; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; inset-inline-start: 62px; inset-inline-end: 0; height: 1px; background: var(--line-soft); }
.row.plain + .row.plain::before { inset-inline-start: 16px; }
button.row:active { background: #F6F7F8; }
.row-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.row-ic .ic { width: 18px; height: 18px; }
.row.on .row-ic { background: var(--accent-soft); color: var(--accent); }
.row.warn .row-ic { background: var(--warn-soft); color: var(--warn); }
.row-main { flex: 1; min-width: 0; }
.row-t { font-weight: 500; }
.row-s { font-size: var(--t-small); color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.row-v { font-size: var(--t-small); color: var(--muted); font-weight: 500; white-space: nowrap; }
.row-v.on { color: var(--accent); }
.row-v.warn { color: var(--warn); }
.row .chev { width: 18px; height: 18px; color: var(--faint); }
.row-mono { font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: end; word-break: break-all; max-width: 58%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; font-weight: 600;
  background: var(--btn-bg); color: var(--btn-fg);
}
.btn:active { opacity: .85; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.soft { background: var(--paper); color: var(--ink); }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: var(--t-small); }
.btn.danger { color: var(--bad); }
.btn .ic { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

/* Segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sunk); border-radius: 12px; padding: 3px; margin-bottom: 20px; }
.seg button { padding: 8px 4px; border-radius: 9px; font-size: var(--t-small); font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Notices */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: var(--t-small); margin-bottom: 14px; background: var(--accent-soft); color: #0A4F4B; }
.notice.warn { background: var(--warn-soft); color: #7A3A06; }
.notice.bad { background: var(--bad-soft); color: #7A1A12; }
.notice .ic { width: 18px; height: 18px; margin-top: 1px; }
.empty { text-align: center; color: var(--muted); font-size: var(--t-small); padding: 26px 20px; }
.empty .ic { width: 30px; height: 30px; color: var(--faint); margin-bottom: 8px; }

.tag { font-size: var(--t-tiny); font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.tag.on { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.off { background: var(--bad-soft); color: var(--bad); }

/* File rows */
.file { padding: 14px 16px; }
.file + .file { border-top: 1px solid var(--line-soft); }
.file-head { display: flex; gap: 12px; align-items: flex-start; }
.file-name { font-weight: 500; word-break: break-all; direction: ltr; unicode-bidi: isolate; text-align: start; }
.file-meta { font-size: var(--t-small); color: var(--muted); }
.file-actions { display: flex; gap: 8px; margin-top: 12px; padding-inline-start: 46px; }
.file-actions .btn { flex: 1; }
.file-actions .btn.icon-only { flex: none; width: 36px; padding: 0; }

/* Connection hero (Status) */
.conn-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.conn-big { font-size: var(--t-title); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.conn-big .dot { width: 12px; height: 12px; }
.conn-meta { font-size: var(--t-small); color: var(--muted); margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: var(--r-group); padding: 16px 0; margin-bottom: 22px; }
.kpi { padding: 0 14px; border-inline-start: 1px solid var(--line-soft); }
.kpi:first-child { border-inline-start: 0; }
.kpi-v { font-size: 20px; font-weight: 600; }
.kpi-v small { font-size: var(--t-tiny); color: var(--muted); font-weight: 500; margin-inline-start: 2px; }
.kpi-l { font-size: var(--t-tiny); color: var(--muted); }

/* Profile */
.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); display: grid; place-items: center; font-size: 22px; font-weight: 600; flex: none; }
.profile-n { font-size: 20px; font-weight: 700; }
.profile-s { font-size: var(--t-small); color: var(--muted); }

.mini-seg { display: inline-grid; grid-auto-flow: column; background: var(--sunk); border-radius: 9px; padding: 2px; }
.mini-seg button { padding: 5px 12px; border-radius: 7px; font-size: var(--t-small); font-weight: 500; color: var(--ink-2); }
.mini-seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; }

.foot { text-align: center; color: var(--faint); font-size: var(--t-tiny); margin-top: 6px; }

/* -------------------------------------------------------------------------- */
/* Toast                                                                       */
/* -------------------------------------------------------------------------- */
.toast {
  position: absolute; inset-inline: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  background: var(--toast-bg); color: #fff; border-radius: 14px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; font-size: var(--t-small); font-weight: 500;
  box-shadow: 0 10px 30px rgba(22, 25, 29, .25);
  transform: translateY(16px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease); z-index: 200;
}
.toast.visible { transform: none; opacity: 1; }
.toast .ic { width: 18px; height: 18px; color: #7FD6CF; }
.toast.warn .ic { color: #F5B26B; }

/* -------------------------------------------------------------------------- */
/* Bottom sheet                                                                */
/* -------------------------------------------------------------------------- */
.backdrop { position: absolute; inset: 0; background: rgba(22, 25, 29, .38); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 50; display: flex; align-items: flex-end; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-height: 90%; overflow-y: auto; background: var(--sheet-bg);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
  transform: translateY(40px); transition: transform .3s var(--ease);
}
.backdrop.open .sheet { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-t { font-size: 20px; font-weight: 700; }
.sheet-s { font-size: var(--t-small); color: var(--muted); }
.close { width: 34px; height: 34px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; flex: none; }
.close .ic { width: 18px; height: 18px; }

.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.seat { background: var(--surface); border-radius: 16px; padding: 14px; }
.seat-n { font-weight: 600; margin-bottom: 10px; }
.levels { display: flex; gap: 6px; }
.lvl { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; border-radius: 10px; background: var(--paper); font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
.lvl .ic { width: 16px; height: 16px; }
.lvl.cool { background: #DDEFFB; color: #0B5C8A; }
.lvl.heat { background: #FBE3DA; color: #A13A12; }

.field { width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: var(--t-body); direction: ltr; user-select: text; margin-bottom: 12px; }
.field-l { font-size: var(--t-small); font-weight: 600; color: var(--ink-2); margin: 0 2px 6px; display: block; }

.cam { background: #15181B; color: #C9CED3; border-radius: 18px; aspect-ratio: 16 / 10; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 14px; margin-bottom: 14px; font-size: var(--t-small); }
.cam-top { display: flex; justify-content: space-between; }
.cam-mid { text-align: center; color: #8A9097; }
.cam-live { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; }
.cam-live .dot { background: #E5484D; }

.rpa-read { text-align: center; padding: 18px; background: var(--surface); border-radius: 18px; margin-bottom: 14px; }
.rpa-num { font-size: 40px; font-weight: 300; }
.rpa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.post { padding: 16px; }
.post + .post { border-top: 1px solid var(--line-soft); }
.post-a { font-weight: 600; }
.post-c { font-size: var(--t-small); color: var(--muted); }
.post-t { font-weight: 600; margin: 8px 0 4px; }
.post-b { font-size: var(--t-small); color: var(--ink-2); }

.dict { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.dict + .dict { border-top: 1px solid var(--line-soft); }
.dict-cn { font-size: 18px; font-weight: 600; }
.dict-tr { color: var(--ink-2); text-align: end; }

/* -------------------------------------------------------------------------- */
/* Sign-in & pairing                                                           */
/* -------------------------------------------------------------------------- */
.auth { position: absolute; inset: 0; z-index: 80; background: var(--paper); overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px 30px; display: none; }
.auth.visible { display: block; }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--t-h); }
.auth-logo img { width: 40px; height: 40px; border-radius: 12px; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--ink); }
.auth-step { font-size: var(--t-small); color: var(--muted); font-weight: 500; }
.auth-title { font-size: var(--t-title); font-weight: 700; margin: 4px 0 8px; line-height: 1.2; }
.auth-sub { color: var(--muted); margin-bottom: 26px; }
.scanner { position: relative; aspect-ratio: 1; max-width: 300px; margin: 0 auto 22px; border-radius: 28px; overflow: hidden; background: #15181B; display: grid; place-items: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: relative; width: 62%; aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 999px rgba(21, 24, 27, .45); border: 2px solid rgba(255, 255, 255, .9); }
.scanner .hint { position: absolute; bottom: 14px; inset-inline: 14px; text-align: center; color: #fff; font-size: var(--t-small); font-weight: 500; }
.code-field { text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .12em; }
.welcome-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.welcome-item { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px; }
.welcome-num { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; margin-top: 2px; }
.welcome-t { font-weight: 600; font-size: var(--t-body); margin-bottom: 3px; color: var(--ink); }
.welcome-d { font-size: var(--t-small); color: var(--muted); line-height: 1.45; }
.zk-badge { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid rgba(15, 118, 110, .2); color: var(--ink); font-size: var(--t-small); line-height: 1.45; margin-bottom: 18px; }
.zk-badge .ic { color: var(--accent); flex: none; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (min-width: 640px) {
  .scroll { padding-inline: calc((100% - 560px) / 2); }
  .stage { margin-inline: 0; }
}

/* -------------------------------------------------------------------------- */
/* Dark theme: obsidian / titanium glass, amber-gold "on", cyan EV            */
/* -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  --paper: #0B0D10;
  --surface: rgba(28, 32, 38, .78);
  --sunk: #23282F;
  --ink: #ECEEF0;
  --ink-2: #C3C8CE;
  --muted: #8E959D;
  --faint: #626A73;
  --line: #2C3138;
  --line-soft: #22272D;
  --accent: #D9A441;
  --accent-soft: rgba(217, 164, 65, .16);
  --warn: #F0A04B;
  --warn-soft: rgba(240, 160, 75, .14);
  --bad: #F2675C;
  --bad-soft: rgba(242, 103, 92, .14);
  --good: #3CC6A0;
  --btn-bg: #ECEEF0;
  --btn-fg: #0B0D10;
  --ev: #3CC6E0;
  --nav-bg: rgba(16, 19, 23, .78);
  --sheet-bg: #111418;
  --toast-bg: #23282F;
  --floor: #1C2026;
  --shadow-car: rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root[data-theme="dark"] body {
  background: radial-gradient(120% 60% at 50% 0%, #1A1F26 0%, #0B0D10 60%);
}
:root[data-theme="dark"] .surface,
:root[data-theme="dark"] .group,
:root[data-theme="dark"] .kpis,
:root[data-theme="dark"] .seat-row,
:root[data-theme="dark"] .tire {
  border: 1px solid rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
:root[data-theme="dark"] .stage::after { /* soft key light behind the car */
  content: ""; position: absolute; inset: 10% 8% 0; z-index: 0;
  background: radial-gradient(50% 55% at 50% 60%, rgba(217, 164, 65, .10), rgba(60, 198, 224, .05) 55%, transparent 75%);
}
:root[data-theme="dark"] .stage > * { z-index: 1; }
:root[data-theme="dark"] .chip.on { color: #0B0D10; }
:root[data-theme="dark"] .pa.warn .pa-btn { border-color: rgba(240, 160, 75, .35); }
:root[data-theme="dark"] .car-switch, :root[data-theme="dark"] .conn, :root[data-theme="dark"] .pa-btn, :root[data-theme="dark"] .btn.ghost { border-color: var(--line); }
:root[data-theme="dark"] .notice { color: #F3D9A4; }
:root[data-theme="dark"] .notice.warn { color: #F7C995; }
:root[data-theme="dark"] .notice.bad { color: #F8B4AE; }
:root[data-theme="dark"] .lvl-group.cool button.on { background: #1E4C63; color: #BFEAF6; }
:root[data-theme="dark"] .lvl-group.heat button.on { background: #5A2A1C; color: #FFD2C2; }
:root[data-theme="dark"] .switch::after { background: #F4F5F6; }

/* -------------------------------------------------------------------------- */
/* v3.2 components                                                            */
/* -------------------------------------------------------------------------- */
.pending { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: var(--t-small); font-weight: 500; }
.pending .ic { width: 16px; height: 16px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fan-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; }
.fan-l { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-small); color: var(--muted); font-weight: 500; flex: none; }
.fan-ctrl { flex: 1; display: flex; align-items: center; gap: 8px; direction: ltr; }
.fan-step-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line-soft); display: grid; place-items: center; color: var(--ink); flex: none; }
.fan-step-btn:active { background: var(--sunk); transform: scale(.93); }
.fan-step-btn .ic { width: 15px; height: 15px; }
.fan-steps { flex: 1; display: flex; align-items: flex-end; gap: 5px; height: 32px; direction: ltr; }
.fan-steps button { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.fan-steps i { display: block; width: 100%; border-radius: 4px; background: var(--sunk); transition: background .2s; }
.fan-steps button.on i { background: var(--accent); }
.fan-v { min-width: 30px; text-align: center; font-weight: 600; font-size: var(--t-small); direction: ltr; }

.clim-dial.small { margin: 12px 0 0; }
.clim-dial.small .temp { font-size: 40px; font-weight: 400; }

.kpis.four { grid-template-columns: repeat(4, 1fr); padding: 14px 0; }
.kpis.four .kpi { padding: 0 10px; }
.kpis.four .kpi-v { font-size: 17px; }

.row-ic.mono { color: #fff; font-weight: 700; font-size: var(--t-small); }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: start; }
[dir="rtl"] .ltr { text-align: end; }

.toast.warn .ic { color: #F5B26B; }
.toast.sleep .ic { color: #B9C3FF; }
.toast.wait .ic { color: #7FD6CF; animation: spin 1s linear infinite; }

/* Tyres (always physical vehicle orientation: FL/RL on left, FR/RR on right) */
.tires { display: grid; grid-template-columns: 1fr 56px 1fr; grid-template-rows: auto auto; gap: 10px; margin-bottom: 22px; align-items: center; direction: ltr; }
[dir="rtl"] .tire { direction: rtl; }
.tires .tire.fl { grid-column: 1; grid-row: 1; } .tires .tire.fr { grid-column: 3; grid-row: 1; }
.tires .tire.rl { grid-column: 1; grid-row: 2; } .tires .tire.rr { grid-column: 3; grid-row: 2; }
.tires-car { grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; color: var(--faint); }
.tire { background: var(--surface); border-radius: 16px; padding: 12px 14px; }
.tire-v { font-size: 20px; font-weight: 600; }
.tire-v small { font-size: var(--t-tiny); color: var(--muted); font-weight: 500; margin-inline-start: 3px; }
.tire-l { font-size: var(--t-tiny); color: var(--muted); }
.tire.low .tire-v { color: var(--warn); }

/* Seats sheet */
.seat-row { display: grid; grid-template-columns: 1fr; gap: 8px; background: var(--surface); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
[dir="rtl"] .seat-row { direction: rtl; }
.seat-row .seat-n { font-weight: 600; margin: 0; }
.lvl-group { display: flex; align-items: center; gap: 6px; }
.lvl-group > span { width: 28px; display: grid; place-items: center; color: var(--muted); }
.lvl-group button { flex: 1; min-height: 40px; border-radius: 10px; background: var(--paper); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lvl-group.cool button.on { background: #DDEFFB; color: #0B5C8A; }
.lvl-group.heat button.on { background: #FBE3DA; color: #A13A12; }

.surface.tight { padding: 14px; margin-bottom: 14px; }
.surface.tight .seg { margin-bottom: 14px; }
.surface.tight .seg:last-child { margin-bottom: 0; }

/* Window slider */
.topview { display: block; width: 100%; max-width: 320px; margin: 0 auto 14px; }
.topview .tv-t { font: 500 11px "Plex", system-ui, sans-serif; fill: var(--ink-2); }
.topview .tv-n { font: 600 11px "Plex", system-ui, sans-serif; fill: var(--ink-2); }
.topview .tv-s { font: 500 10px "Plex", system-ui, sans-serif; fill: var(--muted); }
.topview .tv-i { font: 700 12px system-ui, sans-serif; fill: #fff; }
.slider-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; margin: 0; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--sunk); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--btn-bg); margin-top: -10px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.range::-moz-range-track { height: 6px; border-radius: 6px; background: var(--sunk); }
.range::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--btn-bg); }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.presets .chip { justify-content: center; padding: 9px 4px; flex-direction: column; gap: 0; line-height: 1.25; }
.presets .chip .num { font-size: var(--t-tiny); opacity: .75; }
.presets.wide { grid-template-columns: repeat(3, 1fr); margin: 0 0 18px; }
.presets.wide .chip { flex-direction: row; }
.presets.wide .chip .ic { margin-inline-end: 6px; }
.auth-mode-seg { margin: 6px 0 16px; }
.auth-mode-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px; }
.auth-mode-seg button .ic { width: 16px; height: 16px; }

/* Drive modes */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-soft); font-weight: 500; font-size: var(--t-small); color: var(--ink-2); }
.mode.on { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }

.sheet .chip:not(.on) { background: var(--surface); }
:root[data-theme="dark"] .sheet .chip:not(.on) { background: var(--sunk); }
:root[data-theme="dark"] .stage .cs-nav { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .stage .cs-nav button.on { background: rgba(255,255,255,.14); }
:root[data-theme="dark"] .stage::after {
  background: radial-gradient(55% 60% at 50% 62%, rgba(200, 210, 222, .16), rgba(217, 164, 65, .06) 55%, transparent 78%);
}

/* -------------------------------------------------------------------------- */
/* v3.4 Digital Key, Keyless Drive, BLE & Samsung Wallet                      */
/* -------------------------------------------------------------------------- */
.keyless-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; margin-bottom: 18px; border-radius: 18px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  color: var(--ink); cursor: pointer;
}
.kb-left { display: flex; align-items: center; gap: 12px; text-align: start; }
.kb-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
:root[data-theme="dark"] .kb-ic { color: #0B0D10; }
.kb-t { font-weight: 700; font-size: var(--t-small); }
.kb-s { font-size: var(--t-tiny); color: var(--ink-2); margin-top: 2px; }
.kb-timer { font-size: 20px; font-weight: 700; color: var(--accent); padding: 4px 10px; border-radius: 10px; background: var(--paper); }

.dk-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.dk-pill {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 10px 11px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line-soft); font-size: 11px; color: var(--muted); text-align: start;
}
.dk-pill strong { font-size: 12px; color: var(--ink); font-weight: 600; }
.dk-pill.ok { border-color: rgba(11, 122, 117, .35); }
:root[data-theme="dark"] .dk-pill.ok { border-color: rgba(217, 164, 65, .35); }

.dk-hero-card { border: 1px solid var(--line); }
.dk-hero-card.active { border-color: var(--accent); background: var(--accent-soft); }
.dk-hero-top { display: flex; align-items: flex-start; gap: 12px; }
.dk-badge-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.dk-title { font-weight: 700; font-size: var(--t-body); line-height: 1.3; }
.dk-sub { font-size: var(--t-small); color: var(--ink-2); margin-top: 4px; line-height: 1.45; }

.dk-countdown-box {
  margin-top: 14px; padding: 14px; border-radius: 14px;
  background: var(--paper); text-align: center; border: 1px solid var(--line-soft);
}
.dk-timer-big { font-size: 38px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.dk-timer-lbl { font-size: var(--t-tiny); color: var(--muted); margin-top: 4px; }

.dk-meta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.dk-meta-grid > div { display: flex; flex-direction: column; gap: 2px; font-size: var(--t-tiny); color: var(--muted); }
.dk-meta-grid strong { font-size: 12px; color: var(--ink); font-weight: 600; word-break: break-all; }

.dk-ble-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; }
.dk-guide { margin-bottom: 14px; }

/* -------------------------------------------------------------------------- */
/* v3.4.3 Luxury Car Active & Bluetooth Proximity Radar Artwork               */
/* -------------------------------------------------------------------------- */
@keyframes csPulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.16); opacity: 0.35; }
}
@keyframes csRadarWave {
  0% { transform: scale(0.55); opacity: 0.75; }
  100% { transform: scale(1.65); opacity: 0; }
}
@keyframes csRadarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes csAlertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 58, 45, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(220, 58, 45, 0); }
}

.cs-dual-ind {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 14px;
}
.cs-ind-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 24, 34, 0.94), rgba(11, 15, 22, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #F3F5F7;
  text-align: start;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  cursor: pointer;
}
:root[data-theme="light"] .cs-ind-card {
  background: linear-gradient(145deg, #151C26, #0E131B);
  border-color: rgba(15, 23, 35, 0.18);
  color: #F3F5F7;
}
.cs-ind-card.ready {
  border-color: rgba(24, 194, 156, 0.55);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.16);
}
.cs-ind-card.awake {
  border-color: rgba(56, 189, 248, 0.45);
}
.cs-ind-card.bt-cabin {
  border-color: rgba(217, 164, 65, 0.65);
  box-shadow: 0 8px 24px rgba(217, 164, 65, 0.18);
}
.cs-ind-card.bt-welcome {
  border-color: rgba(24, 194, 156, 0.6);
  box-shadow: 0 8px 24px rgba(24, 194, 156, 0.18);
}
.cs-ind-card.bt-warn {
  border-color: rgba(245, 158, 11, 0.55);
}
.cs-ind-art {
  position: relative;
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
}
.cs-ind-art svg {
  width: 42px;
  height: 42px;
  display: block;
}
.cs-ind-body {
  min-width: 0;
  flex: 1;
}
.cs-ind-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
  display: flex;
  align-items: center;
  gap: 5px;
}
.cs-ind-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.cs-ind-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cs-leave-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.95), rgba(127, 29, 29, 0.98));
  border: 1px solid rgba(252, 165, 165, 0.55);
  color: #FFF;
  animation: csAlertPulse 1.6s infinite;
}
.cs-leave-alert .la-title {
  font-weight: 700;
  font-size: 13px;
}
.cs-leave-alert .la-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.86);
  margin-top: 2px;
}
.cs-leave-alert button {
  padding: 8px 12px;
  border-radius: 12px;
  background: #FFF;
  color: #991B1B;
  font-weight: 700;
  font-size: 12px;
  flex: none;
}

/* Radar Artwork Canvas inside Digital Key Modal */
.cs-radar-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 14px;
  background: radial-gradient(circle at 50% 42%, #132235 0%, #0A101A 72%, #070B12 100%);
  border: 1px solid rgba(217, 164, 65, 0.28);
  color: #F3F5F7;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}
.cs-radar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.cs-radar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
}
.cs-radar-badge.cabin {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6EE7B7;
}
.cs-radar-badge.welcome {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: #7DD3FC;
}
.cs-radar-badge.walkaway {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.55);
  color: #FCD34D;
}
.cs-radar-svg {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto;
}
.cs-radar-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.cs-radar-hud > div {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 6px 8px;
  text-align: center;
}
.cs-radar-hud span {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.52);
}
.cs-radar-hud strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #FFF;
  margin-top: 2px;
}

/* Live 360° Camera & Cabin Viewer + Live GPS Map Preview */
.cam.has-img {
  padding: 12px;
}
.cam-img-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #05080F;
  margin: 8px 0;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cam-live-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
}
.cam-loading-pill {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 13, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFF;
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.cam-foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.nav-map-wrap {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sunk);
  margin-bottom: 12px;
  height: 210px;
}
.nav-map-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.nav-map-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 12px;
  background: rgba(11, 13, 16, 0.84);
  color: #F3F5F7;
  font-size: 11.5px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.nav-map-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px 16px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: var(--sunk);
  color: var(--ink-2);
  font-size: 12.5px;
  margin-bottom: 12px;
}

/* -------------------------------------------------------------------------- */
/* v3.6 SuperApp Redesign: Engine Pill, Car Color/Model, Interactive Car Card */
/* -------------------------------------------------------------------------- */
.hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.engine-pill.on {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.38);
}
.engine-pill.off {
  background: rgba(239, 68, 68, 0.14);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.engine-pill .edot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.engine-pill.on .edot {
  box-shadow: 0 0 6px #10B981;
}

.car-custom-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.car-custom-swatch {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  flex: none;
}

/* Paint Swatch Grid & Car Model Selector */
.model-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.model-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  text-align: center;
  transition: transform 0.15s, border-color 0.2s;
}
.model-card.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.model-card-t {
  font-weight: 700;
  font-size: 13px;
}
.model-card-s {
  font-size: 11px;
  color: var(--muted);
}

.paint-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.paint, .paint-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--ink-2);
  text-align: center;
}
.paint.on, .paint-item.on {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.paint-chip, .paint-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35), inset -8px -10px 14px rgba(0, 0, 0, .28), inset 6px 7px 12px rgba(255, 255, 255, .38);
}
.paint-n, .paint-name {
  font-size: var(--t-small);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-2);
}
.paint.on .paint-n, .paint-item.on .paint-name {
  color: var(--ink);
  font-weight: 600;
}
.paint-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35), inset -3px -4px 6px rgba(0, 0, 0, .25), inset 3px 3px 5px rgba(255, 255, 255, .35);
}

/* Car colour stage aura (factory paint) */
.stage::after {
  content: "";
  position: absolute;
  inset: 6% 6% 18px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(52% 58% at 50% 64%, var(--paint-glow, transparent), transparent 76%);
}
:root[data-theme="dark"] .stage::after {
  background: radial-gradient(55% 60% at 50% 62%, var(--paint-glow, rgba(200, 210, 222, .16)), rgba(200, 210, 222, .05) 55%, transparent 78%);
}
.stage > * {
  z-index: 1;
}
:root[data-theme="dark"] .stage .cs-nav { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .stage .cs-nav button.on { background: rgba(255,255,255,.14); }

/* Simplified Climate Card */
.clim-simple-slider {
  margin: 4px 0 14px;
}
.clim-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.clim-qbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.clim-qbtn.on {
  background: var(--accent);
  color: #fff;
}
:root[data-theme="dark"] .clim-qbtn.on {
  color: #0B0D10;
}

/* Interactive Car Control Picture on Controls Page */
.ctrl-car-card {
  position: relative;
  background: radial-gradient(120% 80% at 50% 42%, #1B2432 0%, #0D1219 70%, #090C10 100%);
  border-radius: 24px;
  padding: 16px 14px 18px;
  margin-bottom: 22px;
  color: #F3F5F7;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.ctrl-car-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.ctrl-car-head-t {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}
.ctrl-car-head-s {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.64);
  margin-top: 2px;
}
.ctrl-car-top-hotspots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
  direction: ltr;
  margin-bottom: -6px;
  position: relative;
  z-index: 5;
}
.ctrl-callout-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.ctrl-callout-pin {
  width: 2px;
  height: 16px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.65) 0%, rgba(148, 163, 184, 0.08) 100%);
  position: relative;
  margin-top: 2px;
  pointer-events: none;
}
.ctrl-callout-pin::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94A3B8;
  box-shadow: 0 0 8px rgba(148, 163, 184, 0.8);
}
.ctrl-callout-pin.active {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.85) 0%, rgba(16, 185, 129, 0.12) 100%);
}
.ctrl-callout-pin.active::after {
  background: #34D399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.9);
}
.ctrl-callout-pin.warn {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.9) 0%, rgba(245, 158, 11, 0.15) 100%);
}
.ctrl-callout-pin.warn::after {
  background: #FBBF24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.95);
}
.ctrl-car-Canvas {
  position: relative;
  width: 100%;
  min-height: 222px;
  display: block;
  margin: 0 0 8px;
}
.ctrl-car-stage-slot.stage {
  height: 222px;
  margin: 0 -10px;
}
.ctrl-car-stage-slot.stage .cs-car {
  color: #E2E8F0;
}
.ctrl-car-stage-slot.stage .cs-nav {
  background: rgba(15, 23, 35, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ctrl-car-stage-slot.stage .cs-nav button {
  color: rgba(241, 245, 249, 0.72);
}
.ctrl-car-stage-slot.stage .cs-nav button.on {
  background: rgba(56, 189, 248, 0.24);
  color: #fff;
  opacity: 1;
}
.ctrl-car-bottom-hotspots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  direction: ltr;
  margin: 4px 0 10px;
  position: relative;
  z-index: 5;
}
.car-hotspot {
  position: relative;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 35, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #F8FAFC;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38);
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  z-index: 4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-hotspot span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-hotspot:active {
  transform: scale(0.94);
}
.car-hotspot .ic {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.car-hotspot.active {
  background: rgba(16, 185, 129, 0.92);
  border-color: #6EE7B7;
  color: #06281E;
}
.car-hotspot.warn {
  background: rgba(245, 158, 11, 0.94);
  border-color: #FDE68A;
  color: #1F1200;
}
.car-hotspot.danger {
  background: rgba(239, 68, 68, 0.92);
  border-color: #FCA5A5;
  color: #fff;
}
.ctrl-car-quickbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.ctrl-car-quickbar.four-cols {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 400px) {
  .ctrl-car-quickbar.four-cols {
    grid-template-columns: repeat(4, 1fr);
  }
}
.ctrl-car-qbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F1F5F9;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.ctrl-car-qbtn .ic {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.ctrl-car-qbtn.on {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6EE7B7;
}
.ctrl-car-qbtn.warn {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
  color: #FCD34D;
}

/* Custom Automation Builder */
.auto-act-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.auto-act-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: start;
}
.auto-act-chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}
.days-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.day-btn {
  flex: 1;
  min-height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.day-btn.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
:root[data-theme="dark"] .day-btn.on {
  color: #0B0D10;
}

/* ============================================================================
   Design 2 · Showroom Themes & Layout (v3.9.27)
   7 Themes: silver (Black & Silver default), apn (APNfinity), gold (Black & Gold),
             yellow (Yellow & Black), red (Sport Red), emerald (Emerald), pearl (Pearl Light)
   ============================================================================ */
:root[data-theme="silver"] {
  --page: #040507; --paper: #080A0D; --bg: #080A0D;
  --surface: #11141A; --sunk: #171B22; --raised: #171B22;
  --line: rgba(203, 213, 225, .18); --line-soft: rgba(203, 213, 225, .11);
  --ink: #F8FAFC; --ink-2: #E2E8F0; --muted: #94A3B8; --faint: #64748B;
  --accent: #CBD5E1; --accent-soft: rgba(203, 213, 225, .15); --on-ink: #080A0D;
  --good: #10B981; --ok: #CBD5E1; --icon: #E2E8F0; --glow: rgba(203, 213, 225, .18);
  --btn-bg: #E2E8F0; --btn-fg: #080A0D; --nav-bg: rgba(12, 15, 20, .94);
  --sheet-bg: #080A0D; --toast-bg: #171B22; --floor: #11141A;
  --scrim: rgba(4, 5, 7, .72);
  color-scheme: dark;
}
:root[data-theme="apn"] {
  --page: #01040B; --paper: #030712; --bg: #030712;
  --surface: #0B152B; --sunk: #0F1D38; --raised: #0F1D38;
  --line: rgba(56, 189, 248, .18); --line-soft: rgba(56, 189, 248, .12);
  --ink: #F8FAFC; --ink-2: #CBD5E1; --muted: #94A3B8; --faint: #64748B;
  --accent: #38BDF8; --accent-soft: rgba(56, 189, 248, .14); --on-ink: #03121F;
  --good: #10B981; --ok: #10B981; --icon: #7DD3FC; --glow: rgba(56, 189, 248, .18);
  --btn-bg: #38BDF8; --btn-fg: #03121F; --nav-bg: rgba(11, 21, 43, .94);
  --sheet-bg: #030712; --toast-bg: #0B152B; --floor: #091326;
  --scrim: rgba(3, 7, 18, .66);
  color-scheme: dark;
}
:root[data-theme="gold"] {
  --page: #050607; --paper: #0B0D10; --bg: #0B0D10;
  --surface: #14181D; --sunk: #1B2027; --raised: #1B2027;
  --line: rgba(217, 164, 65, .18); --line-soft: rgba(217, 164, 65, .12);
  --ink: #ECEEF0; --ink-2: #BFC4CA; --muted: #8E959C; --faint: #5A6067;
  --accent: #D9A441; --accent-soft: rgba(217, 164, 65, .14); --on-ink: #14110A;
  --good: #10B981; --ok: #D9A441; --icon: #E6C27A; --glow: rgba(217, 164, 65, .16);
  --btn-bg: #D9A441; --btn-fg: #14110A; --nav-bg: rgba(20, 24, 29, .94);
  --sheet-bg: #0B0D10; --toast-bg: #1B2027; --floor: #14181D;
  --scrim: rgba(5, 6, 8, .7);
  color-scheme: dark;
}
:root[data-theme="yellow"] {
  --page: #000000; --paper: #0A0A0A; --bg: #0A0A0A;
  --surface: #161616; --sunk: #202020; --raised: #202020;
  --line: rgba(250, 204, 21, .18); --line-soft: rgba(250, 204, 21, .12);
  --ink: #FAFAFA; --ink-2: #D4D4D4; --muted: #A3A3A3; --faint: #737373;
  --accent: #FACC15; --accent-soft: rgba(250, 204, 21, .13); --on-ink: #141100;
  --good: #10B981; --ok: #FACC15; --icon: #FDE047; --glow: rgba(250, 204, 21, .15);
  --btn-bg: #FACC15; --btn-fg: #141100; --nav-bg: rgba(22, 22, 22, .94);
  --sheet-bg: #0A0A0A; --toast-bg: #202020; --floor: #161616;
  --scrim: rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root[data-theme="red"] {
  --page: #070404; --paper: #0E0A0A; --bg: #0E0A0A;
  --surface: #1A1212; --sunk: #241818; --raised: #241818;
  --line: rgba(248, 113, 113, .2); --line-soft: rgba(248, 113, 113, .13);
  --ink: #FAF5F5; --ink-2: #E2D6D6; --muted: #A8A0A0; --faint: #786E6E;
  --accent: #F87171; --accent-soft: rgba(248, 113, 113, .14); --on-ink: #1A0505;
  --good: #10B981; --ok: #F87171; --icon: #FCA5A5; --glow: rgba(248, 113, 113, .16);
  --btn-bg: #F87171; --btn-fg: #1A0505; --nav-bg: rgba(26, 18, 18, .94);
  --sheet-bg: #0E0A0A; --toast-bg: #241818; --floor: #1A1212;
  --scrim: rgba(8, 4, 4, .7);
  color-scheme: dark;
}
:root[data-theme="emerald"] {
  --page: #020806; --paper: #04100C; --bg: #04100C;
  --surface: #0A1C16; --sunk: #10261E; --raised: #10261E;
  --line: rgba(52, 211, 153, .2); --line-soft: rgba(52, 211, 153, .13);
  --ink: #F0FDF7; --ink-2: #C6E6D8; --muted: #94ABA2; --faint: #607A70;
  --accent: #34D399; --accent-soft: rgba(52, 211, 153, .14); --on-ink: #03140D;
  --good: #34D399; --ok: #34D399; --icon: #6EE7B7; --glow: rgba(52, 211, 153, .16);
  --btn-bg: #34D399; --btn-fg: #03140D; --nav-bg: rgba(10, 28, 22, .94);
  --sheet-bg: #04100C; --toast-bg: #10261E; --floor: #0A1C16;
  --scrim: rgba(2, 8, 6, .7);
  color-scheme: dark;
}
:root[data-theme="pearl"], :root[data-theme="light"] {
  --page: #DDE3EA; --paper: #F4F6F9; --bg: #F4F6F9;
  --surface: #FFFFFF; --sunk: #EAEFF5; --raised: #EAEFF5;
  --line: rgba(15, 23, 42, .11); --line-soft: rgba(15, 23, 42, .07);
  --ink: #0F172A; --ink-2: #334155; --muted: #526071; --faint: #94A3B8;
  --accent: #0B74B5; --accent-soft: rgba(11, 116, 181, .11); --on-ink: #FFFFFF;
  --good: #0E9F6E; --ok: #0E9F6E; --icon: #0B74B5; --glow: rgba(11, 116, 181, .14);
  --btn-bg: #0B74B5; --btn-fg: #FFFFFF; --nav-bg: rgba(255, 255, 255, .94);
  --sheet-bg: #F4F6F9; --toast-bg: #0F172A; --floor: #E2E8F0;
  --scrim: rgba(15, 23, 42, .35);
  color-scheme: light;
}

/* Showroom Home Header (.sr-top) */
.sr-top {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 0 8px;
}
.sr-top-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
}
.sr-top-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sr-carname {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: start;
  max-width: 100%;
}
.sr-carname span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-carname .ic { width: 17px; height: 17px; color: var(--muted); }
.sr-sub {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.sr-gdot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: var(--ok, var(--good));
  box-shadow: 0 0 8px var(--ok, var(--good));
  display: inline-block;
}
.sr-gdot.wait { background: #F59E0B; box-shadow: 0 0 8px #F59E0B; }
.sr-gdot.off { background: #EF4444; box-shadow: 0 0 8px #EF4444; }
.sr-beta-tag {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .04em;
}
.sr-iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon, var(--accent));
  flex: none;
  font-size: 12px;
  font-weight: 700;
}
.sr-iconbtn:active { transform: scale(.95); }
.sr-iconbtn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* Showroom Stage & Caption */
.stage {
  position: relative;
  margin-top: 2px;
}
.stage::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--glow, rgba(56, 189, 248, .18));
  filter: blur(14px);
  pointer-events: none;
}
.sr-caption {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px 2px;
  min-height: 22px;
}
.sr-caption b { color: var(--ink); font-weight: 600; }
.sr-metrics-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 4px 2px;
}
.sr-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: inherit;
  cursor: pointer;
}
.sr-metric-pill:active { transform: scale(.96); }
.sr-metric-pill .ic { width: 14px; height: 14px; color: var(--accent); }
.sr-metric-pill b { color: var(--ink); font-weight: 700; }

/* Showroom Center Dial Dock (.sr-dock) */
.sr-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 0 6px;
  direction: ltr;
}
.sr-dbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  width: 68px;
}
.sr-dcirc {
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon, var(--ink));
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.sr-dbtn.on .sr-dcirc {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink, #03121F);
  box-shadow: 0 6px 20px var(--glow, rgba(56, 189, 248, .25));
}
.sr-dbtn.on { color: var(--ink); }
.sr-small {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon, var(--ink));
  padding: 0;
  flex: none;
}
.sr-small:active, .sr-dbtn:active, .sr-ring:active { transform: scale(.95); }
.sr-ring {
  position: relative;
  width: 114px;
  height: 114px;
  border-radius: 57px;
  border: 0;
  padding: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
.sr-ring > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(135deg);
  pointer-events: none;
}
.sr-ring .tv {
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sr-ring .tl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: .04em;
}
.sr-ring.on .tl { color: var(--accent); }

/* Showroom Section Header & Horizontal Chips (.sr-shead, .sr-chips) */
.sr-shead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 2px 8px;
}
.sr-shead span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sr-shead button {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.sr-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 6px;
  margin: 0 -2px;
  scrollbar-width: none;
}
.sr-chips::-webkit-scrollbar { display: none; }
.sr-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 15px 0 12px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  flex: none;
  transition: background .2s, border-color .2s, color .2s;
}
.sr-chip .ic { width: 19px; height: 19px; color: var(--icon, var(--accent)); }
.sr-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink, #03121F);
}
.sr-chip.on .ic { color: var(--on-ink, #03121F); }

/* Showroom All Controls Bar (.sr-allbtn) & Right Edge Handle */
.sr-allbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  width: 100%;
  text-align: start;
}
.sr-allbtn .cic {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.sr-allbtn .t { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.sr-allbtn .s { font-size: 12px; color: var(--muted); }

.sr-handle {
  position: fixed;
  right: 0;
  top: 235px;
  width: 28px;
  height: 135px;
  background: none;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 15;
}
.sr-handle span {
  display: block;
  width: 5px;
  height: 96px;
  border-radius: 4px 0 0 4px;
  background: var(--accent);
  opacity: .78;
  box-shadow: 0 0 12px var(--accent);
}
[dir="rtl"] .sr-handle { right: auto; left: 0; justify-content: flex-start; }
[dir="rtl"] .sr-handle span { border-radius: 0 4px 4px 0; }

/* Showroom Side Drawer & Half-Screen Category Sheet (car stays visible on top!) */
.sr-layer {
  position: fixed;
  inset: 0;
  z-index: 46; /* above the pill nav so the drawer footer stays reachable */
  pointer-events: none;
  opacity: 0;
  transition: opacity .24s var(--ease);
}
.sr-layer.open {
  pointer-events: auto;
  opacity: 1;
}
.sr-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--scrim, rgba(3, 7, 18, .66));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sr-side {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--paper);
  border-inline-start: 1px solid var(--line);
  border-radius: 28px 0 0 28px;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform .3s var(--ease);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .45);
}
[dir="rtl"] .sr-side {
  right: auto;
  left: 0;
  border-radius: 0 28px 28px 0;
  transform: translateX(-105%);
}
.sr-layer.open .sr-side { transform: none; }
.sr-sidehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 12px 20px;
}
[dir="rtl"] .sr-sidehead { padding-inline: 20px 16px; }
.sr-sidetitle { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sr-sidehead h2 { font-size: 20px; font-weight: 700; margin: 0; }
.sr-sidesub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* At-a-glance tiles (battery, doors, A/C) */
.sr-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 14px 10px;
  flex: none;
}
.sr-gtile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 10px 9px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: start;
  min-width: 0;
  transition: background .2s, border-color .2s;
}
.sr-gtile .ic { width: 16px; height: 16px; color: var(--muted); }
.sr-gtile b { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.sr-gtile span { font-size: 11px; color: var(--muted); }
.sr-gtile.on { background: var(--accent-soft); border-color: var(--accent); }
.sr-gtile.on .ic { color: var(--accent); }
.sr-gtile:active { transform: scale(.97); }

/* Grouped category list */
.sr-catlist {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}
.sr-catlist::-webkit-scrollbar { display: none; }
.sr-cgroup { display: flex; flex-direction: column; gap: 2px; }
.sr-cghead {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
}
.sr-crow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 12px;
  border-radius: 16px;
  width: 100%;
  text-align: start;
  border: 1px solid transparent;
  transition: background .18s, border-color .18s;
}
.sr-crow:active, .sr-crow:hover { background: var(--surface); }
.sr-crow:active { transform: scale(.985); }
.sr-crow.last { background: var(--surface); border-color: var(--line); }
.sr-crow .cic {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background .2s, color .2s, box-shadow .2s;
}
.sr-crow.on .cic {
  background: var(--accent);
  color: var(--on-ink, #03121F);
  box-shadow: 0 4px 14px var(--glow, rgba(56, 189, 248, .25));
}
.sr-crow .cdot {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: var(--good);
  border: 2px solid var(--paper);
}
.sr-crow.warn .cic { background: rgba(245, 158, 11, .16); color: #F59E0B; }
.sr-crow.warn .cdot { background: #F59E0B; }
.sr-crow .ctext {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sr-crow .cname { font-size: 15px; font-weight: 600; color: var(--ink); }
.sr-crow .cstat {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-crow.on .cstat { color: var(--ink-2); }
.sr-crow.warn .cstat { color: #F59E0B; }
.sr-crow .chev { width: 18px; height: 18px; color: var(--faint); flex: none; }

/* Footer: settings shortcut + version */
.sr-sidefoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 14px);
  border-top: 1px solid var(--line-soft);
  flex: none;
}
.sr-sidefoot button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.sr-sidefoot button .ic { color: var(--icon, var(--accent)); }
.sr-sidefoot > span { font-size: 11px; color: var(--faint); }

/* Staggered entrance, only while the drawer is sliding in */
@keyframes srRowIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes srRowInRtl {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: none; }
}
.sr-layer.entering .sr-crow-wrap,
.sr-layer.entering .sr-gtile {
  animation: srRowIn .36s var(--ease) both;
  animation-delay: calc(60ms + var(--i, 0) * 28ms);
}
[dir="rtl"] .sr-layer.entering .sr-crow-wrap,
[dir="rtl"] .sr-layer.entering .sr-gtile { animation-name: srRowInRtl; }
@media (prefers-reduced-motion: reduce) {
  .sr-layer, .sr-side, .sr-catsheet-layer, .sr-catsheet { transition: none; }
  .sr-layer.entering .sr-crow-wrap, .sr-layer.entering .sr-gtile { animation: none; }
}

/* Half-Screen Category Sheet below the Car Stage */
.sr-catsheet-layer {
  position: fixed;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  opacity: 0;
  transition: opacity .24s var(--ease);
}
.sr-catsheet-layer.open {
  pointer-events: auto;
  opacity: 1;
}
.sr-catsheet-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}
.sr-catsheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 295px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  transition: transform .32s var(--ease);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .45);
}
.sr-catsheet-layer.open .sr-catsheet { transform: none; }
.sr-shtop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 10px 18px;
}
.sr-shtop h2 { margin: 0; font-size: 19px; font-weight: 700; flex: 1; }
.sr-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 16px 10px;
  scrollbar-width: none;
  flex: none;
}
.sr-tabs::-webkit-scrollbar { display: none; }
.sr-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  flex: none;
}
.sr-tab .ic { width: 16px; height: 16px; color: var(--icon, var(--accent)); }
.sr-tab.act {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink, #03121F);
}
.sr-tab.act .ic { color: var(--on-ink, #03121F); }
.sr-shbody {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px calc(env(safe-area-inset-bottom, 0px) + 28px);
  scrollbar-width: none;
}
.sr-shbody::-webkit-scrollbar { display: none; }

/* Showroom Top-View Seat & Window Interactive Diagram */
.sr-topview-body {
  position: relative;
  height: 158px;
  margin: 6px 0;
  direction: ltr;
}
.sr-topview-shell {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 22px;
  bottom: 22px;
  border: 2px solid var(--line);
  border-radius: 48px 26px 26px 48px;
  background: var(--sunk);
  opacity: .85;
}
.sr-topview-front {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
}
.sr-seatbtn {
  position: absolute;
  width: 106px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.sr-seatbtn .ic { width: 16px; height: 16px; }
.sr-seatbtn.heat {
  background: #7C4A03;
  border-color: #FBBF24;
  color: #FEF3C7;
}
.sr-seatbtn.vent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink, #03121F);
}

/* Theme Picker Grid (.tgrid, .topt) */
.tgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.topt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--surface);
  text-align: start;
}
.topt.act, .topt.on { border-color: var(--accent); }
.topt .prev, .topt .tprev {
  width: 100%;
  height: 58px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px;
}
.topt .prev i, .topt .tprev span {
  display: block;
  height: 10px;
  border-radius: 5px;
  flex: 1;
}
.topt .tname, .topt .tn {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}
.topt .ts {
  font-size: 11px;
  color: var(--muted);
}
.topt .tname .ic { width: 18px; height: 18px; color: var(--accent); }

/* Fixed Full-Width Bottom Bar — Flush Right-to-Left to Bottom with Zero Gap */
.nav.sr-pill-nav {
  position: fixed;
  left: 0;
  right: 0;
  inset-inline: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding: 5px 8px calc(env(safe-area-inset-bottom, 0px) + 4px);
  border-radius: 0;
  background: var(--surface);
  border: 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .42);
  gap: 4px;
  direction: rtl;
  z-index: 45;
}
.nav.sr-pill-nav .nav-item {
  border-radius: 14px;
  height: 48px;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
}
.nav.sr-pill-nav .nav-item.on,
.nav.sr-pill-nav .nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav.sr-pill-nav .nav-item.on::after,
.nav.sr-pill-nav .nav-item.active::after {
  display: none;
}

/* ==========================================================================
   Custom User Profiles (Saved Status & Confirm-First Execution)
   ========================================================================== */
.sr-prof-empty {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px dashed var(--accent);
  text-align: start;
  margin-bottom: 12px;
  transition: transform .15s var(--ease), background .2s;
}
.sr-prof-empty:active {
  transform: scale(0.985);
  background: var(--accent-soft);
}
.sr-prof-empty .pe-ic {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.sr-prof-empty .pe-t {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.sr-prof-empty .pe-s {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
}
.sr-prof-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.sr-prof-strip::-webkit-scrollbar { display: none; }
.sr-prof-card {
  position: relative;
  flex: 0 0 auto;
  min-width: 174px;
  max-width: 220px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: start;
  transition: border-color .2s, background .2s, transform .15s;
}
.sr-prof-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.sr-prof-card-main {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding-inline-end: 26px;
  text-align: start;
}
.sr-prof-ic {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.sr-prof-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-prof-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-prof-edit-btn {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--sunk);
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sr-prof-edit-btn:active {
  color: var(--accent);
  border-color: var(--accent);
}
.sr-prof-new {
  flex: 0 0 auto;
  min-width: 116px;
  border-radius: 18px;
  background: var(--sunk);
  border: 1.5px dashed var(--line);
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.prof-snap-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}
.prof-sec-card {
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.prof-sec-card.off {
  opacity: 0.62;
}
.prof-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.prof-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.prof-sec-title .ic {
  color: var(--accent);
}
.prof-sec-body {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prof-confirm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
}
.prof-confirm-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.prof-confirm-item .pci-ic {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.prof-confirm-item .pci-t {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.prof-confirm-item .pci-s {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.prof-icon-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
}
.prof-icon-row::-webkit-scrollbar { display: none; }
.prof-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.prof-icon-btn.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============================================================================
   v3.7.8 · APN Wallet Key (top drawer + flip pass), full A/C page, camera & maps
   ============================================================================ */
:root {
  --gold: #D9A441; --gold-bg: rgba(217, 164, 65, .14);
  --mint: #34D399; --sky: #38BDF8;
  --surface-2: var(--sunk, #0F1D38);
}
:root[data-theme="pearl"], :root[data-theme="light"] {
  --gold: #A16207; --gold-bg: rgba(161, 98, 7, .1);
  --mint: #0E9F6E; --sky: #0B74B5;
}

/* Top bar button + pull tab */
.sr-wallet-btn { color: var(--gold); }
.sr-wallet-btn.on { background: var(--gold-bg); border-color: var(--gold); }
.sr-wallet-pull-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: -6px auto 2px;
  padding: 3px 14px 4px;
  border-radius: 0 0 14px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.sr-wallet-pull-tab .grip { width: 30px; height: 3px; border-radius: 2px; background: var(--gold); opacity: .7; }
.sr-wallet-pull-tab .lbl { display: inline-flex; align-items: center; gap: 4px; }
.sr-wallet-pull-tab .ic { width: 12px; height: 12px; }
.sr-wallet-pull-tab.hidden { visibility: hidden; }
.sr-wallet-pull-tab:active { transform: scale(.96); }

/* Flip-down drawer */
.apn-wallet-drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 47;
  pointer-events: none;
  opacity: 0;
  transition: opacity .24s var(--ease);
}
.apn-wallet-drawer-layer.open { pointer-events: auto; opacity: 1; }
.apn-wallet-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--scrim, rgba(3, 7, 18, .66));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.apn-wallet-drawer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  max-width: 520px;
  max-height: 92vh;
  margin: 0 auto;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 6px;
  background: var(--sheet-bg, var(--paper));
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  transform: translateY(-105%);
  transition: transform .32s var(--ease);
}
.apn-wallet-drawer-layer.open .apn-wallet-drawer { transform: none; }
.apn-wallet-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.apn-wallet-drawer-head > span { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.apn-wallet-drawer-head .sr-iconbtn { width: 34px; height: 34px; }
.apn-wallet-drawer-grip { display: flex; justify-content: center; width: 100%; padding: 10px 0 4px; background: none; border: 0; }
.apn-wallet-drawer-grip span { width: 44px; height: 5px; border-radius: 3px; background: var(--ink-2); opacity: .35; }

/* Pass card (front = live key, back = guide) */
.apn-wallet-wrap.in-modal { margin-bottom: 14px; }
.apn-wallet-pass { perspective: 1200px; }
.apn-wallet-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform .55s var(--ease);
}
.apn-wallet-pass.flipped .apn-wallet-inner { transform: rotateY(180deg); }
.apn-wallet-face {
  grid-area: 1 / 1;
  position: relative;
  overflow: hidden;
  padding: 14px 15px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 55%, var(--surface-2) 100%);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .06);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.apn-wallet-face::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%;
  height: 120%;
  background: radial-gradient(closest-side, var(--gold-bg), transparent);
  pointer-events: none;
}
.apn-wallet-face > * { position: relative; }
.apn-wallet-face.back { transform: rotateY(180deg); }
.aw-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aw-badge {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--gold-bg);
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}
.aw-nfc { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.aw-status {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 700;
  direction: ltr;
}
.aw-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.aw-status.ready { color: var(--mint); }
.aw-status.drive { color: var(--gold); }
.aw-status.pair { color: var(--sky); }
.aw-model { margin: 12px 0 8px; font-size: 19px; font-weight: 800; letter-spacing: .01em; }
.aw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.aw-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aw-grid span { font-size: 10.5px; color: var(--muted); }
.aw-grid strong { font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-grid strong.ok { color: var(--mint); }
.aw-grid strong.warn { color: var(--gold); }
.aw-foot { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.aw-foot button {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--sky);
  font-size: 11.5px;
  font-weight: 700;
}
.apn-wallet-steps { list-style: none; margin: 10px 0 0; padding: 0; }
.apn-wallet-steps li { display: flex; gap: 10px; margin-bottom: 10px; }
.apn-wallet-steps li:last-child { margin-bottom: 0; }
.apn-wallet-steps .n {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  background: var(--gold-bg);
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 800;
}
.apn-wallet-steps .t { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.apn-wallet-steps .d { margin-top: 2px; font-size: 11.5px; line-height: 1.45; color: var(--ink-2); }

/* Fast actions under the pass */
.apn-wallet-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.aw-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 62px;
  padding: 9px 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.aw-act .ic { width: 20px; height: 20px; }
.aw-act.unlock .ic { color: var(--mint); }
.aw-act.lock .ic { color: var(--sky); }
.aw-act.drive .ic { color: var(--gold); }
.aw-act.pair .ic { color: var(--sky); }
.aw-act.on { background: var(--gold-bg); border-color: var(--gold); }
.aw-act:active { transform: scale(.95); }

/* Climate: dual-zone temps, numbered fan 1-7, all modes, seats */
.clim-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; direction: ltr; }
[dir="rtl"] .clim-zone { direction: rtl; }
.clim-zone { padding: 10px; border-radius: 14px; background: var(--paper); text-align: center; }
.clim-zone-l { font-size: var(--t-small); color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.clim-zone-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 6px; direction: ltr; }
.clim-zone .step-btn { width: 34px; height: 34px; min-width: 34px; background: var(--surface); }
.fan-card .fan-step-btn { background: var(--surface); }
.clim-zone .temp { font-size: 30px; font-weight: 500; }
.clim-zone .temp.off { opacity: .45; }
.clim-zone .temp sup { font-size: 12px; }
.fan-card { margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: var(--paper); }
.fan-card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fan-badge { padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; }
.fan-steps.num-steps { height: 46px; }
.fan-steps.num-steps button { flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; border-radius: 8px; }
.fan-steps.num-steps b { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fan-steps.num-steps button.cur { background: var(--accent-soft); }
.fan-steps.num-steps button.cur b { color: var(--accent); font-weight: 800; }
.clim-quick-grid.all-modes { grid-template-columns: repeat(3, 1fr); }
.clim-quick-grid.all-modes .clim-qbtn { text-align: center; line-height: 1.2; min-height: 64px; }
.clim-seats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; direction: ltr; margin-bottom: 8px; }
.clim-seat { margin-bottom: 12px; }
[dir="rtl"] .clim-seat { direction: rtl; }
.clim-seats-grid .clim-seat { margin-bottom: 0; background: var(--paper); padding: 10px; border-radius: 14px; }
.clim-seat-n { font-size: var(--t-small); font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.clim-seat .lvl-group { margin-bottom: 6px; }
.clim-seat .lvl-group button { min-height: 34px; }

/* Horizontal toolbars: keep scroll position stable, prevent elastic snapback */
.sr-tabs, .sr-chips, .chips, .sr-prof-strip, .prof-icon-row {
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scroll-snap-type: none;
}

/* Security & Cameras inline feed */
.cam.sr-cam { margin-bottom: 10px; }

/* Send to car maps */
.nav-send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nav-send-grid .btn { width: 100%; }
.nav-send-grid .btn:last-child { grid-column: 1 / -1; }
.notice.nav-send-note { color: var(--ink-2); margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .apn-wallet-inner, .apn-wallet-drawer, .apn-wallet-drawer-layer { transition: none; }
}

/* ============================================================================
   v3.8 · APN Wallet: 3-layer status strip, metallic finishes + sheen,
   hold-near-mirror zone, Your Keys, live APDU inspector, NFC card scan
   ============================================================================ */
:root { --aw-err: var(--bad, #EF4444); }

/* 3-layer status strip (Bluetooth key · NFC key · Cloud) */
.aw-layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 10px; }
.aw-layer {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.aw-layer i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint, var(--muted)); }
.aw-layer span { display: flex; flex-direction: column; min-width: 0; }
.aw-layer b, .aw-layer small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-layer b { font-size: 11px; font-weight: 700; color: var(--ink); }
.aw-layer small { font-size: 10.5px; font-weight: 600; }
.aw-layer.on { border-color: color-mix(in srgb, var(--mint) 40%, var(--line)); }
.aw-layer.on i { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.aw-layer.on small { color: var(--mint); }
.aw-layer.warn i { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: awDot 1.4s ease-in-out infinite; }
.aw-layer.warn small { color: var(--gold); }
.aw-layer.err i { background: var(--aw-err); box-shadow: 0 0 8px var(--aw-err); }
.aw-layer.err small { color: var(--aw-err); }
@keyframes awDot { 50% { opacity: .35; } }

/* Metallic card finishes — local ink overrides keep the pass readable on every theme */
.apn-wallet-pass[class*="finish-"] .apn-wallet-face { box-shadow: 0 12px 30px rgba(0, 0, 0, .3), 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .35); }
.apn-wallet-pass[class*="finish-"] .apn-wallet-face::before { display: none; }
.apn-wallet-pass.finish-titanium .apn-wallet-face {
  --ink: #0C1118; --ink-2: #2A3340; --muted: #4A5563;
  --gold: #8A5A00; --gold-bg: rgba(138, 90, 0, .12); --mint: #0B7A4F; --sky: #0B5F94;
  --surface-2: rgba(255, 255, 255, .45); --line: rgba(12, 17, 24, .16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 40%),
    linear-gradient(160deg, #E9EEF4 0%, #C3CCD6 38%, #9AA6B4 66%, #D6DEE7 100%);
  border-color: rgba(255, 255, 255, .45);
}
.apn-wallet-pass.finish-graphite .apn-wallet-face {
  --ink: #EEF2F7; --ink-2: #C9D1DA; --muted: #9AA6B4;
  --gold: #E6C27A; --gold-bg: rgba(230, 194, 122, .14); --mint: #34D399; --sky: #7DD3FC;
  --surface-2: rgba(255, 255, 255, .08); --line: rgba(255, 255, 255, .14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 40%),
    linear-gradient(160deg, #4A525C 0%, #232A32 60%, #3A424C 100%);
  border-color: rgba(255, 255, 255, .12);
}
.apn-wallet-pass.finish-gold .apn-wallet-face {
  --ink: #241A06; --ink-2: #4A3A14; --muted: #6B5523;
  --gold: #6B4300; --gold-bg: rgba(107, 67, 0, .12); --mint: #0B6B45; --sky: #0B4F7A;
  --surface-2: rgba(255, 255, 255, .4); --line: rgba(36, 26, 6, .18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 42%),
    linear-gradient(160deg, #F3E3B3 0%, #D9B870 55%, #B8923F 100%);
  border-color: rgba(255, 244, 214, .5);
}
.apn-wallet-pass.finish-blue .apn-wallet-face {
  --ink: #EEF4FB; --ink-2: #CFE0F2; --muted: #A9C2DC;
  --gold: #F3D58A; --gold-bg: rgba(243, 213, 138, .14); --mint: #6EE7B7; --sky: #BAE6FD;
  --surface-2: rgba(255, 255, 255, .1); --line: rgba(255, 255, 255, .18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 42%),
    linear-gradient(160deg, #4A7FB5 0%, #1E4E79 60%, #2B5F8F 100%);
  border-color: rgba(255, 255, 255, .16);
}
:root[data-theme="pearl"] .apn-wallet-pass[class*="finish-"] .apn-wallet-face,
:root[data-theme="light"] .apn-wallet-pass[class*="finish-"] .apn-wallet-face {
  box-shadow: 0 10px 24px rgba(15, 23, 42, .16), 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.aw-beta {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--on-ink, #14110A);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
}
.apn-wallet-pass.finish-titanium .aw-beta, .apn-wallet-pass.finish-gold .aw-beta { color: #FFF8E6; }
.apn-wallet-pass.finish-graphite .aw-beta, .apn-wallet-pass.finish-blue .aw-beta { color: #1A1206; }

/* Specular sheen: slow idle sweep, bright one-shot on finish change / mirror tap */
.apn-wallet-face > .pass-sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .34) 48%, transparent 64%);
  transform: translateX(-120%);
  animation: awSheen 7s var(--ease) infinite;
}
.apn-wallet-pass.finish-graphite .pass-sheen, .apn-wallet-pass.finish-blue .pass-sheen {
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .18) 48%, transparent 64%);
}
.apn-wallet-pass.shine .pass-sheen { animation: awSheenOnce .9s ease-out 1; }
@keyframes awSheen { 0%, 72% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes awSheenOnce { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* Finish selector pills */
.aw-finishes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.aw-finish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}
.aw-finish span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-finish .sw { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.aw-finish.on { background: var(--gold-bg); border-color: var(--gold); color: var(--gold); }
.aw-finish:active { transform: scale(.95); }
.finish-titanium.sw, .aw-key-sw.finish-titanium { background: linear-gradient(160deg, #E9EEF4, #9AA6B4); }
.finish-graphite.sw, .aw-key-sw.finish-graphite { background: linear-gradient(160deg, #4A525C, #232A32); }
.finish-gold.sw, .aw-key-sw.finish-gold { background: linear-gradient(160deg, #F3E3B3, #B8923F); }
.finish-blue.sw, .aw-key-sw.finish-blue { background: linear-gradient(160deg, #4A7FB5, #1E4E79); }

/* Hold Near Left Mirror */
.aw-mirror-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 14px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: start;
}
.aw-mirror-ic { flex: none; width: 28px; height: 28px; fill: none; stroke: var(--sky); stroke-width: 1.7; stroke-linecap: round; }
.aw-mirror-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.aw-mirror-txt b { font-size: 14.5px; font-weight: 800; }
.aw-mirror-txt small { font-size: 11px; color: var(--muted); }
.aw-mirror-rings { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.aw-mirror-rings i { position: absolute; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--sky); opacity: 0; }
.aw-mirror-btn.scanning { border-color: var(--sky); }
.aw-mirror-btn.scanning .aw-mirror-txt small { color: var(--sky); }
.aw-mirror-btn.scanning .aw-mirror-rings i { animation: awRing 1.6s ease-out infinite; }
.aw-mirror-btn.scanning .aw-mirror-rings i:nth-child(2) { animation-delay: .5s; }
.aw-mirror-btn.scanning .aw-mirror-rings i:nth-child(3) { animation-delay: 1s; }
.aw-mirror-btn.tapped { animation: awTapFlash .6s ease; border-color: var(--mint); }
.aw-mirror-btn:active { transform: scale(.98); }
@keyframes awRing { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes awTapFlash { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 0 3px var(--mint), 0 0 24px var(--mint); } }

/* Extra fast actions */
.aw-act.trunk .ic { color: var(--gold); }
.aw-act.horn .ic { color: var(--aw-err); }
.aw-act.scan .ic { color: var(--mint); }
.aw-act.log .ic { color: var(--sky); }

/* Section header with pill action */
.aw-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aw-pill {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.aw-pill.add { background: var(--gold-bg); border-color: var(--gold); color: var(--gold); }

/* Your Keys */
.aw-keys { display: flex; flex-direction: column; gap: 8px; }
.aw-key {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.aw-key.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.aw-key-sw {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--sky);
}
.aw-key-sw.card { color: var(--mint); }
.aw-key-main { flex: 1; min-width: 0; }
.aw-key-main .n { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-key-main .s { margin-top: 2px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-key-tag { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 700; }
.aw-key-tag.on { background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint); }
.aw-key-del { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: none; border: 1px solid var(--line); color: var(--aw-err); }
.aw-key-del .ic { width: 15px; height: 15px; }

/* Live Mirror APDU inspector */
.aw-apdu {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
}
.aw-apdu-row { padding: 6px 2px; border-bottom: 1px dashed var(--line); }
.aw-apdu-row:last-child { border-bottom: 0; }
.aw-apdu-row .top { display: flex; gap: 8px; color: var(--muted); margin-bottom: 2px; }
.aw-apdu-row .aid { color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-apdu-row .ins { margin-inline-start: auto; color: var(--sky); font-weight: 700; }
.aw-apdu-row .cmd { color: var(--ink-2); word-break: break-all; }
.aw-apdu-row .rsp { color: var(--mint); word-break: break-all; }
.aw-empty { padding: 16px 6px; text-align: center; color: var(--muted); font-family: inherit; font-size: 12px; }

/* Footer note */
.aw-foot-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 0 2px; font-size: 11px; color: var(--muted); }

/* Physical NFC card scan sheet */
.aw-scan { position: relative; display: grid; place-items: center; height: 120px; margin: 4px 0 6px; color: var(--sky); }
.aw-scan .ic { width: 46px; height: 46px; }
.aw-scan-pulse { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 2px solid var(--sky); opacity: .35; }
.aw-scan.active .aw-scan-pulse { animation: awRing 1.6s ease-out infinite; }
.aw-scan-hint { margin: 0 0 12px; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.aw-scan-result {
  margin: 0 0 12px;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============================================================================
   v3.7.9 — Master ON/OFF Ring, A/C + Fan Card, Charging & Smart Charging Card
   ============================================================================ */

/* Master ON/OFF Ring — Luxury Engine Start/Stop Bezel */
.sr-ring.sr-pwr-ring {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 58px;
  padding: 14px 8px 10px;
  gap: 2px;
  background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--accent) 12%, var(--surface)) 0%, var(--surface) 68%);
  border: 1.5px solid color-mix(in srgb, var(--line) 85%, rgba(255,255,255,.16));
  box-shadow: 0 12px 28px rgba(0,0,0,.26), inset 0 1px 1px rgba(255,255,255,.12);
  transition: box-shadow .25s, border-color .25s, transform .18s;
}
.sr-ring.sr-pwr-ring.on {
  background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--accent) 24%, var(--surface)) 0%, var(--surface) 72%);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), 0 12px 32px color-mix(in srgb, var(--accent) 28%, rgba(0,0,0,.3));
}
.sr-ring.sr-pwr-ring > svg {
  transform: none;
}
.sr-pwr-led {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
  transition: background .25s, box-shadow .25s;
}
.sr-pwr-led.on {
  background: var(--accent, #06B6D4);
  box-shadow: 0 0 8px var(--accent, #06B6D4), 0 0 16px color-mix(in srgb, var(--accent, #06B6D4) 55%, transparent);
}
.sr-pwr-ic {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.sr-ring.sr-pwr-ring.on .sr-pwr-ic {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.sr-ring.sr-pwr-ring .sr-pwr-ic svg,
.sr-pwr-ic .ic {
  position: static !important;
  inset: auto !important;
  width: 20px !important;
  height: 20px !important;
  transform: none !important;
  color: var(--ink);
  flex: none;
}
.sr-ring.sr-pwr-ring.on .sr-pwr-ic svg,
.sr-ring.sr-pwr-ring.on .sr-pwr-ic .ic {
  color: var(--accent);
}
.sr-pwr-main {
  position: relative;
  z-index: 1;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.1;
  color: var(--ink);
  margin-top: 3px;
}
.sr-ring.sr-pwr-ring.on .sr-pwr-main { color: var(--accent); }
.sr-pwr-sub {
  position: relative;
  z-index: 1;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.1;
  color: var(--muted);
  margin-top: 1px;
}
.sr-ring.sr-pwr-ring.on .sr-pwr-sub { color: var(--accent); }

/* A/C + Fan Speed Card under dock */
.sr-ac-under-card {
  margin: 6px 0 0;
  padding: 14px 16px 12px;
  border-radius: var(--r-group, 18px);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .25s, box-shadow .25s;
}
.sr-ac-under-card.on {
  border-color: var(--accent);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 18%, transparent);
}
.sr-ac-under-card .sr-ac-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.sr-ac-pwr-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.sr-ac-pwr-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sr-ac-pwr-btn .ic { width: 16px; height: 16px; }
.sr-ac-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  direction: ltr;
}
.sr-ac-stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.sr-ac-stepper button:active { background: var(--sunk); }
.sr-ac-temp {
  min-width: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sr-ac-more-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.sr-ac-more-btn .ic { width: 16px; height: 16px; }

/* Fan Speed Bar */
.sr-fan-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.sr-fan-row .sr-fan-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2, var(--ink));
  flex: none;
  min-width: 0;
}
.sr-fan-row .sr-fan-label .ic-sm { width: 14px; height: 14px; }
.sr-fan-bar {
  display: flex;
  align-items: center;
  gap: 2.5px;
  margin-inline-start: auto;
  direction: ltr;
}
.sr-fan-bar > button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.sr-fan-bar > button:active { background: var(--sunk); }
.sr-fan-pills {
  display: flex;
  align-items: center;
  gap: 2.5px;
  direction: ltr;
}
.sr-fan-bar .sr-fan-pill,
.sr-fan-pill {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex: none;
  transition: background .15s, border-color .15s, color .15s;
}
.sr-fan-pill.on {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}
.sr-fan-pill.cur {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Charging & Smart Energy Card */
.sr-charge-card {
  margin: 10px 0 0;
  padding: 16px;
  border-radius: var(--r-group, 18px);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .3s, box-shadow .3s;
}
.sr-charge-card.charging {
  border-color: var(--ev, #0E9FBF);
  box-shadow: 0 2px 16px color-mix(in srgb, var(--ev, #0E9FBF) 18%, transparent);
}
.sr-charge-card.scheduled {
  border-color: var(--warn);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--warn) 12%, transparent);
}
.sr-charge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sr-charge-head .sr-charge-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.sr-charge-head .sr-charge-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: color-mix(in srgb, var(--ev) 14%, transparent);
  color: var(--ev);
}
.sr-charge-card.charging .sr-charge-badge { background: var(--ev); color: #fff; }
.sr-charge-bars {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.sr-charge-bars .sr-bar-col {
  flex: 1;
  min-width: 0;
}
.sr-bar-col .sr-bar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
}
.sr-bar-col .sr-bar-top b {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sr-bar-col .sr-bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--sunk);
  overflow: hidden;
}
.sr-bar-col .sr-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--ev);
  transition: width .4s;
}
.sr-bar-col.fuel .sr-bar-fill { background: var(--warn); }
.sr-charge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.sr-charge-grid .sr-cg-cell {
  padding: 10px 8px;
  border-radius: 14px;
  background: var(--sunk, #E4E7E9);
  text-align: center;
}
.sr-cg-cell .sr-cg-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.sr-cg-cell .sr-cg-lbl {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}
.sr-charge-actions {
  display: flex;
  gap: 8px;
}
.sr-charge-actions button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.sr-charge-actions button:active { background: var(--sunk); }
.sr-charge-actions button .ic { width: 16px; height: 16px; }

/* Smart Charging Modal */
.sc-tz-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.sc-tz-badge .ic { width: 16px; height: 16px; flex: none; }
.sc-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sc-time-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2, var(--ink));
  min-width: 60px;
}
.sc-time-row input[type="time"] {
  flex: 1;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sc-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sc-presets button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2, var(--ink));
  cursor: pointer;
}
.sc-presets button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-presets button:active { background: var(--sunk); }
.sc-soc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sc-soc-row button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.sc-soc-row button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-save-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity .15s;
}
.sc-save-btn:active { opacity: .85; }

/* Responsive tweaks for new cards */
@media (max-width: 380px) {
  .sr-charge-grid { grid-template-columns: 1fr 1fr; }
  .sr-charge-grid .sr-cg-cell:last-child { grid-column: 1 / -1; }
  .sr-fan-pills { gap: 2px; }
  .sr-fan-pill { width: 24px; height: 24px; font-size: 10px; }
  .sr-ac-stepper button { width: 32px; height: 32px; }
  .sr-ac-temp { font-size: 19px; min-width: 44px; }
}

@media (max-width: 360px) {
  .aw-layer { padding: 7px; gap: 5px; }
  .aw-layer b { font-size: 10.5px; }
  .aw-finish .sw { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .apn-wallet-face > .pass-sheen, .aw-layer.warn i, .aw-mirror-btn .aw-mirror-rings i, .aw-scan-pulse, .aw-mirror-btn.tapped { animation: none !important; }
}

/* ==========================================================================
   v3.8.2 — App Lock Overlay (6-Digit PIN + Biometric / Face ID / Passkey)
   ========================================================================== */
.cs-applock-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 76vh;
  padding: 12px 6px 20px;
  text-align: center;
}
.cs-applock-shield {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--accent-soft, rgba(11, 122, 117, 0.16));
  border: 1px solid rgba(11, 122, 117, 0.35);
  color: var(--accent, #0B7A75);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.cs-applock-shield svg {
  width: 30px;
  height: 30px;
}
.cs-applock-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 22px;
  direction: ltr;
}
.cs-applock-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--muted, #64748B);
  background: transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.cs-applock-dot.filled {
  background: var(--accent, #0B7A75);
  border-color: var(--accent, #0B7A75);
  transform: scale(1.14);
  box-shadow: 0 0 10px rgba(11, 122, 117, 0.55);
}
.cs-applock-dot.err {
  background: #EF4444;
  border-color: #EF4444;
}
.cs-applock-pad {
  display: grid;
  grid-template-columns: repeat(3, 74px);
  gap: 14px 20px;
  justify-content: center;
  margin: 4px auto 18px;
  direction: ltr;
}
.cs-applock-key {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: var(--surface, rgba(255, 255, 255, 0.05));
  color: var(--ink, #F8FAFC);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.15s ease;
}
.cs-applock-key:active {
  transform: scale(0.92);
  background: var(--accent, #0B7A75);
  color: #fff;
}
.cs-applock-key.bio-key {
  color: var(--accent, #0B7A75);
  border-color: rgba(11, 122, 117, 0.4);
  background: var(--accent-soft, rgba(11, 122, 117, 0.12));
}
.cs-applock-key svg {
  width: 26px;
  height: 26px;
}
.cs-bio-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(11, 122, 117, 0.45);
  background: var(--accent-soft, rgba(11, 122, 117, 0.14));
  color: var(--ink, #F8FAFC);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.cs-bio-pill-btn svg {
  width: 20px;
  height: 20px;
  color: var(--accent, #0B7A75);
}

/* ==========================================================================
   v3.8.3 Team Feedback Enhancements:
   - Pull-to-Refresh Live Hardware Status Indicator (.cs-ptr-bar)
   - Default-on-Start Profile Long-Press Badge (.sr-prof-card.default-start)
   - Rear A/C Controls Card (.sr-rear-ac-box)
   - Live Camera HD Clarity Pill (.cam-hd-pill)
   ========================================================================== */
.cs-ptr-bar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translate(-50%, -72px);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, background 0.18s ease;
}
.cs-ptr-bar.visible,
.cs-ptr-bar.pulling,
.cs-ptr-bar.refreshing {
  opacity: 1;
  transform: translate(-50%, 10px);
}
.cs-ptr-bar.ready,
.cs-ptr-bar.refreshing {
  background: var(--accent);
  color: var(--on-ink, #041016);
}
.cs-ptr-bar .ptr-spin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  flex: none;
}
@keyframes csPtrSpin {
  to { transform: rotate(360deg); }
}
.cs-ptr-bar.ready .ptr-spin,
.cs-ptr-bar.refreshing .ptr-spin {
  animation: csPtrSpin 0.65s linear infinite;
}
.cs-ptr-bar .ic {
  width: 16px;
  height: 16px;
}

.sr-prof-card {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sr-prof-card.default-start {
  border-color: #10B981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 8px 20px rgba(16, 185, 129, 0.14);
}
.sr-prof-default-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #10B981;
  font-size: 10px;
  font-weight: 800;
  margin-top: 3px;
}
.sr-prof-default-badge .ic {
  width: 11px;
  height: 11px;
  stroke-width: 2.8;
}
.sr-prof-default-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sr-prof-default-btn.on {
  background: #10B981;
  border-color: #10B981;
  color: #03150E;
}
.sr-prof-default-btn .ic {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.sr-rear-ac-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface2);
  border: 1px solid var(--line);
}
.sr-rear-ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sr-rear-ac-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}
.sr-rear-ac-title .ic {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.sr-rear-ac-toggle {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.sr-rear-ac-toggle.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-ink, #041016);
}
.sr-rear-ac-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.cam-hd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: #E2E8F0;
  cursor: pointer;
}
.cam-hd-pill.on {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.22);
  color: #38BDF8;
}

.cam-live-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  background: #05080F;
}
.cam-live-video.is-hidden,
.cam-live-img.is-hidden {
  display: none !important;
}
.cam-net-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(6, 12, 24, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #BAE6FD;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.cam-guard-banner {
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #FDE68A;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.cam-max-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: #E2E8F0;
  cursor: pointer;
}
.cam-max-pill .ic {
  width: 13px;
  height: 13px;
}
.cam-max-pill.on {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.22);
  color: #38BDF8;
}
.cam-max-bar {
  display: none;
}

body.cam-fullscreen-open {
  overflow: hidden !important;
}
body.cam-fullscreen-open .nav {
  display: none !important;
}
body.cam-fullscreen-open .scroll,
body.cam-fullscreen-open .sr-shbody {
  overflow: visible !important;
}
body.cam-fullscreen-open .sr-catsheet-layer.open {
  z-index: 9998 !important;
}
body.cam-fullscreen-open .sr-catsheet-layer.open .sr-catsheet {
  top: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
}
body.cam-fullscreen-open .toast {
  z-index: 10002 !important;
}
.sheet.cam-sheet-maximized {
  transform: none !important;
  height: 100vh !important;
  max-height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  width: 100vw !important;
  max-width: 100vw !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}
.cam.is-maximized {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
}
.cam.is-maximized .cam-top {
  position: relative;
  z-index: 4;
  background: rgba(5, 8, 15, 0.74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: 12px;
}
.cam.is-maximized .cam-img-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
}
.cam.is-maximized .cam-live-video,
.cam.is-maximized .cam-live-img {
  width: 100% !important;
  height: 100% !important;
  max-height: calc(100vh - 130px) !important;
  max-height: calc(100dvh - 130px) !important;
  object-fit: contain !important;
  border-radius: 8px !important;
}
.cam.is-maximized .cam-foot-bar {
  position: relative;
  z-index: 4;
  padding: 4px 8px;
}
.cam.is-maximized .cam-max-bar {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(5, 8, 15, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.cam.is-maximized .cam-max-chips {
  margin: 0 !important;
  flex: 1 1 auto;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.cam.is-maximized .cam-max-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* iPhone Safari / iOS WebClip portrait-lock-proof phone-wide landscape mode */
@media (orientation: portrait) {
  body.cam-web-landscape .cam.is-maximized {
    inset: auto !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;
    width: 100dvh !important;
    height: 100vw !important;
    max-width: 100vh !important;
    max-width: 100dvh !important;
    max-height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
    padding: 10px max(18px, env(safe-area-inset-bottom, 0px)) 10px max(18px, env(safe-area-inset-top, 0px)) !important;
  }
  body.cam-web-landscape .cam.is-maximized .cam-img-wrap,
  body.cam-web-landscape .cam.is-maximized .cam-live-video,
  body.cam-web-landscape .cam.is-maximized .cam-live-img {
    max-height: calc(100vw - 126px) !important;
  }
}

/* Per-control loading state & global command execution lock */
@keyframes csCtrlSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

body.cs-cmd-busy .sr-shbody button:not(.cs-ctrl-loading),
body.cs-cmd-busy .sr-dock button:not(.cs-ctrl-loading),
body.cs-cmd-busy .sr-chips button:not(.cs-ctrl-loading),
body.cs-cmd-busy .ctrl-car-card button:not(.cs-ctrl-loading),
body.cs-cmd-busy #ctrlBottom button:not(.cs-ctrl-loading),
body.cs-cmd-busy #ctrlBottom .row:not(.cs-ctrl-loading),
body.cs-cmd-busy #modalSheetContent button:not(.cs-ctrl-loading):not(.icon-btn),
body.cs-cmd-busy #modalSheetContent .row:not(.cs-ctrl-loading) {
  opacity: 0.45 !important;
  pointer-events: none !important;
  filter: saturate(0.65);
  transition: opacity 0.12s ease;
}

.cs-ctrl-loading {
  position: relative !important;
  opacity: 1 !important;
  pointer-events: none !important;
  box-shadow: 0 0 0 2px var(--accent, #38bdf8), 0 0 14px rgba(56, 189, 248, 0.42) !important;
  z-index: 3 !important;
}

.cs-ctrl-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-right-color: var(--accent, #38bdf8);
  transform: translate(-50%, -50%);
  animation: csCtrlSpin 0.55s linear infinite;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.55);
}





