/* ============================================================
   Car — a charging ledger in road-sign type.
   Overpass (Highway Gothic lineage) throughout. The one loud
   thing is the status sign; everything else is quiet ledger.
   ============================================================ */

@font-face {
  font-family: 'Overpass';
  src: url('/fonts/overpass-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  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: 'Overpass';
  src: url('/fonts/overpass-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light;
  --page:    #eceee9;   /* concrete */
  --surface: #fcfcfb;
  --ink:     #15191c;
  --ink-2:   #4d5357;
  --muted:   #7c8286;
  --hair:    #dde0da;
  --axis:    #c3c6bf;
  --sign:    #00664a;   /* US guide-sign green */
  --sign-ink:#ffffff;
  --link:    #00664a;
  --bad:     #b3261e;
  --wash:    rgba(0, 102, 74, 0.08);

  /* places — validated categorical set (see README) */
  --place-1: #2a78d6;   /* first geofence (usually Home) */
  --place-2: #1baf7a;   /* second geofence (usually Work) */
  --place-3: #eda100;
  --place-4: #e87ba4;
  --place-5: #4a3aa7;
  --place-sc: #eb6834;  /* Supercharger */
  --place-none: #a4a9a5;/* Untagged: neutral, not a hue */

  --font: 'Overpass', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px;
  --tabs-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page:    #0f1214;
    --surface: #1b1e21;
    --ink:     #eef1ef;
    --ink-2:   #b3b9b6;
    --muted:   #858b88;
    --hair:    #2b3033;
    --axis:    #3a3f42;
    --sign:    #0a6a4d;
    --link:    #4fc29a;
    --bad:     #ff8a80;
    --wash:    rgba(79, 194, 154, 0.10);
    --place-1: #3987e5;
    --place-2: #199e70;
    --place-3: #c98500;
    --place-4: #d55181;
    --place-5: #9085e9;
    --place-sc: #d95926;
    --place-none: #6d7370;
  }
}

html { -webkit-text-size-adjust: 100%; background: var(--page); }

body {
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--page);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--link); text-decoration: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

#view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 28px);
  outline: none;
}
#view.is-loading { opacity: 0.55; transition: opacity 0.2s; }

/* ── Type scale (1.25) ────────────────────────────────────── */

.title  { font-size: 1.75rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.h2     { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.meta   { font-size: 0.875rem; color: var(--ink-2); }
.num    { font-variant-numeric: tabular-nums; }

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ── The sign ─────────────────────────────────────────────── */
/* A highway guide sign: green panel, white inset border, white Overpass. */

.sign {
  position: relative;
  padding: 18px 20px 20px;
  border-radius: 14px;
  background: var(--sign);
  color: var(--sign-ink);
  box-shadow: inset 0 0 0 4px var(--sign), inset 0 0 0 6px rgba(255, 255, 255, 0.92);
}

.sign-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.sign-lead { font-size: 1rem; font-weight: 600; opacity: 0.9; }
.sign-place {
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 800;
  line-height: 1.02;
  overflow-wrap: anywhere;
}
.sign-figure { text-align: right; flex: none; }
.sign-pct { font-size: clamp(2rem, 9vw, 2.75rem); font-weight: 800; line-height: 1.02; }
.sign-range { font-size: 1rem; font-weight: 600; opacity: 0.9; }

.sign-meter {
  position: relative;
  height: 8px;
  margin-top: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}
.sign-meter > span {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--sign-ink);
}
.sign-meter > span.fill-in { transform-origin: left; animation: fill-in 0.9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fill-in { from { transform: scaleX(0); } }
.sign-meter > span.is-charging {
  background: repeating-linear-gradient(-45deg, #fff 0 8px, rgba(255,255,255,.72) 8px 16px);
  background-size: 22.6px 22.6px;
  animation: stripes 0.9s linear infinite;
}
.sign-meter > span.is-charging.fill-in { animation: fill-in 0.9s cubic-bezier(.2,.8,.2,1) both, stripes 0.9s linear infinite; }
@keyframes stripes { to { background-position: 22.6px 0; } }
.sign-lead .bolt {
  display: inline-block; width: 0.7em; height: 0.95em; margin-right: 0.35em; vertical-align: -0.1em;
  background: currentColor;
  clip-path: polygon(56% 0, 8% 58%, 44% 58%, 36% 100%, 92% 40%, 56% 40%);
  animation: bolt 1.8s ease-in-out infinite;
}
@keyframes bolt { 50% { opacity: 0.45; } }
.sign.is-skeleton .sign-place { height: 1.02em; width: 55%; border-radius: 6px; background: rgba(255,255,255,.18); }
.sign.is-skeleton .sign-meter > span { width: 35% !important; background: rgba(255,255,255,.45); animation: shimmer 1.2s ease-in-out infinite alternate; }
@keyframes shimmer { to { width: 70%; opacity: .6; } }
.ghost { height: 1.15em; width: 40%; border-radius: 6px; background: var(--hair); }

.save-here { margin-left: 10px; font-weight: 700; }

.sign-foot { margin-top: 8px; font-size: 0.8125rem; color: var(--ink-2); }

/* ── Sections & rows (a ledger, not cards) ────────────────── */

.section { margin-top: 28px; }
.section > .h2 { margin-bottom: 8px; }

.panel {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--hair);
}
.panel-pad { padding: 16px; }

.rows { list-style: none; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  color: inherit;
}
.rows > li + li > .row, .rows > li + li.row { box-shadow: inset 0 1px 0 var(--hair); }
a.row:active { background: var(--wash); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 0.875rem; color: var(--ink-2); }
.row-end { text-align: right; flex: none; }
.row-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.chev { flex: none; width: 8px; height: 8px; border: solid var(--muted); border-width: 2px 2px 0 0; transform: rotate(45deg); }

.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dot.p1 { background: var(--place-1); } .dot.p2 { background: var(--place-2); }
.dot.p3 { background: var(--place-3); } .dot.p4 { background: var(--place-4); }
.dot.p5 { background: var(--place-5); } .dot.psc { background: var(--place-sc); }
.dot.pnone { background: transparent; box-shadow: inset 0 0 0 2px var(--place-none); }

.rows > li.day {
  padding: 14px 16px 4px;
  font-size: 0.8125rem; font-weight: 700; color: var(--ink-2);
}
.rows > li.day + li > .row { box-shadow: none; }
.rows > li + li.day { box-shadow: inset 0 1px 0 var(--hair); margin-top: 6px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; }
.fact { padding: 12px 16px; }
.fact:nth-child(n+3) { box-shadow: inset 0 1px 0 var(--hair); }
.fact:nth-child(even) { box-shadow: inset 1px 0 0 var(--hair); }
.fact:nth-child(n+3):nth-child(even) { box-shadow: inset 1px 0 0 var(--hair), inset 0 1px 0 var(--hair); }
.fact-label { font-size: 0.8125rem; color: var(--ink-2); }
.fact-value { font-size: 1.125rem; font-weight: 700; }

/* ── Month switcher ───────────────────────────────────────── */

.switcher { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.switcher .title { text-align: center; flex: 1; }
.step {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink);
}
.step:active { background: var(--wash); }
.step[aria-disabled="true"] { visibility: hidden; }
.step i { width: 10px; height: 10px; border: solid currentColor; border-width: 2.5px 2.5px 0 0; }
.step.prev i { transform: translateX(2px) rotate(-135deg); }
.step.next i { transform: translateX(-2px) rotate(45deg); }

/* ── Hero figure ──────────────────────────────────────────── */

.hero { font-size: 3.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.hero-sub { margin-top: 8px; color: var(--ink-2); max-width: 36ch; }

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--place-sc), 0 0 0 1px var(--hair);
  font-size: 0.9375rem;
}

/* ── Charts ───────────────────────────────────────────────── */

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .col { fill: var(--muted); opacity: 0.55; }
.chart .col.is-current { fill: var(--sign); opacity: 1; }
.chart .col-hit { fill: transparent; cursor: pointer; }
.chart .col-hit:focus-visible { outline: none; stroke: var(--link); stroke-width: 2; }
.chart .cap { fill: var(--ink); font-weight: 700; font-size: 12px; }
.chart .line { fill: none; stroke: var(--sign); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--sign); opacity: 0.1; }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .marker { fill: var(--sign); stroke: var(--surface); stroke-width: 2; }
.chart .col.grow { transform-box: fill-box; transform-origin: bottom; animation: grow-up 0.55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow-up { from { transform: scaleY(0); } }
.chart .fade-late { animation: fade-in 0.4s ease-out 0.45s both; }
@keyframes fade-in { from { opacity: 0; } }
.chart .area.fade-late { animation: fade-area 0.5s ease-out 0.6s both; }
@keyframes fade-area { from { opacity: 0; } }
.chart .line.draw { transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1); stroke-dashoffset: 0 !important; }
.stack.grow > span { transform-origin: left; animation: fill-in 0.7s cubic-bezier(.2,.8,.2,1) both; }

.stack { display: flex; gap: 2px; height: 16px; margin: 4px 0 14px; }
.stack > span { min-width: 3px; }
.stack > span:first-child { border-radius: 4px 0 0 4px; }
.stack > span:last-child { border-radius: 0 4px 4px 0; }
.stack > span:only-child { border-radius: 4px; }
.stack .p1 { background: var(--place-1); } .stack .p2 { background: var(--place-2); }
.stack .p3 { background: var(--place-3); } .stack .p4 { background: var(--place-4); }
.stack .p5 { background: var(--place-5); } .stack .psc { background: var(--place-sc); }
.stack .pnone { background: var(--place-none); }

.legend { list-style: none; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 4px 12px; padding: 7px 0; }
.legend li + li { box-shadow: inset 0 1px 0 var(--hair); }
.legend .num { text-align: right; min-width: 4.5ch; }
.legend .share { color: var(--ink-2); font-size: 0.875rem; }

.tip {
  position: fixed; z-index: 20;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--page);
  font-size: 0.8125rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap;
}
.tip b { font-weight: 700; }

/* ── Controls ─────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 10px;
  background: var(--sign); color: var(--sign-ink);
  font-weight: 700; cursor: pointer;
}
.btn.quiet { background: transparent; color: var(--link); box-shadow: inset 0 0 0 1.5px var(--hair); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 0.9375rem; }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); color: #fff; box-shadow: none; }
.btn { transition: transform 0.12s ease-out, background-color 0.15s; }
.btn:active:not(:disabled) { transform: scale(0.97); }
a.row { transition: background-color 0.15s; }
.btn:disabled { opacity: 0.5; }

.pill {
  display: inline-block; padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700;
  color: var(--link); box-shadow: inset 0 0 0 1.5px currentColor;
}

.field { display: flex; gap: 8px; margin-top: 12px; }
.field .money { position: relative; flex: 1; }
.field .money::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.field input {
  width: 100%; min-height: 44px; padding: 0 12px 0 28px;
  border: 0; border-radius: 10px;
  background: var(--page); box-shadow: inset 0 0 0 1.5px var(--hair);
  font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--link); }

.error { color: var(--bad); font-size: 0.9375rem; margin-top: 8px; }

.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -10px 0 4px -4px; padding: 0 4px; font-weight: 700; }
.back i { width: 9px; height: 9px; border: solid currentColor; border-width: 2.5px 2.5px 0 0; transform: rotate(-135deg); }

.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 32px; font-weight: 700; }
.links button { background: none; border: 0; color: var(--link); font-weight: 700; cursor: pointer; }

.empty { padding: 24px 16px; color: var(--ink-2); text-align: center; }

.steps { margin: 12px 0 0 1.2em; }
.steps li { padding: 4px 0; }

/* ── Sign-in ──────────────────────────────────────────────── */

.signin { max-width: 360px; margin: 12vh auto 0; }
.signin .sign { margin-bottom: 24px; }
.signin label { display: block; font-weight: 700; margin-bottom: 6px; }
.signin input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: 10px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--hair);
  font-size: 1.0625rem;
}
.signin input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--link); }
.signin .btn { width: 100%; margin-top: 12px; }

/* ── Tab bar ──────────────────────────────────────────────── */

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--page) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  box-shadow: inset 0 1px 0 var(--hair);
}
.tabs[hidden] { display: none; }
.tabs a {
  flex: 0 1 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabs-h);
  color: var(--muted);
  font-size: 0.75rem; font-weight: 700;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] svg { stroke: var(--sign); stroke-width: 2.2; }

@media (prefers-color-scheme: dark) {
  .tabs a[aria-current="page"] svg { stroke: var(--link); }
}

@media (prefers-reduced-motion: reduce) {
  .sign-meter > span.is-charging { animation: none; }
  #view.is-loading { transition: none; }
}

/* ── Place form ───────────────────────────────────────────── */

.page-title { margin-bottom: 16px; }
.place-form { display: grid; gap: 20px; }
.form-row { display: grid; gap: 8px; }
.form-row > label, .form-row .label, .label-row label { font-weight: 700; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.place-form input[type=text] {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: 10px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--hair);
  font-size: 1.0625rem; font-weight: 600;
}
.place-form input[type=text]:focus { outline: none; box-shadow: inset 0 0 0 2px var(--link); }
.place-form .field { margin-top: 0; align-items: center; }
.place-form .field input { background: var(--surface); }
.place-form .unit { flex: none; color: var(--ink-2); font-weight: 600; }
.hint { margin-top: -2px; }
.linkish { background: none; border: 0; color: var(--link); font-weight: 700; cursor: pointer; padding: 6px 0; }

input[type=range] { width: 100%; accent-color: var(--sign); height: 32px; }

.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; border-radius: 12px; background: var(--hair);
}
.segmented button {
  min-height: 40px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 700; color: var(--ink-2); cursor: pointer;
  transition: background-color 0.18s, color 0.18s, box-shadow 0.18s;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--sign); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.form-actions .btn:first-child { flex: 1; }

.map {
  position: relative; height: 260px; overflow: hidden;
  border-radius: var(--r); background: #dfe3dc;
  box-shadow: 0 0 0 1px var(--hair);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.map.dragging { cursor: grabbing; }
.map-tiles img {
  position: absolute; left: 0; top: 0; width: 256px; height: 256px;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.map-tiles img.in { opacity: 1; }
@media (prefers-color-scheme: dark) {
  .map { background: #23282b; }
  .map-tiles img { filter: brightness(0.72) contrast(1.1) saturate(0.8); }
}
.map-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-ring { fill: rgba(0, 102, 74, 0.16); stroke: var(--sign); stroke-width: 2; }
.map-pin { fill: var(--sign); stroke: #fff; stroke-width: 3; }
.map.dragging .map-pin { transform-box: fill-box; transform-origin: center; transform: scale(1.3); }
.map-pin { transition: transform 0.15s; }
.map-car {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--place-1); box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(0,0,0,.4);
  pointer-events: none;
}
.map-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 1px; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.map-zoom button { width: 40px; height: 40px; border: 0; background: var(--surface); color: var(--ink); font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.map-credit { position: absolute; right: 6px; bottom: 4px; font-size: 0.6875rem; color: #333; background: rgba(255,255,255,.75); padding: 0 4px; border-radius: 3px; }

/* ── Toast & pull-to-refresh ──────────────────────────────── */

.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--page); font-weight: 700; font-size: 0.9375rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toast-in 0.28s cubic-bezier(.2,.9,.3,1.2) both;
}
.toast.out { animation: toast-out 0.3s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); } }

.ptr {
  position: fixed; z-index: 25; left: 50%; top: calc(env(safe-area-inset-top) + 4px);
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.18);
  transform: translate(-50%, -60px);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
  display: grid; place-items: center;
}
.ptr > span { width: 14px; height: 18px; background: var(--muted); clip-path: polygon(56% 0, 8% 58%, 44% 58%, 36% 100%, 92% 40%, 56% 40%); transition: background-color .15s; }
.ptr.ready > span, .ptr.spin > span { background: var(--sign); }
.ptr.spin { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { rotate: 360deg; } }

/* ── Screen transitions (View Transitions API) ────────────── */

.tabs { view-transition-name: tabs; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
html[data-nav="push"]::view-transition-old(root) { animation-name: vt-out-left; }
html[data-nav="push"]::view-transition-new(root) { animation-name: vt-in-right; }
html[data-nav="pop"]::view-transition-old(root)  { animation-name: vt-out-right; }
html[data-nav="pop"]::view-transition-new(root)  { animation-name: vt-in-left; }
html[data-nav="tab"]::view-transition-old(root)  { animation: vt-fade-out 0.16s ease-out both; }
html[data-nav="tab"]::view-transition-new(root)  { animation: vt-fade-in 0.22s ease-out both; }
@keyframes vt-in-right  { from { transform: translateX(28%); opacity: 0; } }
@keyframes vt-out-left  { to   { transform: translateX(-12%); opacity: 0; } }
@keyframes vt-in-left   { from { transform: translateX(-12%); opacity: 0; } }
@keyframes vt-out-right { to   { transform: translateX(28%); opacity: 0; } }
@keyframes vt-fade-in   { from { opacity: 0; transform: translateY(6px); } }
@keyframes vt-fade-out  { to   { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Passkeys ─────────────────────────────────────────────── */

.btn.passkey { width: 100%; gap: 10px; margin-bottom: 4px; }
.faceid {
  width: 22px; height: 22px; flex: none; background: currentColor;
  -webkit-mask: url('/icons/faceid.svg') center / contain no-repeat;
  mask: url('/icons/faceid.svg') center / contain no-repeat;
}
.faceid.small { width: 20px; height: 20px; color: var(--sign); }
.or { text-align: center; color: var(--ink-2); font-size: 0.875rem; margin: 14px 0 10px; }
.nudge { display: grid; gap: 6px; box-shadow: inset 3px 0 0 var(--sign), 0 0 0 1px var(--hair); }
.nudge .form-actions { margin-top: 6px; justify-content: flex-start; }
.nudge .form-actions .btn:first-child { flex: 0 1 auto; }
.actions { margin-top: 12px; }
.actions + .hint { margin-top: 8px; }
