/* App layout and screen-level styles. Components live in components.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--surface-base); color: var(--ink);
  font: 400 17px/22px var(--font-sans); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
a { color: var(--ember); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }
.icon { flex: none; display: block; }

/* ---- navigation bar ---------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  /* Extra room below the status bar: iOS blurs the strip just under it in
     Home Screen apps, which softened the gear and + buttons. */
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-3));
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.navbar.is-compact {
  background: color-mix(in srgb, var(--surface-overlay) 82%, transparent);
  -webkit-backdrop-filter: blur(var(--blur-regular)); backdrop-filter: blur(var(--blur-regular));
  border-bottom-color: var(--line);
}
.navbar__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; max-width: 720px; height: var(--nav-bar-height); margin: 0 auto; padding: 0 var(--space-3); }
.navbar__title { font: 700 17px/22px var(--font-sans); opacity: 0; transform: translateY(4px); transition: opacity 140ms ease, transform 140ms ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar.is-compact .navbar__title { opacity: 1; transform: none; }
.navbar__lead { justify-self: start; }
.navbar__trail { justify-self: end; display: flex; gap: var(--space-1); }
.navbar__back { padding-left: var(--space-1); gap: 0; }
.icon-btn { display: inline-grid; place-items: center; width: var(--tap-min); height: var(--tap-min); padding: 0; border: 0; border-radius: var(--radius-pill); background: none; color: var(--ember); cursor: pointer; }
.icon-btn:active { opacity: var(--opacity-pressed); }
.icon-btn--filled { background: var(--ember-subtle); }

/* ---- page ------------------------------------------------------------------ */
.page {
  max-width: 720px; margin: 0 auto;
  padding: 0 var(--space-4) calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px) + var(--space-10));
  outline: none;
}
.large-title { font: 800 34px/41px var(--font-display); letter-spacing: -.02em; margin: var(--space-1) 0 var(--space-4); }
.section { margin-top: var(--space-8); }
.section:first-of-type { margin-top: 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-2); padding: 0 var(--space-1); }
.section__title { font: 700 22px/28px var(--font-display); letter-spacing: -.01em; }
.section__label { font: 700 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.section__link { font: 600 15px/20px var(--font-sans); color: var(--ember); background: none; border: 0; padding: var(--space-2) 0; min-height: var(--tap-min); cursor: pointer; }
.section__foot { margin: var(--space-2) var(--space-4) 0; font: 400 13px/18px var(--font-sans); color: var(--ink-muted); }
.stack { display: flex; flex-direction: column; gap: var(--space-6); }

/* ---- cards and stats ------------------------------------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.stat-grid .ag-card { min-width: 0; }
.ag-stat__value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-stat__value--md { font-size: 26px; }
.ag-stat__value--accent { color: var(--ember); }
.card-button { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.card-button:active { transform: scale(.985); }
.hero-stat { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.hero-actions .ag-btn { padding: 0 var(--space-3); white-space: nowrap; }

/* ---- lists ---------------------------------------------------------------------------- */
.ag-list > li { list-style: none; position: relative; }
.ag-list > li + li > .ag-row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--space-4); border-top: 1px solid var(--line); }
.ag-list > li + li > .ag-row:has(.ag-row__icon)::before { left: calc(var(--space-4) + var(--space-8) + var(--space-3)); }
button.ag-row:disabled { cursor: default; opacity: 1; }
button.ag-row:disabled:active { background: none; }
a.ag-row, button.ag-row { width: 100%; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); }
.ag-row__body { display: flex; flex-direction: column; }
.ag-row__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-row__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-row__meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); min-width: 0; }
.ag-row__meta .ag-badge { flex: none; }
.ag-row__end { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.ag-row__icon--text { font: 700 15px/1 var(--font-mono); }
.ag-row__icon--muted { background: var(--surface-sunken); color: var(--ink-muted); }
.ag-row .ag-badge { flex: none; }
.ag-row:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; border-radius: var(--radius-lg); }
.list-group-label { margin: var(--space-6) var(--space-1) var(--space-2); font: 700 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); display: flex; justify-content: space-between; }
.list-group-label:first-child { margin-top: 0; }
.mpg-tag { font: 600 13px/18px var(--font-mono); color: var(--ember); font-variant-numeric: tabular-nums; }

/* ---- empty state ------------------------------------------------------------------------ */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-10) var(--space-4); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.empty__title { font: 700 20px/25px var(--font-display); }
.empty__sub { font: 400 15px/20px var(--font-sans); color: var(--ink-muted); max-width: 32ch; margin-bottom: var(--space-3); }

/* ---- tab bar ------------------------------------------------------------------------------- */
.ag-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; }
.ag-tab { text-decoration: none; justify-content: center; }
.ag-tab:active { opacity: var(--opacity-pressed); }
.tabbar-inner { display: flex; width: 100%; max-width: 720px; margin: 0 auto; }

/* ---- garage hero --------------------------------------------------------------------------- */
.ag-hero__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.ag-hero__odo { text-align: right; }
.ag-hero__odo .ag-stat__value { font-size: 28px; line-height: 32px; }
.vehicle-switch { display: inline-flex; align-items: center; gap: var(--space-1); background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.vehicle-switch .icon { color: var(--ink-faint); transform: rotate(90deg); }
/* Generic car illustration (js/car-art.js). Dark is the default, as in tokens.css. */
:root { --car-body: #4a5058; --car-shade: #3c4148; --car-glass: #0d0f11; --car-clad: #26292d; --car-tire: #0b0c0e; --car-rim: #8a9098; --car-hub: #2f3338; --car-seam: #2b2f34; --car-head: #e9ecef; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --car-body: #b9bdc2; --car-shade: #a4a9af; --car-glass: #2b2f34; --car-clad: #3a3e44; --car-tire: #1b1d20; --car-rim: #c9cdd2; --car-hub: #5c6168; --car-seam: #959aa1; --car-head: #f7f8f9; } }
:root[data-theme="light"] { --car-body: #b9bdc2; --car-shade: #a4a9af; --car-glass: #2b2f34; --car-clad: #3a3e44; --car-tire: #1b1d20; --car-rim: #c9cdd2; --car-hub: #5c6168; --car-seam: #959aa1; --car-head: #f7f8f9; }
.car-art { overflow: visible; }
.car__body { fill: var(--car-body); }
.car__body--shade { fill: var(--car-shade); }
.car__glass { fill: var(--car-glass); }
.car__clad, .car__trim { fill: var(--car-clad); }
.car__seam { fill: none; stroke: var(--car-seam); stroke-width: 3; stroke-linecap: round; }
.car__crease { fill: none; stroke: var(--car-shade); stroke-width: 4; stroke-linecap: round; }
.car__tail { fill: var(--ember); }
.car__head { fill: var(--car-head); }
.car__tire { fill: var(--car-tire); }
.car__rim { fill: var(--car-rim); }
.car__spoke { fill: var(--car-hub); }
.car__hub { fill: var(--car-hub); }

/* First run: no vehicle yet */
.welcome { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-4); }
.welcome__figure { position: relative; margin: 0 calc(var(--space-2) * -1); }
.welcome__title { margin: 0; font: 800 30px/36px var(--font-display); letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.welcome__sub { margin: var(--space-2) 0 0; font: 400 17px/24px var(--font-sans); color: var(--ink-muted); max-width: 34ch; }
.welcome__actions { display: flex; flex-direction: column; gap: var(--space-3); }
body.no-vehicle .ag-tabbar { display: none; }

/* Add to Home Screen card (js/install.js) */
.install-card { position: relative; display: flex; gap: var(--space-3); padding: var(--space-4); padding-right: calc(var(--tap-min) + var(--space-1)); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.install-card__icon { flex: none; width: 44px; height: 44px; border-radius: 10px; }
.install-card__body { min-width: 0; }
.install-card__title { margin: 0; font: 700 17px/22px var(--font-display); color: var(--ink); }
.install-card__sub { margin: var(--space-1) 0 0; font: 400 15px/20px var(--font-sans); color: var(--ink-muted); }
.install-card__sub b { color: var(--ink); font-weight: 600; }
.install-card__note { margin: var(--space-2) 0 0; font: 400 13px/18px var(--font-sans); color: var(--ink-faint); }
.install-card__btn { margin-top: var(--space-3); }
.install-card__close { position: absolute; top: var(--space-1); right: var(--space-1); color: var(--ink-faint); }

/* Garage: vehicle sits on the page background, no card */
.garage-hero { margin-top: var(--space-1); }
.garage-hero__head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.garage-hero__title { margin: 0; font: 800 30px/36px var(--font-display); letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.garage-hero__odo { display: flex; flex-direction: row-reverse; align-items: baseline; gap: var(--space-2); }
.garage-hero__odo-value { font: 700 24px/30px var(--font-mono); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.garage-hero__odo-value .ag-stat__unit { font-size: 15px; }
.garage-hero__figure { position: relative; margin: var(--space-3) calc(var(--space-2) * -1) 0; }
.garage-actions { margin-top: var(--space-2); }
.garage-hero .vehicle-switch { min-height: var(--tap-min); }

/* ---- bottom sheet ------------------------------------------------------------------------------ */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; padding: 0; border: 0;
  width: 100%; max-width: 640px; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
  background: var(--surface-overlay); color: var(--ink);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-sheet);
  animation: sheet-in 300ms cubic-bezier(.2, .8, .2, 1);
}
dialog.sheet.is-closing { animation: sheet-out 220ms ease-in forwards; }
dialog.sheet::backdrop { background: var(--scrim); animation: fade-in 300ms ease; }
dialog.sheet.is-closing::backdrop { animation: fade-out 220ms ease 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; } }
.sheet__form { display: flex; flex-direction: column; max-height: inherit; }
.sheet__head { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--space-5) var(--space-3) var(--space-1); touch-action: none; cursor: grab; }
.sheet__head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: var(--radius-pill); background: var(--line-strong); opacity: .6; }
dialog.sheet:focus, dialog.sheet:focus-visible { outline: none; }
dialog.sheet.is-dragging { animation: none; transition: none; }
dialog.sheet.is-settling { transition: transform 220ms cubic-bezier(.2, .8, .2, 1); }
.sheet__head .ag-btn--plain { justify-self: start; font-weight: 400; }
.sheet__title { font: 700 17px/22px var(--font-sans); text-align: center; }
.sheet__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); overscroll-behavior: contain; }
/* Never let long rows (toggles, notes) get squeezed to fit the sheet: the sheet scrolls instead. */
.sheet__body > * { flex-shrink: 0; }
.toggle-row { align-items: center; }
.toggle-row__text { flex: 1; min-width: 0; }
.sheet__foot { padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface-overlay); }
.sheet__destroy { margin-top: var(--space-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.form-grid > *, .ag-field, .ag-field__control { min-width: 0; }
.ag-field__input { width: 100%; min-width: 0; }
.ag-field__input:focus-visible { outline: none; }
.sheet__body { overflow-x: hidden; }
.form-grid > .span-2 { grid-column: 1 / -1; }
.form-note { font: 400 13px/18px var(--font-sans); color: var(--ink-muted); }
.form-error { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-3); border-radius: var(--radius-md); background: var(--danger-subtle); color: var(--danger); font: 600 15px/20px var(--font-sans); }
.form-error[hidden] { display: none; }
.calc-line { display: flex; justify-content: space-between; align-items: baseline; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-sunken); }
.calc-line__label { font: 700 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.calc-line__value { font: 700 22px/28px var(--font-mono); font-variant-numeric: tabular-nums; }

/* fields: text inputs use the sans face; numbers stay mono */
.ag-field__input--text { font: 400 17px/22px var(--font-sans); }
.ag-field__input[type="date"], .ag-field__input[type="datetime-local"] { font: 600 17px/22px var(--font-mono); min-height: 42px; -webkit-appearance: none; appearance: none; }
.ag-field__input::-webkit-date-and-time-value { text-align: left; }
.ag-field__control { position: relative; }
.ag-field__control--area { padding: var(--space-3) var(--space-4); align-items: stretch; }
.ag-field__control--area textarea { resize: vertical; min-height: 66px; }
select.ag-field__input { -webkit-appearance: none; appearance: none; padding-right: var(--space-5); text-overflow: ellipsis; cursor: pointer; }
.select-chev { position: absolute; right: var(--space-2); transform: rotate(90deg); color: var(--ink-faint); pointer-events: none; }
.ag-field__error { margin: 0; }

/* toggles */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap-min); padding: var(--space-3) var(--space-4); background: var(--surface-sunken); border-radius: var(--radius-md); cursor: pointer; }
.toggle-row__text { display: flex; flex-direction: column; }
.toggle-row__label { font: 600 15px/20px var(--font-sans); }
.toggle-row__sub { font: 400 13px/18px var(--font-sans); color: var(--ink-muted); }
.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: var(--radius-pill); background: var(--line-strong); cursor: pointer; transition: background-color 140ms ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px #0000004d; transition: transform 200ms cubic-bezier(.2, .8, .2, 1); }
.switch:checked { background: var(--ember); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* chips (multi-select of schedule items) */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 36px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: none; font: 600 15px/20px var(--font-sans); color: var(--ink); cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .icon { display: none; }
.chip:has(input:checked) { background: var(--ember-subtle); border-color: var(--ember); color: var(--ember); }
.chip:has(input:checked) .icon { display: block; }
.chip:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.chips-label { font: 600 15px/20px var(--font-sans); margin-bottom: var(--space-2); }

/* alert */
dialog.alert { border: 0; padding: var(--space-6) var(--space-4) var(--space-4); width: min(320px, calc(100% - 32px)); border-radius: var(--radius-xl); background: var(--surface-overlay); color: var(--ink); box-shadow: var(--shadow-sheet); }
dialog.alert::backdrop { background: var(--scrim); }
.alert__msg { font: 600 17px/22px var(--font-sans); text-align: center; margin-bottom: var(--space-6); }
.alert__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px) + var(--space-4)); z-index: 50; display: flex; align-items: center; gap: var(--space-2); max-width: calc(100% - 32px); padding: var(--space-3) var(--space-4); border-radius: var(--radius-pill); background: var(--ink); color: var(--surface-base); font: 600 15px/20px var(--font-sans); box-shadow: var(--shadow-sheet); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform 250ms cubic-bezier(.2, .8, .2, 1), opacity 200ms ease; }
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }

/* ---- charts ------------------------------------------------------------------------------------ */
.chart-card { padding: var(--space-4) var(--space-4) var(--space-3); }
.chart-card__head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-3); }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 500 11px var(--font-sans); fill: var(--ink-muted); }
.chart .grid { stroke: var(--steel); stroke-width: 1; opacity: .5; }
.chart .series-1 { stroke: var(--ember); }
.chart .series-2 { stroke: var(--ink); }
.chart .fill-1 { fill: var(--ember); }
.chart .fill-2 { fill: var(--ink-muted); }
.chart .fill-3 { fill: var(--info); }
.chart .fill-4 { fill: var(--steel); }
.chart .fill-5 { fill: var(--warning); }
.chart .dot { fill: var(--surface-raised); stroke: var(--ember); stroke-width: 2; }
.chart-empty { padding: var(--space-8) 0; text-align: center; font: 400 15px/20px var(--font-sans); color: var(--ink-muted); }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font: 500 12px/16px var(--font-sans); color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.breakdown { display: flex; flex-direction: column; gap: var(--space-3); }
.breakdown__row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); align-items: baseline; }
.breakdown__name { font: 600 15px/20px var(--font-sans); }
.breakdown__val { font: 600 15px/20px var(--font-mono); font-variant-numeric: tabular-nums; }
.breakdown__bar { grid-column: 1 / -1; height: 8px; border-radius: var(--radius-xs); background: var(--surface-sunken); overflow: hidden; }
.breakdown__bar > i { display: block; height: 100%; border-radius: var(--radius-xs); }
.range-bar { display: flex; justify-content: flex-start; margin-bottom: var(--space-4); }
.range-bar .ag-seg { width: 100%; }
.range-bar .ag-seg__item { flex: 1; }

/* ---- import --------------------------------------------------------------------------------------- */
.map-table { width: 100%; border-collapse: collapse; font: 400 13px/18px var(--font-mono); }
.map-table th, .map-table td { text-align: left; padding: var(--space-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.map-table th { font: 700 12px/16px var(--font-sans); letter-spacing: .04em; color: var(--ink-muted); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunken); }
.file-drop { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-4); border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); text-align: center; color: var(--ink-muted); cursor: pointer; }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.callout { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--info-subtle); color: var(--ink); font: 400 15px/20px var(--font-sans); }
.callout .icon { color: var(--info); margin-top: 1px; }
.callout--warning { background: var(--warning-subtle); }
.callout--warning .icon { color: var(--warning); }

/* ---- press feedback (see js/press.js) ---------------------------------------------------------------- */
.ag-btn.is-pressed { transform: scale(.96); filter: brightness(.88); }
.ag-btn--primary.is-pressed { background: var(--ember-pressed); filter: none; }
.ag-btn--plain.is-pressed { opacity: var(--opacity-pressed); transform: none; filter: none; }
.ag-row.is-pressed { background: var(--surface-overlay); }
.ag-tab.is-pressed, .icon-btn.is-pressed { opacity: var(--opacity-pressed); }
.icon-btn.is-pressed { transform: scale(.92); }
.card-button.is-pressed { transform: scale(.985); filter: brightness(.94); }
.chip.is-pressed { transform: scale(.95); background: var(--surface-overlay); }
.ag-seg__item.is-pressed { background: var(--surface-overlay); color: var(--ink); }
.ag-hotspot.is-pressed .ag-hotspot__dot { transform: scale(.88); }
.file-drop.is-pressed { filter: brightness(.92); }
.chip, .icon-btn, .ag-seg__item { transition: transform 140ms cubic-bezier(.2, .8, .2, 1), background-color 140ms ease, opacity 140ms ease; }
@media (prefers-reduced-motion: reduce) {
  .ag-btn.is-pressed, .icon-btn.is-pressed, .card-button.is-pressed, .chip.is-pressed { transform: none; }
}

/* ---- motion ---------------------------------------------------------------------------------------- */
.view-enter { animation: view-in 250ms cubic-bezier(.2, .8, .2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
@media (min-width: 720px) {
  .page { padding-left: var(--space-6); padding-right: var(--space-6); }
}

/* Sync code shown in a sheet (Settings › Sync › Sync codes) */
.code-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: var(--space-3); }
.code-card__code { font: 700 28px/34px var(--font-mono); letter-spacing: .04em; color: var(--ink); user-select: all; -webkit-user-select: all; }
