/* ==========================================================
   Vault Pro — security-print world
   Intaglio ground, engraved line-work, colour-shifting ink.
   Radius rule: controls 12px, surfaces 20px, chips/pills full.
   ========================================================== */

@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --t-press: 140ms;
  --t-fast: 180ms;
  --t-base: 240ms;

  --r-control: 12px;
  --r-surface: 20px;
  --r-pill: 999px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  --rail-w: 248px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --ovi: 0.35;
  color-scheme: dark;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --scrim: rgba(2, 4, 8, 0.62);
}

:root[data-theme="light"] {
  color-scheme: light;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 10px 30px -14px rgba(20, 28, 48, 0.24);
  --shadow-lift: 0 24px 60px -24px rgba(20, 28, 48, 0.32);
  --scrim: rgba(16, 22, 36, 0.38);
}

/* ---------- inks (generated from OKLCH by inks.py) ---------- */
:root[data-ink="sapphire"], :root:not([data-ink]) {
  --ground: #050810;
  --ground-raise: #070D17;
  --surface: #0D1421;
  --surface-2: #141C2C;
  --surface-3: #1C2638;
  --line: rgba(225, 232, 246, 0.08);
  --line-strong: rgba(225, 232, 246, 0.16);
  --ink: #EBEFF5;
  --ink-2: #B5BECE;
  --ink-3: #8A94A7;
  --in: #A4C5FF;
  --primary: #3967C1;
  --primary-hover: #4575D0;
  --primary-hi: #507ED3;
  --primary-ink: #FFFFFF;
  --ink-a: #90B7FF;
  --ink-b: #EAA76B;
  --focus: #EAA76B;
  --danger: #F08C7E;
  --danger-bg: rgba(240, 140, 126, 0.12);
  --warn: #E7BE6A;
  --warn-bg: rgba(231, 190, 106, 0.12);
  --ok-bg: rgba(164, 197, 255, 0.13);
  --note-a: #0F192C;
  --note-b: #070E1B;
  --guilloche: rgba(144, 183, 255, 0.34);
  --guilloche-b: rgba(234, 167, 107, 0.34);
  --guilloche-fine: rgba(234, 167, 107, 0.24);
  --chart-line: #90B7FF;
  --chart-fill: rgba(144, 183, 255, 0.22);
}

:root[data-ink="sapphire"][data-theme="light"], :root:not([data-ink])[data-theme="light"] {
  --ground: #EEE5D8;
  --ground-raise: #F3ECE0;
  --surface: #FCF9F1;
  --surface-2: #F5EEE4;
  --surface-3: #E9E1D5;
  --line: rgba(56, 49, 49, 0.1);
  --line-strong: rgba(56, 49, 49, 0.18);
  --ink: #16181E;
  --ink-2: #43454D;
  --ink-3: #5A5C64;
  --in: #3057A3;
  --primary: #2855AD;
  --primary-hover: #1E4798;
  --primary-hi: #3D68BC;
  --primary-ink: #FFFFFF;
  --ink-a: #3E66B3;
  --ink-b: #975A18;
  --focus: #975A18;
  --danger: #B3402F;
  --danger-bg: rgba(179, 64, 47, 0.09);
  --warn: #8A5F0B;
  --warn-bg: rgba(138, 95, 11, 0.12);
  --ok-bg: rgba(48, 87, 163, 0.1);
  --note-a: #FDF7EB;
  --note-b: #E6DED7;
  --guilloche: rgba(62, 102, 179, 0.32);
  --guilloche-b: rgba(151, 90, 24, 0.32);
  --guilloche-fine: rgba(151, 90, 24, 0.26);
  --chart-line: #3E66B3;
  --chart-fill: rgba(62, 102, 179, 0.16);
}

:root[data-ink="bronze"] {
  --ground: #0D0703;
  --ground-raise: #130B04;
  --surface: #1C1208;
  --surface-2: #251A0D;
  --surface-3: #312314;
  --line: rgba(240, 230, 219, 0.08);
  --line-strong: rgba(240, 230, 219, 0.16);
  --ink: #F3EDE8;
  --ink-2: #C7BBAF;
  --ink-3: #9F9182;
  --in: #F1B879;
  --primary: #975D00;
  --primary-hover: #A96800;
  --primary-hi: #B17013;
  --primary-ink: #FFFFFF;
  --ink-a: #E5AA69;
  --ink-b: #F59D8B;
  --focus: #F59D8B;
  --danger: #F08C7E;
  --danger-bg: rgba(240, 140, 126, 0.12);
  --warn: #E7BE6A;
  --warn-bg: rgba(231, 190, 106, 0.12);
  --ok-bg: rgba(241, 184, 121, 0.13);
  --note-a: #241606;
  --note-b: #160C03;
  --guilloche: rgba(229, 170, 105, 0.34);
  --guilloche-b: rgba(245, 157, 139, 0.34);
  --guilloche-fine: rgba(245, 157, 139, 0.24);
  --chart-line: #E5AA69;
  --chart-fill: rgba(229, 170, 105, 0.22);
}

:root[data-ink="bronze"][data-theme="light"] {
  --ground: #F2E4D1;
  --ground-raise: #F6EBDB;
  --surface: #FDF9EF;
  --surface-2: #F7EEE0;
  --surface-3: #EDE0CE;
  --line: rgba(66, 46, 27, 0.1);
  --line-strong: rgba(66, 46, 27, 0.18);
  --ink: #1F160E;
  --ink-2: #4F4236;
  --ink-3: #68594C;
  --in: #804E00;
  --primary: #804E00;
  --primary-hover: #6D4200;
  --primary-hi: #975D00;
  --primary-ink: #FFFFFF;
  --ink-a: #935A00;
  --ink-b: #A04F40;
  --focus: #A04F40;
  --danger: #B3402F;
  --danger-bg: rgba(179, 64, 47, 0.09);
  --warn: #8A5F0B;
  --warn-bg: rgba(138, 95, 11, 0.12);
  --ok-bg: rgba(128, 78, 0, 0.1);
  --note-a: #FEF7E8;
  --note-b: #F1DCC4;
  --guilloche: rgba(147, 90, 0, 0.32);
  --guilloche-b: rgba(160, 79, 64, 0.32);
  --guilloche-fine: rgba(160, 79, 64, 0.26);
  --chart-line: #935A00;
  --chart-fill: rgba(147, 90, 0, 0.16);
}

:root[data-ink="amethyst"] {
  --ground: #0A060E;
  --ground-raise: #0F0A15;
  --surface: #17111E;
  --surface-2: #201928;
  --surface-3: #2A2233;
  --line: rgba(235, 229, 242, 0.08);
  --line-strong: rgba(235, 229, 242, 0.16);
  --ink: #F0EDF4;
  --ink-2: #C1BACA;
  --ink-3: #9890A2;
  --in: #D4B2FD;
  --primary: #7F52AD;
  --primary-hover: #8D60BB;
  --primary-hi: #9369BF;
  --primary-ink: #FFFFFF;
  --ink-a: #C8A5F2;
  --ink-b: #ED9BBB;
  --focus: #ED9BBB;
  --danger: #F08C7E;
  --danger-bg: rgba(240, 140, 126, 0.12);
  --warn: #E7BE6A;
  --warn-bg: rgba(231, 190, 106, 0.12);
  --ok-bg: rgba(212, 178, 253, 0.13);
  --note-a: #1E1527;
  --note-b: #110B18;
  --guilloche: rgba(200, 165, 242, 0.34);
  --guilloche-b: rgba(237, 155, 187, 0.34);
  --guilloche-fine: rgba(237, 155, 187, 0.24);
  --chart-line: #C8A5F2;
  --chart-fill: rgba(200, 165, 242, 0.22);
}

:root[data-ink="amethyst"][data-theme="light"] {
  --ground: #F0E4D7;
  --ground-raise: #F5EBDF;
  --surface: #FDF9F1;
  --surface-2: #F6EEE4;
  --surface-3: #EBE0D4;
  --line: rgba(62, 46, 47, 0.1);
  --line-strong: rgba(62, 46, 47, 0.18);
  --ink: #1C161C;
  --ink-2: #4B424A;
  --ink-3: #635861;
  --in: #6B4692;
  --primary: #6E419A;
  --primary-hover: #5E3586;
  --primary-hi: #7E55A9;
  --primary-ink: #FFFFFF;
  --ink-a: #7A54A1;
  --ink-b: #984F6D;
  --focus: #984F6D;
  --danger: #B3402F;
  --danger-bg: rgba(179, 64, 47, 0.09);
  --warn: #8A5F0B;
  --warn-bg: rgba(138, 95, 11, 0.12);
  --ok-bg: rgba(107, 70, 146, 0.1);
  --note-a: #FDF7EA;
  --note-b: #ECDCD5;
  --guilloche: rgba(122, 84, 161, 0.32);
  --guilloche-b: rgba(152, 79, 109, 0.32);
  --guilloche-fine: rgba(152, 79, 109, 0.26);
  --chart-line: #7A54A1;
  --chart-fill: rgba(122, 84, 161, 0.16);
}

:root[data-ink="graphite"] {
  --ground: #07080A;
  --ground-raise: #0C0D0F;
  --surface: #131417;
  --surface-2: #1B1D1F;
  --surface-3: #242629;
  --line: rgba(230, 232, 234, 0.08);
  --line-strong: rgba(230, 232, 234, 0.16);
  --ink: #EEEEF0;
  --ink-2: #BCBEC0;
  --ink-3: #919497;
  --in: #BBC5D2;
  --primary: #626D7C;
  --primary-hover: #6E7A89;
  --primary-hi: #76818F;
  --primary-ink: #FFFFFF;
  --ink-a: #AEB8C5;
  --ink-b: #90BFD7;
  --focus: #90BFD7;
  --danger: #F08C7E;
  --danger-bg: rgba(240, 140, 126, 0.12);
  --warn: #E7BE6A;
  --warn-bg: rgba(231, 190, 106, 0.12);
  --ok-bg: rgba(187, 197, 210, 0.13);
  --note-a: #171A1D;
  --note-b: #0D0E11;
  --guilloche: rgba(174, 184, 197, 0.34);
  --guilloche-b: rgba(144, 191, 215, 0.34);
  --guilloche-fine: rgba(144, 191, 215, 0.24);
  --chart-line: #AEB8C5;
  --chart-fill: rgba(174, 184, 197, 0.22);
}

:root[data-ink="graphite"][data-theme="light"] {
  --ground: #EEE5D8;
  --ground-raise: #F3ECE0;
  --surface: #FCF9F1;
  --surface-2: #F4EEE4;
  --surface-3: #E9E1D5;
  --line: rgba(55, 49, 48, 0.1);
  --line-strong: rgba(55, 49, 48, 0.18);
  --ink: #1A1817;
  --ink-2: #474443;
  --ink-3: #5F5B5A;
  --in: #525C68;
  --primary: #515C6A;
  --primary-hover: #444E5B;
  --primary-hi: #626D7B;
  --primary-ink: #FFFFFF;
  --ink-a: #606A77;
  --ink-b: #447187;
  --focus: #447187;
  --danger: #B3402F;
  --danger-bg: rgba(179, 64, 47, 0.09);
  --warn: #8A5F0B;
  --warn-bg: rgba(138, 95, 11, 0.12);
  --ok-bg: rgba(82, 92, 104, 0.1);
  --note-a: #FDF7EA;
  --note-b: #E5DFD7;
  --guilloche: rgba(96, 106, 119, 0.32);
  --guilloche-b: rgba(68, 113, 135, 0.32);
  --guilloche-fine: rgba(68, 113, 135, 0.26);
  --chart-line: #606A77;
  --chart-fill: rgba(96, 106, 119, 0.16);
}

:root[data-ink="emerald"] {
  --ground: #030B06;
  --ground-raise: #041009;
  --surface: #081810;
  --surface-2: #0E2117;
  --surface-3: #152B20;
  --line: rgba(221, 236, 227, 0.08);
  --line-strong: rgba(221, 236, 227, 0.16);
  --ink: #E9F1EC;
  --ink-2: #B1C3B8;
  --ink-3: #859A8D;
  --in: #7CDBAA;
  --primary: #008053;
  --primary-hover: #00905D;
  --primary-hi: #009863;
  --primary-ink: #FFFFFF;
  --ink-a: #6BCF9D;
  --ink-b: #EAA76B;
  --focus: #EAA76B;
  --danger: #F08C7E;
  --danger-bg: rgba(240, 140, 126, 0.12);
  --warn: #E7BE6A;
  --warn-bg: rgba(231, 190, 106, 0.12);
  --ok-bg: rgba(124, 219, 170, 0.13);
  --note-a: #061F13;
  --note-b: #03120A;
  --guilloche: rgba(107, 207, 157, 0.34);
  --guilloche-b: rgba(234, 167, 107, 0.34);
  --guilloche-fine: rgba(234, 167, 107, 0.24);
  --chart-line: #6BCF9D;
  --chart-fill: rgba(107, 207, 157, 0.22);
}

:root[data-ink="emerald"][data-theme="light"] {
  --ground: #EDE6D3;
  --ground-raise: #F2EDDC;
  --surface: #FCF9F0;
  --surface-2: #F4EFE1;
  --surface-3: #E8E2D0;
  --line: rgba(54, 51, 35, 0.1);
  --line-strong: rgba(54, 51, 35, 0.18);
  --ink: #141A13;
  --ink-2: #40483D;
  --ink-3: #575F53;
  --in: #006C45;
  --primary: #006C45;
  --primary-hover: #005C3B;
  --primary-hi: #008053;
  --primary-ink: #FFFFFF;
  --ink-a: #007D51;
  --ink-b: #975A18;
  --focus: #975A18;
  --danger: #B3402F;
  --danger-bg: rgba(179, 64, 47, 0.09);
  --warn: #8A5F0B;
  --warn-bg: rgba(138, 95, 11, 0.12);
  --ok-bg: rgba(0, 108, 69, 0.1);
  --note-a: #FCF8E9;
  --note-b: #E4E1CA;
  --guilloche: rgba(0, 125, 81, 0.32);
  --guilloche-b: rgba(151, 90, 24, 0.32);
  --guilloche-fine: rgba(151, 90, 24, 0.26);
  --chart-line: #007D51;
  --chart-fill: rgba(0, 125, 81, 0.16);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
html.has-sheet { overflow: hidden; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 1.625rem; line-height: 1.2; }
h2 { font-size: 1rem; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-family: var(--mono); font-feature-settings: normal; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

::selection { background: color-mix(in oklab, var(--ink-b) 40%, transparent); color: var(--ink); }
input, textarea { caret-color: var(--ink-b); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
html { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }

.ico { width: 20px; height: 20px; flex: none; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 24px; height: 24px; }

/* ---------- seal (colour-shifting ink) ---------- */
.seal {
  --ovi-ink: color-mix(in oklab, var(--ink-b) calc((1 - var(--ovi)) * 100%), var(--ink-a));
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; color: var(--ovi-ink);
  flex: none;
}
.seal svg { width: 100%; height: 100%; }

/* ---------- buttons ---------- */
.btn {
  --h: 48px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--h); padding: 0 var(--s5);
  border-radius: var(--r-control);
  font-weight: 560; font-size: 15px; letter-spacing: -0.005em; white-space: nowrap;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease,
              border-color var(--t-fast) ease, color var(--t-fast) ease, opacity var(--t-fast) ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
  background: linear-gradient(180deg, var(--primary-hi), var(--primary) 70%);
  color: var(--primary-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.16) inset, 0 8px 20px -10px color-mix(in oklab, var(--primary) 70%, transparent);
}
.btn--secondary { background: var(--surface-2); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.btn--ghost { color: var(--ink-2); box-shadow: 0 0 0 1px var(--line) inset; --h: 40px; padding: 0 var(--s4); font-size: 14px; }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { --h: 36px; padding: 0 var(--s3); font-size: 13.5px; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--primary-hi), var(--primary-hover) 70%); }
  .btn--secondary:hover:not(:disabled) { background: var(--surface-3); }
  .btn--ghost:hover:not(:disabled) { color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong) inset; }
}
.btn .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-control);
  color: var(--ink-2);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-fast) ease, color var(--t-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--surface-2); color: var(--ink); } }

.link { color: var(--ink-2); font-size: 14px; font-weight: 520; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { color: var(--ink); }
.link-btn { color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link-btn:hover { color: var(--ink); }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field__label { font-size: 13.5px; font-weight: 540; color: var(--ink-2); }
.input {
  width: 100%; min-height: 48px; padding: 0 var(--s4);
  border-radius: var(--r-control);
  background: var(--ground-raise); border: 1px solid var(--line-strong);
  font-size: 16px; color: var(--ink);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input:focus { outline: none; border-color: var(--ink-b); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink-b) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-affix { position: relative; }
.input-affix .input { padding-right: 52px; }
.affix-btn { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-3); border-radius: 10px; }
.affix-btn:hover { color: var(--ink); }
.field__hint { font-size: 13px; color: var(--ink-3); }
.field__error { font-size: 13px; color: var(--danger); min-height: 0; }
.field__error:empty { display: none; }
.form-error { font-size: 14px; color: var(--danger); background: var(--danger-bg); padding: var(--s3) var(--s4); border-radius: var(--r-control); }
.form-error:empty { display: none; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--ground); z-index: 50; transition: opacity 260ms var(--ease-out); }
.boot.is-done { opacity: 0; pointer-events: none; }
.boot .seal { width: 56px; height: 56px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr); }
.auth__plate {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 60% at 85% 20%, color-mix(in oklab, var(--ink-a) 9%, transparent), transparent 70%),
    radial-gradient(50% 60% at 10% 95%, color-mix(in oklab, var(--ink-b) 8%, transparent), transparent 70%),
    radial-gradient(120% 90% at 70% 40%, var(--note-a), var(--note-b) 70%), var(--ground);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--s8);
}
.auth__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.auth__brand { display: flex; align-items: center; gap: var(--s3); font-weight: 650; letter-spacing: -0.01em; font-size: 17px; }
.auth__pitch { max-width: 30rem; }
.auth__pitch h1 { font-size: 2.75rem; line-height: 1.05; letter-spacing: -0.035em; font-weight: 640; }
.auth__pitch p { margin-top: var(--s4); color: var(--ink-2); font-size: 17px; max-width: 26rem; }
.auth__serial { font: 500 12px/1 var(--mono); color: var(--ink-b); letter-spacing: 0.08em; display: flex; justify-content: space-between; }
.auth__panel { display: grid; align-content: center; justify-items: center; padding: var(--s8) var(--s6); gap: var(--s6); }
.auth__form { width: 100%; max-width: 380px; display: grid; gap: var(--s5); }
.auth__form h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.auth__form .muted { margin-top: -12px; }
.auth__form .link-btn { justify-self: center; }
.auth__foot { max-width: 380px; display: flex; gap: var(--s2); align-items: flex-start; font-size: 13px; color: var(--ink-3); }
.auth__foot .ico { width: 16px; height: 16px; margin-top: 2px; }

@media (max-width: 899px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth__plate { min-height: 38dvh; padding: calc(var(--s6) + var(--safe-t)) var(--s5) var(--s5); border-right: 0; border-bottom: 1px solid var(--line); gap: var(--s6); }
  .auth__pitch h1 { font-size: 2rem; }
  .auth__pitch p { font-size: 15px; }
  .auth__panel { align-content: start; padding: var(--s7) var(--s5) calc(var(--s7) + var(--safe-b)); }
}

/* ---------- microprint (security line) ---------- */
.microprint {
  overflow: hidden; white-space: nowrap;
  font: 600 5.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); opacity: 0.55; user-select: none;
}

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: var(--s6);
  padding: var(--s6) var(--s4);
  border-right: 1px solid var(--line);
  background: var(--ground-raise);
}
.rail__brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2); font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.rail__nav { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: var(--s3);
  height: 42px; padding: 0 var(--s3); border-radius: var(--r-control);
  color: var(--ink-2); font-weight: 520; font-size: 14.5px;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.nav-link:active { transform: scale(0.98); }
.nav-link[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: 0 0 0 1px var(--line) inset; }
.nav-link[aria-current="page"] .ico { color: var(--in); }
@media (hover: hover) and (pointer: fine) { .nav-link:hover { color: var(--ink); background: var(--surface); } }
.rail__foot { margin-top: auto; }
.who { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s2); border-radius: var(--r-control); text-align: left; }
.who:hover { background: var(--surface); }
.who__text { min-width: 0; display: grid; }
.who__text strong { font-size: 14px; font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who__text span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; flex: none; overflow: hidden;
  background: var(--surface-3); color: var(--ink); font-weight: 620; font-size: 14px;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 72px; height: 72px; font-size: 26px; }

.topbar { display: none; }
.tabbar { display: none; }
.view { min-width: 0; padding: var(--s7) var(--s8) var(--s9); outline: none; }
.view > * { max-width: 1120px; margin-inline: auto; }

@media (max-width: 959px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
  .rail { display: none; }
  .topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(var(--s3) + var(--safe-t)) var(--s4) var(--s3);
    background: color-mix(in oklab, var(--ground) 86%, transparent);
    -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-fast) ease;
  }
  .topbar.is-scrolled { border-bottom-color: var(--line); }
  .topbar__who { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
  .topbar__who small { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.2; }
  .topbar__who strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
  .tabbar {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in oklab, var(--ground-raise) 90%, transparent);
    -webkit-backdrop-filter: saturate(140%) blur(18px); backdrop-filter: saturate(140%) blur(18px);
    border-top: 1px solid var(--line);
  }
  .tab {
    display: grid; place-items: center; align-content: center; gap: 3px;
    color: var(--ink-3); font-size: 11.5px; font-weight: 540;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
  }
  .tab:active { transform: scale(0.94); }
  .tab > .ico { width: 24px; height: 24px; margin: 4px 0; }
  .tab[aria-current="page"] { color: var(--ink); }
  .tab[aria-current="page"] .ico { color: var(--in); }
  .tab--move .tab__disc {
    width: 40px; height: 32px; border-radius: var(--r-pill);
    display: grid; place-items: center;
    background: var(--primary); color: var(--primary-ink);
  }
  .tab--move .tab__disc .ico { width: 20px; height: 20px; color: inherit; }
  .view { padding: var(--s4) var(--s4) var(--s8); }
}

/* ---------- view transitions ---------- */
.view-enter { animation: viewIn var(--t-base) var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-surface);
  box-shadow: 0 0 0 1px var(--line) inset, var(--shadow);
  padding: var(--s5);
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.card__head h2 { font-size: 15px; }
.page__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
.page__sub { margin-top: 4px; color: var(--ink-2); }

/* ---------- home ---------- */
.home {
  display: grid; gap: var(--s5);
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  grid-template-areas: "greet greet" "note side" "quick side" "chart side";
  align-items: start;
}
.home__note { grid-area: note; }
.home__quick { grid-area: quick; }
.home__chart { grid-area: chart; }
.home__side { grid-area: side; display: grid; gap: var(--s5); }
.home__greet { grid-area: greet; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.home__greet h1 { font-size: 1.5rem; }
@media (max-width: 1099px) {
  .home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "greet" "note" "quick" "side" "chart"; }
}
@media (max-width: 959px) { .home__greet { display: none; } .home { gap: var(--s4); grid-template-areas: "note" "quick" "side" "chart"; } }

/* the Note: the balance printed as a security plate */
.note {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-surface);
  background:
    radial-gradient(70% 90% at 100% 0%, color-mix(in oklab, var(--ink-a) 10%, transparent), transparent 70%),
    radial-gradient(60% 80% at 0% 100%, color-mix(in oklab, var(--ink-b) 8%, transparent), transparent 70%),
    radial-gradient(140% 120% at 85% 50%, transparent 40%, color-mix(in oklab, var(--note-b) 70%, transparent) 100%),
    linear-gradient(155deg, var(--note-a), var(--note-b));
  box-shadow: 0 0 0 1px var(--line-strong) inset, var(--shadow-lift);
  padding: var(--s6) var(--s6) var(--s6);
  min-height: 248px;
  display: flex; flex-direction: column;
}
.note::after {
  content: ""; position: absolute; inset: 7px; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.note__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.note .microprint { position: absolute; left: 22px; right: 22px; }
.note .microprint--top { top: 11px; }
.note .microprint--bottom { bottom: 11px; }
.note__head { display: flex; align-items: center; gap: var(--s2); color: var(--ink-2); font-size: 14px; font-weight: 520; margin-top: var(--s2); }
.note__head .icon-btn { width: 32px; height: 32px; margin-left: -4px; }
.note__head .icon-btn .ico { width: 18px; height: 18px; }
.note__label { transition: color var(--t-fast) ease; }
.is-scrub .note__label { color: var(--ink-b); }
.amt { font-variant-numeric: tabular-nums; letter-spacing: -0.035em; font-weight: 620; line-height: 1; white-space: nowrap; }
.amt--xl { font-size: 3.25rem; margin-top: var(--s3); }
.amt__cents { font-size: 0.5em; letter-spacing: -0.01em; color: var(--ink-2); margin-left: 2px; vertical-align: 0.62em; font-weight: 560; }
.amt__masked { letter-spacing: 0.04em; color: var(--ink-2); }
.amt__stars { display: inline-block; transform: translateY(0.2em); letter-spacing: 0.08em; margin-left: 0.04em; }
.note__sub { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2); min-height: 28px; }
.note__foot { margin-top: auto; padding-top: var(--s5); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.note__serial { font: 500 12px/1.2 var(--mono); letter-spacing: 0.1em; color: var(--ink-b); }
.note__serial small { display: block; font-size: 10px; letter-spacing: 0.14em; color: var(--ink-3); margin-bottom: 4px; text-transform: uppercase; }
.note .seal { width: 54px; height: 54px; }
@media (max-width: 599px) {
  .note { min-height: 228px; padding: var(--s5) var(--s5) 26px; }
  .chart-help { display: none; }
  .amt--xl { font-size: 2.6rem; }
  .note .seal { width: 44px; height: 44px; }
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 540; white-space: nowrap;
  background: color-mix(in oklab, var(--surface-2) 80%, transparent);
  box-shadow: 0 0 0 1px var(--line) inset; color: var(--ink-2);
}
.tag .ico { width: 14px; height: 14px; }
.tag--in { color: var(--in); background: var(--ok-bg); }
.tag--warn { color: var(--warn); background: var(--warn-bg); }

.home__quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }

/* chart */
.chart-card .card__head { align-items: center; flex-wrap: wrap; }
.delta { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.delta--up { color: var(--in); }
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill);
  background: var(--ground-raise); box-shadow: 0 0 0 1px var(--line) inset;
}
.seg button {
  height: 30px; min-width: 40px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 560; color: var(--ink-3);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--surface-3); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.chart { position: relative; height: 200px; margin: 0 calc(var(--s5) * -1); touch-action: pan-y; outline: none; cursor: crosshair; }
.chart:focus-visible { box-shadow: 0 0 0 2px var(--focus) inset; border-radius: 12px; }
.chart-svg { display: block; overflow: visible; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart-grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart-cross { stroke: var(--ink-b); stroke-width: 1; opacity: 0; transition: opacity 120ms ease; }
.chart-dot { fill: var(--surface); stroke: var(--ink-b); stroke-width: 2; opacity: 0; transition: opacity 120ms ease; }
.chart-end { fill: var(--chart-line); }
.chart.is-scrubbing .chart-cross, .chart.is-scrubbing .chart-dot { opacity: 1; }
.chart__axis { display: flex; justify-content: space-between; margin-top: var(--s2); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart-empty { height: 200px; display: grid; place-items: center; text-align: center; color: var(--ink-3); font-size: 14px; border-radius: 14px; background: repeating-linear-gradient(90deg, transparent 0 23px, var(--line) 23px 24px); }

/* in progress */
.track { display: grid; gap: var(--s3); }
.track-item {
  display: grid; gap: var(--s3); padding: var(--s4); width: 100%; text-align: left;
  border-radius: 16px; background: var(--ground-raise); box-shadow: 0 0 0 1px var(--line) inset;
  transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.track-item:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .track-item:hover { background: var(--surface-2); } }
.track-item__top { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; }
.track-item__title { font-weight: 580; font-size: 14.5px; }
.track-item__amt { font-weight: 620; font-variant-numeric: tabular-nums; }
.track-item__meta { font-size: 12.5px; color: var(--ink-3); }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stepper__seg { display: grid; gap: 6px; align-content: start; font-size: 11.5px; line-height: 1.3; color: var(--ink-3); }
.stepper__bar { height: 4px; border-radius: 4px; background: var(--line-strong); overflow: hidden; position: relative; }
.stepper__seg.is-done .stepper__bar { background: var(--in); }
.stepper__seg.is-done { color: var(--ink-2); }
.stepper__seg.is-now { color: var(--ink); }
.stepper__seg.is-now .stepper__bar::after {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: var(--ink-b); border-radius: 4px;
  animation: sweep 1.6s var(--ease-in-out) infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- rows / ledger ---------- */
.list { display: grid; }
.row {
  position: relative;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
  width: 100%; padding: 10px var(--s2); margin: 0 calc(var(--s2) * -1); width: calc(100% + var(--s2) * 2);
  border-radius: 14px; text-align: left;
  transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.row:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .row:hover { background: var(--surface-2); } }
.row + .row::before { content: ""; position: absolute; top: 0; left: 60px; right: var(--s2); height: 1px; background: var(--line); }
@media (hover: hover) and (pointer: fine) { .row:hover + .row::before, .row + .row:hover::before { opacity: 0; } }
.row__tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--ink-2); }
.row__tile--in { color: var(--in); }
.row__tile--failed { color: var(--danger); }
.row__main { min-width: 0; display: grid; gap: 2px; }
.row__title { font-weight: 560; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row__end { display: grid; justify-items: end; gap: 3px; }
.row__amt { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14.5px; letter-spacing: -0.01em; }
.row__amt--in { color: var(--in); }
.row__amt--void { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.pill { font-size: 11.5px; font-weight: 560; padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.pill--pending, .pill--processing { color: var(--warn); background: var(--warn-bg); }
.pill--failed, .pill--expired { color: var(--danger); background: var(--danger-bg); }
.pill--completed { color: var(--in); background: var(--ok-bg); }

.row--skeleton { pointer-events: none; }
.sk { display: block; border-radius: 10px; background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
.sk--tile { width: 40px; height: 40px; border-radius: 12px; }
.sk--lines { display: grid; gap: 6px; background: none; animation: none; }
.sk--lines i { display: block; height: 10px; width: 60%; border-radius: 6px; background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
.sk--lines i + i { width: 36%; }
.sk--amt { width: 72px; height: 12px; }
@keyframes pulse { 50% { opacity: 0.45; } }

.ledger { display: grid; gap: var(--s5); }
.ledger__group h3 {
  position: sticky; top: 0; z-index: 2;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  padding: var(--s2) 0; background: var(--ground);
  display: flex; justify-content: space-between; font-variant-numeric: tabular-nums;
}
@media (max-width: 959px) { .ledger__group h3 { top: calc(64px + var(--safe-t)); } }
.ledger__group .list { background: var(--surface); border-radius: var(--r-surface); padding: 4px var(--s4); box-shadow: 0 0 0 1px var(--line) inset; }

.toolbar { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 44px; }
.chips { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--s4) * -1); padding: 2px var(--s4); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 36px; padding: 0 14px; border-radius: var(--r-pill); white-space: nowrap;
  font-size: 13.5px; font-weight: 540; color: var(--ink-2);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.chip:active { transform: scale(0.96); }
.chip[aria-checked="true"] { background: var(--ink); color: var(--ground); box-shadow: none; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
.summary__cell { padding: var(--s4); border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; display: grid; gap: 4px; min-width: 0; }
.summary__cell span { font-size: 12.5px; color: var(--ink-3); }
.summary__cell strong { font-size: 17px; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 599px) {
  .summary { gap: 0; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; }
  .summary__cell { background: none; box-shadow: none; padding: var(--s3) var(--s3); border-radius: 0; }
  .summary__cell + .summary__cell { border-left: 1px solid var(--line); }
  .summary__cell strong { font-size: 14px; letter-spacing: -0.02em; }
}

.empty { display: grid; justify-items: center; text-align: center; gap: var(--s3); padding: var(--s8) var(--s5); color: var(--ink-2); }
.empty .seal { width: 44px; height: 44px; opacity: 0.8; }
.empty p { max-width: 32ch; }

/* ---------- flows (add / withdraw) ---------- */
.flow { max-width: 560px !important; }
.flow__head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.flow__head .icon-btn { margin-left: -8px; }
.flow__head h1 { font-size: 1.375rem; }
.flow__step { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.progress { display: grid; grid-auto-flow: column; gap: 6px; margin-bottom: var(--s6); }
.progress span { height: 3px; border-radius: 3px; background: var(--line-strong); transition: background-color var(--t-base) var(--ease-out); }
.progress span.is-done { background: var(--in); }
.flow__body { display: grid; gap: var(--s5); }
.flow__body.step-enter { animation: stepIn 220ms var(--ease-out) both; }
.flow__body.step-back { animation: stepBack 220ms var(--ease-out) both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-14px); } }
.flow__actions { display: grid; gap: var(--s3); margin-top: var(--s2); }

.amount-entry {
  display: grid; justify-items: center; gap: var(--s2);
  padding: var(--s7) var(--s4) var(--s6);
  border-radius: var(--r-surface); background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset;
}
.amount-entry label { font-size: 13.5px; color: var(--ink-2); font-weight: 540; }
.amount-entry__row { display: flex; align-items: baseline; justify-content: center; gap: 2px; max-width: 100%; }
.amount-entry__cur { font-size: 2rem; font-weight: 560; color: var(--ink-3); }
.amount-entry input {
  width: 7ch; min-width: 3ch; max-width: 100%;
  background: none; border: 0; outline: none; text-align: left;
  font-size: 3rem; font-weight: 620; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--ink);
  caret-color: var(--ink-b); padding: 0;
}
.amount-entry input::placeholder { color: var(--ink-3); opacity: 0.6; }
.amount-entry__note { font-size: 13px; color: var(--ink-3); min-height: 20px; text-align: center; }
.amount-entry__note.is-error { color: var(--danger); }
.quick-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }

.option {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
  width: 100%; padding: var(--s4); text-align: left;
  border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong) inset;
  transition: box-shadow var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.option:active { transform: scale(0.99); }
.option[aria-checked="true"] { box-shadow: 0 0 0 2px var(--in) inset; background: color-mix(in oklab, var(--surface) 92%, var(--in)); }
.option__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); font: 650 13px/1 var(--mono); letter-spacing: 0; }
.option__body strong { display: block; font-weight: 580; font-size: 15px; }
.option__body span { display: block; font-size: 13px; color: var(--ink-3); }
.option__radio { width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--line-strong) inset; display: grid; place-items: center; }
.option[aria-checked="true"] .option__radio { box-shadow: 0 0 0 6px var(--in) inset; }
.options { display: grid; gap: var(--s2); }
.options--compact .option { padding: var(--s3) var(--s4); }

.review { border-radius: var(--r-surface); background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; overflow: hidden; }
.review__hero { padding: var(--s6) var(--s5) var(--s5); text-align: center; border-bottom: 1px dashed var(--line-strong); }
.review__hero span { font-size: 13px; color: var(--ink-3); }
.review__hero strong { display: block; font-size: 2.25rem; letter-spacing: -0.03em; font-weight: 640; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kv { display: grid; }
.kv__row { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: var(--s4); padding: 12px var(--s5); align-items: baseline; }
.kv__row + .kv__row { border-top: 1px solid var(--line); }
.kv__row dt { font-size: 13.5px; color: var(--ink-3); }
.kv__row dd { margin: 0; text-align: right; font-size: 14px; font-weight: 520; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv__copy { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; text-align: right; color: var(--ink); max-width: 100%; }
.kv__copy .ico { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.kv__copy:hover .ico, .kv__copy.is-copied .ico { color: var(--in); }

.callout { display: flex; gap: var(--s3); padding: var(--s4); border-radius: 14px; font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; }
.callout .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--ink-3); }
.callout--warn { background: var(--warn-bg); color: var(--ink); box-shadow: none; }
.callout--warn .ico { color: var(--warn); }
.callout--ok { background: var(--ok-bg); box-shadow: none; color: var(--ink); }
.callout--ok .ico { color: var(--in); }
.callout--danger { background: var(--danger-bg); box-shadow: none; color: var(--ink); }
.callout--danger .ico { color: var(--danger); }

.addr-check { font: 500 15px/1.6 var(--mono); letter-spacing: 0.02em; word-break: break-all; padding: var(--s4); border-radius: 14px; background: var(--ground-raise); box-shadow: 0 0 0 1px var(--line) inset; }
.addr-check b { color: var(--ink-b); font-weight: 650; }

/* hold to confirm */
.hold {
  position: relative; overflow: hidden; isolation: isolate;
  --h: 56px; font-size: 16px;
  touch-action: none;
}
.hold__fill {
  position: absolute; inset: 0; z-index: -1;
  background: var(--primary-hover);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 220ms var(--ease-out);
}
.hold.is-holding .hold__fill { clip-path: inset(0 0 0 0); transition: clip-path var(--hold, 1500ms) linear; }
.hold.is-holding { transform: scale(0.985); }
.hold.is-confirmed .hold__fill { clip-path: inset(0 0 0 0); transition: none; }
.hold-hint { text-align: center; font-size: 12.5px; color: var(--ink-3); }
.hold-hint.nudge { animation: nudge 360ms var(--ease-out); color: var(--ink-b); }
@keyframes nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }

/* status hero (after submit) */
.status-hero { display: grid; justify-items: center; text-align: center; gap: var(--s3); padding: var(--s6) var(--s4) var(--s4); }
.status-hero__mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-strong) inset; color: var(--ink-b); }
.status-hero__mark .ico { width: 30px; height: 30px; }
.status-hero__mark.is-ok { color: var(--in); background: var(--ok-bg); box-shadow: none; }
.status-hero__mark.is-bad { color: var(--danger); background: var(--danger-bg); box-shadow: none; }
.status-hero__mark.is-wait .ico { animation: spin 2.4s linear infinite; }
.status-hero h2 { font-size: 1.25rem; }
.status-hero p { color: var(--ink-2); max-width: 36ch; }
.check-draw path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 420ms var(--ease-out) 80ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.qr { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: var(--s4); align-items: center; padding: var(--s4); border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; }
.qr__img { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 8px; display: grid; place-items: center; }
.qr__img svg { width: 100%; height: 100%; }
.qr p { font-size: 13.5px; color: var(--ink-2); }
.qr strong { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
@media (max-width: 599px) { .qr { display: none; } }

/* ---------- profile ---------- */
.profile { max-width: 720px !important; display: grid; gap: var(--s5); }
.identity { display: flex; align-items: center; gap: var(--s5); }
.identity__actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.identity h2 { font-size: 1.25rem; }
.settings-group h2 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 0 0 var(--s2) var(--s1); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s4) 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting__text { min-width: 0; }
.setting__text strong { display: block; font-weight: 560; font-size: 14.5px; }
.setting__text span { display: block; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--line-strong); transition: background-color var(--t-fast) ease; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--t-base) var(--ease-out); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.name-form { display: flex; gap: var(--s2); }
.name-form .input { min-height: 44px; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet__scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 260ms var(--ease-out); }
.sheet__panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(460px, 100vw);
  background: var(--surface); box-shadow: -1px 0 0 var(--line-strong), var(--shadow-lift);
  display: flex; flex-direction: column; outline: none;
  transform: translateX(104%);
  transition: transform 300ms var(--ease-drawer);
}
.sheet.is-open .sheet__scrim { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }
.sheet.is-closing .sheet__panel { transition-duration: 200ms; }
.sheet__grab { display: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s4) var(--s2) var(--s5); }
.sheet__title { font-size: 16px; }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: var(--s2) var(--s5) calc(var(--s6) + var(--safe-b)); flex: 1; }
@media (max-width: 719px) {
  .sheet__panel {
    left: 0; right: 0; top: auto; width: auto; max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -1px 0 var(--line-strong), var(--shadow-lift);
    transform: translateY(104%);
  }
  .sheet__grab { display: grid; place-items: center; height: 22px; touch-action: none; cursor: grab; }
  .sheet__grab span { width: 40px; height: 5px; border-radius: 5px; background: var(--line-strong); }
  .sheet__head { padding-top: 0; touch-action: none; }
}

/* receipt (transaction detail) */
.receipt__hero { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: var(--s6) var(--s4) var(--s5); border-radius: var(--r-surface); background: linear-gradient(155deg, var(--note-a), var(--note-b)); box-shadow: 0 0 0 1px var(--line-strong) inset; margin-bottom: var(--s4); }
.receipt__hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.8; }
.receipt__tile { width: 48px; height: 48px; margin: 0 auto var(--s3); border-radius: 14px; display: grid; place-items: center; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong) inset; color: var(--ink-2); }
.receipt__tile.is-in { color: var(--in); }
.receipt__amt { font-size: 2.25rem; font-weight: 640; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.receipt__amt.is-in { color: var(--in); }
.receipt__when { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.receipt__serial { margin-top: var(--s3); font: 500 11.5px/1 var(--mono); letter-spacing: 0.12em; color: var(--ink-b); }
.receipt .kv { border-radius: 16px; box-shadow: 0 0 0 1px var(--line) inset; margin-bottom: var(--s4); }
.receipt .kv__row { padding: 12px var(--s4); }
.timeline { list-style: none; margin: 0 0 var(--s4); padding: 0 0 0 var(--s1); display: grid; gap: var(--s3); }
.timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: var(--s3); align-items: baseline; font-size: 13.5px; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); transform: translateY(1px); }
.timeline li.is-done::before { background: var(--in); }
.timeline li.is-now::before { background: var(--ink-b); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ink-b) 25%, transparent); }
.timeline li.is-bad::before { background: var(--danger); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 4.5px; top: 16px; height: calc(100% - 2px); width: 1px; background: var(--line-strong); }
.timeline time { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.receipt__actions { display: grid; gap: var(--s2); }

/* move sheet */
.move { display: grid; gap: var(--s3); padding-top: var(--s2); }
.move a { display: grid; grid-template-columns: 48px minmax(0,1fr) 20px; gap: var(--s4); align-items: center; padding: var(--s4); border-radius: 16px; background: var(--ground-raise); box-shadow: 0 0 0 1px var(--line) inset; transition: transform var(--t-press) var(--ease-out); }
.move a:active { transform: scale(0.98); }
.move__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); }
.move__icon.is-in { color: var(--in); }
.move__text strong { display: block; font-weight: 600; }
.move__text small { display: block; font-size: 13px; color: var(--ink-3); }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 80; right: var(--s5); bottom: var(--s5); display: grid; gap: var(--s2); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--s3);
  padding: 12px var(--s4); border-radius: 14px;
  background: var(--surface-3); color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong) inset, var(--shadow-lift);
  font-size: 14px;
  animation: toastIn 260ms var(--ease-out) both;
}
.toast .ico { width: 18px; height: 18px; }
.toast--success .ico { color: var(--in); }
.toast--error .ico { color: var(--danger); }
.toast--info .ico { color: var(--ink-3); }
.toast__msg { flex: 1; min-width: 0; }
.toast__action { font-weight: 600; color: var(--ink-b); padding: 4px 6px; }
.toast.is-leaving { animation: toastOut 160ms var(--ease-out) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 959px) {
  .toasts { left: 50%; right: auto; transform: translateX(-50%); top: calc(var(--s3) + var(--safe-t)); bottom: auto; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn:active, .icon-btn:active, .row:active, .chip:active, .tab:active, .option:active, .track-item:active { transform: none; }
  .stepper__seg.is-now .stepper__bar::after { animation: none; width: 100%; opacity: 0.5; }
  .hold.is-holding .hold__fill { transition: clip-path var(--hold, 1500ms) linear; }
}

/* ---------- slip: the draft instrument beside a flow (wide screens) ---------- */
.flow-wrap { display: grid; grid-template-columns: minmax(0, 560px); justify-content: center; gap: var(--s9); max-width: 1120px; }
.slip { display: none; }
@media (min-width: 1100px) {
  .flow-wrap { grid-template-columns: minmax(0, 520px) 400px; align-items: start; }
  .flow-wrap .flow { margin: 0; }
  .slip {
    display: flex; flex-direction: column; gap: var(--s4);
    position: sticky; top: var(--s7);
    margin-top: 72px;
    padding: var(--s6);
    border-radius: var(--r-surface);
    background: linear-gradient(155deg, var(--note-a), var(--note-b));
    box-shadow: 0 0 0 1px var(--line-strong) inset, var(--shadow-lift);
    overflow: hidden; isolation: isolate;
    transform: rotate(-0.6deg);
  }
  .slip::after { content: ""; position: absolute; inset: 7px; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 1px var(--line) inset; }
}
.slip__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.55; }
.slip .microprint { position: absolute; left: 22px; right: 22px; }
.slip .microprint--top { top: 11px; }
.slip .microprint--bottom { bottom: 11px; }
.slip__head { display: flex; align-items: center; gap: var(--s3); }
.slip__head .seal { width: 40px; height: 40px; }
.slip__head strong { display: block; font-size: 15px; font-weight: 620; }
.slip__head > div { min-width: 0; }
.slip__head span { display: block; font: 500 11px/1.3 var(--mono); letter-spacing: 0.03em; color: var(--ink-3); white-space: nowrap; }
.slip__no { margin-left: auto; text-align: right; font: 500 11px/1.3 var(--mono) !important; color: var(--ink-b) !important; letter-spacing: 0.03em; white-space: nowrap; align-self: flex-start; padding-top: 3px; }
.slip__amount { font-size: 2.5rem; font-weight: 640; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: var(--s2); min-height: 1.05em; }
.slip__amount.is-blank { color: var(--ink-3); }
.slip__words { font-size: 13.5px; color: var(--ink-2); font-style: italic; min-height: 2.6em; border-bottom: 1px dashed var(--line-strong); padding-bottom: var(--s3); }
.slip__lines { display: grid; gap: var(--s3); margin: 0; }
.slip__lines div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--s3); align-items: end; }
.slip__lines dt { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 3px; }
.slip__lines dd { margin: 0; min-height: 24px; padding-bottom: 3px; border-bottom: 1px dashed var(--line-strong); font-size: 14px; overflow-wrap: anywhere; transition: color var(--t-fast) ease; }
.slip__lines dd.is-blank { color: var(--ink-3); }
.slip__lines dd.mono { font-size: 13px; }
.slip__sign { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); margin-top: var(--s3); padding-bottom: var(--s3); }
.slip__sign span { flex: 1; border-top: 1px solid var(--line-strong); padding-top: 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.slip__stamp {
  position: absolute; right: 26px; top: 44%;
  padding: 6px 14px; border-radius: 10px;
  border: 2.5px solid currentColor; color: var(--in);
  font: 700 22px/1 var(--mono); letter-spacing: 0.18em;
  transform: rotate(-12deg); opacity: 0; pointer-events: none;
  mix-blend-mode: normal;
}
.slip__stamp.is-on { animation: stamp 320ms var(--ease-out) forwards; }
.slip__stamp.is-bad { color: var(--danger); }
.slip__stamp.is-wait { color: var(--ink-b); }
@keyframes stamp { from { opacity: 0; transform: rotate(-12deg) scale(1.25); } to { opacity: 0.92; transform: rotate(-12deg) scale(1); } }

/* ---------- ink picker ---------- */
.inks { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.ink {
  width: 36px; height: 36px; border-radius: 50%; position: relative;
  background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-fast) ease;
}
.ink:active { transform: scale(0.92); }
.ink[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.setting--stack { flex-wrap: wrap; }
@media (max-width: 599px) { .setting--stack .inks { justify-content: flex-start; width: 100%; } }

/* ---------- notifications ---------- */
.bell { position: relative; }
.bell--lg { width: 44px; height: 44px; box-shadow: 0 0 0 1px var(--line) inset; background: var(--surface); }
.badge {
  position: absolute; top: 4px; right: 3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--ink-b); color: var(--ground);
  font: 700 10.5px/1 var(--font); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--ground);
  animation: badgeIn 260ms var(--ease-out);
}
.badge--inline { position: static; margin-left: auto; box-shadow: none; }
@keyframes badgeIn { from { transform: scale(0.6); opacity: 0; } }
.notifs { display: grid; gap: var(--s5); padding-top: var(--s1); }
.notifs h3 { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin: 0 0 var(--s2); }
.notifs__list { display: grid; gap: 2px; }
.notif {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s3); align-items: start;
  width: 100%; padding: var(--s3) var(--s2); margin: 0 calc(var(--s2) * -1); width: calc(100% + var(--s2) * 2);
  border-radius: 14px; text-align: left;
  transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out);
}
.notif:not(:disabled):active { transform: scale(0.99); }
.notif:disabled { cursor: default; opacity: 1; }
@media (hover: hover) and (pointer: fine) { .notif:not(:disabled):hover { background: var(--surface-2); } }
.notif.is-unread { background: color-mix(in oklab, var(--ink-a) 7%, transparent); }
.notif__tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--ink-2); }
.notif__tile--ok { color: var(--in); }
.notif__tile--wait { color: var(--ink-b); }
.notif__tile--warn { color: var(--warn); }
.notif__tile--bad { color: var(--danger); }
.notif__main { display: grid; gap: 2px; min-width: 0; }
.notif__main strong { font-size: 14.5px; font-weight: 600; }
.notif__main span { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.notif__end { display: grid; justify-items: end; gap: 8px; }
.notif__end time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.notif__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-b); }
