/* cgms-labs · Buffalo — tokens, layout, components and motion. */

@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/onest-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/onest-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/onest-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/onest-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/onest-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/onest-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/onest-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/onest-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/unbounded-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/unbounded-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/unbounded-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/unbounded-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------------------------------------------------------------- tokens */
:root, :root[data-theme="day"] {
  color-scheme: light;
  --bg: #EFE5D0;            /* sun-dried wheat */
  --surface: #FFFBF3;       /* card paper */
  --surface-2: #F6EDDA;     /* inset panel */
  --surface-3: #EADDC3;
  --ink: #2B2118;           /* dark umber */
  --ink-2: #5E4D3C;
  --line: #D9C9AA;
  --line-strong: #8C765B;
  --hard: #CDB993;          /* stamped card shadow */
  --primary: #2B2118;
  --primary-ink: #FFF6E6;
  --primary-hover: #4A3524;
  --accent: #A3431B;        /* rust */
  --accent-soft: #F3DCCB;
  --ok: #3D6A2A; --ok-bg: #E1EAD0;
  --warn: #8A5300; --warn-bg: #F6E3BF;
  --bad: #A42A1E; --bad-bg: #F6D9D3;
  --info: #2D5B78; --info-bg: #DCE8EE;
  --idle: #6B5B4A; --idle-bg: #ECE3D2;
  --focus: #1F5F7A;
  --hill-1: #C9B17E; --hill-2: #D8C69B; --hill-3: #E3D6B5;
  --herd: #3A2A1C; --bison: #2B2118;
  --water: #8FB3BD; --water-2: #B9D0D4;
  --stone: #CDBB98; --stone-on: #A3431B;
  --scrim: rgba(43, 33, 24, .42);
  --shadow: 0 1px 0 rgba(43,33,24,.04), 0 12px 32px -18px rgba(43,33,24,.35);
}
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #19130F;            /* prairie at night */
  --surface: #241C16;
  --surface-2: #2D231B;
  --surface-3: #3A2D22;
  --ink: #F3E8D6;
  --ink-2: #CDBDA6;
  --line: #4A3B2E;
  --line-strong: #8E7A62;
  --hard: #0E0A07;
  --primary: #F3E8D6;
  --primary-ink: #1B140F;
  --primary-hover: #FFD9B8;
  --accent: #EE9358;        /* ember */
  --accent-soft: #4A2B1A;
  --ok: #A6CC85; --ok-bg: #26331D;
  --warn: #EDB867; --warn-bg: #3B2A12;
  --bad: #F29A8E; --bad-bg: #44201B;
  --info: #9CC8E4; --info-bg: #1D3240;
  --idle: #C2B29B; --idle-bg: #33291F;
  --focus: #8FD0E8;
  --hill-1: #2C2219; --hill-2: #33281D; --hill-3: #3B2F22;
  --herd: #0D0907; --bison: #E9DAC2;
  --water: #2F4E5A; --water-2: #3D6371;
  --stone: #4E3F30; --stone-on: #EE9358;
  --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 14px 32px -16px rgba(0,0,0,.7);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
p { margin: 0 0 10px; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--primary); color: var(--primary-ink); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.mono, .mono-input { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .92em; letter-spacing: -.01em; }
.mono-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.h-display { font-family: 'Unbounded', 'Onest', sans-serif; font-weight: 700; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.h-page { font-family: 'Unbounded', 'Onest', sans-serif; font-weight: 500; font-size: 26px; line-height: 1.2; letter-spacing: -.01em; }
.h-sub { font-size: 17px; font-weight: 600; line-height: 1.35; margin: 22px 0 10px; display: flex; gap: 8px; align-items: center; }
.h-sub:first-child { margin-top: 0; }
.h-mini { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 14px 0 8px; }
.eyebrow { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.hint { font-size: 14px; line-height: 1.45; color: var(--ink-2); margin: 6px 0 0; }
.prose p { margin: 0 0 12px; line-height: 1.6; }

/* ---------------------------------------------------------------- shell */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 40px; height: 25px; fill: var(--ink); }
.brand-mark .bison-horn, .brand-mark .bison-tail { stroke: var(--ink); stroke-width: 2; }
.brand-mark .bison-eye { fill: var(--bg); }
.brand-word { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.mainnav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.navlink { text-decoration: none; padding: 9px 14px; border-radius: 999px; font-weight: 500; color: var(--ink-2); transition: background .15s, color .15s; white-space: nowrap; }
.navlink:hover { background: var(--surface-3); color: var(--ink); }
.navlink.is-active { background: var(--ink); color: var(--bg); }
.service-tag { flex: 1; font-size: 13px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.prefs-inline { display: flex; gap: 8px; }
.mini-field { display: flex; flex-direction: column; font-size: 11px; color: var(--ink-2); gap: 2px; }
.mini-field select { font-size: 13px; min-height: 34px; padding: 4px 26px 4px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background-color: var(--surface); }
.demo-tag { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); border: 1px dashed var(--warn); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink); transition: background .15s, transform .12s; flex: none; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.copy { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.copy .ico { width: 16px; height: 16px; }
.menu-btn { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.chip-chain { color: var(--ink-2); font-size: 13px; }
.chip-warn { border-color: var(--warn); }
.chip-warn .chip-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.chip-role { cursor: default; }
.role-strip { max-width: 1280px; margin: 0 auto; padding: 6px 24px 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.role-badge { font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: 999px; }
.role-note { color: var(--ink-2); }
.link { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.drawer { border-top: 1px solid var(--line); padding: 12px 20px 18px; display: grid; gap: 6px; animation: drop .22s ease-out; }
.drawer nav { display: grid; gap: 4px; }
.drawer-link { display: block; text-decoration: none; padding: 12px 14px; border-radius: 12px; font-weight: 500; }
.drawer-link.is-active { background: var(--ink); color: var(--bg); }
.drawer-prefs { display: flex; gap: 12px; padding: 8px 0; }
.drawer-prefs .mini-field { flex: 1; }
.drawer-prefs select { width: 100%; min-height: 44px; }
.banners { max-width: 1280px; margin: 12px auto 0; padding: 0 24px; display: grid; gap: 8px; width: 100%; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; font-size: 14px; animation: rise .26s ease-out; }
.banner .btn { margin-left: auto; }
.banner-alert { background: var(--bad-bg); color: var(--bad); }
.banner-action { background: var(--warn-bg); color: var(--warn); }
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px 40px; outline: none; }
.view { animation: view-in .28s ease-out; }

/* ---------------------------------------------------------------- footer & landscape */
.foot { margin-top: auto; position: relative; }
.landscape { height: 150px; overflow: hidden; position: relative; }
.landscape svg { width: 100%; height: 100%; display: block; }
.hill-1 { fill: var(--hill-1); } .hill-2 { fill: var(--hill-2); } .hill-3 { fill: var(--hill-3); }
.landscape .fence path, .landscape .grass path { stroke: var(--line-strong); stroke-width: 2; fill: none; stroke-linecap: round; }
.landscape .tree path { stroke: var(--herd); stroke-width: 4; }
.landscape .tree circle { fill: var(--hill-1); stroke: var(--herd); stroke-width: 0; filter: brightness(.82); }
.landscape .herd { fill: var(--herd); transform: translateX(calc(var(--herd-n, 0) * 26px)); transition: transform 2.4s cubic-bezier(.4, .1, .2, 1); }
.landscape .herd .far { opacity: .55; }
.landscape .herd .bison-horn, .landscape .herd .bison-tail { stroke: var(--herd); stroke-width: 2; }
.landscape .herd .bison-eye { fill: var(--hill-1); }
.foot-line { background: var(--hill-1); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 6px 24px 18px; font-size: 13px; color: var(--ink); }
:root[data-theme="night"] .foot-line { color: var(--ink-2); }

/* ---------------------------------------------------------------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 14px; border: 1.5px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .12s, transform .12s, border-color .15s; white-space: nowrap; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 11px; }
.btn-xl { width: 100%; min-height: 58px; font-size: 17px; border-radius: 18px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 3px 0 var(--accent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--accent); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface-2); }
.btn-ghost:active:not(:disabled) { transform: translateY(1px); }
.btn-ghost[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.btn-danger { background: var(--bad); color: var(--surface); }
.btn-danger:hover { filter: brightness(1.08); }
.btn:disabled { cursor: not-allowed; opacity: 1; background: var(--surface-3); color: var(--ink-2); box-shadow: none; border-color: var(--line); }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; cursor: pointer; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
.link-btn .ico { width: 16px; height: 16px; }
.btn-row, .btn-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.btn-col { display: grid; gap: 8px; margin: 12px 0; }
.btn-cell { white-space: nowrap; }
.btn-cell .btn + .btn { margin-left: 6px; }

input, select, textarea { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; min-height: 44px; padding: 9px 12px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; margin: 2px 0 0; }
input[type="range"] { padding: 0; border: 0; accent-color: var(--accent); background: transparent; }
[aria-invalid="true"] { border-color: var(--bad) !important; }
.field { display: grid; gap: 6px; margin: 14px 0; }
.field > label, .field-top label { font-weight: 500; font-size: 14px; }
.field-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--bad); font-size: 14px; margin: 6px 0 0; animation: shake .32s ease-out; }
.field-error .ico { width: 17px; height: 17px; margin-top: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.switch { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 10px 0; cursor: pointer; }
.switch input { width: 22px; height: 22px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .field { margin: 6px 0; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1 1 200px; }

/* ---------------------------------------------------------------- send */
.send-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px) minmax(0, 1fr); gap: 28px; align-items: start; }
.send-layout .trade { grid-column: 2; }
.send-layout .send-aside { grid-column: 3; max-width: 320px; position: sticky; top: 96px; }
.trade-card { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 26px; padding: 22px 22px 24px; box-shadow: 0 5px 0 var(--hard), var(--shadow); animation: card-in .34s cubic-bezier(.2, .8, .2, 1); }
.trade-card[data-dir="back"] { animation-name: card-back; }
.trade-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.purpose { color: var(--ink-2); font-size: 14px; margin: 6px 0 18px; }
.leg { background: var(--surface-2); border-radius: 18px; padding: 14px 16px 14px; border: 1.5px solid transparent; transition: border-color .18s, background .18s; }
.leg:focus-within { border-color: var(--line-strong); background: var(--surface); }
.leg.has-error { border-color: var(--bad); }
.leg-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); font-weight: 500; flex-wrap: wrap; }
.leg-bal { display: inline-flex; gap: 6px; align-items: center; }
.leg-main { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.amount-input { border: 0; background: transparent; font-size: 36px; font-weight: 600; padding: 0; min-height: 52px; letter-spacing: -.02em; flex: 1; min-width: 0; border-radius: 8px; }
.amount-input:focus-visible { box-shadow: none; outline: 3px solid var(--focus); outline-offset: 2px; }
.amount-out { font-size: 36px; font-weight: 600; letter-spacing: -.02em; flex: 1; min-width: 0; display: block; min-height: 52px; line-height: 52px; animation: tick .3s ease-out; }
.asset-select { width: auto; min-width: 112px; max-width: 48%; border-radius: 999px; font-weight: 600; background-color: var(--surface); flex: none; }
.leg-chain { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.leg-chain select { min-height: 38px; font-size: 14px; flex: 1; }
.flip-wrap { display: flex; justify-content: center; height: 10px; position: relative; z-index: 2; }
.flip { width: 46px; height: 46px; border-radius: 15px; border: 4px solid var(--surface); background: var(--surface-3); display: grid; place-items: center; cursor: pointer; margin-top: -18px; transform: rotate(calc(var(--flip) * 180deg)); transition: transform .45s cubic-bezier(.5, -0.4, .3, 1.5), background .15s; color: var(--ink); }
.flip:hover { background: var(--accent-soft); }
.leg-to { margin-top: 0; }
.trade-card .field { margin-top: 16px; }
.mono-input { font-size: 14px; }
.choice-group { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.choice-group legend { font-weight: 600; font-size: 16px; padding: 0; }
.choice-group > .hint { margin-bottom: 8px; }
.choice { display: flex; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; margin-top: 8px; cursor: pointer; transition: border-color .15s, background .15s, transform .12s; background: var(--surface); }
.choice:hover { border-color: var(--line-strong); }
.choice.is-on { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 4px 0 0 var(--accent); }
.choice.is-disabled { cursor: not-allowed; background: var(--surface-2); }
.choice.is-disabled .choice-title { color: var(--ink-2); }
.choice-body { display: grid; gap: 3px; min-width: 0; }
.choice-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.choice-desc { font-size: 14px; color: var(--ink-2); display: grid; gap: 2px; }
.choice-consequence { font-size: 14px; background: var(--warn-bg); color: var(--ink); border-radius: 10px; padding: 8px 10px; margin-top: 6px; animation: rise .22s ease-out; }
.choice-reason { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--bad); }
.choice-reason .ico, .reason .ico { width: 16px; height: 16px; margin-top: 2px; }
.sub-card { background: var(--surface-2); border-radius: 16px; padding: 14px 16px; margin-top: 16px; animation: rise .26s ease-out; }
.h-sub + .hint { margin-top: -4px; }
.cta { margin-top: 22px; }
.todo { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.todo li { padding-left: 18px; position: relative; animation: rise .2s ease-out; }
.todo li::before { content: ''; position: absolute; left: 3px; top: 8px; width: 7px; height: 7px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.send-aside .aside-card { background: transparent; border-left: 2px solid var(--line-strong); padding: 4px 0 4px 18px; animation: rise .3s ease-out; }
.route-line { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; counter-reset: leg; }
.route-line li { display: grid; gap: 2px; font-size: 14px; padding-left: 26px; position: relative; counter-increment: leg; }
.route-line li::before { content: counter(leg); position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.route-line li.is-core::before { background: var(--accent); color: var(--surface); }
.route-line span { color: var(--ink-2); }
.aside-p { font-size: 14px; line-height: 1.5; }
.aside-mode { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }

/* quote */
.quote { margin-top: 22px; border-top: 1.5px dashed var(--line-strong); padding-top: 18px; animation: rise .3s ease-out; }
.quote.is-invalid .rows { opacity: .55; }
.quote-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.quote-head .h-sub { margin: 0; }
.rows { margin: 10px 0; display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4px 16px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.row:last-child { border-bottom: 0; }
.row dt { color: var(--ink-2); font-size: 14px; }
.row dd { margin: 0; text-align: right; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 4px 6px; }
.row dd .sub, .sub { display: block; width: 100%; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.money .row { animation: rise .32s ease-out backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.row-key { background: var(--surface-2); margin: 4px -10px; padding: 12px 10px; border-radius: 12px; border-bottom: 0; }
.row-key dt { color: var(--ink); font-weight: 600; }
.big { font-size: 22px; font-weight: 700; animation: tick .3s ease-out; }
.indent { padding-left: 14px; position: relative; }
.indent::before { content: ''; position: absolute; left: 2px; top: -6px; width: 8px; height: 14px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 4px; }
.compact .row { padding: 6px 0; }
.expiry { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; align-items: center; font-size: 14px; margin: 10px 0; }
.expiry > span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.meter { flex: 1 1 120px; max-width: 200px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.diff { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.diff .h-mini { margin-top: 0; }
.diff-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.diff-table th, .diff-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.diff-table thead th { color: var(--ink-2); font-weight: 500; font-size: 13px; }
.diff-table tbody th { font-weight: 500; }
.diff-table tr.is-changed td:last-child { animation: flash 1.2s ease-out; background: var(--accent-soft); font-weight: 600; }
.changed-mark { font-size: 12px; color: var(--accent); font-weight: 600; }
.deadlines { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.dl { padding: 10px 12px; display: grid; gap: 1px; border-right: 1px solid var(--line); background: var(--surface); }
.dl:last-child { border-right: 0; }
.dl-label { font-size: 12px; color: var(--ink-2); }
.dl-abs { font-weight: 600; font-size: 14px; }
.dl-rel { font-size: 13px; color: var(--ink-2); }
.dl.is-passed { background: var(--surface-2); }
.dl.is-passed .dl-abs { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-2); }

/* tags & pills */
.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 7px; line-height: 1.5; white-space: nowrap; }
.tag-estimate { border: 1.5px dashed var(--line-strong); color: var(--ink-2); }
.tag-fixed { background: var(--ink); color: var(--bg); }
.tag-demo { background: var(--warn-bg); color: var(--warn); }
.tag-alloc { font-family: 'JetBrains Mono', monospace; font-size: 11px; background: var(--surface-3); color: var(--ink); font-weight: 400; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; animation: pop .26s cubic-bezier(.3, 1.4, .5, 1); }
.pill-shape { width: 9px; height: 9px; flex: none; display: inline-block; }
.shape-done { background: currentColor; border-radius: 50%; }
.shape-wait { border: 2px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.shape-action { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid currentColor; }
.shape-alert { background: currentColor; border-radius: 1px; }
.shape-idle { border: 2px solid currentColor; border-radius: 50%; }
.shape-info { background: currentColor; transform: rotate(45deg) scale(.8); }
.pill-done { background: var(--ok-bg); color: var(--ok); }
.pill-wait { background: var(--info-bg); color: var(--info); }
.pill-action { background: var(--warn-bg); color: var(--warn); }
.pill-alert { background: var(--bad-bg); color: var(--bad); }
.pill-idle { background: var(--idle-bg); color: var(--idle); }
.pill-info { background: var(--info-bg); color: var(--info); }
.callout { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin: 10px 0; animation: rise .24s ease-out; }
.callout .ico { width: 18px; height: 18px; margin-top: 1px; }
.callout-alert { background: var(--bad-bg); color: var(--ink); border-left: 4px solid var(--bad); }
.reason { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }
.plain { margin: 6px 0; padding-left: 20px; display: grid; gap: 6px; }
.plain li { line-height: 1.5; }

/* review */
.review .back { margin-bottom: 10px; }
.review-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 20px; margin: 14px 0; }
.review-hero .ico { color: var(--accent); }
.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; animation: rise .26s ease-out backwards; }
.checks li:nth-child(2) { animation-delay: 40ms; } .checks li:nth-child(3) { animation-delay: 80ms; } .checks li:nth-child(4) { animation-delay: 120ms; }
.checks li:nth-child(5) { animation-delay: 160ms; } .checks li:nth-child(6) { animation-delay: 200ms; } .checks li:nth-child(7) { animation-delay: 240ms; } .checks li:nth-child(8) { animation-delay: 280ms; }
.checks .ok .ico { color: var(--ok); }
.checks .bad .ico { color: var(--bad); }
.checks .ico { width: 18px; height: 18px; margin-top: 1px; }
.notice { border: 1.5px solid var(--ink); border-radius: 16px; padding: 14px 16px; margin: 18px 0; background: var(--surface); }
.notice p { font-size: 14px; line-height: 1.55; }
.notice-rec { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ok); font-weight: 600; margin: 8px 0 0; }
.notice-rec .ico { width: 16px; height: 16px; }
.assent { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.cp2 { display: block; }
.cp2 .h-sub { margin-top: 0; }

/* ---------------------------------------------------------------- pages */
.page { max-width: 1100px; margin: 0 auto; }
.page.narrow { max-width: 640px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; text-decoration: none; font-weight: 500; }
.back .ico { width: 18px; height: 18px; }
.order-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.order-sum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 17px; margin-top: 8px; }
.order-sum .mono-num { font-size: 22px; }
.addr { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.panel { background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px 20px; margin: 16px 0; animation: rise .3s ease-out; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
.split > .panel { margin: 16px 0 0; }
.split.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.next { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 20px; padding: 18px 20px; margin: 16px 0; box-shadow: 0 4px 0 var(--hard); animation: rise .3s ease-out; }
.next p { max-width: 70ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.actions .claim { flex: 1 1 100%; margin: 4px 0 0; }
.actions .hint, .actions .reason { flex: 1 1 100%; }
.demo-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; border: 1.5px dashed var(--warn); border-radius: 14px; padding: 8px 12px; background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.demo-bar-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); }
.demo-bar .hint { margin: 0; flex: 1 1 220px; }
.incident { border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 16px 16px 0; padding: 12px 16px; margin: 16px 0; animation: rise .3s ease-out; }
.incident .h-sub { margin-top: 0; }
.folds { margin-top: 18px; border-top: 1px solid var(--line); }
.fold { border-bottom: 1px solid var(--line); }
.fold-h { margin: 0; font-size: 16px; }
.fold-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 14px 4px; cursor: pointer; font-weight: 600; text-align: left; min-height: 48px; }
.fold-btn .ico { transition: transform .2s ease; color: var(--ink-2); }
.fold.is-open .fold-btn .ico { transform: rotate(90deg); }
.fold-hint { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.fold-body { padding: 0 4px 16px; animation: unfold .24s ease-out; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.privacy-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 18px; }
.privacy-note .ico { width: 16px; height: 16px; margin-top: 2px; }
.timeline { list-style: none; padding: 0; margin: 6px 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 82px 22px minmax(0, 1fr) auto; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; animation: rise .26s ease-out; }
.tl-time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tl-chain { font-weight: 700; color: var(--accent); text-align: center; }
.tl-actor { color: var(--ink-2); font-size: 13px; }
.mono-rows dd { font-family: 'JetBrains Mono', monospace; }
.swap2 .inline-form { margin: 10px 0; }

/* crossing — the signature motion */
.crossing { margin: 18px 0 8px; --p0: 6.5%; --pw: 87%; }
.cross-scene { position: relative; height: 120px; border-radius: 22px; overflow: hidden; background: var(--surface); border: 1.5px solid var(--line); }
.bank { position: absolute; bottom: 0; width: 13%; height: 60px; background: var(--hill-1); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .05em; z-index: 1; text-align: center; line-height: 1.1; }
.bank-a { left: 0; border-top-right-radius: 44px; }
.bank-b { right: 0; border-top-left-radius: 44px; transition: background .5s ease .8s, color .5s ease .8s; }
.river { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 60px; }
.river path:first-child { fill: var(--water); }
.river .ripple { fill: none; stroke: var(--water-2); stroke-width: 2; stroke-linecap: round; }
.stones { list-style: none; margin: 0; padding: 0; position: absolute; inset: auto 0 14px 0; height: 14px; z-index: 1; }
.stone { position: absolute; left: calc(var(--p0) + var(--pw) * (var(--i) + 1) / 6); transform: translateX(-50%); width: 34px; height: 12px; border-radius: 50%; background: var(--stone); transition: background .4s ease, box-shadow .4s ease; transition-delay: calc(var(--i) * 80ms); }
.stone.is-on { background: var(--stone-on); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stone-on) 25%, transparent); }
.bison { position: absolute; z-index: 2; bottom: 20px; width: 70px; height: 44px; left: calc(var(--p0) + var(--pw) * var(--step) / 6); transform: translateX(-50%); transition: left 1s cubic-bezier(.45, .05, .25, 1); fill: var(--bison); overflow: visible; }
.bison .bison-horn, .bison .bison-tail { stroke: var(--bison); stroke-width: 2.2; stroke-linecap: round; }
.bison .bison-eye { fill: var(--surface); }
.bison .leg { transform-box: fill-box; transform-origin: 50% 0; }
.crossing.is-walking .bison { animation: bob .25s ease-in-out 4; }
.crossing.is-walking .leg-a { animation: stride .25s ease-in-out 4 alternate; }
.crossing.is-walking .leg-b { animation: stride .25s ease-in-out 4 alternate-reverse; }
.crossing.is-back .bison, .crossing.is-return .bison { transform: translateX(-50%) scaleX(-1); }
.crossing.is-arrived .bank-b { background: var(--accent); color: var(--surface); }
.bank-short { display: none; font-size: 15px; }
.cross-labels { list-style: none; margin: 8px 0 0; padding: 0; position: relative; height: 34px; font-size: 12px; color: var(--ink-2); }
.cross-labels li { position: absolute; top: 0; left: calc(var(--p0) + var(--pw) * (var(--i) + 1) / 6); width: calc(var(--pw) / 6); transform: translateX(-50%); text-align: center; line-height: 1.25; transition: color .3s; }
.cross-labels li:last-child { transform: translateX(-80%); text-align: right; }
.cross-labels li.is-on { color: var(--ink); }
.cross-labels li.is-current { font-weight: 700; color: var(--accent); }

/* history & tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 14px 0; }
.search { position: relative; flex: 1 1 240px; }
.search .ico { position: absolute; left: 12px; top: 12px; color: var(--ink-2); }
.search input { padding-left: 40px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.seg-wrap { margin: 10px 0; }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 14px; min-height: 36px; transition: background .15s, color .15s; }
.seg-btn:hover { background: var(--surface-3); }
.seg-btn.is-on { background: var(--ink); color: var(--bg); }
.count { font-size: 12px; opacity: .75; margin-left: 2px; }
.tx-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.tx { animation: rise .3s ease-out backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.tx-link { display: grid; grid-template-columns: 100px minmax(0, 1.3fr) minmax(0, 1fr) auto 130px 20px; gap: 6px 16px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tx-link:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 3px 0 var(--hard); }
.tx-amt { display: grid; }
.tx-amt b { font-size: 17px; }
.tx-amt .muted, .tx-date { font-size: 13px; }
.tx-go { color: var(--ink-2); }
.tx.skeleton { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 16px; padding: 18px; background: var(--surface); border-radius: 18px; border: 1.5px solid var(--line); }
.tx.skeleton span { height: 14px; border-radius: 6px; background: var(--surface-3); }
.empty { text-align: center; padding: 40px 20px; border: 1.5px dashed var(--line-strong); border-radius: 20px; display: grid; justify-items: center; gap: 8px; color: var(--ink-2); }
.empty .ico { width: 28px; height: 28px; }
.table-wrap { position: relative; overflow-x: auto; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); margin: 10px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table tbody th { font-weight: 600; }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr { animation: rise .28s ease-out backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.table tbody tr.is-selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.table.compact th, .table.compact td { padding: 7px 10px; }
.table:not(.table-wrap .table) { border: 1.5px solid var(--line); border-radius: 14px; border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--surface); }
.queue a { font-weight: 600; }
.cap-input { width: 120px; min-height: 36px; padding: 6px 8px; font-size: 13px; }
.inventory { margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin: 18px 0 0; overflow-x: auto; }
.tab { border: 0; background: none; padding: 12px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; min-height: 46px; transition: color .15s, border-color .2s; }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); border-color: var(--accent); }
.tabpanel { padding: 18px 0; animation: fade .2s ease-out; }
.guarded { margin: 12px 0; display: grid; gap: 4px; justify-items: start; }
.incident-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.inc-card { margin: 0; }
.inc-card.has-hits { border-color: var(--accent); }
.hits { display: flex; flex-wrap: wrap; gap: 8px; }
.decision { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
.summary-rows { max-width: 520px; }
.inspector { position: sticky; top: 96px; margin: 10px 0; }
.danger-zone { border-color: var(--bad); }
.release { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.rel { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.rel-mark { color: var(--ok); }
.rel-missing .rel-mark, .rel-open .rel-mark { color: var(--bad); }
.rel-text { display: grid; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 18px; }
.settings-grid .panel { margin: 16px 0 0; }
.narrow-form .split { gap: 0 28px; }

/* lab & system */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 18px; }
.lab-grid .panel { margin: 12px 0 0; }
.clock-now { font-size: 20px; font-weight: 600; }
.scenarios { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.scenarios li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); }
.scenarios li.is-current { border-color: var(--accent); background: var(--accent-soft); }
.sc-id { font-weight: 700; color: var(--accent); }
.sc-text { display: grid; }
.swatches { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swatches li { display: flex; gap: 8px; align-items: center; }
.sw { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); flex: none; }

/* toasts, dialogs, help */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 14px; box-shadow: 0 4px 0 var(--accent), var(--shadow); font-size: 14px; animation: toast-in .34s cubic-bezier(.2, 1.3, .4, 1); }
.toast-alert { box-shadow: 0 4px 0 var(--bad), var(--shadow); }
.toast-mark .ico { width: 18px; height: 18px; }
.dialog { border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 6px 0 var(--hard), var(--shadow); }
.dialog[open] { animation: dialog-in .26s cubic-bezier(.2, .9, .3, 1.1); }
.dialog::backdrop { background: var(--scrim); animation: fade .2s ease-out; }
.dialog-inner { padding: 20px 22px 18px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.dialog-head h2 { font-family: 'Unbounded', sans-serif; font-weight: 500; font-size: 19px; }
.dialog-body { font-size: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.dialog-wallet { width: min(420px, calc(100vw - 24px)); }
.wallet-sheet .wallet-src { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.siwe-msg { white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: 13px; background: var(--surface-2); border-radius: 12px; padding: 12px; overflow-wrap: anywhere; }
.help-layer { position: fixed; inset: 0; z-index: 40; }
.help-scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade .2s ease-out; }
.help { position: absolute; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); border-left: 1.5px solid var(--line-strong); padding: 18px 20px; overflow-y: auto; animation: slide-left .26s cubic-bezier(.2, .8, .2, 1); }
.help-head { display: flex; justify-content: space-between; align-items: center; }
.help-head h2 { margin: 0; }
.help-body { margin-top: 10px; animation: fade .2s ease-out; }
.gloss { display: grid; gap: 12px; margin: 0; }
.gloss dt { font-weight: 600; }
.gloss dd { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }

/* ---------------------------------------------------------------- keyframes */
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes card-back { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tick { from { opacity: .2; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.86); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { background: var(--accent); color: var(--surface); } 100% { background: var(--accent-soft); } }
@keyframes shake { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes slide-left { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stride { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes bob { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 3px; } }

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
:root[data-motion="reduce"] .dialog::backdrop { animation: none !important; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .send-layout { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
  .send-layout .trade, .send-layout .send-aside { grid-column: 1; max-width: none; position: static; }
}
@media (max-width: 980px) {
  .mainnav, .prefs-inline { display: none; }
  .menu-btn { display: inline-grid; }
  .split, .split.wide-left, .two-col { grid-template-columns: minmax(0, 1fr); }
  .inspector { position: static; }
  .tx-link { grid-template-columns: minmax(0, 1fr) auto; }
  .tx-id { grid-column: 1; }
  .tx-st { grid-column: 2; grid-row: 1; justify-self: end; }
  .tx-amt { grid-column: 1 / -1; }
  .tx-to, .tx-date { grid-column: 1; }
  .tx-go { display: none; }
}
@media (max-width: 640px) {
  .bar { padding: 8px 12px; gap: 6px; }
  .tools { gap: 4px; min-width: 0; }
  .chip { padding: 6px 10px; }
  .brand-word { font-size: 15px; }
  .demo-tag { display: none; }
  .help-btn { width: 36px; }
  .chip-chain { display: none; }
  main { padding: 18px 16px 32px; }
  .banners { padding: 0 16px; }
  .role-strip { padding: 4px 16px 8px; }
  .trade-card { padding: 16px 14px 18px; border-radius: 22px; }
  .amount-input, .amount-out { font-size: 30px; }
  .asset-select { min-width: 96px; }
  .two { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row dd { justify-content: flex-start; text-align: left; }
  .deadlines { grid-template-columns: 1fr; }
  .dl { border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr auto; }
  .dl-label { grid-column: 1 / -1; }
  .dl:last-child { border-bottom: 0; }
  .cross-scene { height: 104px; }
  .bison { width: 54px; height: 34px; }
  .bank-long { display: none; }
  .bank-short { display: inline; }
  .cross-labels { height: auto; font-size: 14px; }
  .cross-labels li { display: none; }
  .cross-labels li.is-current, .cross-labels li.is-current:last-child { display: block; position: static; transform: none; width: auto; text-align: center; }
  .h-display, .h-page { font-size: 22px; }
  .timeline li { grid-template-columns: 70px 16px minmax(0, 1fr); }
  .tl-actor { grid-column: 3; }
  .scenarios li { grid-template-columns: 40px minmax(0, 1fr); }
  .scenarios li .btn { grid-column: 2; justify-self: start; }
  .landscape { height: 90px; }
  .table.queue thead { display: none; }
  .table.queue tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .table.queue tbody tr:last-child { border-bottom: 0; }
  .table.queue th, .table.queue td { border: 0; padding: 0; }
  .table.queue td:nth-of-type(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  .table.queue td:nth-of-type(3), .table.queue td:nth-of-type(4) { grid-column: 1 / -1; }
  .foot-line { padding: 6px 16px 16px; }
  .dialog-inner { padding: 16px; }
  .dialog-actions .btn { flex: 1 1 auto; }
  .rel { grid-template-columns: 24px minmax(0, 1fr); }
  .rel .pill { grid-column: 2; justify-self: start; }
  .toasts { right: 16px; bottom: 16px; }
}

@media (max-width: 440px) {
  .brand-word { display: none; }
}

@media print {
  .topbar, .foot, .demo-bar, .actions, .toasts, .crossing, [data-private] { display: none !important; }
  body { background: #fff; color: #000; }
}
