/* ==========================================================
   Vault Logistics — security-print world (shared design language with Vault Pro)
   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); }

/* ---------- tags ---------- */
.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); }


/* ---------- 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); }

.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); }
.cred { user-select: all; -webkit-user-select: all; }
.review--cred .kv__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.review--cred .kv__row dd { text-align: left; font-size: 15px; }

.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; } }

/* ---------- 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; }
}

/* 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); }

/* ==========================================================
   Logistics components
   ========================================================== */

/* ---------- plate: security-printed document surface ---------- */
.plate {
  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) 9%, transparent), transparent 70%),
    radial-gradient(60% 80% at 0% 100%, color-mix(in oklab, var(--ink-b) 7%, transparent), transparent 70%),
    linear-gradient(155deg, var(--note-a), var(--note-b));
  box-shadow: 0 0 0 1px var(--line-strong) inset, var(--shadow);
}
.plate::after { content: ""; position: absolute; inset: 7px; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 1px var(--line) inset; }
.plate__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.plate .microprint { position: absolute; left: 22px; right: 22px; }
.plate .microprint--top { top: 11px; }
.plate .microprint--bottom { bottom: 11px; }

/* ---------- waybill card ---------- */
.waybills { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.waybill {
  display: grid; gap: var(--s4); text-align: left; width: 100%;
  padding: var(--s6) var(--s6) var(--s5);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-fast) ease;
  color: inherit;
}
a.waybill:active, button.waybill:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { a.waybill:hover, button.waybill:hover { box-shadow: 0 0 0 1px color-mix(in oklab, var(--ink-a) 45%, transparent) inset, var(--shadow-lift); } }
.waybill__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-top: 4px; }
.track-id { font: 600 13px/1.2 var(--mono); letter-spacing: 0.1em; color: var(--ink-b); }
.track-id small { display: block; font: 500 10px/1.2 var(--mono); letter-spacing: 0.16em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 4px; }
.waybill__item { font-size: 1.25rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
.waybill__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.waybill__meta .ico { width: 16px; height: 16px; color: var(--ink-3); }
.waybill__meta span { display: inline-flex; align-items: center; gap: 6px; }
.waybill--lg { padding: var(--s7) var(--s7) var(--s6); }
.waybill--lg .waybill__item { font-size: 1.75rem; }
@media (max-width: 599px) { .waybill, .waybill--lg { padding: var(--s6) var(--s5) var(--s5); } .waybill--lg .waybill__item { font-size: 1.4rem; } }

/* route line: origin, great-circle arc, destination */
.route { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; gap: var(--s2); }
.route__end { min-width: 0; }
.route__end:last-child { text-align: right; }
.route__end small { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.route__end strong { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route__end span { display: block; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route__arc { width: 96px; height: 40px; overflow: visible; }
.route__arc path { fill: none; stroke: var(--ink-a); stroke-width: 1.6; stroke-dasharray: 3 4; }
.route__arc .travelled { stroke-dasharray: none; stroke-width: 2; }
.route__arc circle { fill: var(--surface); stroke-width: 1.8; }
.route__arc .a { stroke: var(--ink-b); }
.route__arc .b { stroke: var(--ink-a); }
.route__arc .now { fill: var(--ink-a); stroke: none; }

/* segmented checkpoint progress */
.segs { display: flex; gap: 4px; min-width: 120px; flex: 1; }
.segs i { flex: 1; height: 5px; border-radius: 5px; background: var(--line-strong); }
.segs i.on { background: linear-gradient(90deg, var(--ink-b), var(--ink-a)); }
.segs i.sealed { background: repeating-linear-gradient(135deg, var(--line-strong) 0 3px, transparent 3px 6px); box-shadow: 0 0 0 1px var(--line-strong) inset; }

/* ---------- stamps ---------- */
.stamp {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 5px 10px; border-radius: 8px;
  border: 1.5px solid currentColor;
  font: 700 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  transform: rotate(-4deg);
  color: var(--ink-b);
  background: color-mix(in oklab, currentColor 8%, transparent);
}
.stamp--delivered { color: var(--in); }
.stamp--on_hold { color: var(--warn); }
.stamp--cancelled { color: var(--danger); }
.stamp--flat { transform: none; }
.stamp--xl { font-size: 22px; padding: 8px 16px; border-width: 2.5px; border-radius: 12px; }

/* ---------- page layout helpers ---------- */
.stack { display: grid; gap: var(--s5); }
.split { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.split--wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); }
@media (max-width: 1099px) { .split, .split--wide-left { grid-template-columns: minmax(0, 1fr); } }
.sticky-col { position: sticky; top: var(--s6); }
@media (max-width: 1099px) { .sticky-col { position: static; } }
.page-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; font-weight: 520; margin-bottom: var(--s3); }
.back-link:hover { color: var(--ink); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.section-title h2 { font-size: 15px; }
.muted-small { font-size: 13px; color: var(--ink-3); }

/* ---------- KPI strip (admin) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--r-surface); background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset, var(--shadow); overflow: hidden; }
.kpi { padding: var(--s5); display: grid; gap: 4px; min-width: 0; text-align: left; transition: background-color var(--t-fast) ease; }
.kpi + .kpi { border-left: 1px solid var(--line); }
a.kpi:hover { background: var(--surface-2); }
.kpi span { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi span .ico { width: 16px; height: 16px; }
.kpi strong { font-size: 1.75rem; font-weight: 640; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi small { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 799px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi strong { font-size: 1.4rem; }
}

/* ---------- data table ---------- */
.dtable-wrap { border-radius: var(--r-surface); background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset, var(--shadow); overflow: hidden; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.dtable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 12px var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.dtable td { padding: 14px var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr { transition: background-color var(--t-fast) ease; }
.dtable tbody tr[data-href] { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .dtable tbody tr[data-href]:hover { background: var(--surface-2); } }
.dtable .cell-main strong { display: block; font-weight: 580; }
.dtable .cell-main span { display: block; font-size: 12.5px; color: var(--ink-3); }
.dtable .num { text-align: right; }
.dtable .mono { font-size: 12.5px; letter-spacing: 0.06em; color: var(--ink-b); }
@media (max-width: 799px) {
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--s3); }
  .dtable tbody tr:last-child { border-bottom: 0; }
  .dtable td { padding: 0; border: 0; }
  .dtable td[data-hide-mobile] { display: none; }
  .dtable td.cell-span { grid-column: 1 / -1; }
  .dtable .num { text-align: right; }
}

/* ---------- inline progress (table) ---------- */
.mini-progress { display: flex; align-items: center; gap: var(--s2); font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.mini-progress .segs { min-width: 64px; max-width: 120px; }

/* ---------- map ---------- */
.mapbox {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-surface);
  box-shadow: 0 0 0 1px var(--line-strong) inset, var(--shadow);
  height: clamp(280px, 52vh, 520px);
  background: var(--ground-raise);
}
.mapbox--short { height: clamp(240px, 38vh, 380px); }
.lmap { position: absolute; inset: 0; background: var(--ground-raise); font: inherit; }
.lmap .leaflet-tile-pane { filter: var(--map-filter, none); }
:root[data-theme="dark"] .lmap { --map-filter: invert(1) hue-rotate(180deg) grayscale(0.5) brightness(0.78) contrast(1.05); }
:root[data-theme="light"] .lmap { --map-filter: sepia(0.35) saturate(0.6) brightness(1.03) contrast(0.95); }
.mapbox::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 401;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, color-mix(in oklab, var(--ground) 55%, transparent) 100%);
  mix-blend-mode: normal;
}
.mapbox::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 400;
  background: linear-gradient(135deg, var(--ink-b), var(--ink-a));
  mix-blend-mode: color; opacity: 0.16;
}
.map-route { stroke: var(--ink-a); stroke-width: 3; fill: none; stroke-linecap: round; }
.map-route-glow { stroke: color-mix(in oklab, var(--ink-a) 40%, transparent); stroke-width: 9; fill: none; stroke-linecap: round; filter: blur(3px); }
.map-planned { stroke: var(--ink-b); stroke-width: 2; stroke-dasharray: 5 7; fill: none; opacity: 0.85; }
.pin {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink-a); color: var(--ground);
  font: 700 12px/1 var(--mono);
  box-shadow: 0 0 0 3px var(--surface), 0 6px 14px rgba(0,0,0,.35);
  transition: transform var(--t-press) var(--ease-out);
}
.pin--locked { background: var(--surface); color: var(--ink-2); box-shadow: 0 0 0 2px var(--ink-3) inset, 0 0 0 3px var(--surface); border: 0; }
.pin--od { background: var(--surface); color: var(--ink-b); box-shadow: 0 0 0 2px var(--ink-b) inset, 0 0 0 3px var(--surface), 0 6px 14px rgba(0,0,0,.3); }
.pin--od.is-b { color: var(--ink-a); box-shadow: 0 0 0 2px var(--ink-a) inset, 0 0 0 3px var(--surface), 0 6px 14px rgba(0,0,0,.3); }
.pin--drag { cursor: grab; }
.pin--pulse::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--ink-a); animation: pinPulse 1.8s var(--ease-out) infinite; }
@keyframes pinPulse { from { transform: scale(0.8); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.leaflet-div-icon { background: none; border: 0; }
.map-ctrl { position: absolute; z-index: 500; top: var(--s3); right: var(--s3); display: grid; gap: 6px; }
.map-ctrl button {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in oklab, var(--surface) 82%, transparent); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px var(--line-strong) inset, var(--shadow);
  transition: transform var(--t-press) var(--ease-out);
}
.map-ctrl button:active { transform: scale(0.94); }
.map-ctrl .ico { width: 18px; height: 18px; }
.map-legend { position: absolute; z-index: 500; left: var(--s3); bottom: var(--s3); display: flex; gap: var(--s3); flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; font-size: 12px; color: var(--ink-2); background: color-mix(in oklab, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 0 0 1px var(--line) inset; }
.map-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--ink-a); vertical-align: middle; margin-right: 6px; }
.map-legend i.planned { border-top: 2px dashed var(--ink-b); }
.map-empty { position: absolute; inset: 0; z-index: 450; display: grid; place-items: center; text-align: center; padding: var(--s5); color: var(--ink-2); font-size: 14px; pointer-events: none; }
.mapbox.is-full { position: fixed; inset: 0; z-index: 70; height: auto; border-radius: 0; }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in oklab, var(--surface) 70%, transparent) !important; color: var(--ink-3) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-control-scale-line { background: color-mix(in oklab, var(--surface) 70%, transparent); color: var(--ink-2); border-color: var(--ink-3); font-size: 10px; }
.leaflet-bar { display: none; }

/* ---------- manifest (checkpoint timeline) ---------- */
.manifest { list-style: none; margin: 0; padding: 0; display: grid; }
.mf { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s4); padding-bottom: var(--s5); }
.mf:last-child { padding-bottom: 0; }
.mf::before { content: ""; position: absolute; left: 17.5px; top: 36px; bottom: 0; width: 1px; background: var(--line-strong); }
.mf:last-child::before { display: none; }
.mf.is-done::before { background: linear-gradient(var(--ink-a), color-mix(in oklab, var(--ink-a) 30%, transparent)); }
.mf__dot {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; z-index: 1;
  font: 700 12px/1 var(--mono); background: var(--surface-2); color: var(--ink-3);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
}
.mf.is-done .mf__dot { background: var(--ink-a); color: var(--ground); box-shadow: none; }
.mf.is-current .mf__dot { box-shadow: 0 0 0 4px color-mix(in oklab, var(--ink-a) 25%, transparent); }
.mf.is-sealed .mf__dot { background: var(--surface); color: var(--ink-b); box-shadow: 0 0 0 1.5px var(--ink-b) inset; }
.mf__dot .ico { width: 16px; height: 16px; }
.mf__body { min-width: 0; padding-top: 6px; display: grid; gap: 4px; }
.mf__name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.mf__meta { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mf__details { font-size: 14px; color: var(--ink-2); line-height: 1.55; max-width: 62ch; }
.classified { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); padding: 4px 10px; border-radius: var(--r-pill); box-shadow: 0 0 0 1px var(--line-strong) inset; width: fit-content; }
.classified .ico { width: 14px; height: 14px; }

/* sealed envelope + code entry */
.seal-card {
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: var(--s2); padding: var(--s5);
  border-radius: 18px;
  background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--ink-b) 5%, transparent) 0 10px, transparent 10px 20px), var(--surface);
  box-shadow: 0 0 0 1.5px color-mix(in oklab, var(--ink-b) 55%, transparent) inset;
  display: grid; gap: var(--s4);
}
.seal-card h3 { font-size: 15px; display: flex; align-items: center; gap: var(--s2); }
.seal-card h3 .ico { color: var(--ink-b); }
.seal-card p { font-size: 13.5px; color: var(--ink-2); }
.codes { display: flex; gap: 8px; }
.codes input {
  width: 46px; height: 54px; border-radius: 12px; text-align: center;
  font: 650 22px/1 var(--mono); text-transform: uppercase; letter-spacing: 0;
  background: var(--ground-raise); color: var(--ink);
  border: 1px solid var(--line-strong);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform var(--t-press) var(--ease-out);
  caret-color: var(--ink-b);
}
.codes input:focus { outline: none; border-color: var(--ink-b); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink-b) 22%, transparent); }
.codes.is-error input { border-color: var(--danger); animation: shake 380ms var(--ease-out); }
.codes.is-ok input { border-color: var(--in); color: var(--in); }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@media (max-width: 399px) { .codes { gap: 6px; } .codes input { width: 40px; height: 50px; font-size: 20px; } }
.seal-card .stamp--xl { position: absolute; right: 18px; top: 16px; opacity: 0; }
.seal-card.is-unsealed .stamp--xl { animation: stampIn 360ms var(--ease-out) forwards; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-12deg) scale(1.3); } to { opacity: 0.95; transform: rotate(-12deg) scale(1); } }
.pending-card { padding: var(--s4); border-radius: 16px; box-shadow: 0 0 0 1px var(--line-strong) inset; border: 1px dashed transparent; font-size: 13.5px; color: var(--ink-3); display: flex; gap: var(--s3); align-items: center; }

/* ---------- admin checkpoint manager ---------- */
.cp-list { display: grid; gap: var(--s2); }
.cp {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4); border-radius: 16px; background: var(--ground-raise); box-shadow: 0 0 0 1px var(--line) inset;
}
.cp.is-done .mf__dot { background: var(--ink-a); color: var(--ground); box-shadow: none; }
.cp__main { min-width: 0; display: grid; gap: 2px; }
.cp__main strong { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp__main span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp__end { display: flex; align-items: center; gap: 4px; }
.code-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 9px;
  font: 650 13px/1 var(--mono); letter-spacing: 0.12em; color: var(--ink-b);
  background: color-mix(in oklab, var(--ink-b) 10%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--ink-b) 35%, transparent) inset;
}
.code-chip .ico { width: 14px; height: 14px; }
.code-chip.is-used { color: var(--ink-3); background: none; box-shadow: 0 0 0 1px var(--line) inset; text-decoration: line-through; text-decoration-color: var(--line-strong); }
.cp .icon-btn { width: 34px; height: 34px; }
.cp .icon-btn .ico { width: 18px; height: 18px; }
@media (max-width: 599px) {
  .cp { grid-template-columns: 36px minmax(0, 1fr); }
  .cp__end { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
}

/* code reveal card (after creating) */
.codecard { display: grid; justify-items: center; gap: var(--s3); text-align: center; padding: var(--s5) 0 var(--s2); }
.codecard__code { display: flex; gap: 6px; }
.codecard__code span {
  width: 44px; height: 56px; border-radius: 12px; display: grid; place-items: center;
  font: 700 26px/1 var(--mono); color: var(--ink-b);
  background: var(--ground-raise); box-shadow: 0 0 0 1.5px color-mix(in oklab, var(--ink-b) 50%, transparent) inset;
}
.codecard p { color: var(--ink-2); font-size: 14px; max-width: 34ch; }

/* ---------- combobox ---------- */
.combo { position: relative; }
.combo .input { padding-right: 40px; }
.combo__caret { position: absolute; right: 12px; top: 14px; color: var(--ink-3); pointer-events: none; }
.combo__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border-radius: 14px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong) inset, var(--shadow-lift);
  transform-origin: top center;
  animation: comboIn 160ms var(--ease-out);
}
@keyframes comboIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.combo__opt { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%; padding: 9px 10px; border-radius: 9px; text-align: left; font-size: 14px; }
.combo__opt small { color: var(--ink-3); font-size: 12px; }
.combo__opt[aria-selected="true"], .combo__opt:hover { background: var(--surface-2); }
.combo__empty { padding: 10px; font-size: 13px; color: var(--ink-3); }

/* ---------- forms ---------- */
.form-card { display: grid; gap: var(--s5); }
.form-section { display: grid; gap: var(--s4); }
.form-section h2 { font-size: 13px; color: var(--ink-3); font-weight: 600; text-transform: none; }
.grid-2 { display: grid; gap: var(--s4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 599px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
textarea.input { min-height: 96px; padding: 12px var(--s4); resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; background-image: none; }
.optional { font-weight: 450; color: var(--ink-3); }

/* ---------- charts ---------- */
.chart-bars { display: grid; gap: var(--s2); }
.chart-bars svg { width: 100%; height: 220px; display: block; overflow: visible; }
.bar-a { fill: var(--ink-a); }
.bar-b { fill: var(--ink-b); }
.axis text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.axis line { stroke: var(--line); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; }
.donut svg { width: 150px; height: 150px; flex: none; }
.donut__list { display: grid; gap: var(--s2); font-size: 13.5px; min-width: 160px; flex: 1; }
.donut__list div { display: flex; justify-content: space-between; gap: var(--s3); }
.donut__list span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.donut__list i { width: 10px; height: 10px; border-radius: 3px; }
.hbars { display: grid; gap: var(--s3); }
.hbar { display: grid; gap: 6px; }
.hbar div { display: flex; justify-content: space-between; font-size: 13.5px; }
.hbar div span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hbar i { display: block; height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--ink-b), var(--ink-a)); }

/* ---------- activity ---------- */
.act-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 12px 0; }
.act-row + .act-row { border-top: 1px solid var(--line); }
.act-row .notif__tile { width: 36px; height: 36px; }
.act-row strong { font-size: 14px; font-weight: 580; display: block; }
.act-row span { font-size: 12.5px; color: var(--ink-3); }
.act-row time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ---------- print: waybill only ---------- */
.print-only { display: none; }
@media print {
  body { background: #fff !important; color: #000 !important; }
  .rail, .topbar, .tabbar, .toasts, #sheet-root, .no-print, .map-ctrl { display: none !important; }
  .shell { display: block !important; padding: 0 !important; }
  .view { padding: 0 !important; }
  .print-only { display: block !important; }
  .plate, .card, .dtable-wrap, .mapbox { box-shadow: 0 0 0 1px #999 inset !important; break-inside: avoid; }
  .plate__canvas { opacity: 0.35; }
  .mapbox { height: 360px !important; }
  a[href]::after { content: none !important; }
}

.flow-wrap--wide { grid-template-columns: minmax(0, 680px); }
@media (min-width: 1100px) { .flow-wrap--wide { grid-template-columns: minmax(0, 640px) 380px; } }
.flow-wrap .flow { max-width: none !important; }

/* polish after first review */
.stamp { white-space: nowrap; }
.dtable .cell-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.waybill--lg .route { max-width: 620px; }
.codes { display: grid; grid-template-columns: repeat(6, minmax(0, 52px)); gap: 8px; }
.codes input { width: 100%; min-width: 0; }
@media (max-width: 599px) {
  .codes { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .codes input { height: 48px; font-size: 20px; }
  .mf.is-sealed { grid-template-columns: 36px minmax(0, 1fr); }
  .mf.is-sealed .seal-card { margin-left: -52px; padding: var(--s4); }
}

/* segmented control (theme, account type) */
.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: 32px; min-width: 40px; padding: 0 12px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 560; color: var(--ink-3);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.seg button[aria-checked="true"] { background: var(--surface-3); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong) inset; }

/* table avatars keep their own layout */
.dtable .cell-main .avatar { display: grid; max-width: none; overflow: hidden; white-space: normal; }

/* phones: headers and action bars wrap instead of overflowing */
.page__head { flex-wrap: wrap; }
@media (max-width: 599px) {
  .page__head .page-actions, .page__head > .btn { width: 100%; }
  .page__head .page-actions .btn { flex: 1; }
  [data-actions].page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  [data-actions].page-actions .btn { width: 100%; margin-left: 0 !important; padding: 0 var(--s3); font-size: 14px; }
  [data-actions].page-actions .btn--primary { grid-column: 1 / -1; }
  .toolbar label.muted-small { margin-left: 0 !important; }
}

/* grid columns never grow past the screen (min-content overflow guard) */
.stack, .flow__body, .form-card, .form-section, .profile, .notifs { grid-template-columns: minmax(0, 1fr); }
.page__head > div:first-child { min-width: 0; }
.toolbar { grid-template-columns: minmax(0, 1fr); }
