/* Dnevnik potrošnje — app styles.
 * KompMajstor brand (navy + gold, Montserrat/Lato), light + dark.
 * Rule of thumb: gold is for fills, bars, badges and readouts on navy —
 * never small text on light surfaces (it fails contrast there). */

@layer reset, tokens, base, components, utilities;

/* ── Fonts (self-hosted, latin + latin-ext for č ć đ š ž) ─────────────────── */
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url('/fonts/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url('/fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/lato-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/lato-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/lato-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/lato-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  fieldset { border: 0; padding: 0; min-width: 0; }
  legend { padding: 0; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  a { color: inherit; -webkit-tap-highlight-color: transparent; }
  svg { display: block; }
  [hidden] { display: none !important; }
}

/* ── Tokens ───────────────────────────────────────────────────────────────── */
@layer tokens {
  :root {
    color-scheme: light;
    --navy: #04395e;
    --navy-2: #0b4a75;
    --gold: #fabc41;
    --gold-2: #f2ab1f;
    --cream: #f9f9f9;

    --bg: #eef2f5;
    --surface: #ffffff;
    --surface-2: #f5f7f9;
    --border: #dbe3ea;
    --border-strong: #b9c6d2;
    --text: #04395e;
    --text-2: #2f4a63;
    --muted: #5a6b7d;
    --gold-ink: #85600f;
    --gold-soft: #fff4dc;
    --accent: var(--navy);          /* strongest interactive color on this theme */
    --on-accent: #ffffff;
    --input-bg: #f7f9fb;
    --input-border: #7f90a2;
    --focus-ring: rgb(250 188 65 / .55);
    --danger: #b42318;
    --danger-soft: #fdecea;
    --warn: #8a5300;
    --warn-soft: #fff4dc;
    --ok: #1e7a4c;

    --hero-bg: #04395e;
    --hero-bg-2: #0a4a77;
    --hero-text: #f4f7fa;
    --hero-muted: #a9bfd3;
    --hero-line: rgb(255 255 255 / .12);

    --asphalt: #233f57;
    --asphalt-dash: #f4e3b8;
    --stone: #fdfcf8;
    --stone-border: #04395e;
    --stone-text: #04395e;

    --t-city: #7d8ca1;
    --t-highway: #f2b233;
    --t-open: #3da36a;
    --t-mixed: #5b86b5;

    --shadow-sm: 0 1px 2px rgb(4 57 94 / .06), 0 2px 8px -2px rgb(4 57 94 / .08);
    --shadow-md: 0 8px 24px -10px rgb(4 57 94 / .28);
    --shadow-fab: 0 12px 28px -10px rgb(4 57 94 / .55);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;

    --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --ease-out: cubic-bezier(.2, .8, .2, 1);
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #08131d;
    --surface: #0f1d2a;
    --surface-2: #142536;
    --border: #213649;
    --border-strong: #2f4a63;
    --text: #e8eef4;
    --text-2: #c3d1de;
    --muted: #8ea3b8;
    --gold-ink: #fabc41;
    --gold-soft: rgb(250 188 65 / .12);
    --accent: var(--gold);
    --on-accent: #04395e;
    --input-bg: #0c1924;
    --input-border: #4f6b86;
    --focus-ring: rgb(250 188 65 / .45);
    --danger: #ff8a7a;
    --danger-soft: rgb(255 138 122 / .12);
    --warn: #ffc860;
    --warn-soft: rgb(250 188 65 / .12);
    --ok: #6fd6a0;

    --hero-bg: #0d2538;
    --hero-bg-2: #12324b;
    --hero-line: rgb(255 255 255 / .09);

    --asphalt: #2a4157;
    --asphalt-dash: #e7d7aa;
    --stone: #e9eef3;
    --stone-border: #04395e;
    --stone-text: #04395e;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-md: 0 10px 30px -12px rgb(0 0 0 / .6);
    --shadow-fab: 0 12px 28px -10px rgb(0 0 0 / .7);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #08131d;
      --surface: #0f1d2a;
      --surface-2: #142536;
      --border: #213649;
      --border-strong: #2f4a63;
      --text: #e8eef4;
      --text-2: #c3d1de;
      --muted: #8ea3b8;
      --gold-ink: #fabc41;
      --gold-soft: rgb(250 188 65 / .12);
      --accent: var(--gold);
      --on-accent: #04395e;
      --input-bg: #0c1924;
      --input-border: #4f6b86;
      --focus-ring: rgb(250 188 65 / .45);
      --danger: #ff8a7a;
      --danger-soft: rgb(255 138 122 / .12);
      --warn: #ffc860;
      --warn-soft: rgb(250 188 65 / .12);
      --ok: #6fd6a0;

      --hero-bg: #0d2538;
      --hero-bg-2: #12324b;
      --hero-line: rgb(255 255 255 / .09);

      --asphalt: #2a4157;
      --asphalt-dash: #e7d7aa;
      --stone: #e9eef3;

      --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
      --shadow-md: 0 10px 30px -12px rgb(0 0 0 / .6);
      --shadow-fab: 0 12px 28px -10px rgb(0 0 0 / .7);
    }
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
@layer base {
  html { background: var(--bg); }
  body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
  }
  h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--text); }
  ::selection { background: var(--gold); color: #04395e; }
  :focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
  .i {
    width: 20px; height: 20px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  }
  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
}

/* ── Components ───────────────────────────────────────────────────────────── */
@layer components {

  /* Shell */
  .app {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--safe-top) 16px calc(120px + var(--safe-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  #main { display: grid; gap: 22px; }

  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 0 12px;
  }
  .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
  .brand-mark { width: 30px; height: 30px; flex: none; }
  .brand-name {
    font-family: var(--font-display); font-weight: 800; font-size: 13.5px;
    letter-spacing: .12em; text-transform: uppercase; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-actions { display: flex; align-items: center; gap: 6px; }

  .icon-btn {
    position: relative;
    width: 44px; height: 44px; border-radius: 12px;
    display: inline-grid; place-items: center; flex: none;
    color: var(--text);
    transition: background-color .15s;
  }
  .icon-btn:hover { background: var(--surface-2); }
  .icon-btn:active { background: var(--border); }
  .icon-btn .i { width: 22px; height: 22px; }
  .icon-btn .dot {
    position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--gold); box-shadow: 0 0 0 2px var(--bg);
  }

  .update-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px 0 10px; border-radius: 999px;
    background: var(--gold); color: #04395e;
    font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
    box-shadow: var(--shadow-sm);
  }
  .update-pill .i { width: 16px; height: 16px; }

  /* Car switcher */
  .car-switch {
    width: 100%;
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
    padding: 10px 12px 10px 10px; margin-bottom: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); text-align: left;
    transition: border-color .15s, transform .1s;
  }
  .car-switch:hover { border-color: var(--border-strong); }
  .car-switch:active { transform: scale(.995); }
  .car-switch-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
    background: var(--gold-soft); color: var(--text);
  }
  .car-switch-icon .i { width: 24px; height: 24px; }
  .car-switch-text { display: grid; min-width: 0; }
  .car-switch-name {
    font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .car-switch-meta { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .car-switch-chevron { color: var(--muted); }

  /* Notices */
  .notices { display: grid; gap: 10px; }
  .notices:not(:empty) { margin-bottom: 14px; }
  .notice {
    display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start;
    padding: 12px 14px; border-radius: var(--radius);
    background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
    font-size: 14.5px; color: var(--text);
  }
  .notice > .i { margin-top: 1px; color: var(--gold-ink); }
  .notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
  .notice.danger > .i { color: var(--danger); }
  .notice strong { font-weight: 700; }
  .notice-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; padding: 0 20px; border-radius: var(--radius);
    font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .01em;
    border: 1.5px solid transparent; text-decoration: none;
    transition: background-color .15s, border-color .15s, transform .1s, filter .15s;
    -webkit-user-select: none; user-select: none;
  }
  .btn:active { transform: translateY(1px); }
  .btn .i { width: 20px; height: 20px; }
  .btn.primary { background: var(--gold); color: #04395e; }
  .btn.primary:hover { background: var(--gold-2); }
  .btn.secondary { background: var(--surface); border-color: var(--input-border); color: var(--text); }
  .btn.secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
  .btn.ghost { background: transparent; color: var(--text-2); }
  .btn.ghost:hover { background: var(--surface-2); }
  .btn.danger { color: var(--danger); }
  .btn.solid-danger { background: var(--danger); color: #fff; }
  :root[data-theme="dark"] .btn.solid-danger { color: #2a0a06; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.solid-danger { color: #2a0a06; } }
  .btn.small { min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
  .btn.grow { flex: 1; }
  .btn[disabled] { opacity: .5; pointer-events: none; }

  .link-btn {
    color: var(--gold-ink); font-weight: 700; font-size: 14px; text-decoration: underline;
    text-underline-offset: 3px; padding: 6px 2px;
  }

  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 34px; padding: 0 12px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 13.5px; color: var(--text-2); white-space: nowrap;
  }
  .chip:hover { border-color: var(--border-strong); }
  .chip strong { color: var(--text); }

  /* FAB */
  .fab {
    position: fixed; z-index: 10;
    left: 50%; bottom: calc(18px + var(--safe-bottom));
    transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 10px;
    height: 58px; padding: 0 28px 0 22px; border-radius: 999px;
    background: var(--gold); color: #04395e;
    font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: .01em;
    box-shadow: var(--shadow-fab), 0 0 0 4px color-mix(in srgb, var(--bg) 70%, transparent);
    transition: transform .15s var(--ease-out), background-color .15s;
  }
  .fab .i { width: 24px; height: 24px; stroke-width: 2.5; }
  .fab:hover { background: var(--gold-2); }
  .fab:active { transform: translateX(-50%) scale(.97); }

  /* Toasts (popover → always above dialogs) */
  .toasts {
    position: fixed; inset: auto 0 calc(92px + var(--safe-bottom)) 0;
    margin: 0 auto; padding: 0; border: 0; background: transparent; overflow: visible;
    width: max-content; max-width: calc(100% - 32px);
    display: grid; gap: 8px; justify-items: center;
    color: inherit;
  }
  .toasts:not(:popover-open):not(.no-popover) { display: none; }
  .toast {
    display: flex; align-items: center; gap: 12px;
    min-height: 48px; padding: 8px 8px 8px 16px; border-radius: var(--radius);
    background: #0c2236; color: #f4f7fa; box-shadow: var(--shadow-md);
    font-size: 15px; max-width: 520px;
    animation: toast-in .25s var(--ease-out);
  }
  .toast.is-leaving { animation: toast-out .2s ease-in forwards; }
  .toast .i { width: 20px; height: 20px; color: var(--gold); }
  .toast.error .i { color: #ff8a7a; }
  .toast-msg { flex: 1; padding-right: 8px; }
  .toast:not(:has(.toast-action)) { padding-right: 16px; }
  .toast-action {
    min-height: 36px; padding: 0 12px; border-radius: 10px;
    font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .06em;
    text-transform: uppercase; color: var(--gold);
  }
  .toast-action:hover { background: rgb(255 255 255 / .08); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

  /* ── Dashboard: the trip computer ──────────────────────────────────────── */
  .tc {
    position: relative; overflow: hidden;
    border-radius: var(--radius-lg);
    background:
      radial-gradient(120% 90% at 100% 0%, var(--hero-bg-2) 0%, transparent 60%),
      var(--hero-bg);
    color: var(--hero-text);
    padding: 18px 18px 8px;
    box-shadow: var(--shadow-md);
  }
  :root[data-theme="dark"] .tc { border: 1px solid #1c3a54; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tc { border: 1px solid #1c3a54; } }
  .tc-eyebrow {
    font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
    letter-spacing: .14em; text-transform: uppercase; color: var(--hero-muted);
  }
  .tc-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: end; }
  .tc-head .tc-eyebrow { grid-column: 1 / -1; }
  .tc-value {
    display: flex; align-items: baseline; gap: 8px; margin-top: 4px;
    font-family: var(--font-display); line-height: 1;
  }
  .tc-value .num { font-weight: 800; font-size: clamp(48px, 15vw, 64px); color: var(--gold); letter-spacing: -.02em; }
  .tc-value .num.is-estimate::before { content: '≈'; font-weight: 600; font-size: .55em; margin-right: 4px; vertical-align: .35em; opacity: .85; }
  .tc-value .unit { font-weight: 600; font-size: 15px; color: var(--hero-muted); white-space: nowrap; }
  .tc-value .num.is-empty { color: var(--hero-muted); }
  .tc-state { margin-top: 8px; font-size: 13.5px; color: var(--hero-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  .tc-state .pill {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
    font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    background: rgb(250 188 65 / .16); color: var(--gold);
  }
  .tc-state .pill.estimate { background: rgb(255 255 255 / .1); color: var(--hero-text); }
  .tc-spark { justify-self: end; width: 100%; max-width: 150px; color: var(--gold); }
  .tc-spark svg { width: 100%; height: auto; overflow: visible; }
  .tc-spark text { fill: var(--hero-muted); font: 600 10px var(--font-display); }

  .tc-kpis {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 18px -18px 0; border-top: 1px solid var(--hero-line);
  }
  .tc-kpi { padding: 12px 18px; display: grid; gap: 2px; }
  .tc-kpi:nth-child(odd) { border-right: 1px solid var(--hero-line); }
  .tc-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--hero-line); }
  .tc-kpi dt { font-size: 12px; color: var(--hero-muted); font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; }
  .tc-kpi dd { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--hero-text); white-space: nowrap; }
  .tc-kpi dd small { font-size: 12.5px; font-weight: 600; color: var(--hero-muted); margin-left: 3px; }
  @media (min-width: 520px) {
    .tc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tc-kpi { border: 0 !important; }
    .tc-kpi + .tc-kpi { border-left: 1px solid var(--hero-line) !important; }
  }

  .tc-gauge { padding: 14px 0 6px; border-top: 1px solid var(--hero-line); margin: 0 0 0; }
  .tc-gauge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; color: var(--hero-muted); }
  .tc-gauge-head strong { color: var(--hero-text); font-family: var(--font-display); font-weight: 700; font-size: 15px; }
  .tc-bar { position: relative; height: 10px; margin: 8px 0 6px; border-radius: 999px; background: rgb(255 255 255 / .12); overflow: hidden; }
  .tc-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .5s var(--ease-out); }
  .tc-bar.is-low > span { background: linear-gradient(90deg, #e2563b, #ff8a65); }
  .tc-bar-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgb(4 57 94 / .55) calc(25% - 1px) 25%); pointer-events: none; }
  .tc-gauge-foot { font-size: 13px; color: var(--hero-muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
  .tc-gauge-foot .low { color: #ffab91; font-weight: 700; }
  .tc-gauge-note { font-size: 12.5px; color: var(--hero-muted); opacity: .85; margin-top: 2px; }

  .tc-toggle {
    width: calc(100% + 36px); margin: 4px -18px 0; min-height: 46px; padding: 0 18px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    border-top: 1px solid var(--hero-line);
    font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--hero-muted);
  }
  .tc-toggle:hover { color: var(--hero-text); }
  .tc-toggle .i { width: 18px; height: 18px; transition: transform .2s var(--ease-out); }
  .tc-toggle[aria-expanded="true"] .i { transform: rotate(180deg); }

  .tc-details { display: grid; gap: 18px; padding: 6px 0 14px; }
  .tc-sub { font-family: var(--font-display); font-weight: 700; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--hero-muted); margin-bottom: 10px; }
  .mix-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: rgb(255 255 255 / .1); gap: 2px; }
  .mix-bar > span { min-width: 3px; }
  .mix-list { display: grid; gap: 2px; margin-top: 10px; }
  .mix-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
  .mix-row .sw { width: 12px; height: 12px; border-radius: 4px; }
  .mix-row .name { color: var(--hero-text); font-weight: 700; }
  .mix-row .km { color: var(--hero-muted); text-align: right; }
  .mix-row .mix-cons { min-width: 72px; text-align: right; font-family: var(--font-display); font-weight: 700; color: var(--hero-text); }
  .mix-row .mix-cons.none { color: var(--hero-muted); font-weight: 600; }
  .tc-chart { color: var(--gold); }
  .tc-chart svg { width: 100%; height: auto; overflow: visible; }
  .tc-chart text { fill: var(--hero-muted); font: 600 10.5px var(--font-display); }
  .tc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tc-fact { display: grid; gap: 2px; }
  .tc-fact span { font-size: 12px; color: var(--hero-muted); font-family: var(--font-display); font-weight: 600; }
  .tc-fact strong { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
  .tc-note { font-size: 13px; color: var(--hero-muted); }
  .tc-note strong { color: var(--hero-text); }

  /* Cards: welcome / empty */
  .card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 20px;
  }
  .welcome { text-align: center; padding: 32px 22px 26px; display: grid; justify-items: center; gap: 10px; }
  .welcome .brand-mark { width: 64px; height: 64px; margin-bottom: 6px; }
  .welcome h1 { font-size: 23px; font-weight: 800; }
  .welcome p { color: var(--muted); max-width: 34ch; }
  .welcome .btn { margin-top: 10px; min-width: 220px; }
  .welcome-points { display: grid; gap: 8px; text-align: left; margin: 8px 0 4px; font-size: 14.5px; color: var(--text-2); }
  .welcome-points li { display: flex; gap: 10px; align-items: flex-start; }
  .welcome-points .i { color: var(--gold-ink); margin-top: 1px; }

  .empty { display: grid; gap: 8px; text-align: center; justify-items: center; padding: 26px 20px; }
  .empty .i.big { width: 40px; height: 40px; color: var(--gold-ink); stroke-width: 1.6; margin-bottom: 4px; }
  .empty h3 { font-size: 18px; }
  .empty p { color: var(--muted); max-width: 36ch; font-size: 15px; }
  .empty .btn { margin-top: 8px; }

  /* ── History: the road ─────────────────────────────────────────────────── */
  .history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 12px; }
  .history-head h2 { font-size: 20px; font-weight: 800; }
  .history-head .count { font-size: 14px; color: var(--muted); }

  .road { --rail-w: 56px; --asphalt-w: 14px; position: relative; }
  .road > li { position: relative; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); column-gap: 10px; }
  .rail { position: relative; }
  .rail::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: var(--asphalt-w); transform: translateX(-50%);
    background: var(--asphalt);
    box-shadow: inset 2px 0 0 var(--edge, transparent), inset -2px 0 0 var(--edge, transparent);
  }
  .rail::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%);
    background: repeating-linear-gradient(180deg, var(--asphalt-dash) 0 7px, transparent 7px 16px);
    opacity: .8;
  }
  .road [data-type="city"] { --edge: var(--t-city); }
  .road [data-type="highway"] { --edge: var(--t-highway); }
  .road [data-type="open"] { --edge: var(--t-open); }
  .road [data-type="mixed"] { --edge: var(--t-mixed); }

  /* caps */
  .road-cap { min-height: 52px; align-items: center; }
  .road-cap p { font-size: 13.5px; color: var(--muted); padding: 14px 0; }
  .road-cap p strong { color: var(--text); font-family: var(--font-display); font-weight: 700; }
  .road-now .rail::before, .road-now .rail::after { top: 50%; }
  .road-now .rail > .here {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1;
    width: 22px; height: 22px; border-radius: 50%; background: var(--gold); border: 3px solid var(--stone-border);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 30%, transparent);
  }
  .road-end .rail::before, .road-end .rail::after { bottom: 50%; }
  .road-end .rail > .end {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -2px); z-index: 1;
    width: 26px; height: 8px; border-radius: 4px; background: var(--asphalt);
  }

  /* month marker */
  .road-month > div:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 14px 0 6px; }
  .sign {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px;
    background: var(--navy); color: #fff; border: 1.5px solid #fff; outline: 1.5px solid var(--navy);
    font-family: var(--font-display); font-weight: 800; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  }
  :root[data-theme="dark"] .sign { background: #12324b; outline-color: #2a4a66; border-color: #8fb0cc; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sign { background: #12324b; outline-color: #2a4a66; border-color: #8fb0cc; } }
  .sign-sum { font-size: 13.5px; color: var(--muted); }

  /* entry */
  .road-entry > .entry-card { margin: 6px 0; }
  .stone {
    position: absolute; z-index: 1; left: 50%; top: 14px; transform: translateX(-50%);
    width: 46px; padding-bottom: 5px; border-radius: 23px 23px 7px 7px;
    background: var(--stone); border: 2px solid var(--stone-border); color: var(--stone-text);
    display: grid; justify-items: center; overflow: hidden;
    box-shadow: 0 2px 0 rgb(4 57 94 / .18);
    font-family: var(--font-display); line-height: 1;
  }
  .stone-cap { width: 100%; height: 11px; background: var(--edge, var(--t-mixed)); border-bottom: 2px solid var(--stone-border); margin-bottom: 4px; }
  .stone-k { font-weight: 700; font-size: 10.5px; color: #4b5f73; margin-bottom: 1px; }
  .stone-u { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }

  .entry-card {
    width: 100%; display: grid; gap: 8px; text-align: left;
    padding: 12px 14px 12px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: border-color .15s, transform .1s, box-shadow .15s;
  }
  .entry-card:hover { border-color: var(--border-strong); }
  .entry-card:active { transform: scale(.992); }
  .ec-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .ec-date { font-family: var(--font-display); font-weight: 700; font-size: 16px; white-space: nowrap; }
  .ec-time { font-size: 13.5px; color: var(--muted); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ec-badges { margin-left: auto; display: flex; gap: 6px; flex: none; }
  .badge {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
    font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  }
  .badge.full { background: var(--gold); color: #04395e; border-color: transparent; }
  .ec-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15.5px; }
  .ec-nums > span { white-space: nowrap; font-weight: 700; color: var(--text); }
  .ec-nums small { font-weight: 400; color: var(--muted); font-size: 13.5px; margin-left: 2px; }
  .ec-bottom { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .cons {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    height: 28px; padding: 0 10px; border-radius: 8px;
    font-family: var(--font-display); font-weight: 800; font-size: 14px;
    background: var(--gold-soft); color: var(--text);
  }
  .cons small { font-weight: 600; font-size: 11.5px; color: var(--muted); }
  .cons.estimate { background: var(--surface-2); }
  .cons.outlier { background: var(--danger-soft); color: var(--danger); }
  .cons.outlier small { color: inherit; }
  .cons.muted { background: transparent; padding: 0; height: auto; font-family: var(--font-body); font-weight: 400; font-style: italic; font-size: 13.5px; color: var(--muted); }
  .cons.invalid { background: var(--danger-soft); color: var(--danger); font-family: var(--font-body); font-weight: 700; font-size: 13px; }
  .cons .i { width: 15px; height: 15px; }
  .ec-meta { font-size: 13.5px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .road-leg > div:last-child { display: flex; align-items: center; gap: 8px; padding: 4px 0; min-height: 34px; font-size: 13.5px; color: var(--muted); }
  .road-leg strong { color: var(--text-2); font-weight: 700; }
  .road-leg .i { width: 16px; height: 16px; color: var(--edge); }
  :root:not([data-theme="dark"]) .road-leg [data-type="highway"] .i { color: var(--gold-ink); }

  .highlight { animation: highlight 1.6s ease-out; }
  @keyframes highlight { 0%, 30% { box-shadow: 0 0 0 3px var(--gold), var(--shadow-sm); } }

  /* ── Sheets (native <dialog>) ──────────────────────────────────────────── */
  dialog { color: var(--text); }
  dialog.sheet {
    position: fixed; inset: auto 0 var(--vv-bottom, 0px) 0;
    margin: 0 auto; padding: 0; border: 0;
    width: 100%; max-width: 560px;
    max-height: calc(var(--vv-height, 100dvh) - max(var(--safe-top), 12px) - 8px);
    border-radius: 22px 22px 0 0;
    background: var(--surface);
    box-shadow: 0 -16px 48px -16px rgb(0 0 0 / .4);
    overflow: hidden;
  }
  dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .32s var(--ease-out); }
  dialog.sheet.is-closing { animation: sheet-out .2s ease-in forwards; }
  dialog.sheet.is-dragging { animation: none; transition: none; }
  dialog.sheet.is-settling { transition: transform .2s var(--ease-out); }
  dialog::backdrop { background: rgb(2 14 24 / .52); }
  dialog[open]::backdrop { animation: fade-in .3s ease-out; }
  dialog.is-closing::backdrop { animation: fade-out .2s ease-in forwards; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes fade-out { to { opacity: 0; } }

  @media (min-width: 720px) {
    dialog.sheet { inset: 0; margin: auto; border-radius: 22px; max-height: min(88vh, 860px); box-shadow: var(--shadow-md); }
    dialog.sheet[open] { animation: pop-in .24s var(--ease-out); }
    dialog.sheet.is-closing { animation: pop-out .16s ease-in forwards; }
    .grabber { display: none; }
  }
  @keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
  @keyframes pop-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

  .sheet-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
  .sheet-head {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 20px 10px 10px 20px; flex: none;
    touch-action: none;
  }
  .grabber {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 42px; height: 5px; border-radius: 3px; background: var(--border-strong);
  }
  .sheet-titles { flex: 1; min-width: 0; }
  .sheet-titles h2 { font-size: 21px; font-weight: 800; }
  .sheet-sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet-body {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 8px 20px 24px; display: grid; gap: 22px; align-content: start;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-foot {
    flex: none; padding: 12px 16px calc(12px + var(--safe-bottom));
    border-top: 1px solid var(--border); background: var(--surface);
  }
  @media (min-width: 720px) { .sheet-foot { padding-bottom: 14px; } }
  .foot-actions { display: flex; gap: 10px; }
  .sheet-foot > .btn { width: 100%; }
  .preview {
    display: flex; align-items: center; gap: 8px; margin: 0 4px 10px;
    font-size: 14.5px; color: var(--text-2);
  }
  .preview .i { color: var(--gold-ink); width: 18px; height: 18px; }
  .preview strong { font-family: var(--font-display); font-weight: 800; color: var(--text); }

  /* Fields */
  .field { display: grid; gap: 7px; }
  .field-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
  .field label, .field legend, .field .label, .fuel-cell label {
    font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
    letter-spacing: .06em; text-transform: uppercase; color: var(--text-2);
  }
  .field legend { margin-bottom: 7px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
  .legend-note { font-family: var(--font-body); font-weight: 400; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }

  .input-wrap {
    display: flex; align-items: center; gap: 8px; min-width: 0;
    height: 54px; padding: 0 14px;
    background: var(--input-bg); border: 1.5px solid var(--input-border); border-radius: 12px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
  }
  .input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); background: var(--surface); }
  .input-wrap input {
    flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; padding: 0;
    font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--text);
    font-variant-numeric: tabular-nums;
  }
  .input-wrap input[type="text"]:not([inputmode]) { font-family: var(--font-body); font-weight: 400; font-size: 17px; }
  .input-wrap input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); font-family: var(--font-body); font-weight: 400; font-size: 16px; }
  .input-wrap input[type="datetime-local"] { font-family: var(--font-body); font-weight: 700; font-size: 17px; min-width: 0; }
  .suffix { flex: none; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--muted); }
  .field.has-error .input-wrap, .fuel-group.has-error .input-wrap { border-color: var(--danger); }
  .hint { font-size: 13.5px; color: var(--muted); min-height: 0; }
  .hint:empty { display: none; }
  .hint strong { color: var(--text-2); }
  .hint.warn { color: var(--warn); font-weight: 700; }
  .hint .i, .fuel-foot .hint .i { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
  .error { font-size: 13.5px; color: var(--danger); font-weight: 700; display: flex; gap: 6px; align-items: flex-start; }
  .error .i { width: 17px; height: 17px; margin-top: 1px; }

  /* Fuel triad */
  .fuel-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fuel-cell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; }
  .fuel-cell .input-wrap { padding: 0 10px; gap: 4px; }
  .fuel-cell .input-wrap input { font-size: 18px; }
  .fuel-cell .suffix { font-size: 12.5px; }
  .calc-tag {
    font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .04em;
    color: var(--gold-ink); visibility: hidden; height: 14px; line-height: 14px; padding-left: 2px;
  }
  .calc-tag::before { content: '= '; }
  .fuel-cell.is-computed .calc-tag { visibility: visible; }
  .fuel-cell.is-computed .input-wrap { background: var(--gold-soft); border-style: dashed; border-color: color-mix(in srgb, var(--gold-ink) 55%, transparent); }
  .fuel-cell.is-computed .input-wrap:focus-within { border-style: solid; border-color: var(--accent); }
  .fuel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: -2px; }
  .fuel-foot .hint { flex: 1 1 160px; }

  /* Mini segmented (Ukupno / Trip) */
  .mini-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
  .mini-seg label { position: relative; }
  .mini-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .mini-seg span {
    display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
    font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .02em; text-transform: none;
    color: var(--muted); transition: background-color .15s, color .15s;
  }
  .mini-seg input:checked + span { background: var(--accent); color: var(--on-accent); }
  .mini-seg input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
  .mini-seg input:disabled + span { opacity: .45; }

  /* Segmented radio groups */
  .seg { display: grid; gap: 8px; }
  .seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg-wrap { display: flex; flex-wrap: wrap; }
  .seg label { position: relative; display: block; }
  .seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .seg span {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    min-height: 64px; padding: 8px 4px; border-radius: 12px;
    background: var(--input-bg); border: 1.5px solid var(--input-border);
    font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .01em; text-transform: none;
    color: var(--text-2); text-align: center; line-height: 1.15;
    transition: background-color .15s, border-color .15s, color .15s;
  }
  .seg-wrap span { min-height: 44px; padding: 0 14px; flex-direction: row; font-size: 13.5px; }
  .seg-3 span { min-height: 58px; }
  .seg span .i { width: 22px; height: 22px; }
  .seg input:checked + span { background: var(--gold-soft); border-color: var(--accent); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
  .seg input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
  .seg label:hover span { border-color: var(--border-strong); }

  /* Switch row */
  .switch-row {
    position: relative; display: flex; align-items: center; gap: 14px; cursor: pointer;
    padding: 14px 14px 14px 16px; border-radius: 14px;
    background: var(--input-bg); border: 1.5px solid var(--input-border);
    text-transform: none !important; letter-spacing: 0 !important; font-family: var(--font-body) !important; font-weight: 400 !important; font-size: 15px !important; color: var(--text) !important;
  }
  .switch-text { flex: 1; display: grid; gap: 2px; }
  .switch-text strong { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; color: var(--text); }
  .switch-text small { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
  .switch-row input { position: absolute; right: 14px; top: 50%; width: 52px; height: 32px; transform: translateY(-50%); opacity: 0; margin: 0; cursor: pointer; }
  .switch {
    position: relative; flex: none; width: 52px; height: 32px; border-radius: 999px;
    background: var(--border-strong); transition: background-color .2s;
  }
  .switch::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease-out);
  }
  .switch-row input:checked + .switch { background: var(--accent); }
  .switch-row input:checked + .switch::after { transform: translateX(20px); background: var(--gold); }
  :root[data-theme="dark"] .switch-row input:checked + .switch::after { background: #04395e; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .switch-row input:checked + .switch::after { background: #04395e; } }
  .switch-row input:focus-visible + .switch { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

  .level-block { display: grid; gap: 6px; padding: 12px 16px 14px; margin-top: 8px; border-radius: 14px; border: 1.5px dashed var(--input-border); }
  .level-block output { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text); }
  .level-block output.unset { font-family: var(--font-body); font-weight: 400; font-style: italic; font-size: 14px; color: var(--muted); }
  .level-row { display: flex; align-items: center; gap: 12px; }

  input[type="range"] {
    --pct: 25%;
    flex: 1; height: 36px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
  }
  input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--gold) var(--pct), var(--border) var(--pct)); }
  input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--gold) var(--pct), var(--border) var(--pct)); }
  input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: var(--shadow-sm); }
  input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
  input[type="range"].unset::-webkit-slider-runnable-track { background: var(--border); }
  input[type="range"].unset::-moz-range-track { background: var(--border); }
  input[type="range"].unset::-webkit-slider-thumb { border-color: var(--border-strong); }
  input[type="range"]:focus-visible { outline: none; }
  input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--focus-ring); }

  .date-btn {
    width: 100%; display: flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 14px; border-radius: 12px;
    background: var(--input-bg); border: 1.5px solid var(--input-border); text-align: left;
    font-weight: 700; font-size: 16px;
  }
  .date-btn .i { color: var(--muted); }
  .date-btn span:first-of-type { flex: 1; }
  .date-btn-action { font-size: 13.5px; font-weight: 700; color: var(--gold-ink); }
  .date-btn[aria-expanded="true"] { display: none; }

  .more { border-top: 1px solid var(--border); padding-top: 4px; }
  .more > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none;
    min-height: 44px; font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2);
  }
  .more > summary::-webkit-details-marker { display: none; }
  .more > summary .i { color: var(--muted); transition: transform .2s; }
  .more[open] > summary .i { transform: rotate(180deg); }
  .more[open] { display: grid; gap: 18px; padding-bottom: 4px; }

  /* Car list */
  .car-list { display: grid; gap: 8px; }
  .car-row { display: flex; align-items: stretch; gap: 6px; }
  .car-pick {
    flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 14px; text-align: left;
    background: var(--input-bg); border: 1.5px solid var(--input-border);
  }
  .car-pick[aria-current="true"] { background: var(--gold-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
  .car-pick .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
  .car-pick[aria-current="true"] .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .car-pick .tick .i { width: 16px; height: 16px; stroke-width: 3; }
  .car-pick strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .car-pick small { display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .car-row .icon-btn { height: auto; min-height: 44px; width: 52px; border-radius: 14px; border: 1.5px solid var(--input-border); background: var(--input-bg); }

  /* Settings */
  .set-section { display: grid; gap: 10px; }
  .set-section h3 { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .set-list { display: grid; gap: 8px; }
  .set-row {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 14px; border-radius: 14px; text-align: left; text-decoration: none;
    background: var(--input-bg); border: 1px solid var(--border);
  }
  .set-row:hover { border-color: var(--border-strong); }
  .set-row > .i { color: var(--text-2); }
  .set-row > span { flex: 1; display: grid; gap: 2px; min-width: 0; }
  .set-row strong { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
  .set-row small { font-size: 13.5px; color: var(--muted); }
  .set-row.static { cursor: default; }
  .set-row.accent { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
  .set-note { font-size: 14px; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }
  .set-note .i { width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
  .set-note.warn { color: var(--warn); font-weight: 700; }
  .set-note.warn .i { color: currentColor; }
  .set-foot { font-size: 13px; color: var(--muted); text-align: center; padding-top: 4px; }

  /* Confirm modal */
  dialog.modal {
    width: calc(100% - 32px); max-width: 420px; padding: 0; border: 0; border-radius: 22px;
    background: var(--surface); box-shadow: var(--shadow-md);
  }
  dialog.modal[open] { animation: pop-in .2s var(--ease-out); }
  dialog.modal.is-closing { animation: pop-out .15s ease-in forwards; }
  .modal-box { padding: 22px 20px 18px; display: grid; gap: 12px; }
  .modal-box h2 { font-size: 19px; font-weight: 800; }
  .modal-msg { font-size: 15.5px; color: var(--text-2); display: grid; gap: 8px; }
  .modal-msg ul { display: grid; gap: 6px; }
  .modal-msg li { display: flex; gap: 8px; align-items: flex-start; }
  .modal-msg li .i { width: 18px; height: 18px; margin-top: 2px; color: var(--warn); }
  .modal-actions { display: grid; gap: 8px; margin-top: 6px; }
  .modal-actions .btn { width: 100%; }
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
@layer utilities {
  .sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after, ::backdrop { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  }
}
