/* ==========================================================================
   Base design system: tokens, reset, typography and shared components.
   Brand colours (--primary, --secondary, --accent) are injected from Admin > Branding.
   One radius scale: 6px controls, 10px containers, pills only for status badges.
   ========================================================================== */

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

:root {
  --primary: #0B2E4F;
  --secondary: #2B5C8A;
  --accent: #0A7F5F;

  --bg: #F6F7F9;
  --bg-alt: #F1F3F7;
  --surface: #FFFFFF;
  --surface-2: #F3F5F8;
  --line: #E3E7ED;
  --line-strong: #CBD2DC;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #667085;
  --on-primary: #FFFFFF;

  --primary-hover: color-mix(in srgb, var(--primary) 86%, #000);
  --primary-soft: color-mix(in srgb, var(--primary) 7%, #fff);
  --primary-text: var(--primary);
  --link: var(--secondary);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
  --accent-text: color-mix(in srgb, var(--accent) 88%, #000);

  --ok: #0B6B45;     --ok-bg: #E6F4EC;
  --warn: #8A5300;   --warn-bg: #FFF3D6;
  --bad: #B42318;    --bad-bg: #FDECEA;
  --info: #1849A9;   --info-bg: #E8F0FE;
  --neutral: #475467; --neutral-bg: #EDF0F4;

  --chart-1: #2a78d6; --chart-2: #eb6834; --chart-3: #1baf7a; --chart-4: #eda100;
  --chart-5: #e87ba4; --chart-6: #008300; --chart-7: #4a3aa7; --chart-8: #e34948;
  --chart-grid: #E1E4EA; --chart-axis: #98A2B3;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-control: 6px;
  --r-card: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-pop: 0 14px 36px -10px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px color-mix(in srgb, var(--secondary) 28%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --z-header: 40; --z-drawer: 60; --z-modal: 80; --z-toast: 100;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1117; --bg-alt: #10151C; --surface: #151B24; --surface-2: #1B222D;
    --line: #262E3A; --line-strong: #37414F; --ink: #E7EAF0; --ink-2: #AAB3C1; --ink-3: #8B95A5;
    --primary-text: color-mix(in srgb, var(--primary) 35%, #fff);
    --link: color-mix(in srgb, var(--secondary) 45%, #fff);
    --primary-soft: color-mix(in srgb, var(--primary) 30%, #151B24);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, #151B24);
    --accent-text: color-mix(in srgb, var(--accent) 45%, #fff);
    --ok: #5FD3A0; --ok-bg: #12291F; --warn: #F3C56A; --warn-bg: #2E2410; --bad: #FF8F86; --bad-bg: #331615; --info: #8DB4FF; --info-bg: #14233F; --neutral: #B2BBC9; --neutral-bg: #202834;
    --chart-1: #3987e5; --chart-2: #d95926; --chart-3: #199e70; --chart-4: #c98500; --chart-5: #d55181; --chart-7: #9085e9; --chart-8: #e66767;
    --chart-grid: #2A323E; --chart-axis: #6B7686;
    --shadow-1: none; --shadow-pop: 0 14px 36px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1117; --bg-alt: #10151C; --surface: #151B24; --surface-2: #1B222D;
  --line: #262E3A; --line-strong: #37414F; --ink: #E7EAF0; --ink-2: #AAB3C1; --ink-3: #8B95A5;
  --primary-text: color-mix(in srgb, var(--primary) 35%, #fff);
  --link: color-mix(in srgb, var(--secondary) 45%, #fff);
  --primary-soft: color-mix(in srgb, var(--primary) 30%, #151B24);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, #151B24);
  --accent-text: color-mix(in srgb, var(--accent) 45%, #fff);
  --ok: #5FD3A0; --ok-bg: #12291F; --warn: #F3C56A; --warn-bg: #2E2410; --bad: #FF8F86; --bad-bg: #331615; --info: #8DB4FF; --info-bg: #14233F; --neutral: #B2BBC9; --neutral-bg: #202834;
  --chart-1: #3987e5; --chart-2: #d95926; --chart-3: #199e70; --chart-4: #c98500; --chart-5: #d55181; --chart-7: #9085e9; --chart-8: #e66767;
  --chart-grid: #2A323E; --chart-axis: #6B7686;
  --shadow-1: none; --shadow-pop: 0 14px 36px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--secondary) 24%, transparent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
table.sr-only { display: block; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: var(--r-control); z-index: var(--z-toast); }
.skip-link:focus { top: 12px; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; vertical-align: -0.22em; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2em; height: 2em; }

/* -------------------------------------------------------------- typography */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; color: var(--ink); }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 62ch; line-height: 1.6; }
.muted { color: var(--ink-3); }
.text-2 { color: var(--ink-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num, .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.money.neg, .neg { color: var(--bad); }
.money.pos, .pos { color: var(--ok); }
.mono { font-family: var(--font-mono); font-size: .92em; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serif { font-family: var(--font-serif); letter-spacing: -0.02em; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* --------------------------------------------------------------- utilities */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

/* ----------------------------------------------------------------- buttons */
.btn { --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd); border-radius: var(--r-control);
  font-weight: 550; font-size: 14px; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease), color .15s; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-bd: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--bad); --btn-bd: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-danger-solid { --btn-bg: var(--bad); --btn-fg: #fff; --btn-bd: var(--bad); }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--bad) 88%, #000); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { min-width: 40px; padding: 0; }
.btn-sm.btn-icon { min-width: 32px; }
.btn.is-loading { pointer-events: none; color: transparent !important; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--btn-fg-live, #fff); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-accent):not(.btn-danger-solid).is-loading::after { border-color: var(--ink-3); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font-weight: 500; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field, .form-grid + .field, .field + .form-grid { margin-top: 16px; }
.field > label, .label { font-size: 13px; font-weight: 550; color: var(--ink); }
.field .req { color: var(--bad); margin-left: 2px; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 9px 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-control); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23667085'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--ink-3) 70%, var(--line-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--secondary); box-shadow: var(--ring); }
.input[readonly], .input:disabled, .select:disabled { background: var(--surface-2); color: var(--ink-2); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--bad); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.field.is-valid .input { border-color: color-mix(in srgb, var(--ok) 60%, var(--line-strong)); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.field-error { font-size: 12.5px; color: var(--bad); display: none; align-items: flex-start; gap: 6px; }
.field.has-error .field-error { display: flex; }
.field.has-error .hint { display: none; }
.field-ok { display: none; font-size: 12.5px; color: var(--ok); gap: 6px; align-items: center; }
.field.is-valid .field-ok { display: inline-flex; }
.input-group { display: flex; align-items: stretch; }
.input-group .affix { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); font-size: 15px; }
.input-group .affix:first-child { border-right: 0; border-radius: var(--r-control) 0 0 var(--r-control); }
.input-group .affix:last-child { border-left: 0; border-radius: 0 var(--r-control) var(--r-control) 0; }
.input-group .input:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-money { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; min-height: 54px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid > .field + .field { margin-top: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.switch { position: relative; display: inline-flex; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background-color .18s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.pin-input { letter-spacing: .6em; text-align: center; font-family: var(--font-mono); font-size: 24px; font-weight: 600; }
.code-input { letter-spacing: .5em; text-align: center; font-family: var(--font-mono); font-size: 26px; font-weight: 600; min-height: 56px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 10px; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.strength i { height: 4px; background: var(--line); border-radius: 2px; transition: background-color .2s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--bad); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] i:nth-child(-n+3) { background: #5a9a2f; }
.strength[data-level="4"] i { background: var(--ok); }

/* -------------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 16px; }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-card) var(--r-card); }
.card-flush .card-body { padding: 0; }
.card.pad { padding: 20px; }
.card-link { display: block; color: inherit; transition: border-color .15s var(--ease), transform .15s var(--ease); }
.card-link:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-1px); }

/* ------------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.badge-success { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-btn { border: none; cursor: pointer; font-family: inherit; }
.badge-btn:hover { filter: brightness(0.94); }
.badge-btn .icon { width: 12px; height: 12px; }
.count-pill { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; }

/* ------------------------------------------------------------------- alerts */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-control); border: 1px solid; font-size: 14px; align-items: flex-start; }
.alert .icon { margin-top: 2px; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-danger { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert strong { font-weight: 650; }
.alert a { color: inherit; text-decoration: underline; }
.alert p + p { margin-top: 4px; }

/* ------------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 3%, transparent); }
.table .r, .table th.r { text-align: right; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table th.sorted::after { content: " \2193"; }
.table th.sorted.asc::after { content: " \2191"; }
.table td .cell-title { font-weight: 550; }
.table td .cell-sub { font-size: 12.5px; color: var(--ink-3); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-hidden { opacity: .55; }
.txn-icon { width: 36px; height: 36px; border-radius: var(--r-control); background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none; }
.txn-icon.in { background: var(--accent-soft); color: var(--accent-text); }

/* ------------------------------------------------------------ lists / dl / kv */
.list > li, .list > .list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list > li:last-child, .list > .list-row:last-child { border-bottom: 0; }
.list-link { color: inherit; }
.list-link:hover { background: color-mix(in srgb, var(--primary) 3%, transparent); text-decoration: none; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 0; font-size: 14px; }
.kv dt, .kv dd { padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-3); }
.kv dd { font-weight: 500; text-align: right; word-break: break-word; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv.left dd { text-align: left; }

/* --------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 10px 14px; font-size: 14px; font-weight: 550; color: var(--ink-2); background: none; border: 0; white-space: nowrap; cursor: pointer; border-radius: var(--r-control) var(--r-control) 0 0; }
.tab:hover { color: var(--ink); text-decoration: none; background: var(--surface-2); }
.tab[aria-selected="true"], .tab.active { color: var(--primary-text); }
.tab[aria-selected="true"]::after, .tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--primary-text); border-radius: 2px; }
.tab-panel[hidden] { display: none; }
.segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-control); padding: 3px; gap: 2px; }
.segmented button, .segmented a { flex: none; white-space: nowrap; padding: 6px 12px; border: 0; background: none; border-radius: 4px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.segmented .on, .segmented [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------------------------------------------------------------- accordion */
.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 4px; font-weight: 600; cursor: pointer; font-size: 15.5px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--ink-3); line-height: 1; transition: transform .2s var(--ease); }
.accordion details[open] summary::after { content: "\2212"; }
.accordion .acc-body { padding: 0 4px 18px; color: var(--ink-2); max-width: 70ch; }

/* -------------------------------------------------------------- pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.pager-nav { display: flex; gap: 4px; }
.pager-nav button, .pager-nav a { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-control); color: var(--ink-2); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.pager-nav .on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pager-nav button:disabled { opacity: .45; cursor: not-allowed; }
.pager-nav button:not(:disabled):hover { background: var(--surface-2); }

/* --------------------------------------------------------------- empty state */
.empty { text-align: center; padding: 44px 24px; color: var(--ink-2); }
.empty .icon { width: 36px; height: 36px; color: var(--ink-3); margin: 0 auto 12px; }
.empty h3 { margin-bottom: 4px; }
.empty p { max-width: 42ch; margin: 0 auto 16px; font-size: 14px; }

/* ----------------------------------------------------------------- skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 4px; min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 6%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-row { height: 48px; margin: 10px 20px; }

/* -------------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(9, 14, 24, .5); z-index: var(--z-modal); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; animation: fade .16s var(--ease); }
.modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-pop); animation: rise .2s var(--ease); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-card) var(--r-card); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* -------------------------------------------------------------------- toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: var(--r-control); box-shadow: var(--shadow-pop); font-size: 14px; animation: rise .22s var(--ease); }
.toast .icon { margin-top: 2px; }
.toast.success .icon { color: #5FD3A0; } .toast.error .icon { color: #FF8F86; } .toast.warning .icon { color: #F3C56A; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; padding: 0 2px; }
.toast button:hover { opacity: 1; }

/* ---------------------------------------------------------------- dropdown */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 6px; z-index: var(--z-drawer); display: none; }
.menu.left { right: auto; left: 0; }
.dropdown.open > .menu { display: block; animation: rise .16s var(--ease); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; color: var(--ink); font-size: 14px; border-radius: 6px; text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu hr { margin: 6px 0; }
.menu .menu-label { padding: 8px 12px 4px; font-size: 12px; color: var(--ink-3); }

/* --------------------------------------------------------------- tooltip */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; z-index: var(--z-drawer); pointer-events: none; }

/* ------------------------------------------------------------------ progress */
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .6s var(--ease); }
.progress.warn > span { background: var(--warn); } .progress.bad > span { background: var(--bad); }
.progress.primary > span { background: var(--primary-text); }

/* ------------------------------------------------------------------ stepper */
.stepper { display: flex; gap: 0; counter-reset: step; }
.stepper li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.stepper li::before { counter-increment: step; content: counter(step); width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; z-index: 1; transition: all .2s var(--ease); }
.stepper li::after { content: ""; position: absolute; top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 1.5px; background: var(--line-strong); }
.stepper li:last-child::after { display: none; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done::before { content: "\2713"; background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.done::after { background: var(--accent); }
.stepper li.current { color: var(--ink); font-weight: 600; }
.stepper li.current::before { border-color: var(--primary); background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.stepper-compact { display: none; }

/* --------------------------------------------------------------- avatar/chips */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; flex: none; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--line-strong); text-decoration: none; }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.divider-label { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ----------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--primary-text); font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; color: var(--primary); flex: none; }
.brand-word strong { font-weight: 700; }
.brand-word span { font-weight: 400; color: var(--ink-2); }
.brand-img { height: 34px; width: auto; max-width: 200px; object-fit: contain; }

.collapsible { display: none; }
.collapsible.open { display: block; }
/* ------------------------------------------------ shared small components */
.ico-box { width: 44px; height: 44px; border-radius: var(--r-control); background: var(--primary-soft); color: var(--primary-text); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico-box .icon { width: 22px; height: 22px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--link); white-space: nowrap; }
.link-arrow .icon { transition: transform .18s var(--ease); }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover .icon { transform: translateX(3px); }
.tick-list { margin: 20px 0 26px; display: grid; gap: 10px; }
.tick-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 15px; }
.tick-list .icon { color: var(--accent-text); margin-top: 3px; }

/* --------------------------------------------------------- simulation note */
.sim-note { font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------------ media */
@media (max-width: 1099px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  body { font-size: 15px; }
  h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card-head, .card-body, .list > li { padding-left: 16px; padding-right: 16px; }
  .kv { grid-template-columns: minmax(100px, 40%) 1fr; }
  .stepper { display: none; }
  .stepper-compact { display: block; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: var(--r-card) var(--r-card) 0 0; max-height: 92dvh; }
  .toasts { right: 16px; left: 16px; bottom: 84px; width: auto; }
  .btn-lg { min-height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .no-print, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; }
}

/* ------------------------------------------------------------- cookie notice */
.cookie-banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 32px; width: min(1180px, calc(100% - 32px)); padding: 22px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(16, 24, 40, .18); }
.cookie-copy { flex: 1; min-width: 0; }
.cookie-copy h2 { margin-bottom: 6px; font-size: 17px; font-weight: 600; }
.cookie-copy p { max-width: 84ch; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.cookie-copy .cookie-links { display: flex; gap: 18px; margin-top: 10px; font-size: 12.5px; }
.cookie-links a { color: var(--ink-2); text-decoration: underline; }
.cookie-actions { display: flex; flex: none; gap: 12px; }
.cookie-actions .btn { min-width: 150px; }
.cookie-opt { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-card); }
.cookie-opt input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
.cookie-opt strong { display: block; }
.cookie-opt span { font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 719px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 16px; bottom: 12px; padding: 18px; }
  .cookie-actions { flex-direction: column; }
  .cookie-actions .btn { width: 100%; }
}

/* ------------------------------------------------ secure-check animation (transfer steps, sign in) */
.ipc { max-width: 540px; margin: 0 auto; padding: 8px 0 4px; text-align: center; transition: opacity .38s ease, transform .38s ease; animation: ipc-in .4s ease backwards; }
@keyframes ipc-in { from { opacity: 0; } }
.ipc.is-leaving { opacity: 0; transform: translateY(-6px); }
.ipc-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ipc-eyebrow .icon { width: 15px; height: 15px; color: var(--primary-text); }
.ipc-title { font-size: 22px; margin: 10px 0 4px; color: var(--ink); }
.ipc-sub { color: var(--ink-2); font-size: 14.5px; margin: 0 auto; max-width: 44ch; }
.ipc-scene { display: block; width: 100%; max-width: 420px; height: auto; margin: 24px auto 4px; overflow: visible; }
.ipc-rail { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.ipc-flow { stroke: var(--secondary); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 3 9; animation: ipc-dash 1s linear infinite; transition: opacity .4s; }
.ipc-packet { fill: var(--secondary); opacity: 0; animation: ipc-travel 2.6s cubic-bezier(.45, .05, .55, .95) infinite; }
.ipc-packet.p2 { animation-delay: .85s; }
.ipc-packet.p3 { animation-delay: 1.7s; }
.ipc-node-bg { fill: var(--primary-soft); stroke: var(--line-strong); stroke-width: 1.5; }
.ipc-glyph { fill: var(--primary-text); }
.ipc-label { font-family: var(--font-sans); font-size: 11.5px; fill: var(--ink-3); text-anchor: middle; }
.ipc-core { fill: var(--surface); stroke: var(--primary-text); stroke-width: 2; transition: stroke .45s, fill .45s; }
.ipc-shield { fill: none; stroke: var(--primary-text); stroke-width: 2; stroke-linejoin: round; transition: stroke .45s; }
.ipc-ring { fill: none; stroke: var(--secondary); stroke-width: 1.5; opacity: 0; animation: ipc-pulse 2.4s ease-out infinite; }
.ipc-ring.r2 { animation-delay: 1.2s; }
.ipc-sweep { fill: none; stroke: var(--secondary); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 38 213; animation: ipc-spin 2.2s linear infinite; transition: opacity .4s; }
.ipc-bang { fill: none; stroke: var(--warn); stroke-width: 2.4; stroke-linecap: round; opacity: 0; transition: opacity .4s .15s; }
.ipc-bang-dot { fill: var(--warn); opacity: 0; transition: opacity .4s .15s; }
.ipc.is-alert .ipc-core { stroke: var(--warn); }
.ipc.is-alert .ipc-shield { stroke: var(--warn); opacity: 0; }
.ipc.is-alert .ipc-bang, .ipc.is-alert .ipc-bang-dot { opacity: 1; }
.ipc.is-alert .ipc-sweep, .ipc.is-alert .ipc-ring, .ipc.is-alert .ipc-packet, .ipc.is-alert .ipc-flow { animation: none; opacity: 0; }
.ipc-steps { list-style: none; margin: 22px auto 0; padding: 0; max-width: 400px; text-align: left; }
.ipc-steps li { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 12px; padding: 10px 4px; font-size: 14px; color: var(--ink-3); border-bottom: 1px solid var(--line); transition: color .3s; }
.ipc-steps li:last-child { border-bottom: 0; }
.ipc-steps li.is-active { color: var(--ink); }
.ipc-steps li.is-done { color: var(--ink-2); }
.ipc-steps li.is-alert { color: var(--ink); }
.ipc-state { position: relative; display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; }
.ipc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.ipc-spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary-text); animation: spin .8s linear infinite; }
.ipc-ok, .ipc-alert { display: none; }
.ipc-ok .icon, .ipc-alert .icon { width: 18px; height: 18px; }
.ipc-ok { color: var(--ok); }
.ipc-alert { color: var(--warn); }
.ipc-steps li.is-active .ipc-dot { display: none; }
.ipc-steps li.is-active .ipc-spin { display: block; }
.ipc-steps li.is-done .ipc-dot, .ipc-steps li.is-alert .ipc-dot { display: none; }
.ipc-steps li.is-done .ipc-ok { display: inline-flex; animation: ipc-pop .35s cubic-bezier(.22, .7, .2, 1); }
.ipc-steps li.is-alert .ipc-alert { display: inline-flex; animation: ipc-pop .35s cubic-bezier(.22, .7, .2, 1); }
.ipc-note { font-size: 12.5px; color: var(--ink-3); opacity: 0; transition: opacity .35s; }
.ipc-steps li.is-done .ipc-note, .ipc-steps li.is-alert .ipc-note { opacity: 1; }
.ipc-steps li.is-alert .ipc-note { color: var(--warn); font-weight: 600; }
.ipc-bar { height: 4px; margin: 20px auto 0; max-width: 400px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ipc-bar span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--secondary), var(--primary-text)); transform-origin: left center; transform: scaleX(var(--p, .04)); transition: transform .7s cubic-bezier(.22, .7, .2, 1); }
.restrict-enter, .panel-enter { animation: ipc-rise .55s cubic-bezier(.22, .7, .2, 1) both; }
@keyframes ipc-dash { to { stroke-dashoffset: -12; } }
@keyframes ipc-travel { 0% { transform: translateX(0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateX(252px); opacity: 0; } }
@keyframes ipc-pulse { from { transform: scale(.88); opacity: .55; } to { transform: scale(1.55); opacity: 0; } }
@keyframes ipc-spin { to { transform: rotate(360deg); } }
@keyframes ipc-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ipc-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* code check scene: the code travels from the device to the bank, the padlock opens and everything turns green */
.ipc-line { fill: none; stroke: var(--primary-text); stroke-width: 2; stroke-linecap: round; }
.ipc-dial { fill: none; stroke: var(--secondary); stroke-width: 2; stroke-dasharray: 1.5 6.2; opacity: .6; transform-origin: 0 0; animation: ipc-spin 7s linear infinite; transition: stroke .4s, opacity .4s; }
.ipc-lock-body { fill: var(--primary-text); transition: fill .45s; }
.ipc-keyhole { fill: var(--surface); }
.ipc-shackle { fill: none; stroke: var(--primary-text); stroke-width: 2.4; stroke-linecap: round; transition: transform .5s cubic-bezier(.22, .7, .2, 1), stroke .45s; }
.ipc.is-secured .ipc-core { stroke: var(--ok); fill: var(--ok-bg); }
.ipc.is-secured .ipc-lock-body { fill: var(--ok); }
.ipc.is-secured .ipc-keyhole { fill: var(--ok-bg); }
.ipc.is-secured .ipc-shackle { stroke: var(--ok); transform: translateY(-3px); }
.ipc.is-secured .ipc-dial { animation: none; stroke: var(--ok); stroke-dasharray: none; opacity: 1; }
.ipc.is-secured .ipc-rail { stroke: var(--ok); }
.ipc.is-secured .ipc-ring, .ipc.is-secured .ipc-packet, .ipc.is-secured .ipc-flow { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .ipc-flow, .ipc-sweep, .ipc-ring, .ipc-packet, .ipc-spin, .ipc-dial, .restrict-enter, .panel-enter, .ipc-steps li .ipc-ok, .ipc-steps li .ipc-alert { animation: none !important; }
  .ipc, .ipc-bar span { transition: none; animation: none; }
}
