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


/**
 * AutoMe design system — entry point.
 * Loads tokens, reset, typography, utilities, components, screens, and the
 * legacy-class compatibility layer. Imported by Vite from src/app/bootstrap.js
 * so the bundler emits a single CSS file at www/styles.bundle.css.
 */
/**
 * Design tokens — single source of truth for colors, type, spacing, shadows.
 * All components reference these CSS variables; never hardcode hex / px in
 * component CSS unless absolutely necessary.
 *
 * Brand: Teal/Cyan (refreshed from legacy purple/indigo).
 * Theme: Light only (no @media prefers-color-scheme overrides anywhere).
 */
:root {
  /* === Brand === */
  --brand-1: #14b8a6;            /* teal-500 — primary surface */
  --brand-2: #06b6d4;            /* cyan-500 — accent (gradient end) */
  --brand-3: #0d9488;            /* teal-600 — pressed / dark */
  --brand-1-soft: #ccfbf1;        /* teal-100 — tinted backgrounds */
  --brand-2-soft: #cffafe;        /* cyan-100 */
  --brand-grad: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
  --brand-grad-hover: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);

  /* === Surface (light theme) === */
  --paper:   #ffffff;
  --paper-2: #f8fafc;            /* page background */
  --paper-3: #f1f5f9;            /* subtle inset, hover state */
  --paper-4: #e2e8f0;            /* deeper inset */
  --backdrop: rgba(15, 23, 42, 0.45);

  /* === Ink (text colors) === */
  --ink-900: #0f172a;            /* h1 / strong text */
  --ink-700: #1e293b;            /* h2/h3 */
  --ink-600: #334155;            /* body */
  --ink-500: #64748b;            /* secondary */
  --ink-400: #94a3b8;            /* placeholders */
  --ink-300: #cbd5e1;            /* disabled / hints */

  /* === Lines === */
  --line:        #e2e8f0;        /* default borders */
  --line-strong: #cbd5e1;        /* stronger borders / dividers */

  /* === Semantic === */
  --ok:        #10b981;          /* emerald-500 */
  --ok-soft:   #d1fae5;
  --warn:      #f59e0b;          /* amber-500 */
  --warn-soft: #fef3c7;
  --bad:       #ef4444;          /* red-500 */
  --bad-soft:  #fee2e2;
  --info:      #3b82f6;          /* blue-500 */
  --info-soft: #dbeafe;

  /* === Typography === */
  --font: 'Rubik', 'Heebo', -apple-system, BlinkMacSystemFont,
          'Segoe UI', system-ui, sans-serif;
  /* `Heebo Mono` isn't a real Google Fonts family — drop it. `Heebo` (loaded
   * by index.html) renders Hebrew + digits cleanly; we lean on
   * `font-variant-numeric: tabular-nums` when callers want monospaced digit
   * alignment. */
  --font-mono: 'Heebo', ui-monospace, 'Cascadia Code', Menlo, monospace;
  --t-2xs: 11px;
  --t-xs:  12px;
  --t-sm:  14px;
  --t-md:  16px;
  --t-lg:  18px;
  --t-xl:  20px;
  --t-2xl: 24px;
  --t-3xl: 30px;
  --t-4xl: 36px;
  --lh-tight:  1.2;
  --lh-snug:   1.35;
  --lh-normal: 1.5;
  --lh-loose:  1.7;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;
  --fw-extra:   800;

  /* === Spacing (4-pt scale) === */
  --s-0:  0;
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-7:  28px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* === Radius === */
  --r-xs:   6px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-2xl:  32px;
  --r-pill: 9999px;

  /* === Shadows (soft layered) === */
  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sh-2: 0 4px 12px rgba(15, 23, 42, 0.08);
  --sh-3: 0 10px 30px rgba(15, 23, 42, 0.10);
  --sh-4: 0 20px 50px rgba(15, 23, 42, 0.15);
  --sh-brand: 0 8px 24px rgba(20, 184, 166, 0.30);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* === Motion === */
  --ease:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 150ms;
  --dur-2: 250ms;
  --dur-3: 400ms;

  /* === Z-index scale ===
   *
   * --z-modal-top is for overlays that open ON TOP of other modals. Several
   * legacy sub-modals in index.html (myCarSubModal, historySubModal,
   * messagesSubModal, aboutSubModal) carry hardcoded inline `z-index: 11001`
   * which would otherwise bury anything launched from inside them. Use
   * --z-modal-top for "secondary" overlays like vehicle details, replace
   * vehicle, etc. (toast/tooltip still beat it via their own scales below).
   */
  --z-base:      1;
  --z-sticky:    100;
  --z-nav:       500;
  --z-overlay:   1000;
  --z-modal:     2000;
  --z-modal-top: 12000;
  --z-toast:     13000;
  --z-tooltip:   14000;

  /* === Safe areas (iOS notch + Android nav bar) ===
   *
   * On iOS, env(safe-area-inset-*) reports correctly when viewport-fit=cover.
   *
   * On Android, the Chromium WebView does NOT propagate window insets to env()
   * even though targetSdk 35 enforces edge-to-edge. MainActivity reads the
   * insets via ViewCompat.setOnApplyWindowInsetsListener and writes them to
   * --android-inset-{t,b,l,r}. We take the max of the two so whichever one
   * the platform populates wins.
   */
  /* Safe areas. On Android (Capacitor WebView, targetSdk 35 edge-to-edge),
   * env(safe-area-inset-*) is not reliable, so we hardcode a generous floor
   * that covers any realistic nav bar (48dp for 3-button, 24dp for gesture).
   * The status bar floor (28px) covers the typical 24-28dp Android bar.
   */
  --safe-t: max(env(safe-area-inset-top, 0px), 28px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: max(env(safe-area-inset-bottom, 0px), 48px);
  --safe-l: env(safe-area-inset-left, 0px);

  /* AdMob banner overlay — the native View sits on top of the WebView and
   * isn't part of HTML layout. admob.service sets --ad-banner-h to ~60px
   * while a banner is visible, 0 otherwise.
   *
   * --bottom-safe = nav bar inset + banner height. Use it for any content
   * that should clear BOTH the system nav and the banner.
   */
  --ad-banner-h: 0px;
  --bottom-safe: calc(var(--safe-b) + var(--ad-banner-h));
}
/**
 * Modern CSS reset. Based on Andy Bell's reset with adjustments for
 * Hebrew RTL apps and Capacitor WebView.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
* { margin: 0; padding: 0; }
html, body {
  height: 100%;
  height: 100dvh;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: var(--lh-normal);
  color: var(--ink-700);
  background: var(--paper-2);
  direction: rtl;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior-y: contain;
}
/* Allow text selection inside inputs and content areas */
input, textarea, [contenteditable], .selectable {
  -webkit-user-select: text;
  user-select: text;
}
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}
input, button, textarea, select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: var(--brand-1);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semi);
  color: var(--ink-900);
  line-height: var(--lh-tight);
}
ul, ol { list-style: none; }
/* Disable scroll lock helper used by the modal manager */
body.no-scroll { overflow: hidden; }
/* Focus ring — visible only via keyboard navigation */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}
/* Remove default styling on Safari for buttons + text-like inputs. Checkboxes
 * and radios MUST keep their native appearance — without it they render as
 * invisible boxes (only the label is visible). */
button, select, textarea,
input:not([type="checkbox"]):not([type="radio"]) {
  -webkit-appearance: none;
  appearance: none;
}
/* Force native keyboard arrow on iOS for selects */
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2364748b' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-inline-start: 14px;
  padding-inline-end: 32px;
}
/* Hide scrollbar visually but keep functionality */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }
/* Opaque "safe area" strip at the bottom of the WebView.
 *
 * With Android edge-to-edge (targetSdk 35) the WebView extends BEHIND the
 * system navigation bar, so any content scrolled into that zone shows
 * through the translucent system bar. To avoid that we paint a fixed CSS
 * strip exactly over the safe-bottom inset: scrolling content passes
 * underneath it, the strip stays put, and the area below the system bar
 * always looks opaque.
 *
 * Sits at the bottom of the viewport. When the AdMob banner is visible
 * `--ad-banner-h` becomes ~60px and the banner (a native View) covers the
 * area above this strip; the strip itself only ever needs to cover
 * `--safe-b` (the system-nav inset). z-index sits above scrollable content
 * but well below modals/toasts/tooltips so it doesn't fight with overlays. */
body::after {
  content: '';
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  height: var(--safe-b);
  background: var(--paper-2);
  z-index: 1;
  pointer-events: none;
}
/**
 * Typography — Hebrew web font + base text classes.
 *
 * Rubik covers Hebrew + Latin well; Heebo is the fallback. Both loaded via
 * Google Fonts subset for Hebrew + Latin to keep payload small.
 */
/* Headings */
.t-display {
  font-size: var(--t-4xl);
  font-weight: var(--fw-extra);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.t-h1 {
  font-size: var(--t-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--ink-900);
}
.t-h2 {
  font-size: var(--t-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  color: var(--ink-900);
}
.t-h3 {
  font-size: var(--t-xl);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  color: var(--ink-900);
}
.t-h4 {
  font-size: var(--t-lg);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  color: var(--ink-900);
}
/* Body */
.t-body {
  font-size: var(--t-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--ink-600);
}
.t-body-strong {
  font-size: var(--t-md);
  font-weight: var(--fw-semi);
  line-height: var(--lh-normal);
  color: var(--ink-900);
}
.t-small {
  font-size: var(--t-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--ink-500);
}
.t-caption {
  font-size: var(--t-xs);
  font-weight: var(--fw-medium);
  line-height: var(--lh-normal);
  color: var(--ink-500);
}
.t-overline {
  font-size: var(--t-2xs);
  font-weight: var(--fw-semi);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}
/* Number/plate display */
.t-numeric {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
/* Color modifiers (compose with size class) */
.t-muted   { color: var(--ink-500) !important; }
.t-strong  { color: var(--ink-900) !important; }
.t-brand   { color: var(--brand-1) !important; }
.t-ok      { color: var(--ok) !important; }
.t-warn    { color: var(--warn) !important; }
.t-bad     { color: var(--bad) !important; }
/**
 * Atomic utility classes. Keep this lean — only add what's used in 3+ places.
 */
/* === Display === */
.hidden  { display: none !important; }
.block   { display: block; }
.inline  { display: inline; }
.flex    { display: flex; }
.iflex   { display: inline-flex; }
.grid    { display: grid; }
/* === Flex helpers === */
.fl-col       { flex-direction: column; }
.fl-row       { flex-direction: row; }
.fl-1         { flex: 1 1 auto; }
.fl-wrap      { flex-wrap: wrap; }
.fl-center    { align-items: center; justify-content: center; }
.fl-between   { justify-content: space-between; }
.fl-around    { justify-content: space-around; }
.fl-start     { justify-content: flex-start; }
.fl-end       { justify-content: flex-end; }
.fl-ai-center { align-items: center; }
.fl-ai-start  { align-items: flex-start; }
.fl-ai-end    { align-items: flex-end; }
.fl-as-stretch{ align-items: stretch; }
/* === Gap === */
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-6 { gap: var(--s-6); }
.gap-8 { gap: var(--s-8); }
/* === Padding === */
.p-0 { padding: 0; }
.p-2 { padding: var(--s-2); }
.p-3 { padding: var(--s-3); }
.p-4 { padding: var(--s-4); }
.p-5 { padding: var(--s-5); }
.p-6 { padding: var(--s-6); }
.p-8 { padding: var(--s-8); }
.px-2 { padding-inline: var(--s-2); }
.px-3 { padding-inline: var(--s-3); }
.px-4 { padding-inline: var(--s-4); }
.px-5 { padding-inline: var(--s-5); }
.px-6 { padding-inline: var(--s-6); }
.py-2 { padding-block: var(--s-2); }
.py-3 { padding-block: var(--s-3); }
.py-4 { padding-block: var(--s-4); }
.py-5 { padding-block: var(--s-5); }
.py-6 { padding-block: var(--s-6); }
/* === Margin === */
.m-0       { margin: 0; }
.mt-1      { margin-top: var(--s-1); }
.mt-2      { margin-top: var(--s-2); }
.mt-3      { margin-top: var(--s-3); }
.mt-4      { margin-top: var(--s-4); }
.mt-6      { margin-top: var(--s-6); }
.mt-8      { margin-top: var(--s-8); }
.mb-1      { margin-bottom: var(--s-1); }
.mb-2      { margin-bottom: var(--s-2); }
.mb-3      { margin-bottom: var(--s-3); }
.mb-4      { margin-bottom: var(--s-4); }
.mb-6      { margin-bottom: var(--s-6); }
.mx-auto   { margin-inline: auto; }
/* === Width === */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-md  { max-width: 480px; }
.max-w-lg  { max-width: 640px; }
.max-w-xl  { max-width: 768px; }
/* === Text === */
.t-start  { text-align: start; }
.t-end    { text-align: end; }
.t-center { text-align: center; }
.t-nowrap { white-space: nowrap; }
.t-trunc  {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* === Visibility helpers === */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* === Cursors === */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
/* === Backgrounds & borders === */
.bg-paper   { background: var(--paper); }
.bg-paper-2 { background: var(--paper-2); }
.bg-paper-3 { background: var(--paper-3); }
.bg-brand   { background: var(--brand-grad); color: #fff; }
.bg-soft    { background: var(--brand-1-soft); color: var(--brand-3); }
.bd        { border: 1px solid var(--line); }
.bd-top    { border-top: 1px solid var(--line); }
.bd-bottom { border-bottom: 1px solid var(--line); }
.r-sm { border-radius: var(--r-sm); }
.r-md { border-radius: var(--r-md); }
.r-lg { border-radius: var(--r-lg); }
.r-xl { border-radius: var(--r-xl); }
.r-pill { border-radius: var(--r-pill); }
/* === Shadows === */
.sh-1 { box-shadow: var(--sh-1); }
.sh-2 { box-shadow: var(--sh-2); }
.sh-3 { box-shadow: var(--sh-3); }
.sh-4 { box-shadow: var(--sh-4); }
/* Components */
/**
 * Button system — primary / secondary / ghost / danger / icon.
 *
 * Use `.btn` as the base, add ONE variant (`.btn-primary`, etc.) and
 * optionally a size modifier (`.btn-sm`, `.btn-lg`).
 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--paper);
  color: var(--ink-700);
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: var(--fw-semi);
  line-height: 1.2;
  cursor: pointer;
  transition:
    background var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease),
    transform var(--dur-1) var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:disabled, .btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn:active { transform: translateY(1px); }
/* Sizes */
.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: var(--t-sm);
  border-radius: var(--r-sm);
}
.btn-lg {
  min-height: 56px;
  padding: 14px 28px;
  font-size: var(--t-lg);
  border-radius: var(--r-lg);
}
.btn-block { width: 100%; }
/* === Primary — gradient brand === */
.btn-primary {
  background: var(--brand-grad);
  color: #ffffff;
  box-shadow: var(--sh-brand);
}
.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible {
  background: var(--brand-grad-hover);
  box-shadow: var(--sh-3);
}
.btn-primary:active { box-shadow: var(--sh-2); }
/* === Secondary — paper with border === */
.btn-secondary {
  background: var(--paper);
  color: var(--ink-700);
  border-color: var(--line-strong);
}
.btn-secondary:hover:not(:disabled),
.btn-secondary:focus-visible {
  background: var(--paper-3);
  border-color: var(--brand-1);
  color: var(--brand-3);
}
/* === Ghost — transparent === */
.btn-ghost {
  background: transparent;
  color: var(--ink-600);
  border: 0;
}
.btn-ghost:hover:not(:disabled),
.btn-ghost:focus-visible {
  background: var(--paper-3);
  color: var(--ink-900);
}
/* === Danger === */
.btn-danger {
  background: var(--bad);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled),
.btn-danger:focus-visible {
  background: #dc2626;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.30);
}
/* === Tinted (soft brand) === */
.btn-tinted {
  background: var(--brand-1-soft);
  color: var(--brand-3);
  border: 0;
}
.btn-tinted:hover:not(:disabled),
.btn-tinted:focus-visible {
  background: #99f6e4;
}
/* === Icon-only square === */
.btn-icon {
  min-height: 40px;
  width: 40px;
  padding: 0;
  border-radius: var(--r-md);
}
.btn-icon.btn-sm { min-height: 32px; width: 32px; border-radius: var(--r-sm); }
.btn-icon.btn-lg { min-height: 52px; width: 52px; border-radius: var(--r-lg); }
/* === Pill — fully rounded === */
.btn-pill { border-radius: var(--r-pill); }
/* === Inline link button — use sparingly === */
.btn-link {
  background: none;
  border: 0;
  color: var(--brand-1);
  font-weight: var(--fw-semi);
  padding: 0;
  min-height: auto;
}
.btn-link:hover { text-decoration: underline; }
/**
 * Card — surface for grouped content.
 */
.card {
  display: block;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-4);
  border: 1px solid transparent;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.card-flat {
  box-shadow: none;
  border-color: var(--line);
}
.card-tinted {
  background: var(--brand-1-soft);
  color: var(--ink-700);
  box-shadow: none;
}
.card-interactive {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card-interactive:hover {
  box-shadow: var(--sh-3);
  transform: translateY(-2px);
}
.card-interactive:active {
  transform: translateY(0);
  box-shadow: var(--sh-2);
}
.card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--brand-1-soft);
  color: var(--brand-3);
  font-size: 22px;
  flex-shrink: 0;
}
.card__title {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  line-height: var(--lh-snug);
  margin: 0;
}
.card__subtitle {
  font-size: var(--t-sm);
  color: var(--ink-500);
  margin-top: 2px;
}
.card__body { color: var(--ink-700); }
.card__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
/* Image-topped feed card */
.card-feed {
  display: block;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.card-feed:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-3);
}
.card-feed__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--paper-3);
  overflow: hidden;
}
.card-feed__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-feed__body {
  padding: var(--s-3) var(--s-4) var(--s-4);
}
.card-feed__title {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0 0 var(--s-1);
}
.card-feed__subtitle {
  font-size: var(--t-sm);
  color: var(--ink-500);
}
/**
 * Form inputs — text, textarea, select, search.
 *
 * The Israeli plate input is intentionally separate (see plate-input.css).
 */
.input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font: inherit;
  font-size: var(--t-md);
  color: var(--ink-900);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.input::placeholder { color: var(--ink-400); }
.input:hover:not(:disabled):not(:focus) { border-color: var(--line-strong); }
.input:focus,
.input:focus-visible {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.input:disabled { background: var(--paper-3); color: var(--ink-400); cursor: not-allowed; }
.input.is-error {
  border-color: var(--bad);
}
.input.is-error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.input.is-ok {
  border-color: var(--ok);
}
.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: var(--lh-normal);
}
/* Field group — label + input + helper */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.field__label {
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  color: var(--ink-700);
}
.field__helper {
  font-size: var(--t-xs);
  color: var(--ink-500);
}
.field__helper.is-error { color: var(--bad); }
/* Checkbox row */
.check-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.check-row input[type='checkbox'] {
  width: 22px;
  height: 22px;
  accent-color: var(--brand-1);
  flex-shrink: 0;
  -webkit-appearance: auto;
  appearance: auto;
}
.check-row__text {
  font-size: var(--t-sm);
  color: var(--ink-700);
}
/**
 * Israeli license-plate input widget — the brand visual of AutoMe.
 *
 * The legacy implementation rendered correctly in desktop Chrome but broke
 * inside Capacitor's Android WebView (gradients clipping, font fallback,
 * letter-spacing in RTL context). This rewrite:
 *
 *   - Fixed pixel dimensions so the widget never reflows
 *   - direction:ltr inside so the IL chip stays on the LEFT
 *   - Tabular-numeric font feature for evenly spaced digits
 *   - Pure flat colors (no gradient inside the plate body)
 *   - -webkit- prefixes for older WebView versions
 */
.plate-input {
  display: grid;
  grid-template-columns: 56px 1fr 48px;
  align-items: stretch;
  width: 100%;
  max-width: 380px;
  height: 76px;
  margin-inline: auto;
  background: #FBE65A;          /* official Israeli plate yellow */
  border: 3px solid #0d1a2c;
  border-radius: 10px;
  box-shadow: var(--sh-2);
  overflow: hidden;
  direction: ltr;               /* CRITICAL: plate spec is LTR even on RTL pages */
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: 'tnum';
  font-feature-settings: 'tnum';
}
.plate-input__il {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1d4ed8;          /* blue-700 */
  color: #ffffff;
  border-inline-end: 3px solid #0d1a2c;
  user-select: none;
  -webkit-user-select: none;
}
.plate-input__il-flag {
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.5px;
}
.plate-input__il-name {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  margin-top: 3px;
  opacity: 0.95;
}
.plate-input__field {
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  text-align: center;
  color: #0d1a2c;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.06em;
  outline: none;
  caret-color: var(--brand-1);
  -webkit-appearance: none;
  appearance: none;
}
.plate-input__field::placeholder {
  color: rgba(13, 26, 44, 0.35);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.plate-input__field:disabled { color: var(--ink-400); cursor: not-allowed; }
.plate-input__scan {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-2);
  color: #ffffff;
  font-size: 20px;
  border: 0;
  border-inline-start: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.plate-input__scan:active,
.plate-input__scan:hover { background: var(--brand-3); }
/* Compact variant — list rows / cards */
.plate-input.is-compact {
  height: 52px;
  max-width: 280px;
  grid-template-columns: 40px 1fr 36px;
  border-width: 2px;
}
.plate-input.is-compact .plate-input__il-flag { font-size: 14px; }
.plate-input.is-compact .plate-input__il-name { font-size: 7px; margin-top: 2px; }
.plate-input.is-compact .plate-input__field   { font-size: 22px; }
.plate-input.is-compact .plate-input__scan    { font-size: 16px; }
/* Static badge — for displaying a plate without input */
.plate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 28px;
  padding: 0 10px;
  background: #FBE65A;
  border: 2px solid #0d1a2c;
  border-radius: 6px;
  color: #0d1a2c;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  white-space: nowrap;
}
.plate-badge.small {
  min-width: 72px;
  height: 22px;
  font-size: 12px;
  padding: 0 6px;
  border-radius: 4px;
  border-width: 1.5px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: var(--backdrop);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.modal-overlay.open,
.modal-overlay[aria-hidden='false'] {
  display: flex;
  opacity: 1;
}
.modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
}
.modal-overlay.open .modal,
.modal-overlay[aria-hidden='false'] .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) var(--s-5) var(--s-3);
}
.modal__title {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0;
}
.modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  border: 0;
  color: var(--ink-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background var(--dur-1) var(--ease);
}
.modal__close:hover { background: var(--paper-4); color: var(--ink-900); }
.modal__body {
  padding: 0 var(--s-5) var(--s-3);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--ink-700);
  font-size: var(--t-md);
  line-height: var(--lh-normal);
}
.modal__foot {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  /* 20px floor + safe-area + AdMob banner height so the action button
     clears the Android nav bar AND any visible banner. */
  padding-bottom: calc(20px + var(--bottom-safe));
  flex-wrap: wrap;
}
.modal__foot .btn { flex: 1; }
/**
 * Drawer — full-height side panel. Used for the account drawer and any other
 * "settings-like" screens. On mobile takes the full viewport. The legacy
 * `.drawer-overlay` + `.drawer` class names are wired here so existing HTML
 * doesn't need to change.
 */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: stretch;
  justify-content: center;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.drawer-overlay.open,
.drawer-overlay[aria-hidden='false'] {
  display: flex;
  opacity: 1;
}
/* The drawer panel itself. Mobile-first: full viewport, slides up from bottom.
   Above 720px wide, becomes a centered card. */
.drawer {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transform: translateY(24px);
  opacity: 0;
  transition: transform var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease);
  overflow: hidden;
}
.drawer-overlay.open .drawer,
.drawer-overlay[aria-hidden='false'] .drawer {
  transform: translateY(0);
  opacity: 1;
}
@media (min-width: 720px) {
  .drawer {
    margin: auto;
    max-width: 560px;
    max-height: 90vh;
    border-radius: var(--r-xl);
    box-shadow: var(--sh-4);
  }
}
.drawer-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  /* Bump the top padding so the close X clears the Android status bar even
     when the WebView is rendering edge-to-edge (env() returns 0). Uses a
     hard 28px floor + the real safe-area inset on devices that report it. */
  padding-top: calc(28px + var(--safe-t));
  padding-inline: var(--s-4);
  padding-bottom: var(--s-4);
  background: var(--brand-grad);
  color: #ffffff;
}
.drawer-header h3,
.drawer-title {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: #ffffff;
  margin: 0;
}
.drawer-close {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-1) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.drawer-close:hover { background: rgba(255, 255, 255, 0.28); }
.drawer-close[disabled] { opacity: 0.45; cursor: not-allowed; }
.drawer-body {
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
}
.drawer-content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-4);
}
.drawer-footer {
  flex-shrink: 0;
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  /* Hard 20px floor + the real safe-area inset + AdMob banner height so the
     bottom button clears the Android nav bar AND any visible banner. */
  padding-bottom: calc(20px + var(--bottom-safe));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.drawer-footer .btn,
.drawer-footer .drawer-close-btn,
.drawer-footer .drawer-logout-btn {
  flex: 1;
  min-height: 48px;
}
/* Logout — destructive action, distinct outline style so the user can't
 * confuse it with the primary close button. */
.drawer-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: transparent;
  color: var(--bad);
  border: 1.5px solid var(--bad);
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  font-size: var(--t-md);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--dur-1) var(--ease);
}
.drawer-logout-btn:hover { background: var(--bad-soft); }
.drawer-logout-btn:active { transform: translateY(1px); }
.drawer-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  background: var(--brand-grad);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  font-size: var(--t-md);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.drawer-close-btn:hover { background: var(--brand-grad-hover); box-shadow: var(--sh-2); }
/* Side drawer nav (account drawer tabs) */
.drawer-nav {
  flex-shrink: 0;
  display: flex;
  gap: var(--s-1);
  padding: var(--s-2) var(--s-3);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.drawer-nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 10px 16px;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--ink-600);
  font-family: var(--font);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav-item:hover { background: var(--paper-3); color: var(--ink-900); }
.nav-item.is-active {
  background: var(--brand-1-soft);
  color: var(--brand-3);
}
.nav-item .notifications-badge,
.nav-item .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--bad);
  color: #ffffff;
  font-size: var(--t-2xs);
  font-weight: var(--fw-bold);
  margin-inline-start: 4px;
}
/**
 * Bottom-sheet — slides up from the bottom of the viewport. Used for
 * action lists (preset picker, share, confirmations) where the user shouldn't
 * lose context of the screen behind.
 */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.sheet-overlay.open,
.sheet-overlay[aria-hidden='false'] { display: flex; opacity: 1; }
.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-4);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--dur-3) var(--ease);
  padding-bottom: var(--bottom-safe);
}
.sheet-overlay.open .sheet,
.sheet-overlay[aria-hidden='false'] .sheet { transform: translateY(0); }
.sheet__grab {
  width: 40px;
  height: 4px;
  background: var(--line-strong);
  border-radius: var(--r-pill);
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.sheet__header {
  padding: var(--s-3) var(--s-5);
  text-align: center;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sheet__title {
  font-size: var(--t-md);
  font-weight: var(--fw-semi);
  color: var(--ink-900);
}
.sheet__body {
  padding: var(--s-3) var(--s-2);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet__option {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-3) var(--s-4);
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--t-md);
  color: var(--ink-700);
  cursor: pointer;
  text-align: start;
  transition: background var(--dur-1) var(--ease);
}
.sheet__option:hover { background: var(--paper-3); }
.sheet__option:active { background: var(--paper-4); }
.sheet__option.is-danger { color: var(--bad); }
.sheet__option .icon { font-size: 20px; flex-shrink: 0; }
/**
 * Toast — transient notification, auto-dismisses. Used for success/error
 * after actions. The legacy `core/alert.js` `.app-toast` styles are folded
 * into this file so we have one set of toasts.
 */
.toast-host,
#__app_alerts_root .app-toasts {
  position: fixed;
  bottom: max(20px, var(--bottom-safe));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  z-index: var(--z-toast);
  pointer-events: none;
  max-width: calc(100vw - var(--s-8));
}
.toast,
#__app_alerts_root .app-toast {
  background: var(--ink-900);
  color: #ffffff;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: var(--fw-medium);
  box-shadow: var(--sh-3);
  pointer-events: auto;
  animation: toast-in var(--dur-2) var(--ease);
  max-width: 100%;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.toast.toast-ok,
#__app_alerts_root .app-toast.success { background: var(--ok); }
.toast.toast-warn,
#__app_alerts_root .app-toast.warn { background: var(--warn); color: var(--ink-900); }
.toast.toast-bad,
#__app_alerts_root .app-toast.error { background: var(--bad); }
.toast.toast-info,
#__app_alerts_root .app-toast.info { background: var(--info); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/**
 * Status banners — license expiry, ownership, blocked, etc.
 * Three tones map to traffic-light semantics.
 */
.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-3);
}
.banner__icon {
  font-size: 18px;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}
.banner__body { flex: 1; }
.banner__title { font-weight: var(--fw-bold); margin-bottom: 2px; }
.banner__text  { color: inherit; opacity: 0.9; }
.banner-ok,
.license-banner.license-green,
.ownership-banner[data-status='match'] {
  background: var(--ok-soft);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.25);
}
.banner-warn,
.license-banner.license-orange,
.ownership-banner[data-status='partial'] {
  background: var(--warn-soft);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.25);
}
.banner-bad,
.license-banner.license-red,
.ownership-banner[data-status='mismatch'] {
  background: var(--bad-soft);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.25);
}
.banner-info,
.ownership-banner[data-status='unknown'] {
  background: var(--info-soft);
  color: #1e40af;
  border-color: rgba(59, 130, 246, 0.25);
}
/* Container that holds stacked banners (used inside my-car card) */
.banners-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
/* Attention pulse — applied when the user opens "my car" by tapping the
 * warning-triangle on the profile icon. Highlights the offending banner so
 * the cause of the warning is immediately obvious.
 *
 * All effects stay WITHIN the element's own box because the drawer chain
 * (.drawer > .drawer-body > .drawer-content) uses overflow:hidden/auto, which
 * would clip an outward box-shadow ring. We rely instead on:
 *   - inset box-shadow (an amber ring drawn inside the element),
 *   - filter brightness/saturate pulse (no layout effect, no clipping),
 *   - a small scale that's well within the available padding.
 *
 * `!important` on the animation defeats the inline `style.cssText` reset
 * that `setBanner` performs whenever banners are re-rendered.
 */
@keyframes banner-attention-pulse {
  0%, 100% {
    box-shadow: inset 0 0 0 0 rgba(245, 158, 11, 0);
    filter: brightness(1) saturate(1);
    transform: scale(1);
  }
  20% {
    box-shadow: inset 0 0 0 4px rgba(245, 158, 11, 0.95);
    filter: brightness(1.08) saturate(1.4);
    transform: scale(1.04);
  }
  50% {
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.5);
    filter: brightness(1) saturate(1);
    transform: scale(1);
  }
  70% {
    box-shadow: inset 0 0 0 4px rgba(245, 158, 11, 0.85);
    filter: brightness(1.05) saturate(1.3);
    transform: scale(1.03);
  }
}
.banner-attention {
  animation: banner-attention-pulse 1.4s ease-in-out 3 !important;
  position: relative;
  z-index: 1;
  transform-origin: center;
  will-change: transform, box-shadow, filter;
}
/**
 * Avatar — round circle with initial / icon / image. Used for the profile
 * button and conversation peer badge.
 */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: var(--brand-grad);
  color: #ffffff;
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.size-sm { width: 32px; height: 32px; font-size: var(--t-sm); }
.avatar.size-lg { width: 56px; height: 56px; font-size: var(--t-lg); }
.avatar.size-xl { width: 80px; height: 80px; font-size: var(--t-xl); }
/* Notification dot on avatar */
.avatar .dot,
.avatar .notification-dot {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 14px;
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--bad);
  border: 2px solid var(--paper);
}
/**
 * Badges & pills — small status / count indicators.
 */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--ink-500);
  color: #ffffff;
  font-size: var(--t-2xs);
  font-weight: var(--fw-bold);
  line-height: 1;
}
.badge-ok    { background: var(--ok); }
.badge-warn  { background: var(--warn); color: var(--ink-900); }
.badge-bad   { background: var(--bad); }
.badge-info  { background: var(--info); }
.badge-brand { background: var(--brand-1); }
.badge.dot {
  width: 10px;
  height: 10px;
  min-width: auto;
  padding: 0;
}
/**
 * Lists & list-items — used for history, inbox, conversation lists.
 */
.list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.list-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease);
}
.list-item:hover { background: var(--paper-3); }
.list-item:active { background: var(--paper-4); }
.list-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--brand-1-soft);
  color: var(--brand-3);
  font-size: 20px;
  flex-shrink: 0;
}
.list-item__main {
  flex: 1;
  min-width: 0;
}
.list-item__title {
  font-size: var(--t-md);
  font-weight: var(--fw-semi);
  color: var(--ink-900);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item__sub {
  font-size: var(--t-sm);
  color: var(--ink-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item__trailing {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-400);
  flex-shrink: 0;
}
.list-item__chevron::after {
  content: '‹';
  font-size: 22px;
  color: var(--ink-400);
}
/* Empty state inside a list */
.list-empty {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--ink-500);
  background: var(--paper);
  border-radius: var(--r-md);
}
.list-empty__icon { font-size: 40px; margin-bottom: var(--s-3); }
.list-empty__title { font-size: var(--t-lg); font-weight: var(--fw-semi); color: var(--ink-700); margin-bottom: 4px; }
.list-empty__text { font-size: var(--t-sm); }
/**
 * Tabs — small filter/pill style. Used in plain content panes (filtering
 * gov data, etc.). For the drawer navigation use `.nav-item` from drawer.css.
 */
.tabs {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-1);
  background: var(--paper-3);
  border-radius: var(--r-pill);
  width: fit-content;
}
.tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--ink-500);
  font-family: var(--font);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.tab:hover { color: var(--ink-700); }
.tab.is-active {
  background: var(--paper);
  color: var(--brand-3);
  box-shadow: var(--sh-1);
}
/**
 * Spinner — full-screen + inline variants. The full-screen one is shown by
 * `core/spinner.js` while async work is pending; the inline one is for
 * within-card loading states.
 */
#spinner.spinner {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  /* Darker backdrop so the spinner is unmistakeable on the login screen. */
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
#spinner.spinner[aria-hidden='false'] { display: flex; }
/* Spinner + label stacked together. */
.spinner-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  background: var(--paper);
  padding: var(--s-5) var(--s-6);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  min-width: 160px;
}
.spinner-label {
  font-size: var(--t-md);
  font-weight: var(--fw-semi);
  color: var(--ink-900);
  text-align: center;
}
.css-spinner,
.spinner-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid var(--brand-1-soft);
  border-top-color: var(--brand-1);
  animation: spin 0.8s linear infinite;
}
.spinner-ring.sm { width: 24px; height: 24px; border-width: 3px; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* Three-dot loader */
.dots {
  display: inline-flex;
  gap: 4px;
}
.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-1);
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
/**
 * Skeleton — shimmering placeholders for content that's loading. Use these
 * to replace `loading...` text strings for a nicer feel.
 */
.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    var(--paper-3) 0%,
    var(--paper-4) 50%,
    var(--paper-3) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}
.skel-text { height: 14px; margin-bottom: 8px; }
.skel-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skel-card { height: 80px; border-radius: var(--r-lg); margin-bottom: var(--s-3); }
.skel-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Screens */
/**
 * Splash / loading screen — first thing the user sees while the bundle
 * boots and the legacy SDKs initialise. Hidden by home-feed.js after
 * `window.load` fires (legacy behaviour, kept for now).
 */
#loadingScreen {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  background: var(--brand-grad);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-6);
  padding: var(--s-6);
  overflow: hidden;
  /* Cinematic exit transitions — see .is-leaving rules below. */
}
#loadingScreen.hidden { opacity: 0; pointer-events: none; }
/* === Cinematic "Curtain Up" exit animation =============================
 * The whole screen slides up off the viewport with a subtle bottom curve,
 * like a curtain lifting. While that happens, the slogan / progress-bar /
 * tip fade out first, and the logo pulses outward (scale 1.2) before
 * disappearing with the curtain.
 * Total duration: 1800ms. Combined with the 2000ms initial display in
 * home-feed.js, the splash is visible for at least 2 seconds.
 */
#loadingScreen.is-leaving {
  pointer-events: none;
  animation: splash-curtain 1800ms cubic-bezier(.76, 0, .24, 1) forwards;
}
#loadingScreen.is-leaving .autome-word-wrapper {
  animation: splash-curtain-logo 1500ms cubic-bezier(.34, 1.56, .64, 1) forwards;
}
#loadingScreen.is-leaving .slogan-text,
#loadingScreen.is-leaving .progress-bar,
#loadingScreen.is-leaving .tip-text {
  animation: splash-curtain-content 400ms ease-out forwards;
}
@keyframes splash-curtain {
  0%   { transform: translateY(0);     border-bottom-left-radius: 0;  border-bottom-right-radius: 0; }
  30%  { transform: translateY(0);     border-bottom-left-radius: 0;  border-bottom-right-radius: 0; }
  100% { transform: translateY(-110%); border-bottom-left-radius: 50% 25%; border-bottom-right-radius: 50% 25%; }
}
@keyframes splash-curtain-logo {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.1); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1.2); opacity: 0; }
}
@keyframes splash-curtain-content {
  to { opacity: 0; transform: translateY(12px); }
}
/* AutoMe logo - centered */
#loadingScreen .autome-logo {
  text-decoration: none;
  color: inherit;
}
#loadingScreen .autome-word-wrapper {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font);
  font-size: 56px;
  font-weight: var(--fw-extra);
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
#loadingScreen .autome-text-start,
#loadingScreen .autome-text-end { color: inherit; }
#loadingScreen .autome-m-animated {
  display: inline-flex;
  color: #fef3c7; /* warm accent on the M */
  animation: m-pulse 2s ease-in-out infinite;
}
@keyframes m-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
#loadingScreen .slogan-text {
  font-size: var(--t-md);
  font-weight: var(--fw-medium);
  opacity: 0.85;
  letter-spacing: 0.04em;
}
#loadingScreen .progress-bar {
  width: 220px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
#loadingScreen .progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: inherit;
  animation: fillBar 4s ease-out forwards;
}
@keyframes fillBar {
  from { width: 0; }
  to   { width: 100%; }
}
#loadingScreen .tip-text {
  font-size: var(--t-sm);
  font-weight: var(--fw-medium);
  opacity: 0.92;
  text-align: center;
  min-height: 22px;
  max-width: 320px;
}
/* Prevent flash of unstyled content */
html.boot body > *:not(#loadingScreen) { visibility: hidden; }
/**
 * Login screen — 3-step wizard (phone → vehicle → terms). Also styles the
 * OTP modal and agreement modal further down.
 *
 * DOM IDs preserved so login.view.js still finds them:
 *   #loginContainer, #loginPhone, #plate, #carProductionYear,
 *   #termsCheckbox, #authButton, #loginAlert, #otpOverlay.
 *
 * The wizard class prefix is `lw-` (login-wizard) to avoid clashing with
 * the variant-A demo classes (`va-`) that live only in login-demo.html.
 */
/* ============ Container =============================================
 * Full-viewport background that CENTERS the wizard shell (`.lw-shell`).
 * `position: fixed` is critical — the parent #mainWrapper has its own
 * `min-height: 100dvh` plus paddings (used by the home screen), so leaving
 * loginContainer in normal flow lets the body scroll. Fixed pins us to
 * the viewport and decouples from #mainWrapper sizing.
 */
#loginContainer.container {
  position: fixed;
  inset: 0;
  max-width: none;
  margin: 0;
  padding: var(--safe-t) 14px var(--safe-b);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  overflow: hidden;
  z-index: 10;
}
/* The wizard "card": all login content lives here. Fixed at 70% of the
 * viewport height so there's a deliberate frame around it. Never scrolls
 * — the active pane's card scrolls internally if it ever needs to. */
.lw-shell {
  width: 100%;
  max-width: 460px;
  height: 70dvh;
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: 14px 14px 12px;
  overflow: hidden;
}
/* ============ Brand header ============ */
.lw-logo {
  text-align: center;
  margin: 0;
  font: 900 28px/1 var(--font);
  letter-spacing: -0.02em;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lw-logo .m {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lw-tagline {
  text-align: center;
  font: 500 12px/1.3 var(--font);
  color: var(--ink-500);
  margin: 2px 0 10px;
}
/* ============ Progress bar ============ */
.lw-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.lw-step {
  flex: 1; height: 6px;
  background: var(--paper-4); border-radius: var(--r-pill);
  transition: background 0.3s ease;
}
.lw-step.lw-done { background: var(--brand-grad); }
.lw-step.lw-current { background: var(--brand-1); }
.lw-counter {
  font: 700 13px/1 var(--font); color: var(--ink-500);
  flex-shrink: 0; margin-inline-start: 6px;
}
/* ============ Panes — fill all available height ============ */
.lw-pane { display: none; }
.lw-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
/* ============ Card — content area inside the shell.
 * Generous sizing so the content naturally fills the 80dvh shell without
 * needing flex tricks. All steps' content "looks right" at this scale.
 */
.lw-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;          /* no scroll — content must fit */
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lw-eyebrow {
  font: 700 11px/1 var(--font); color: var(--brand-3);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.lw-title { font: 800 22px/1.2 var(--font); color: var(--ink-900); }
.lw-title .lw-emph {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lw-subtitle {
  font: 400 13px/1.4 var(--font); color: var(--ink-600);
}
.lw-subtitle strong { color: var(--ink-900); font-weight: 700; }
/* ============ Standard input ============ */
#loginContainer .field-label,
#loginContainer label.field-label {
  display: block;
  font: 600 13px/1 var(--font);
  color: var(--ink-700);
  margin-bottom: 6px;
}
.lw-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  font: 600 17px/1 var(--font);
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  text-align: center;
  letter-spacing: 0.05em;
}
.lw-input:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
  background: var(--paper);
}
.lw-input::placeholder { color: var(--ink-400); font-weight: 400; letter-spacing: 0.02em; }
/* ============ Trust banner (teal, step 1) ============ */
.lw-trust {
  display: flex; gap: 10px; align-items: center;
  background: var(--brand-1-soft);
  border: 1.5px solid var(--brand-1);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font: 600 12px/1.35 var(--font); color: var(--brand-3);
}
.lw-trust-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; font-size: 13px;
  box-shadow: var(--sh-brand);
}
/* ============ Info banner (yellow, step 2) ============ */
.lw-info {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fef9e7; border: 1.5px solid #fcd34d; border-radius: var(--r-md);
  padding: 10px 12px;
  font: 500 12px/1.4 var(--font); color: #78350f;
}
.lw-info-icon {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%; background: #fbbf24; color: #fff;
  display: grid; place-items: center; font-size: 13px;
}
.lw-info-body strong { color: #78350f; font-weight: 800; }
/* ============ Plate card (input lives on the yellow plate) ============ */
.lw-preview-label {
  font: 700 10px/1 var(--font); color: var(--ink-500);
  text-align: center; letter-spacing: 0.04em;
  margin-bottom: 4px; text-transform: uppercase;
}
.lw-plate-card {
  display: flex; align-items: stretch; gap: 0;
  border: 2.5px solid #1e2952; border-radius: 10px; overflow: hidden;
  background: #FFD814; height: 64px;
  box-shadow: 0 6px 16px -8px rgba(30, 41, 82, 0.35);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  cursor: text;
}
.lw-plate-card:focus-within {
  box-shadow: 0 8px 22px -6px rgba(20, 184, 166, 0.55), 0 0 0 3px rgba(20, 184, 166, 0.2);
  transform: translateY(-1px);
}
/* Matches the home-screen search plate's `.plate-symbol` — Israeli flag,
 * "IL", Hebrew, Arabic — for visual consistency. The flag image is loaded
 * from Wikimedia (same source the legacy search uses) and falls back to a
 * blank gracefully. */
.lw-plate-il {
  background: #1e2952; color: #fff;
  width: 56px; flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: 5px 2px;
  border-inline-end: 3px solid #0d1a2c;
  box-sizing: border-box;
}
.lw-plate-flag {
  width: 22px; height: auto;
  margin-bottom: 2px;
  border-radius: 2px;
  display: block;
}
.lw-plate-iltxt {
  font: 900 17px/1 var(--font);
  letter-spacing: 0.5px;
}
.lw-plate-he {
  font: 600 9px/1 var(--font);
  opacity: 0.95;
}
.lw-plate-ar {
  font: 500 8px/1 var(--font);
  opacity: 0.85;
}
.lw-plate-input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  text-align: center; direction: ltr;
  /* `Heebo Mono` was referenced but doesn't exist on Google Fonts — the
   * stack fell through to the OS default monospace (Courier New / Consolas
   * on desktop) which renders the plate digits as awkwardly wide glyphs in
   * an RTL context. Heebo loaded via index.html renders the digits cleanly;
   * `font-variant-numeric: tabular-nums` keeps the spacing even. */
  font: 900 28px/1 'Heebo', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #1e2952; letter-spacing: 0.05em;
  padding: 0 8px;
  caret-color: var(--brand-1);
}
.lw-plate-input::placeholder {
  color: rgba(30, 41, 82, 0.35); font-weight: 700; font-size: 20px;
  letter-spacing: 0.04em;
}
.lw-plate-hint {
  font: 600 10px/1 var(--font); color: var(--ink-500);
  text-align: center; margin-top: 4px;
}
/* ============ Year chip grid (step 2) — compact card ============ */
.lw-year-card {
  background: var(--paper-2);
  border: 1.5px solid var(--brand-1-soft);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.lw-year-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.lw-year-head .lw-year-label {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 13px/1 var(--font); color: var(--ink-900);
}
.lw-year-head .lw-year-label i { color: var(--brand-3); font-size: 14px; }
.lw-year-value {
  font: 800 18px/1 'Heebo Mono', monospace; color: var(--brand-3);
  min-width: 50px; text-align: end;
}
/* Horizontal strip — single row, user swipes left/right to find their year.
 * Selected chip auto-scrolls into view via JS. */
.lw-year-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.lw-year-grid::-webkit-scrollbar { display: none; }
.lw-year-chip {
  flex-shrink: 0;
  scroll-snap-align: center;
  appearance: none; -webkit-appearance: none;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 8px; padding: 8px 14px;
  font: 700 14px/1 'Heebo Mono', monospace; color: var(--ink-700);
  cursor: pointer; transition: all 0.12s ease;
  min-width: 64px;
  white-space: nowrap;     /* prevent year text from wrapping/clipping */
  direction: ltr;          /* digits LTR even inside the RTL document */
  text-align: center;
}
.lw-year-chip:hover {
  background: var(--brand-1-soft); border-color: var(--brand-1); color: var(--brand-3);
}
.lw-year-chip.active {
  background: var(--brand-grad); border-color: transparent; color: #fff;
  box-shadow: var(--sh-brand);
  transform: scale(1.04);
}
/* ============ Summary card (step 3) ============ */
.lw-summary {
  background: var(--paper-2); border: 1.5px solid var(--line);
  border-radius: var(--r-md); padding: 8px 18px;
}
.lw-summary-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font: 500 15px/1 var(--font); color: var(--ink-700);
}
.lw-summary-row:last-child { border-bottom: 0; }
.lw-summary-row strong { color: var(--ink-900); font-weight: 700; font-size: 16px; }
.lw-summary-row i { color: var(--brand-1); margin-inline-end: 8px; font-size: 16px; }
/* ============ Terms checkbox (step 3) ============ */
.lw-terms {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--brand-1-soft); border-radius: var(--r-md);
  padding: 16px;
  font: 500 14px/1.5 var(--font); color: var(--ink-700);
  cursor: pointer;
}
#loginContainer #termsCheckbox {
  width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px;
  accent-color: var(--brand-1);
  -webkit-appearance: auto; appearance: auto;
}
.lw-terms a {
  color: var(--brand-3); font-weight: 700; text-decoration: underline;
}
/* ============ Navigation buttons — pinned below the card ============ */
.lw-nav {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-shrink: 0;
}
.lw-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 16px;
  border: 0; border-radius: var(--r-md);
  font: 700 15px/1 var(--font);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.lw-btn-primary {
  background: var(--brand-grad); color: #fff; box-shadow: var(--sh-brand);
}
.lw-btn-primary:hover { filter: brightness(1.05); }
.lw-btn-primary:active { transform: translateY(1px); }
.lw-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.lw-btn-ghost {
  background: var(--paper-3); color: var(--ink-700);
}
.lw-btn-ghost:hover { background: var(--paper-4); }
.lw-btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
/* The legacy login.view.js binds onSubmit() to #authButton. With the wizard,
 * #authButton IS the step-3 finish button — keep it styled as primary. */
#loginContainer #authButton {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--sh-brand);
}
/* ============ Alert area ============ */
#loginAlert.custom-alert {
  display: none;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: var(--bad-soft);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  font: 500 13px/1.4 var(--font);
}
/* === Generic terms overlay (#otpOverlay, #agreementModal) ===
 *
 * Both overlays share the `terms-overlay` class. They're hidden by default
 * and shown when JS adds `.open` or `.show`, or sets `aria-hidden="false"`.
 * Without this rule, the agreement modal would render its content inline at
 * the bottom of the login page (since the HTML has no inline display:none).
 */
.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: var(--backdrop);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.terms-overlay.open,
.terms-overlay.show,
.terms-overlay[aria-hidden='false'] { display: flex; opacity: 1; }
/* The card itself is animated in by both `.open`/`.show` (legacy) and
 * `aria-hidden='false'` (modern). Card sizing/animation matches the modal
 * pattern used elsewhere in the app. */
.terms-overlay .terms-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
}
.terms-overlay.open .terms-card,
.terms-overlay.show .terms-card,
.terms-overlay[aria-hidden='false'] .terms-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
/* === Generic terms card internals (header / body / footer / typography) ===
 * Styles BOTH overlays (#otpOverlay reuses these too, plus its own overrides). */
.terms-overlay .terms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) var(--s-5) var(--s-3);
  background: var(--brand-grad);
  color: #ffffff;
  flex-shrink: 0;
}
.terms-overlay .terms-header h2 {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: #ffffff;
  margin: 0;
}
.terms-overlay .terms-close {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.terms-overlay .terms-close:hover { background: rgba(255, 255, 255, 0.28); }
.terms-overlay .terms-body {
  padding: var(--s-4) var(--s-5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--ink-700);
  font-size: var(--t-sm);
  line-height: var(--lh-normal);
  background: var(--paper);
  flex: 1;
}
/* Typography inside the agreement body */
.terms-overlay .terms-body p { margin: 0 0 var(--s-3); }
.terms-overlay .terms-body em { color: var(--ink-500); font-style: italic; }
.terms-overlay .terms-body strong { color: var(--ink-900); font-weight: var(--fw-semi); }
.terms-overlay .terms-body h3 {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: var(--s-4) 0 var(--s-2);
}
.terms-overlay .terms-body h3:first-child { margin-top: 0; }
.terms-overlay .terms-body ul {
  list-style: disc;
  padding-inline-start: var(--s-5);
  margin: 0 0 var(--s-3);
}
.terms-overlay .terms-body li { margin-bottom: var(--s-2); }
.terms-overlay .terms-body a {
  color: var(--brand-1);
  text-decoration: underline;
}
.terms-overlay .terms-footer {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  padding-bottom: calc(var(--s-3) + var(--bottom-safe));
  background: var(--paper);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.terms-overlay .terms-btn {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  transition: filter var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.terms-overlay .terms-agree-btn {
  background: var(--brand-grad);
  color: #ffffff;
  box-shadow: var(--sh-brand);
}
.terms-overlay .terms-agree-btn:hover { filter: brightness(1.05); }
.terms-overlay .terms-agree-btn:active { transform: translateY(1px); }
.terms-overlay .terms-disagree-btn {
  background: var(--paper-3);
  color: var(--ink-700);
}
.terms-overlay .terms-disagree-btn:hover { background: var(--paper-4); }
#otpOverlay .terms-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
}
#otpOverlay.open .terms-card,
#otpOverlay.show .terms-card { transform: translateY(0) scale(1); opacity: 1; }
#otpOverlay .terms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) var(--s-5) var(--s-3);
}
#otpOverlay .terms-header h2 {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0;
}
#otpOverlay .terms-close {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  border: 0;
  color: var(--ink-600);
  cursor: pointer;
  font-size: 18px;
}
#otpOverlay .terms-body {
  padding: 0 var(--s-5) var(--s-3);
  overflow-y: auto;
}
#otpOverlay .otp-desc {
  font-size: var(--t-sm);
  color: var(--ink-600);
  margin-bottom: var(--s-2);
}
#otpOverlay .otp-hint {
  font-size: var(--t-xs);
  color: var(--ink-500);
  margin-bottom: var(--s-4);
}
#otpOverlay .otp-input-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--s-4);
}
#otpOverlay .otp-input {
  width: 100%;
  max-width: 260px;
  height: 56px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.3em;
  padding: 0 var(--s-3);
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-900);
  -webkit-appearance: none;
  appearance: none;
}
#otpOverlay .otp-input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
#otpOverlay .terms-footer {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5) var(--s-5);
  padding-bottom: max(var(--s-5), var(--bottom-safe));
  border-top: 1px solid var(--line);
}
#otpOverlay .btn,
#otpOverlay .btn-primary,
#otpOverlay .btn-secondary {
  flex: 1;
  min-height: 48px;
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
#otpOverlay .btn-primary {
  background: var(--brand-grad);
  color: #ffffff;
  border: 0;
}
#otpOverlay .btn-secondary {
  background: var(--paper);
  color: var(--ink-700);
  border: 1.5px solid var(--line-strong);
}
/**
 * Home screen — header (logo + profile), plate search, search button, feed.
 *
 * Targets legacy DOM:
 *   #mainWrapper > .home-header > #homeProfileBtn + autome-logo
 *   #plateSearchContainer (search wrapper) > #plate (input) + #searchBtn
 *   #homeFeed (feed grid)
 *   #homeContentArea (result card)
 */
#mainWrapper {
  max-width: 460px;
  margin: 0 auto;
  padding: calc(var(--s-2) + var(--safe-t)) var(--s-4) calc(var(--s-8) + var(--bottom-safe));
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper-2);
}
/* Home header — logo + profile button */
.home-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-3) 0 var(--s-5);
  min-height: 64px;
}
.home-header .autome-logo {
  text-decoration: none;
}
.home-header .autome-word-wrapper {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font);
  font-size: var(--t-3xl);
  font-weight: var(--fw-extra);
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.home-header .autome-m-animated {
  color: #f59e0b;
  -webkit-text-fill-color: #f59e0b;
}
/* Profile button (top corner) */
#homeProfileBtn,
.home-header .profile-btn,
.home-header .header-btn {
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 0;
  box-shadow: var(--sh-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--brand-3);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  overflow: visible;
}
#homeProfileBtn:hover { box-shadow: var(--sh-3); transform: translateY(-50%) scale(1.04); }
#homeProfileBtn:active { transform: translateY(-50%) scale(0.96); }
#homeProfileBtn .notification-dot {
  position: absolute !important;
  top: -4px !important;
  inset-inline-end: -4px !important;
  /* Counter-style badge: shows a number, grows for 2+ digits. */
  min-width: 20px !important;
  height: 20px !important;
  padding: 0 5px !important;
  border-radius: var(--r-pill) !important;
  background: var(--bad) !important;
  color: #ffffff !important;
  /* IMPORTANT: no `display: flex !important` here. The JS toggles
   * `style.display = 'none' | 'flex'` to show/hide; an !important rule
   * would override that and leave a phantom red pill on screen even
   * when the unread count is zero. The `:empty` rule below is a safety
   * net for cases where the JS forgot to hide it. */
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: var(--fw-bold) !important;
  border: 2px solid var(--paper) !important;
  line-height: 1 !important;
  z-index: 2 !important;
  pointer-events: none !important;
  margin: 0 !important;
}
/* Safety net — if the JS leaves the element visible but text-empty, treat
 * it as hidden. Stops a stale empty pill from showing as a red dot. */
#homeProfileBtn .notification-dot:empty { display: none !important; }
/* === Plate search — wraps the plate-input + search button === */
.search-card,
#plateSearchContainer {
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: var(--s-4);
  box-shadow: var(--sh-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
#searchBtn,
.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  background: var(--brand-grad);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-lg);
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  cursor: pointer;
  box-shadow: var(--sh-brand);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  gap: var(--s-2);
}
#searchBtn:hover { background: var(--brand-grad-hover); }
#searchBtn:active { transform: translateY(1px); }
#searchBtn:disabled { opacity: 0.55; cursor: not-allowed; }
/* === Home feed grid === */
#homeFeed.feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (max-width: 380px) {
  #homeFeed.feed-grid { grid-template-columns: 1fr; }
}
/* Minimalist card with 3D-tilt support (driven by cardEffects.js).
 * `transform-style: preserve-3d` lets child elements (.thumb, .body) sit on
 * separate Z-planes so the tilt has visible depth. The slow 400ms transition
 * is used for the settle-back animation; `cardEffects.js` adds `.tilting` to
 * suppress it while the pointer is moving so the card tracks instantly. */
#homeFeed .feed-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  border: 1px solid rgba(15, 23, 42, 0.04);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 196px;
  position: relative;
  transform-style: preserve-3d;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-3) var(--ease);
  will-change: transform;
}
#homeFeed .feed-card.tilting {
  transition: box-shadow var(--dur-2) var(--ease);
}
#homeFeed .feed-card:hover { box-shadow: var(--sh-3); }
#homeFeed .feed-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--paper-3);
  overflow: hidden;
  position: relative;
  transform: translateZ(20px);
}
#homeFeed .feed-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms var(--ease);
}
#homeFeed .feed-card:hover .thumb img { transform: scale(1.04); }
#homeFeed .feed-card .body {
  padding: var(--s-3) var(--s-3) var(--s-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  transform: translateZ(30px);
}
#homeFeed .feed-card .title {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0;
  line-height: var(--lh-snug);
}
#homeFeed .feed-card .subtitle {
  font-size: var(--t-xs);
  color: var(--ink-500);
  line-height: var(--lh-snug);
  margin: 0;
}
/* Glare — bright spot that tracks the pointer for the premium-card feel.
 * Injected as the first child of every .feed-card by cardEffects.js. */
#homeFeed .feed-card .glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 200px at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 255, 255, 0.35),
    transparent 60%
  );
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
  mix-blend-mode: overlay;
  z-index: 1;
}
#homeFeed .feed-card.tilting .glare { opacity: 1; }
/* Live indicator — pulsing dot in the top-end corner of cards that show
 * real-time data (weather, charging-station distances). cardEffects.js adds
 * this automatically when it detects a relevant card. */
#homeFeed .feed-card .live-dot {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: feed-card-live-pulse 2s ease-out infinite;
  z-index: 2;
  pointer-events: none;
}
@keyframes feed-card-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
/* === Results card (search results in-place) === */
.results-card {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-4);
  margin-top: var(--s-4);
}
.section-title {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0 0 var(--s-3);
}
/* Trademark footer */
.trademark-footer {
  text-align: center;
  padding: var(--s-6) 0 var(--s-3);
  font-size: var(--t-xs);
  color: var(--ink-400);
}
.trademark-link {
  font-weight: var(--fw-semi);
  letter-spacing: 0.05em;
}
/**
 * Account drawer + sub-modals (my car, history, messages, about).
 * Targets: #accountDrawer, #accountContent, #myCarSubModal, #historySubModal,
 *          #messagesSubModal, #aboutSubModal.
 */
#accountDrawer .drawer-header { padding-inline: var(--s-4); }
#accountDrawer #accountContent { flex: 1; overflow-y: auto; padding: var(--s-4); }
#accountDrawer .account-section { display: none; }
#accountDrawer .account-section.is-active { display: block; }
/* My car card (legacy class .car-card) */
.car-card {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-4);
  margin-bottom: var(--s-3);
}
.car-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.car-card .row:not(:last-child) {
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
#mycar_summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  font-size: var(--t-sm);
  color: var(--ink-500);
}
/* Sub-modals share the drawer structure (already styled by drawer.css).
   Just tweak inner content sizing here. */
#myCarSubModal #myCarSubModalContent,
#historySubModal #historySubModalContent,
#messagesSubModal #messagesSubModalContent,
#aboutSubModal .drawer-content { padding: var(--s-4); }
/* History list (search history inside historySubModal) */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.history-item:hover { background: var(--paper-3); }
.history-empty {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--ink-500);
  font-size: var(--t-sm);
}
.history-actions {
  display: flex;
  gap: var(--s-2);
}
.btn-ghost.danger,
#clearHistoryBtn {
  background: transparent;
  color: var(--bad);
  border: 0;
  font-weight: var(--fw-semi);
  font-size: var(--t-sm);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  cursor: pointer;
}
#clearHistoryBtn:hover { background: var(--bad-soft); }
/* About section content */
#aboutSubModal .drawer-content,
.account-section .about-text {
  font-size: var(--t-sm);
  color: var(--ink-700);
  line-height: var(--lh-loose);
}
/**
 * Search results screen / modal (#searchResultsModal).
 * Each result card has plate + status pills + action buttons (call/message).
 */
#searchResultsModal .drawer { background: var(--paper-2); }
#srList,
.history-list#srList {
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  overflow-y: auto;
}
/* Single result card (rendered by buildResultCardHTML) */
#srList .result-card,
#srList article,
#srList > div:not(.history-empty) {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-4);
}
#srList .result-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-3);
}
#srList .result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--ink-600);
  margin-bottom: var(--s-3);
}
#srList .result-meta b { color: var(--ink-900); font-weight: var(--fw-semi); }
#srList .result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
#srList .result-actions button {
  min-height: 52px;
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-weight: var(--fw-bold);
  font-size: var(--t-md);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
#srList .result-actions button:hover { box-shadow: var(--sh-2); }
#srList .result-actions button:active { transform: translateY(1px); }
/* The legacy buildResultCardHTML inlines gradients — keep the inline styles
   but ensure our base button rule above doesn't override them. */
/**
 * Messaging screens — inbox, conversation, send modal, preset picker.
 * These build on `drawer.css` and override only the specifics. The new
 * `features/messaging/*.view.js` files also inject some inline styles for
 * the dynamically-created overlays (#messagingInboxOverlay,
 * #messagingConversationOverlay, #messagingPresetOverlay).
 */
/* === Send message modal (uses existing #sendMessageModal in index.html) === */
#sendMessageModal #sendMessageForm {
  padding: var(--s-4);
}
#sendMessageModal .form-group { margin-bottom: var(--s-4); }
#sendMessageModal .form-label {
  display: block;
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  color: var(--ink-700);
  margin-bottom: var(--s-2);
}
#sendMessageModal #userMessageContent.form-input {
  width: 100%;
  min-height: 120px;
  padding: var(--s-3);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font: inherit;
  font-size: var(--t-md);
  color: var(--ink-900);
  resize: vertical;
}
#sendMessageModal #userMessageContent:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
#sendMessageModal #messageCharCount + span { color: var(--ink-500); }
#sendMessageModal #sendMessageForm button[type='submit'] {
  width: 100%;
  min-height: 54px;
  background: var(--brand-grad) !important;
  border: 0;
  border-radius: var(--r-lg);
  color: #ffffff;
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  cursor: pointer;
  margin-top: var(--s-2);
  box-shadow: var(--sh-brand);
}
#sendMessageModal #sendMessageForm button[type='submit']:hover {
  background: var(--brand-grad-hover) !important;
}
#sendMessageResult.result-box {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
}
/* Plate-banner styling inside the send modal */
#sendMessageModal #targetPlateDisplay {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
}
/* === Char counter alignment === */
#sendMessageModal .form-group > div[style*='text-align: left'] {
  text-align: end !important;
}
/* === Chat modal — legacy structure kept as a backup === */
#chatModal .drawer { background: var(--paper); }
/* === Notification badges (drawer nav, header) === */
#navNotificationBadge,
#headerNotificationBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--bad);
  color: #ffffff;
  border-radius: var(--r-pill);
  font-size: var(--t-2xs);
  font-weight: var(--fw-bold);
  margin-inline-start: 6px;
}
/**
 * Calling screen — full-viewport overlay shown while an anonymous Twilio
 * call is in progress. The view is created dynamically by
 * `features/calling/calling.view.js` which also injects its own inline styles,
 * but we lock in the look-and-feel here too so the design tokens are
 * consistent with the rest of the app.
 */
#callingScreenOverlay,
.calling-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
#callingScreenOverlay.open,
.calling-overlay.open { display: flex; opacity: 1; }
.calling-card {
  text-align: center;
  padding: var(--s-12) var(--s-6);
  max-width: 440px;
  width: calc(100% - var(--s-8));
  direction: rtl;
  position: relative;
}
.calling-icon {
  font-size: 56px;
  margin-bottom: var(--s-4);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 12px rgba(20, 184, 166, 0.30));
}
.calling-plate {
  font-family: var(--font-mono);
  font-size: var(--t-2xl);
  font-weight: var(--fw-extra);
  letter-spacing: 0.08em;
  margin: 0 0 var(--s-2);
  color: #ffffff;
  direction: ltr;
}
.calling-status {
  font-size: var(--t-md);
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 var(--s-8);
  min-height: 24px;
}
.calling-cancel {
  background: var(--bad);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-pill);
  padding: var(--s-4) var(--s-10);
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.40);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.calling-cancel:hover { background: #dc2626; }
.calling-cancel:active { transform: translateY(1px); }
/* Pulsing rings */
.calling-rings { position: absolute; inset: 0; pointer-events: none; }
.calling-ring {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  border: 2px solid rgba(20, 184, 166, 0.7);
  border-radius: var(--r-pill);
  animation: calling-pulse 1.8s infinite ease-out;
}
.calling-ring:nth-child(2) { animation-delay: 0.6s; }
.calling-ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes calling-pulse {
  0%   { transform: translateX(-50%) scale(0.6); opacity: 1; }
  100% { transform: translateX(-50%) scale(2.4); opacity: 0; }
}
/**
 * Plate scanner — full-viewport modal that shows the camera + reticle overlay.
 * Targets #plateScannerModal and the inner elements that the JS controller
 * creates / updates (.scanner-frame, .scanner-progress-bar, etc.).
 */
#plateScannerModal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  flex-direction: column;
  background: #000000;
  color: #ffffff;
}
#plateScannerModal.open { display: flex; }
.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--s-4) + var(--safe-t)) var(--s-4) var(--s-4);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
  color: #ffffff;
}
.scanner-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-md);
  font-weight: var(--fw-semi);
}
.scanner-close-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#scannerVideo,
#scannerPreview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#scannerPreview { display: none; }
.scanner-frame {
  position: absolute;
  width: 70%;
  height: 25%;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--brand-1);
  border-radius: var(--r-md);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.scanner-frame::before,
.scanner-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--brand-2);
  border-style: solid;
}
.scanner-frame::before {
  top: -3px;
  left: -3px;
  border-width: 4px 0 0 4px;
  border-top-left-radius: var(--r-md);
}
.scanner-frame::after {
  bottom: -3px;
  right: -3px;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: var(--r-md);
}
.scanner-manual-btn {
  margin: var(--s-3) auto;
  padding: var(--s-3) var(--s-5);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  align-self: center;
}
#scannerProgressContainer {
  padding: 0 var(--s-4) var(--s-3);
  display: none;
}
.scanner-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--r-pill);
  overflow: hidden;
}
#scannerProgress {
  height: 100%;
  background: var(--brand-1);
  width: 0;
  transition: width var(--dur-2) var(--ease);
}
#scannerProgressText {
  text-align: center;
  margin-top: var(--s-2);
  font-size: var(--t-sm);
  color: rgba(255, 255, 255, 0.85);
}
#scannerResult { padding: 0 var(--s-4) var(--s-3); }
.scanner-result-card {
  background: var(--paper);
  color: var(--ink-900);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  text-align: center;
  margin: var(--s-3) auto;
  max-width: 360px;
}
.scanner-result-plate {
  font-family: var(--font-mono);
  font-size: var(--t-2xl);
  font-weight: var(--fw-extra);
  letter-spacing: 0.08em;
  background: #FBE65A;
  border: 2.5px solid #0d1a2c;
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-4);
  margin: var(--s-3) auto;
  display: inline-block;
}
.scanner-actions { display: flex; gap: var(--s-2); justify-content: center; margin-top: var(--s-3); }
.scanner-btn {
  min-height: 44px;
  padding: 0 var(--s-5);
  background: var(--paper-3);
  color: var(--ink-700);
  border: 0;
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
.scanner-btn.primary {
  background: var(--brand-grad);
  color: #ffffff;
}
.scanner-tips {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--s-3) var(--s-4);
  margin: var(--s-3);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  color: rgba(255, 255, 255, 0.85);
}
.scanner-tips-title { font-weight: var(--fw-semi); margin-bottom: var(--s-2); display: flex; align-items: center; gap: var(--s-2); }
.scanner-tips-list { padding-inline-start: var(--s-4); }
.scanner-tips-list li { margin-bottom: var(--s-1); }
/**
 * Garages screen — full styling for the legacy DOM produced by
 * `www/modals/garages-screen.js`.
 *
 * Scoped to #garagesContainer so the (very generic) class names like
 * `.container`, `.controls`, `.btn` don't leak into other modals.
 */
#garagesContainer .drawer { background: var(--paper-2); }
#garagesContainer #garagesContent { padding: 0; background: var(--paper-2); }
#garagesContainer .container {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
/* === Controls block (city picker + free search + filters) === */
#garagesContainer .controls {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
#garagesContainer .control-section {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
#garagesContainer .control-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  color: var(--ink-700);
}
#garagesContainer input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font: inherit;
  font-size: var(--t-md);
  color: var(--ink-900);
  outline: none;
  transition: border-color var(--dur-1) var(--ease);
}
#garagesContainer input[type="text"]:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
#garagesContainer .city-input-wrapper {
  position: relative;
}
#garagesContainer .dropdown-toggle {
  position: absolute;
  inset-inline-start: var(--s-2);
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: transparent;
  border: 0;
  color: var(--ink-500);
  font-size: 12px;
  cursor: pointer;
}
#garagesContainer .dropdown-toggle:hover { background: var(--paper-3); }
#garagesContainer #cityList {
  display: none;
  margin-top: var(--s-2);
  max-height: 240px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
}
#garagesContainer #cityList.open { display: block; }
#garagesContainer .city-item {
  padding: var(--s-3);
  font-size: var(--t-sm);
  color: var(--ink-900);
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
#garagesContainer .city-item:last-child { border-bottom: 0; }
#garagesContainer .city-item:hover { background: var(--paper-3); }
#garagesContainer .loading-text {
  padding: var(--s-3);
  text-align: center;
  font-size: var(--t-sm);
  color: var(--ink-500);
}
/* === Buttons === */
#garagesContainer .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: var(--fw-semi);
  background: var(--paper-3);
  color: var(--ink-700);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
#garagesContainer .btn:hover { background: var(--paper-4); }
#garagesContainer .btn-primary {
  background: var(--brand-grad);
  color: #ffffff;
  box-shadow: var(--sh-brand);
}
#garagesContainer .btn-primary:hover { filter: brightness(1.05); }
/* === Filter pills === */
#garagesContainer .filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
#garagesContainer .filter-pills > * {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  color: var(--ink-700);
  font-size: var(--t-xs);
  font-weight: var(--fw-semi);
  border: 1px solid var(--line);
  cursor: pointer;
}
#garagesContainer .filter-pills > .active {
  background: var(--brand-1);
  color: #ffffff;
  border-color: var(--brand-1);
}
/* === Stats / errors === */
#garagesContainer #statsBar {
  padding: var(--s-2) var(--s-3);
  background: var(--brand-1-soft);
  color: var(--brand-3);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  text-align: center;
}
#garagesContainer #errorMessage {
  padding: var(--s-3);
  background: rgba(239, 68, 68, 0.08);
  color: var(--bad);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
}
#garagesContainer #errorMessage:empty { display: none; }
/* === Garage list === */
#garagesContainer #garageList {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
#garagesContainer .garage-card {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
#garagesContainer .garage-header { display: flex; }
#garagesContainer .garage-title { flex: 1; min-width: 0; }
#garagesContainer .garage-name {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin-bottom: var(--s-1);
}
#garagesContainer .garage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#garagesContainer .meta-badge {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  color: var(--ink-700);
  font-size: var(--t-2xs);
  font-weight: var(--fw-semi);
  white-space: nowrap;
}
#garagesContainer .meta-badge.primary {
  background: var(--brand-1-soft);
  color: var(--brand-3);
}
/* Phone / address block */
#garagesContainer .info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2);
}
@media (max-width: 380px) {
  #garagesContainer .info-grid { grid-template-columns: 1fr; }
}
#garagesContainer .info-item {
  background: var(--paper-2);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-3);
}
#garagesContainer .info-label {
  font-size: var(--t-2xs);
  color: var(--ink-500);
  margin-bottom: 2px;
}
#garagesContainer .info-value {
  font-size: var(--t-sm);
  color: var(--ink-900);
  font-weight: var(--fw-semi);
}
/* Action buttons */
#garagesContainer .garage-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--s-2);
}
@media (max-width: 380px) {
  #garagesContainer .garage-actions { grid-template-columns: 1fr 1fr; }
}
#garagesContainer .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 var(--s-2);
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: filter var(--dur-1) var(--ease);
}
#garagesContainer .action-call {
  background: var(--good);
  color: #ffffff;
}
#garagesContainer .action-navigate {
  background: var(--brand-grad);
  color: #ffffff;
}
#garagesContainer .action-details {
  background: var(--paper-3);
  color: var(--ink-700);
}
#garagesContainer .action-btn:hover { filter: brightness(1.05); }
#garagesContainer .action-details:hover { background: var(--paper-4); filter: none; }
/* Expanded details */
#garagesContainer .details {
  background: var(--paper-2);
  border-radius: var(--r-md);
  padding: var(--s-3);
}
#garagesContainer .details-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
#garagesContainer .detail-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}
#garagesContainer .detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
#garagesContainer .detail-label {
  font-size: var(--t-xs);
  color: var(--ink-500);
  flex-shrink: 0;
}
#garagesContainer .detail-value {
  font-size: var(--t-sm);
  color: var(--ink-900);
  font-weight: var(--fw-semi);
  text-align: end;
}
/* Bottom padding so the last card clears the AdMob banner + nav bar. */
#garagesContainer .drawer-body {
  padding-bottom: var(--bottom-safe) !important;
}
/**
 * Charge stations screen — full styling for the legacy DOM produced by
 * `www/index.html` (#stationsContainer + #stationsApp) and rendered by
 * `www/modals/stations.js`.
 *
 * Scoped to #stationsContainer so the generic class names don't leak.
 */
#stationsContainer .drawer { background: var(--paper-2); }
#stationsContainer #stationsApp {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
/* ===== Top section: filters + stats banners ============================ */
#stationsContainer .controls {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-3);
}
#stationsContainer #filterSection {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
#stationsContainer #filterSection:empty { display: none; }
/* The legacy CSS had a typo: #stations.stats. Real selectors below. */
#stationsContainer #stats,
#stationsContainer #locationInfo {
  background: var(--brand-grad);
  color: #ffffff;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-lg);
  font-size: var(--t-sm);
  box-shadow: var(--sh-brand);
}
#stationsContainer #stats strong {
  display: block;
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  margin-bottom: 2px;
}
#stationsContainer #stats:empty,
#stationsContainer #locationInfo:empty { display: none; }
#stationsContainer #errorMessage {
  background: rgba(239, 68, 68, 0.08);
  color: var(--bad);
  padding: var(--s-3);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  text-align: center;
}
#stationsContainer #errorMessage:empty { display: none; }
#stationsContainer #welcomeMessage {
  text-align: center;
  padding: var(--s-8) var(--s-4);
  background: var(--paper);
  border-radius: var(--r-lg);
  font-size: var(--t-md);
  color: var(--ink-700);
  box-shadow: var(--sh-2);
  font-weight: var(--fw-semi);
}
/* ===== Filter chips =================================================== */
#stationsContainer .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  color: var(--ink-700);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
#stationsContainer .chip:hover { background: var(--paper-3); }
#stationsContainer .chip.active {
  background: var(--brand-1);
  border-color: var(--brand-1);
  color: #ffffff;
}
#stationsContainer .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
  padding: 0 6px;
  border-radius: var(--r-pill);
  font-size: var(--t-2xs);
  font-weight: var(--fw-bold);
}
#stationsContainer .chip:not(.active) .chip-count {
  background: var(--paper-4);
  color: var(--ink-700);
}
/* ===== Station cards =====
 * Targets the classes produced by the ACTIVE renderer in www/app.js
 * (`cardHTML(rec)`): .station-card / .charging-indicator / .station-main /
 * .station-header / .station-name / .station-meta-inline / .meta-item-inline
 * / .meta-number-inline / .meta-label-inline / .station-details /
 * .station-detail / .station-icon / .station-actions / .action-btn /
 * .waze-btn / .maps-btn.
 *
 * (There's also www/modals/stations.js with `.station-card-luxe` etc., but
 * the live charge-stations flow goes through app.js. We style only the
 * active classes — the luxe-suffixed renderer isn't reachable from the UI.)
 */
#stationsContainer #stationList {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
#stationsContainer .station-card {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: var(--s-4);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
#stationsContainer .station-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-3);
}
#stationsContainer .station-card .charging-indicator {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-grad);
}
#stationsContainer .station-main { padding-inline-start: var(--s-2); }
#stationsContainer .station-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--s-2);
  gap: var(--s-3);
}
#stationsContainer .station-name {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  line-height: var(--lh-snug);
  flex: 1;
  min-width: 0;
}
#stationsContainer .station-meta-inline {
  display: flex;
  gap: var(--s-3);
  flex-shrink: 0;
}
#stationsContainer .meta-item-inline {
  text-align: center;
}
#stationsContainer .meta-number-inline {
  font-size: var(--t-xl);
  font-weight: var(--fw-extra);
  color: var(--brand-3);
  line-height: 1;
}
#stationsContainer .meta-label-inline {
  font-size: var(--t-2xs);
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
#stationsContainer .station-details {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
}
#stationsContainer .station-detail {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  color: var(--ink-600);
}
#stationsContainer .station-icon { font-size: 16px; }
#stationsContainer .station-actions {
  display: flex;
  gap: var(--s-2);
}
#stationsContainer .action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-height: 40px;
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  font-weight: var(--fw-bold);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  color: #ffffff;
  transition: filter var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
#stationsContainer .action-btn:hover { filter: brightness(1.05); }
#stationsContainer .action-btn:active { transform: translateY(1px); }
#stationsContainer .waze-btn { background: #33CCFF; }
#stationsContainer .maps-btn { background: #4285F4; }
/* No results state */
#stationsContainer .no-results {
  text-align: center;
  padding: var(--s-8) var(--s-4);
  color: var(--ink-500);
}
#stationsContainer .no-results-icon {
  font-size: 48px;
  margin-bottom: var(--s-3);
}
#stationsContainer .no-results h3 {
  font-size: var(--t-lg);
  color: var(--ink-900);
  margin: 0 0 var(--s-2);
}
/* ===== Load-more button =============================================== */
#stationsContainer #loadMoreContainer {
  display: none;
  text-align: center;
  padding: var(--s-2) 0;
}
#stationsContainer #loadMoreContainer.active { display: block; }
#stationsContainer #loadMoreBtn {
  padding: var(--s-3) var(--s-6);
  background: var(--brand-1-soft);
  color: var(--brand-3);
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  cursor: pointer;
}
#stationsContainer #loadMoreBtn:hover { background: var(--brand-1); color: #ffffff; }
/* ===== Loading state ================================================== */
#stationsContainer #globalLoading {
  text-align: center;
  padding: var(--s-8) var(--s-3);
  color: var(--ink-600);
  font-size: var(--t-sm);
}
#stationsContainer .loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--s-3);
  position: relative;
}
#stationsContainer .charging-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-1);
  animation: stations-pulse 1.2s ease-in-out infinite;
}
#stationsContainer .charging-circle:nth-child(2) { animation-delay: 0.15s; }
#stationsContainer .charging-circle:nth-child(3) { animation-delay: 0.30s; }
#stationsContainer .charging-icon {
  position: absolute;
  font-size: 18px;
}
@keyframes stations-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
#stationsContainer .loading-dots {
  display: inline-flex;
  gap: 3px;
  margin-inline-start: 4px;
}
#stationsContainer .loading-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: stations-pulse 1.2s ease-in-out infinite;
}
#stationsContainer .loading-dot:nth-child(2) { animation-delay: 0.15s; }
#stationsContainer .loading-dot:nth-child(3) { animation-delay: 0.30s; }
/* Bottom padding so the last card clears the AdMob banner + nav bar. */
#stationsContainer .drawer-body {
  padding-bottom: var(--bottom-safe) !important;
}
/**
 * Auto services screen — grid of category tiles (gas, garages, washes, etc.)
 * Targets #autoServicesContainer.
 */
#autoServicesContainer .drawer-content { padding: var(--s-4); }
.auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
@media (min-width: 480px) {
  .auto-grid { grid-template-columns: repeat(3, 1fr); }
}
.auto-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-height: 110px;
  padding: var(--s-3);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  font: inherit;
}
.auto-card:hover {
  border-color: var(--brand-1);
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
}
.auto-icon { font-size: 32px; line-height: 1; }
.auto-name { font-size: var(--t-sm); font-weight: var(--fw-bold); color: var(--ink-900); }
.auto-desc { font-size: var(--t-xs); color: var(--ink-500); text-align: center; }
.auto-row {
  display: none;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  align-items: center;
}
.auto-row[style*='flex'] { display: flex !important; }
#autoCityInput {
  flex: 1;
  min-height: 44px;
  padding: 0 var(--s-3);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font: inherit;
}
.auto-actions {
  text-align: center;
  padding: var(--s-5);
  background: var(--paper);
  border-radius: var(--r-lg);
  margin-top: var(--s-3);
}
.auto-big { font-size: 48px; margin-bottom: var(--s-2); }
.auto-h1 { font-size: var(--t-lg); font-weight: var(--fw-bold); color: var(--ink-900); margin-bottom: var(--s-1); }
.auto-sub { font-size: var(--t-sm); color: var(--ink-500); margin-bottom: var(--s-4); }
.auto-btns { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; }
.auto-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  text-decoration: none;
  cursor: pointer;
  border: 0;
}
.auto-btn.primary { background: var(--brand-grad); color: #ffffff; }
/* ===== Active category card (after tap) ===== */
.auto-card.is-active {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
  background: var(--brand-1-soft);
}
/* ===== Placeholder shown before any category is picked ===== */
.svc-placeholder {
  text-align: center;
  padding: var(--s-5) var(--s-3);
}
.svc-placeholder-icon { font-size: 44px; margin-bottom: var(--s-2); opacity: 0.7; }
.svc-placeholder-title {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin-bottom: var(--s-1);
}
.svc-placeholder-sub {
  font-size: var(--t-sm);
  color: var(--ink-500);
}
/* ===== Results list ===== */
.svc-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-1);
  margin-bottom: var(--s-2);
}
.svc-header-icon { font-size: 24px; }
.svc-header-title {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
}
.svc-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--s-2);
}
.svc-empty {
  padding: var(--s-5) var(--s-3);
  text-align: center;
  color: var(--ink-500);
  font-size: var(--t-sm);
}
.svc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.svc-card:hover {
  border-color: var(--brand-1);
  box-shadow: var(--sh-2);
}
.svc-card-body { display: flex; flex-direction: column; gap: 4px; }
.svc-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-2);
}
.svc-name {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0;
  flex: 1;
}
.svc-distance {
  font-size: var(--t-xs);
  font-weight: var(--fw-semi);
  color: var(--brand-3);
  background: var(--brand-1-soft);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.svc-brand {
  display: inline-block;
  font-size: var(--t-xs);
  font-weight: var(--fw-semi);
  color: var(--ink-700);
  background: var(--paper-3);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  width: fit-content;
}
.svc-addr,
.svc-profession,
.svc-hours,
.svc-extra {
  font-size: var(--t-xs);
  color: var(--ink-500);
}
.svc-actions {
  display: flex;
  gap: var(--s-2);
  padding-top: var(--s-1);
  border-top: 1px solid var(--line);
}
.svc-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  padding: 10px var(--s-3);
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink-700);
  border: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.svc-btn:hover { background: var(--paper-3); }
.svc-btn.primary {
  background: var(--brand-grad);
  color: #fff;
  border-color: transparent;
}
.svc-btn.primary:hover { filter: brightness(1.05); }
/* "Load more" pager at the bottom of the result list */
.svc-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px var(--s-4);
  margin-top: var(--s-2);
  background: var(--paper);
  color: var(--brand-3);
  border: 1.5px dashed var(--brand-1);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--t-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.svc-load-more:hover {
  background: var(--brand-1-soft);
  border-style: solid;
}
.svc-load-more strong { color: var(--brand-3); font-weight: var(--fw-bold); }
.svc-load-more-total {
  font-size: var(--t-xs);
  color: var(--ink-500);
  font-weight: var(--fw-regular);
}
.svc-list-end {
  text-align: center;
  padding: var(--s-3);
  color: var(--ink-400);
  font-size: var(--t-xs);
}
.auto-btn.outline { background: transparent; color: var(--brand-3); border: 1.5px solid var(--brand-1); }
/**
 * Weather modal — full styling for the legacy DOM produced by
 * `www/modals/weather-card.js`.
 *
 * Scoped to #wxModal so the generic class names (.hour-time, .icon, etc.)
 * don't leak into other modals.
 */
#wxModal .drawer {
  background: var(--paper-2);
}
#wxModal #wxBody {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
/* === Current-conditions hero card === */
#wxModal .wx-main-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
#wxModal .wx-current-big {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}
#wxModal .weather-icon-animated {
  font-size: 64px;
  line-height: 1;
  margin-bottom: var(--s-2);
}
/* The JS hard-codes some inline colors for the temp/city/desc text that
 * clash with the brand. Override them. */
#wxModal .wx-current-big > div[style*="font-size:4rem"] {
  font-size: 4rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  margin-bottom: 4px !important;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}
#wxModal .wx-current-big > div[style*="font-size:1.3rem"] {
  font-size: var(--t-lg) !important;
  font-weight: var(--fw-bold) !important;
  color: var(--ink-900) !important;
  margin-bottom: 4px !important;
}
#wxModal .wx-current-big > div[style*="font-size:1.1rem"] {
  font-size: var(--t-md) !important;
  color: var(--ink-600) !important;
}
/* === Details grid (wind / humidity / location / time) === */
#wxModal .wx-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-2);
}
#wxModal .wx-detail-box {
  background: var(--paper-2);
  border-radius: var(--r-md);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  border: 1px solid var(--line);
}
#wxModal .wx-detail-box .icon {
  font-size: 22px;
  line-height: 1;
}
#wxModal .wx-detail-box .label {
  font-size: var(--t-2xs);
  color: var(--ink-500);
}
#wxModal .wx-detail-box .value {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
}
#wxModal .wx-detail-box.extreme {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}
#wxModal .wx-detail-box.extreme .value { color: var(--bad); }
/* === Hourly forecast card === */
#wxModal .wx-forecast-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: var(--s-5);
}
#wxModal .wx-forecast-card h3 {
  font-size: var(--t-md);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0 0 var(--s-3);
  text-align: center;
}
#wxModal .wx-forecast-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
#wxModal .wx-forecast-hour {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--paper-2);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
#wxModal .wx-forecast-hour .time-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 60px;
}
#wxModal .wx-forecast-hour .hour-time {
  font-size: var(--t-sm);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
}
#wxModal .wx-forecast-hour .hour-icon {
  font-size: 24px;
  line-height: 1;
}
#wxModal .wx-forecast-hour .hour-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#wxModal .wx-forecast-hour .hour-temp {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: var(--brand-3);
}
#wxModal .wx-forecast-hour .hour-desc {
  font-size: var(--t-sm);
  color: var(--ink-700);
}
#wxModal .wx-forecast-hour .hour-wind {
  font-size: var(--t-xs);
  color: var(--ink-500);
}
/* === Alerts (severe-weather banner above the main card) === */
#wxModal .weather-alert {
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  border: 1px solid;
  background: var(--paper);
}
#wxModal .weather-alert.warning,
#wxModal .weather-alert.heat {
  background: #fff7ed;
  border-color: rgba(245, 158, 11, 0.4);
  color: #92400e;
}
#wxModal .weather-alert.danger,
#wxModal .weather-alert.storm {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.4);
  color: #991b1b;
}
#wxModal .weather-alert-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-1);
}
#wxModal .weather-alert-icon { font-size: 20px; }
#wxModal .weather-alert-title {
  font-weight: var(--fw-bold);
  font-size: var(--t-md);
}
#wxModal .weather-alert-message {
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
}
/* === Source line at the bottom (the JS uses inline `color: rgba(255,255,255,...)`
 *     which is invisible on our light background — override it). === */
#wxModal #wxBody > div[style*="rgba(255,255,255"] {
  color: var(--ink-500) !important;
}
/* === Loading spinner (legacy class names from the charging modal) === */
#wxModal .loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: var(--s-8) 0;
}
#wxModal .loading-spinner .charging-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-1);
  animation: wx-pulse 1.2s ease-in-out infinite;
}
#wxModal .loading-spinner .charging-circle:nth-child(2) { animation-delay: 0.15s; }
#wxModal .loading-spinner .charging-circle:nth-child(3) { animation-delay: 0.30s; }
@keyframes wx-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
/* Bottom padding so the source line and last forecast hour clear the
 * AdMob banner + nav bar. */
#wxModal .drawer-body {
  padding-bottom: var(--bottom-safe) !important;
}
/* Legacy class-name compatibility — styles for class names baked into the
   existing index.html (.drawer-overlay, .car-card, etc.) using the new
   design tokens. Loaded last so it wins on equal specificity. */
/**
 * Legacy class compatibility layer.
 *
 * The HTML in `www/index.html` and the JS in `www/modals/*.js` use class
 * names that were originally styled by the deleted `styles.css`. This file
 * maps each of those legacy class names to the new design tokens / patterns
 * so the existing markup keeps looking right without touching a single tag.
 *
 * Loaded LAST in `index.css` so legacy-class rules win on equal specificity.
 */
/* === Custom-alert overlay (used by legacy showError, showNotice, showConfirm, etc.) ===
 * Uses --z-modal-top because confirm dialogs are routinely opened FROM
 * inside a legacy sub-modal (myCarSubModal / historySubModal / etc.) that
 * carries an inline `z-index: 11001`. With the plain --z-modal (2000) the
 * confirm would render behind the sub-modal. */
.custom-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-top);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: var(--backdrop);
}
.custom-alert-overlay.show,
.custom-alert-overlay[style*='display: flex'],
.custom-alert-overlay[style*='display:flex'] { display: flex; }
.custom-alert-box {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  width: 100%;
  max-width: 380px;
  padding: var(--s-5);
  text-align: center;
}
.custom-alert-box p { color: var(--ink-700); font-size: var(--t-md); margin-bottom: var(--s-4); }
.custom-alert-box button {
  min-height: 48px;
  padding: 0 var(--s-5);
  background: var(--brand-grad);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  cursor: pointer;
  min-width: 120px;
}
/* === Notice overlay === */
#noticeOverlay { z-index: var(--z-toast); }
/* === Confirm/Notice/Success inline alerts (confirm-notices.js) === */
.custom-alert {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  background: var(--info-soft);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.success-alert {
  position: fixed;
  inset-inline: var(--s-4);
  bottom: max(var(--s-4), var(--bottom-safe));
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-4);
  background: var(--ok);
  color: #ffffff;
  border-radius: var(--r-md);
  display: none;
  text-align: center;
  box-shadow: var(--sh-3);
}
.success-alert.show { display: block; }
/* === Plate badge (legacy class — also defined in plate-input.css) === */
/* keeping the same definition here for older callsites */
/* ===================================================================
   Plate search widget — restored 1:1 from the original styles.css that
   the user approved. Only the brand-color references swapped to the new
   Teal tokens; layout + dimensions + classes untouched.
   =================================================================== */
#searchContainer.lux { padding: var(--s-3) 0; }
.search-grid { display: flex; flex-direction: column; gap: var(--s-4); }
.search-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
/* Plate wrapper — proper Israeli license plate look:
     [IL strip] [yellow digit area] [floating camera button]
   Pixel-tuned against the reference image the user provided. */
.plate-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  height: 64px;
  border: 3px solid #0d1a2c;
  border-radius: 12px;
  background: #FFD814;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  direction: ltr;
}
/* Blue IL strip on the LEFT.
   HTML has it last in source order; `order:-1` brings it to the start.
   Fixed width so it never collapses on narrow screens. */
.plate-symbol {
  order: -1;
  flex: 0 0 54px;
  width: 54px;
  background: #1e2952;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px;
  font-weight: bold;
  border-inline-end: 3px solid #0d1a2c;
  box-sizing: border-box;
}
.plate-symbol .flag {
  width: 22px;
  height: auto;
  margin-bottom: 2px;
  border-radius: 2px;
  display: block;
}
.plate-symbol .il-text {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.5px;
}
.plate-symbol .hebrew {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  opacity: 0.95;
}
.plate-symbol .arabic {
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.85;
}
/* Yellow plate body — the digits */
#searchPlate {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: 'Arial Black', 'Heebo', sans-serif;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 2px;
  color: #0d1a2c;
  outline: none;
  padding: 0 12px;
  height: 100%;
  direction: ltr;
  -webkit-appearance: none;
  appearance: none;
}
#searchPlate::placeholder {
  font-family: var(--font);
  font-size: 14px;
  color: rgba(13, 26, 44, 0.45);
  letter-spacing: 0;
  font-weight: 600;
}
/* Floating circular camera button on the right side of the plate */
.plate-scanner-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  z-index: 5;
}
.plate-scanner-btn:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.55);
}
.plate-scanner-btn:active { transform: translateY(-50%) scale(0.94); }
/* Hide the camera scanner button on the web — Tesseract.js OCR is too
 * unreliable for live plate scanning in a desktop browser, so we expose
 * the scanner only inside the Capacitor app (where it uses ML Kit and
 * works well). Body class set in `src/app/bootstrap.js`. Also un-reserve
 * the padding the button used to occupy so the plate input centres
 * properly on its own. */
body.is-web .plate-scanner-btn { display: none !important; }
body.is-web #searchPlate.has-scanner {
  padding-right: 12px !important;
}
/* Reserve space on the right of the digits for the floating camera button */
#searchPlate.has-scanner {
  padding-right: 52px !important;
  padding-left: 12px !important;
  text-align: center !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  letter-spacing: 2px !important;
  font-size: 26px !important;
}
/* CTA search button — brand gradient */
.cta-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background-image: var(--brand-grad);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.22);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.cta-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 26px rgba(20, 184, 166, 0.30);
}
.cta-btn:active { transform: translateY(0); }
.cta-btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* ===================================================================
   AutoMe logo — its word-wrapper contains spans in LTR order
   (Auto + M + e). On an RTL page the spans are visually reversed,
   producing "eMAuto". Force LTR direction on the wrapper to keep the
   brand reading "AutoMe" everywhere.
   =================================================================== */
.autome-logo,
.autome-word-wrapper {
  direction: ltr !important;
  unicode-bidi: embed;
  display: inline-flex;
  align-items: baseline;
}
/* === Container helpers === */
.container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
/* === Custom message buttons & misc === */
.green-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  background: var(--brand-grad);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
.btn-ghost { background: transparent; border: 0; cursor: pointer; }
.btn.btn-primary,
.btn-primary {
  min-height: 44px;
  padding: 10px 20px;
  background: var(--brand-grad);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
.btn.btn-secondary,
.btn-secondary {
  min-height: 44px;
  padding: 10px 20px;
  background: var(--paper);
  color: var(--ink-700);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
.btn.wide { width: 100%; }
/* === Replace modal ===
 * Opened from inside myCarSubModal (z-index 11001), so it must sit above. */
.replace-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-top);
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--backdrop);
  padding: var(--s-4);
}
.replace-overlay.open { display: flex; }
.replace-modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.replace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5);
  background: var(--brand-grad);
  color: #ffffff;
}
.replace-title { font-weight: var(--fw-bold); font-size: var(--t-lg); }
.replace-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.replace-step { padding: var(--s-5); }
.replace-step p { margin-bottom: var(--s-3); color: var(--ink-700); }
.replace-input {
  width: 100%;
  min-height: 48px;
  padding: 12px var(--s-3);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font: inherit;
  margin-bottom: var(--s-2);
}
.replace-input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.replace-error {
  color: var(--bad);
  font-size: var(--t-sm);
  margin-top: var(--s-2);
}
.replace-footer {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  padding-bottom: max(var(--s-3), var(--bottom-safe));
  border-top: 1px solid var(--line);
}
.replace-footer .btn,
.replace-footer .green-button,
.replace-footer button { flex: 1; min-height: 48px; }
.replace-row { display: flex; gap: var(--s-2); }
.replace-row .replace-input { flex: 1; }
/* === Vehicle details ===
 * Uses --z-modal-top (12000) so it sits above the legacy sub-modals that
 * carry inline `style="z-index: 11001"` in index.html. */
.details-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-top);
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--backdrop);
  padding: var(--s-4);
}
.details-overlay.open { display: flex; }
.details-modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5);
  border-bottom: 1px solid var(--line);
}
.details-title { font-size: var(--t-lg); font-weight: var(--fw-bold); color: var(--ink-900); }
.details-close {
  width: 32px;
  height: 32px;
  background: var(--paper-3);
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 18px;
}
.details-body {
  padding: var(--s-5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.details-section { margin-bottom: var(--s-5); }
.details-section h4 {
  font-size: var(--t-sm);
  font-weight: var(--fw-bold);
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s-2);
}
.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.kv > div {
  background: var(--paper);
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-sm);
}
.kv .k { color: var(--ink-500); }
.kv .v { color: var(--ink-900); font-weight: var(--fw-semi); }
.details-muted {
  text-align: center;
  padding: var(--s-8);
  color: var(--ink-500);
}
/* === Trademark footer (already styled in home.css) === */
.trademark-footer { text-align: center; padding: var(--s-6) 0 var(--s-3); }
/* === Locked card state (feed-cards.js ownership-mismatch guard) === */
.feed-card.locked { opacity: 0.6; pointer-events: none; }
/* === Custom-message button (preset picker entry from chat modal) === */
.custom-message-button {
  width: 100%;
  min-height: 48px;
  margin-top: var(--s-2);
  background: var(--paper-3);
  color: var(--ink-700);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
.custom-message-button:hover { background: var(--paper-4); }
/* === Result/search styles helpers === */
.history-empty { text-align: center; padding: var(--s-12) var(--s-4); color: var(--ink-500); }
/* === Section-title (used in stations / weather etc.) === */
.section-title {
  font-size: var(--t-lg);
  font-weight: var(--fw-bold);
  color: var(--ink-900);
  margin: 0 0 var(--s-3);
}
/* === Bottom-nav (if present in HTML) === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: var(--bottom-safe);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
}
.bottom-nav.hidden { display: none; }
.bottom-nav a, .bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  background: transparent;
  border: 0;
  color: var(--ink-500);
  font-size: var(--t-2xs);
  text-decoration: none;
}
.bottom-nav .active, .bottom-nav .is-active { color: var(--brand-3); }
