:root {
  color-scheme: light;
  --bg: #f3f3f0;
  --surface: #fcfcfb;
  --surface-2: #f3f3f0;
  --surface-hover: #f0efec;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --danger: #d03b3b;
  --danger-soft: rgba(208, 59, 59, 0.10);
  --good: #006300;
  --fuel: #2a78d6;
  --service: #eb6834;
  --expense: #1baf7a;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 4px 16px rgba(11, 11, 11, 0.04);
  --shadow-lg: 0 12px 48px rgba(11, 11, 11, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-hover: #242422;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #898781;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --grid: #2c2c2a;
    --baseline: #383835;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-soft: rgba(57, 135, 229, 0.16);
    --danger: #e66767;
    --danger-soft: rgba(230, 103, 103, 0.14);
    --good: #0ca30c;
    --fuel: #3987e5;
    --service: #d95926;
    --expense: #199e70;
    --shadow: none;
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-hover: #242422;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #898781;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --grid: #2c2c2a;
  --baseline: #383835;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-soft: rgba(57, 135, 229, 0.16);
  --danger: #e66767;
  --danger-soft: rgba(230, 103, 103, 0.14);
  --good: #0ca30c;
  --fuel: #3987e5;
  --service: #d95926;
  --expense: #199e70;
  --shadow: none;
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.subtle { color: var(--text-2); margin: 2px 0 0; font-size: 14px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding-block: 10px;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: #fff;
}
.brand-mark svg { width: 18px; height: 18px; }
.tabs { display: flex; gap: 4px; }
.tab {
  display: flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 8px 12px; border-radius: 9px;
  color: var(--text-2); font-weight: 500; cursor: pointer;
}
.tab svg { width: 18px; height: 18px; }
.tab:hover { background: var(--surface-hover); color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.vehicle-switch select {
  height: 38px; max-width: 200px; padding: 0 32px 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  appearance: none; font-weight: 500; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: none; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); }
.btn-danger-ghost { background: none; color: var(--danger); padding: 0 10px; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 0; background: none;
  display: grid; place-items: center; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.container {
  max-width: 1200px; margin: 0 auto; padding-block: 28px 96px;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card > h2 { margin-bottom: 16px; }

/* ---------- Segmented / chips ---------- */
.segmented, .chips {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.segmented button, .chips button {
  border: 0; background: none; padding: 6px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.segmented button:hover, .chips button:hover { color: var(--text); }
.segmented button.active, .chips button.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--border);
}

.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-fuel { background: var(--fuel); }
.sw-service { background: var(--service); }
.sw-expense { background: var(--expense); }

/* ---------- KPIs ---------- */
.kpi-grid {
  display: grid; gap: 16px; margin-bottom: 16px;
  grid-template-columns: 1.6fr repeat(4, 1fr);
}
.kpi-grid .card + .card { margin-top: 0; }
.kpi-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 650; margin-top: 6px; letter-spacing: -0.01em; }
.kpi-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hero { grid-row: span 1; }
.hero-value { font-size: 44px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.split { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.split span { display: inline-flex; align-items: center; gap: 6px; }
.split b { color: var(--text); font-weight: 600; }

/* ---------- Charts ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-grid .card + .card { margin-top: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; stroke: none; font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .base-line { stroke: var(--baseline); stroke-width: 1; }
.chart .hit { fill: transparent; stroke: none; cursor: default; }
.chart .hit:hover + .hover-band, .chart .hover-band.on { opacity: 1; }
.chart .hover-band { fill: var(--surface-hover); opacity: 0; stroke: none; pointer-events: none; }
.chart .crosshair { stroke: var(--baseline); stroke-width: 1; pointer-events: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.empty-chart {
  height: 200px; display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
}

.breakdown { display: flex; flex-direction: column; gap: 12px; }
.bd-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 12px; font-size: 14px; }
.bd-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bd-bar { height: 14px; border-radius: 0 4px 4px 0; min-width: 2px; flex: none; }
.bd-val { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 550; }
.bd-val small { color: var(--muted); font-weight: 400; margin-left: 4px; }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px; min-width: 160px;
}
.tooltip .tt-title { font-weight: 600; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tooltip .tt-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip .tt-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

/* ---------- Entries list ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px; margin-bottom: 16px; }
.toolbar-right { display: flex; gap: 8px; flex: 1; justify-content: flex-end; min-width: 240px; }
.toolbar select, .search {
  height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.toolbar select { padding: 0 10px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; flex: 1; max-width: 340px; color: var(--muted); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; height: 100%; color: var(--text); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.month-group { margin-bottom: 20px; }
.month-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 4px 8px; font-size: 13px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.month-head span:last-child { text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--text); }
.entry-list { list-style: none; margin: 0; padding: 0; }
.month-group .entry-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.entry {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 16px; cursor: pointer; border-top: 1px solid var(--border);
}
.entry:first-child { border-top: 0; }
.entry:hover { background: var(--surface-hover); }
.card .entry-list .entry { padding-left: 4px; padding-right: 4px; border-radius: 0; }
.entry-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff;
}
.entry-icon svg { width: 20px; height: 20px; }
.entry-icon.fuel { background: var(--fuel); }
.entry-icon.service { background: var(--service); }
.entry-icon.expense { background: var(--expense); }
.entry-main { min-width: 0; display: block; }
.entry-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-meta { display: block; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-right { text-align: right; }
.entry-cost { font-weight: 650; font-variant-numeric: tabular-nums; }
.entry-sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.badge {
  font-size: 12px; font-weight: 550; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.badge.partial { font-style: italic; }

.empty {
  text-align: center; padding: 48px 20px; color: var(--text-2);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty h2 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.empty .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Vehicles ---------- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.vehicle-grid .card + .card { margin-top: 0; }
.vehicle-card { display: flex; flex-direction: column; gap: 14px; }
.vehicle-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vehicle-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vehicle-top h2 { font-size: 18px; }
.vehicle-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vehicle-stats div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.vehicle-stats small { display: block; color: var(--muted); font-size: 12px; }
.vehicle-stats b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vehicle-actions { display: flex; gap: 8px; }
.pill { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-grid .card + .card { margin-top: 0; }
.storage-info code { font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.status-dot.ok { background: #0ca30c; }
.status-dot.warn { background: #fab219; }
.status-dot.bad { background: #d03b3b; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.file-btn { cursor: pointer; }

/* ---------- Forms & dialog ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field .unit { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: none;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.hint { color: var(--muted); font-size: 12px; }
.date-field { position: relative; }
.field .date-field input[type="text"] { padding-right: 44px; }
.date-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: none;
  display: grid; place-items: center; color: var(--text-2); cursor: pointer;
}
.date-btn:hover { background: var(--surface-hover); color: var(--text); }
.date-btn svg { width: 18px; height: 18px; }
.date-picker { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.hint.warn { color: var(--danger); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
.check { display: flex; align-items: center; gap: 10px; height: 42px; margin-top: 22px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.type-fields { margin-bottom: 4px; }
.type-fields > .hint { display: block; margin: -4px 0 14px; }
.form-error { color: var(--danger); font-size: 14px; margin: 0; min-height: 0; }
.form-error:empty { display: none; }

.dialog {
  border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(10, 10, 10, 0.45); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.dialog-head h2 { font-size: 19px; }
.dialog-body { padding: 12px 20px 4px; max-height: calc(100vh - 180px); overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.spacer { flex: 1; }
.dialog-sm { width: min(420px, calc(100vw - 32px)); }
.confirm-msg { margin: 0 0 12px; color: var(--text-2); }

.type-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch span {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 550; color: var(--text-2);
}
.type-switch span:hover { background: var(--surface-hover); }
.type-switch input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
.type-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .tab span { display: none; }
  .chart-grid, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  /* backdrop-filter would make the fixed bottom nav position relative to the header */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
  .topbar-inner { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 12px; }
  .brand-name { display: none; }
  .tabs {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    justify-content: space-around; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }
  .tab { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; }
  .tab span { display: block; }
  .vehicle-switch select { max-width: 150px; }
  .add-btn span { display: none; }
  .add-btn { width: 40px; padding: 0; }
  .container { padding-block: 20px 110px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  h1 { font-size: 22px; }
  .hero-value { font-size: 36px; }
  .kpi-value { font-size: 20px; }
  .card { padding: 16px; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1; padding: 6px 8px; }
  .toolbar-right { min-width: 0; width: 100%; }
  .search { max-width: none; }
  .chips { width: 100%; overflow-x: auto; }
  .chips button { flex: 1; justify-content: center; padding: 6px 6px; font-size: 13px; gap: 5px; }
  .row.three { grid-template-columns: 1fr 1fr; }
  .row.three > .field:last-child { grid-column: 1 / -1; }
  .entry { grid-template-columns: 36px 1fr auto; gap: 10px; padding: 12px; }
  .entry-icon { width: 36px; height: 36px; }
  .bd-row { grid-template-columns: 100px 1fr; }
  .toast { bottom: 84px; }
  .dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .dialog-body { max-height: calc(92vh - 150px); }
  .dialog-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
