/* ==========================================================================
   Escrow Chambers — Platform (client portal + admin console)
   "Vault & Brass" design system, carried over from the public site.
   Fonts: Source Serif 4 (display) · Inter (UI) · JetBrains Mono (ledger)
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Palette remapped to Escrow Chambers "Chambers & Parchment".
     Token names are historical; the values are chambers green + claret. */
  --navy-900: #10241D;
  --navy-850: #142C23;
  --navy-800: #17342A;
  --navy-700: #204538;
  --navy-600: #2C5A49;
  --steel-600: #35564A;
  --slate-500: #5A7568;
  --slate-400: #8AA096;
  --mist-200: #DED8C9;
  --mist-100: #EBE6DA;
  --fog-100: #F4F1E7;
  --paper: #FFFFFF;

  --brass-400: #C97F8A;
  --brass-500: #8A2836;
  --brass-600: #6E1F2B;
  --brass-050: #F8EDEE;

  --verified-600: #1F7A55;
  --verified-050: #E9F5EF;
  --alert-600: #B4522E;
  --alert-050: #FBEFEA;
  --pending-600: #A97514;
  --pending-050: #FBF3E2;

  --bg: var(--paper);
  --bg-tint: var(--fog-100);
  --text: #14211C;
  --text-muted: var(--slate-500);
  --text-invert: #E9F0F8;
  --text-invert-muted: #A9C0B5;
  --line: var(--mist-200);
  --line-dark: rgba(255, 255, 255, .12);
  --accent: var(--brass-500);

  --font-display: "Spectral", "Iowan Old Style", Georgia, serif;
  --font-ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --fs-h1: clamp(1.875rem, 3.4vw, 2.5rem);
  --fs-h2: clamp(1.5rem, 2.6vw, 2rem);
  --fs-h3: 1.375rem;
  --fs-h4: 1.125rem;
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-eyebrow: 0.75rem;

  --wrap: 1320px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --sp-1: .25rem; --sp-2: .5rem;  --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem;   --sp-7: 2.5rem; --sp-8: 3rem;
  --sp-9: 4rem;

  --shadow-xs: 0 1px 2px rgba(16,36,29, .06);
  --shadow-sm: 0 2px 8px rgba(16,36,29, .06), 0 1px 2px rgba(16,36,29, .04);
  --shadow-md: 0 12px 32px -12px rgba(16,36,29, .18), 0 2px 6px rgba(16,36,29, .05);
  --shadow-lg: 0 28px 64px -24px rgba(16,36,29, .28), 0 4px 12px rgba(16,36,29, .06);

  --t-fast: 140ms cubic-bezier(.4, 0, .2, 1);
  --t-med: 260ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-tint);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.7;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--navy-600); text-decoration: none; text-underline-offset: 3px; transition: color var(--t-fast); }
a:hover { color: var(--brass-600); text-decoration: underline; }
p { margin: 0 0 var(--sp-4); }
strong { font-weight: 600; color: var(--navy-900); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-6) 0; }
:focus-visible { outline: 3px solid var(--brass-500); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--brass-500); color: #fff; }

h1, h2, h3 {
  font-family: var(--font-display); font-weight: 600; line-height: 1.15;
  letter-spacing: -.02em; color: var(--navy-900); margin: 0 0 var(--sp-3); text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -.025em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-family: var(--font-ui); font-size: var(--fs-h4); font-weight: 600; margin: 0 0 var(--sp-2); color: var(--navy-900); line-height: 1.4; }

.mono { font-family: var(--font-mono); font-variant-ligatures: none; }
.tnum { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brass-600); margin: 0 0 var(--sp-2);
}
.eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--brass-500); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--sp-5); }
.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 600;
  line-height: 1; padding: .8125rem 1.25rem; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary { background: var(--brass-500); color: #FFFFFF; box-shadow: 0 1px 0 rgba(255,255,255,.28) inset, var(--shadow-sm); }
.btn--primary:hover:not(:disabled) { background: var(--brass-600); color: #FFFFFF; }
.btn--navy { background: var(--navy-900); color: #fff; box-shadow: var(--shadow-sm); }
.btn--navy:hover:not(:disabled) { background: var(--navy-700); color: #fff; }
.btn--ghost { background: var(--paper); color: var(--navy-900); border-color: var(--mist-200); }
.btn--ghost:hover:not(:disabled) { background: var(--fog-100); border-color: #C6D3E1; color: var(--navy-900); }
.btn--quiet { background: transparent; color: var(--steel-600); border-color: transparent; padding-inline: .625rem; }
.btn--quiet:hover:not(:disabled) { background: var(--fog-100); color: var(--navy-900); }
.btn--danger { background: var(--alert-600); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #9C3826; color: #fff; }
.btn--ok { background: var(--verified-600); color: #fff; }
.btn--ok:hover:not(:disabled) { background: #1A6A4C; color: #fff; }
.btn--sm { font-size: var(--fs-xs); padding: .5rem .75rem; border-radius: var(--r-sm); }
.btn--block { width: 100%; }
.btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.btn--loading::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite;
  color: #FFFFFF; top: calc(50% - 8px); left: calc(50% - 8px);
}
.btn--navy.btn--loading::after, .btn--danger.btn--loading::after, .btn--ok.btn--loading::after { color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 4. Application shell ---------- */
.app-header {
  position: sticky; top: 0; z-index: 60; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-header.is-stuck { box-shadow: var(--shadow-sm); background: rgba(255,255,255,.98); }
.app-header__inner { display: flex; align-items: center; gap: var(--sp-4); min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: .625rem; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; color: var(--navy-900); line-height: 1; display: block; }
.brand__name span { color: var(--brass-600); }
.brand__tag { display: block; font-size: .625rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--slate-500); margin-top: 4px; }

.app-nav { display: flex; align-items: center; gap: var(--sp-1); margin-left: var(--sp-6); }
.app-nav a, .app-nav button {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .85rem; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 500; color: var(--steel-600); background: none; border: 0;
  cursor: pointer; font-family: var(--font-ui); position: relative;
}
.app-nav a:hover, .app-nav button:hover { color: var(--navy-900); background: var(--fog-100); text-decoration: none; }
.app-nav svg { width: 16px; height: 16px; }
.app-nav [aria-current="page"], .app-nav .is-active { color: var(--navy-900); font-weight: 600; }
.app-nav [aria-current="page"]::after, .app-nav .is-active::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: -2px;
  height: 2px; background: var(--brass-500); border-radius: 2px;
}
.app-header__actions { display: flex; align-items: center; gap: var(--sp-3); margin-left: auto; }

/* Language switch */
.lang { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; background: var(--paper); }
.lang button {
  font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: .4rem .7rem; color: var(--slate-500); background: none;
  border: 0; cursor: pointer; line-height: 1.4;
}
.lang button:hover { background: var(--fog-100); color: var(--navy-900); }
.lang button[aria-pressed="true"] { background: var(--navy-900); color: #fff; }

/* Profile menu */
.profile { position: relative; }
.profile__btn {
  display: inline-flex; align-items: center; gap: .625rem; padding: .375rem .625rem .375rem .375rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-pill);
  cursor: pointer; font-family: var(--font-ui); transition: border-color var(--t-fast), box-shadow var(--t-fast);
  max-width: 260px;
}
.profile__btn:hover { border-color: #C6D3E1; box-shadow: var(--shadow-xs); }
.profile__btn[aria-expanded="true"] { border-color: var(--brass-500); }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-900); color: var(--brass-400); font-size: .75rem; font-weight: 600;
  letter-spacing: .04em; font-family: var(--font-ui); line-height: 1;
}
.avatar--lg { width: 52px; height: 52px; font-size: 1rem; }
.profile__name { font-size: var(--fs-sm); font-weight: 600; color: var(--navy-900); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile__chev { width: 14px; height: 14px; color: var(--slate-400); transition: transform var(--t-fast); flex: none; }
.profile__btn[aria-expanded="true"] .profile__chev { transform: rotate(180deg); }

.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 268px; z-index: 70;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: var(--sp-2); display: none;
}
.menu.is-open { display: block; animation: menuIn 160ms cubic-bezier(.2,.8,.2,1); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu__head { padding: var(--sp-3) var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-2); display: flex; gap: var(--sp-3); align-items: center; }
.menu__head div { min-width: 0; }
.menu__head b { display: block; font-size: var(--fs-sm); color: var(--navy-900); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.menu__head span { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; }
.menu__item {
  display: flex; align-items: center; gap: .625rem; width: 100%; text-align: left;
  padding: .625rem .75rem; border-radius: var(--r-sm); border: 0; background: none;
  font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--steel-600); cursor: pointer;
}
.menu__item:hover { background: var(--fog-100); color: var(--navy-900); text-decoration: none; }
.menu__item svg { width: 16px; height: 16px; color: var(--slate-400); flex: none; }
.menu__item:hover svg { color: var(--brass-600); }
.menu__item--danger { color: var(--alert-600); }
.menu__item--danger:hover { background: var(--alert-050); color: var(--alert-600); }
.menu__item--danger svg { color: var(--alert-600); }
.menu__sep { height: 1px; background: var(--line); margin: var(--sp-2) 0; }

.app-main { padding: var(--sp-7) 0 var(--sp-9); }
.page-head { margin-bottom: var(--sp-6); }
.page-head h1 { margin-bottom: var(--sp-2); }
.page-head p { color: var(--text-muted); margin: 0; max-width: 68ch; font-size: var(--fs-sm); }

/* ---------- 5. Panels & cards ---------- */
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.panel + .panel { margin-top: var(--sp-5); }
.panel__head {
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line);
}
.panel__head h2, .panel__head h3 { margin: 0; font-size: var(--fs-h4); font-family: var(--font-ui); font-weight: 600; }
.panel__head p { margin: .25rem 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
.panel__actions { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.panel__body { padding: var(--sp-6); }
.panel__body--flush { padding: 0; }
.panel__foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); background: var(--fog-100); border-radius: 0 0 var(--r-md) var(--r-md); }

/* ---------- 6. Balance hero ---------- */
.vault {
  background: var(--navy-900); color: var(--text-invert); border-radius: var(--r-lg);
  position: relative; overflow: hidden; padding: var(--sp-7) var(--sp-7) var(--sp-6);
  box-shadow: var(--shadow-md);
}
.vault::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(760px 380px at 8% -10%, rgba(138,40,54,.16), transparent 60%),
    radial-gradient(620px 420px at 92% 10%, rgba(32,69,56,.75), transparent 62%);
}
.vault::after {
  content: ""; position: absolute; inset: 0; opacity: .45; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 25%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 25%, #000 20%, transparent 78%);
}
.vault > * { position: relative; }
.vault .eyebrow { color: var(--brass-400); }
.vault .eyebrow::before { background: var(--brass-400); }

.vault__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-6); align-items: end; }
@media (max-width: 900px) { .vault__grid { grid-template-columns: 1fr; gap: var(--sp-5); align-items: start; } }

.vault__total { display: block; font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em;
  font-size: clamp(2.25rem, 5vw, 3.25rem); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.vault__label { display: block; font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--text-invert-muted); margin-bottom: .5rem; font-weight: 600; }
.vault__sub { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.375rem, 2.6vw, 1.75rem); line-height: 1.1; color: #fff; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.vault__cell { border-left: 1px solid rgba(255,255,255,.14); padding-left: var(--sp-5); }
@media (max-width: 900px) { .vault__cell { border-left: 0; border-top: 1px solid rgba(255,255,255,.14); padding-left: 0; padding-top: var(--sp-4); } }
.vault__cell .muted, .vault__note { color: var(--text-invert-muted); font-size: var(--fs-xs); margin: .375rem 0 0; }
.vault__foot { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: center; font-size: var(--fs-xs); color: var(--text-invert-muted); }
.vault__foot .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--verified-600); box-shadow: 0 0 0 3px rgba(31,122,85,.25); display: inline-block; }
.vault__foot .dot--stale { background: var(--brass-500); box-shadow: 0 0 0 3px rgba(138,40,54,.25); }

/* ---------- 7. Wallet cards ---------- */
.wallet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
@media (max-width: 780px) { .wallet-grid { grid-template-columns: 1fr; } }

.wallet {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-5); transition: border-color var(--t-med), box-shadow var(--t-med), transform var(--t-med);
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.wallet:hover { border-color: #C6D3E1; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.wallet__top { display: flex; align-items: flex-start; gap: var(--sp-3); }
/* Asset badge: carries the token brand mark. Tokens custodied on more than one
   network (USDT on ERC-20 and TRC-20) also get a small chain badge, so the two
   rows are distinguishable at a glance. */
.coin {
  position: relative; width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy-700);
  font-family: var(--font-ui); font-weight: 700; font-size: .75rem; color: #fff; letter-spacing: -.02em;
}
.coin > svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.coin--btc, .coin--eth, .coin--usdt { background: transparent; }
.coin__chain {
  position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 2px var(--paper);
}
.coin__chain > svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.wallet__id { min-width: 0; }
.wallet__name { font-size: var(--fs-sm); font-weight: 600; color: var(--navy-900); line-height: 1.3; display: block; }
.wallet__net { font-size: var(--fs-xs); color: var(--text-muted); display: inline-flex; align-items: center; gap: .375rem; }
.wallet__change { margin-left: auto; text-align: right; font-size: var(--fs-xs); font-family: var(--font-mono); }
.wallet__change b { display: block; font-size: var(--fs-sm); color: var(--navy-900); font-weight: 500; }
.up { color: var(--verified-600); }
.down { color: var(--alert-600); }

.wallet__amount { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.wallet__amount b {
  font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--navy-900); line-height: 1.05; font-variant-numeric: tabular-nums; word-break: break-all;
}
.wallet__amount span { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.wallet__fiat { font-size: var(--fs-sm); color: var(--steel-600); font-variant-numeric: tabular-nums; }
.wallet__pending {
  display: flex; align-items: center; gap: .5rem; font-size: var(--fs-xs); color: var(--pending-600);
  background: var(--pending-050); border: 1px solid #F0E3BF; border-radius: var(--r-sm);
  padding: .4375rem .625rem; font-variant-numeric: tabular-nums;
}
.wallet__pending svg { width: 14px; height: 14px; flex: none; }

.addr {
  margin-top: auto; border-top: 1px solid var(--line); padding-top: var(--sp-4);
}
.addr__label { font-size: var(--fs-eyebrow); letter-spacing: .1em; text-transform: uppercase; color: var(--slate-400); font-weight: 600; display: block; margin-bottom: .375rem; }
.addr__row { display: flex; align-items: center; gap: .5rem; background: var(--fog-100); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .625rem; }
.addr__value { font-family: var(--font-mono); font-size: .75rem; color: var(--navy-700); overflow-wrap: anywhere; line-height: 1.5; flex: 1 1 auto; min-width: 0; }
.copy {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--steel-600);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.copy:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.copy svg { width: 14px; height: 14px; }
.copy.is-done { background: var(--verified-050); border-color: #C6E3D7; color: var(--verified-600); }
.addr__note { font-size: var(--fs-xs); color: var(--text-muted); margin: .5rem 0 0; }

/* ---------- 8. Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: var(--sp-4); }

@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); }
.tile__label { font-size: var(--fs-eyebrow); letter-spacing: .1em; text-transform: uppercase; color: var(--slate-400); font-weight: 600; display: block; margin-bottom: .5rem; }
.tile__value { font-family: var(--font-display); font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; color: var(--navy-900); line-height: 1.1; display: block; font-variant-numeric: tabular-nums; }
.tile__hint { font-size: var(--fs-xs); color: var(--text-muted); margin: .375rem 0 0; }
.tile--accent { border-left: 3px solid var(--brass-500); }
.tile--ok { border-left: 3px solid var(--verified-600); }
.tile--warn { border-left: 3px solid var(--pending-600); }

/* ---------- 9. Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .375rem; font-size: var(--fs-eyebrow);
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .3125rem .5625rem;
  border-radius: var(--r-pill); border: 1px solid transparent; line-height: 1.3; white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge--ok { background: var(--verified-050); color: var(--verified-600); border-color: #C6E3D7; }
.badge--pending { background: var(--pending-050); color: var(--pending-600); border-color: #F0E3BF; }
.badge--alert { background: var(--alert-050); color: var(--alert-600); border-color: #F0DAD4; }
.badge--neutral { background: var(--fog-100); color: var(--steel-600); border-color: var(--line); }
.badge--navy { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 10. Callouts ---------- */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--brass-500);
  background: var(--fog-100); border-radius: var(--r-sm); padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm); color: var(--steel-600);
}
.callout h4 { margin-bottom: .25rem; }
.callout p:last-child { margin-bottom: 0; }
.callout--ok { border-left-color: var(--verified-600); background: var(--verified-050); border-color: #D5EAE1; color: #204538; }
.callout--warn { border-left-color: var(--pending-600); background: var(--pending-050); border-color: #F0E3BF; color: #6A5316; }
.callout--alert { border-left-color: var(--alert-600); background: var(--alert-050); border-color: #F0DAD4; color: #8A3323; }
.callout--info { border-left-color: var(--navy-600); background: #F4F8FC; border-color: #D8E5F0; color: var(--steel-600); }
.callout__row { display: flex; gap: var(--sp-3); align-items: flex-start; }
.callout__row svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }

/* ---------- 11. Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-5); }
.form-grid--1 { grid-template-columns: 1fr; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .form-grid, .form-grid--3 { grid-template-columns: 1fr; } }
.field--full { grid-column: 1 / -1; }

.field { display: block; }
.field > label, .label {
  display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--navy-900);
  margin-bottom: .375rem; letter-spacing: .01em;
}
.input, .select, .textarea {
  width: 100%; font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--text);
  background: var(--paper); border: 1px solid var(--mist-200); border-radius: var(--r-sm);
  padding: .6875rem .8125rem; line-height: 1.5; transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none; appearance: none;
}
.input:hover, .select:hover, .textarea:hover { border-color: #C6D3E1; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brass-500); box-shadow: 0 0 0 3px rgba(138,40,54,.16);
}
.input::placeholder, .textarea::placeholder { color: var(--slate-400); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--fog-100); color: var(--text-muted); cursor: not-allowed; }
.input.mono, .input[inputmode="decimal"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235D7794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px; padding-right: 2.25rem;
}
.help { font-size: var(--fs-xs); color: var(--text-muted); margin: .375rem 0 0; line-height: 1.55; }
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea { border-color: var(--alert-600); }
.field.is-invalid .help { color: var(--alert-600); }

.input-group { display: flex; gap: .5rem; align-items: stretch; }
.input-group .input { flex: 1 1 auto; min-width: 0; }

.check { display: flex; gap: .625rem; align-items: flex-start; font-size: var(--fs-sm); color: var(--steel-600); cursor: pointer; }
.check input { margin-top: .3rem; accent-color: var(--brass-500); width: 16px; height: 16px; flex: none; }

.form-error {
  display: flex; gap: .5rem; align-items: flex-start; font-size: var(--fs-sm); color: var(--alert-600);
  background: var(--alert-050); border: 1px solid #F0DAD4; border-left: 3px solid var(--alert-600);
  border-radius: var(--r-sm); padding: .75rem .875rem; margin-bottom: var(--sp-4);
}
.form-error svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.form-ok {
  display: flex; gap: .5rem; align-items: flex-start; font-size: var(--fs-sm); color: var(--verified-600);
  background: var(--verified-050); border: 1px solid #D5EAE1; border-left: 3px solid var(--verified-600);
  border-radius: var(--r-sm); padding: .75rem .875rem; margin-bottom: var(--sp-4);
}

/* ---------- 12. Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 640px; }
table.data th, table.data td { padding: .875rem var(--sp-5); text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--steel-600); }
table.data thead th {
  background: var(--fog-100); font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--steel-600); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: #FAFCFE; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); white-space: nowrap; }
table.data td b { color: var(--navy-900); font-weight: 600; }
.cell-stack b { display: block; line-height: 1.35; }
.cell-stack span { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); }
.row-actions { display: flex; gap: .375rem; justify-content: flex-end; }

.empty { padding: var(--sp-8) var(--sp-5); text-align: center; color: var(--text-muted); }
.empty svg { width: 34px; height: 34px; margin: 0 auto var(--sp-3); color: var(--slate-400); }
.empty p { margin: 0; font-size: var(--fs-sm); }

/* ---------- 13. Activity list ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: var(--sp-4); padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed__icon { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--fog-100); border: 1px solid var(--line); }
.feed__icon svg { width: 15px; height: 15px; color: var(--steel-600); }
.feed__icon--in { background: var(--verified-050); border-color: #C6E3D7; }
.feed__icon--in svg { color: var(--verified-600); }
.feed__icon--out { background: var(--alert-050); border-color: #F0DAD4; }
.feed__icon--out svg { color: var(--alert-600); }
.feed__icon--pending { background: var(--pending-050); border-color: #F0E3BF; }
.feed__icon--pending svg { color: var(--pending-600); }
.feed__body { flex: 1 1 auto; min-width: 0; }
.feed__title { font-size: var(--fs-sm); color: var(--navy-900); font-weight: 600; margin: 0 0 .125rem; }
.feed__meta { font-size: var(--fs-xs); color: var(--text-muted); margin: 0; }
.feed__amount { text-align: right; font-family: var(--font-mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed__amount b { display: block; color: var(--navy-900); font-weight: 500; }
.feed__amount span { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- 14. Tabs ---------- */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-5); overflow-x: auto; }
.tabs button {
  padding: .75rem 1rem; background: none; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; margin-bottom: -1px;
}
.tabs button:hover { color: var(--navy-900); }
.tabs button[aria-selected="true"] { color: var(--navy-900); font-weight: 600; border-bottom-color: var(--brass-500); }

/* ---------- 15. Upload ---------- */
.upload {
  border: 1.5px dashed var(--mist-200); border-radius: var(--r-md); background: var(--fog-100);
  padding: var(--sp-6) var(--sp-5); text-align: center; transition: border-color var(--t-fast), background var(--t-fast);
  cursor: pointer; display: block;
}
.upload:hover, .upload.is-drag { border-color: var(--brass-500); background: var(--brass-050); }
.upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload__icon { width: 40px; height: 40px; margin: 0 auto var(--sp-3); border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; }
.upload__icon svg { width: 18px; height: 18px; color: var(--brass-600); }
.upload b { display: block; font-size: var(--fs-sm); color: var(--navy-900); margin-bottom: .25rem; }
.upload span { font-size: var(--fs-xs); color: var(--text-muted); }
.upload.is-disabled { cursor: not-allowed; opacity: .6; }

.doc {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper);
}
.doc__icon { width: 38px; height: 38px; flex: none; border-radius: var(--r-sm); background: var(--verified-050); border: 1px solid #C6E3D7; display: grid; place-items: center; }
.doc__icon svg { width: 17px; height: 17px; color: var(--verified-600); }
.doc__body { flex: 1 1 auto; min-width: 0; }
.doc__body b { display: block; font-size: var(--fs-sm); color: var(--navy-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc__body span { font-size: var(--fs-xs); color: var(--text-muted); }
.doc__actions { display: flex; gap: .375rem; flex: none; }

.progress { height: 4px; background: var(--mist-100); border-radius: 2px; overflow: hidden; margin-top: var(--sp-3); }
.progress i { display: block; height: 100%; background: var(--brass-500); width: 0; transition: width 200ms linear; }

/* ---------- 16. Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.steps li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--steel-600); }
.steps .n {
  width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--navy-900); color: #fff;
  font-size: .6875rem; font-weight: 600; display: grid; place-items: center; margin-top: 3px; font-family: var(--font-ui);
}
.steps .n--done { background: var(--verified-600); }
.steps .n--todo { background: var(--mist-200); color: var(--steel-600); }

/* ---------- 17. Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,36,29,.55); backdrop-filter: blur(3px);
  z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: var(--sp-6) var(--sp-4); overflow-y: auto;
}
.modal {
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 660px; margin: auto; animation: modalIn 200ms cubic-bezier(.2,.8,.2,1);
}
.modal--wide { max-width: 900px; }
.modal--narrow { max-width: 460px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-size: var(--fs-h4); font-family: var(--font-ui); font-weight: 600; }
.modal__head p { margin: .25rem 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
.modal__close {
  margin-left: auto; width: 34px; height: 34px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--paper); cursor: pointer; display: grid; place-items: center; color: var(--steel-600);
}
.modal__close:hover { background: var(--fog-100); color: var(--navy-900); }
.modal__close svg { width: 16px; height: 16px; }
.modal__body { padding: var(--sp-6); }
.modal__foot { padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); background: var(--fog-100); display: flex; gap: var(--sp-3); justify-content: flex-end; flex-wrap: wrap; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal__foot .grow { text-align: left; }

/* ---------- 18. Toasts ---------- */
.toasts { position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: 300; display: flex; flex-direction: column; gap: var(--sp-3); max-width: 380px; }
@media (max-width: 520px) { .toasts { left: var(--sp-4); right: var(--sp-4); max-width: none; } }
.toast {
  display: flex; gap: .625rem; align-items: flex-start; background: var(--navy-900); color: #fff;
  padding: .875rem 1rem; border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: var(--fs-sm);
  animation: toastIn 240ms cubic-bezier(.2,.8,.2,1); border-left: 3px solid var(--brass-500);
}
.toast.is-out { animation: toastOut 200ms ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.toast--ok { border-left-color: #4FD1A0; }
.toast--ok svg { color: #4FD1A0; }
.toast--error { border-left-color: #E97B63; }
.toast--error svg { color: #E97B63; }

/* ---------- 19. Auth pages ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
}
@media (max-width: 980px) { .auth { grid-template-columns: 1fr; } }
.auth__aside {
  background: var(--navy-900); color: var(--text-invert); position: relative; overflow: hidden;
  padding: var(--sp-8) var(--sp-8) var(--sp-7); display: flex; flex-direction: column; justify-content: space-between;
}
@media (max-width: 980px) { .auth__aside { padding: var(--sp-6) var(--sp-5); min-height: auto; } }
.auth__aside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(800px 420px at 10% 0%, rgba(138,40,54,.15), transparent 60%),
    radial-gradient(700px 460px at 90% 20%, rgba(32,69,56,.8), transparent 62%);
}
.auth__aside::after {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 78%);
}
.auth__aside > * { position: relative; }
.auth__aside .brand__name { color: #fff; }
.auth__aside .brand__tag { color: #7E97B2; }
.auth__pitch { max-width: 46ch; margin: var(--sp-8) 0; }
@media (max-width: 980px) { .auth__pitch { margin: var(--sp-6) 0; } }
.auth__pitch h1 { color: #fff; font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.auth__pitch p { color: #C7D8E9; font-size: var(--fs-sm); }
.auth__points { list-style: none; margin: var(--sp-5) 0 0; padding: 0; display: grid; gap: var(--sp-3); }
.auth__points li { display: flex; gap: .75rem; align-items: flex-start; font-size: var(--fs-sm); color: #C7D8E9; }
.auth__points svg { width: 18px; height: 18px; color: var(--brass-400); flex: none; margin-top: 3px; }
.auth__legal { font-size: var(--fs-xs); color: #7E97B2; margin: 0; line-height: 1.6; }

.auth__panel { display: flex; align-items: center; justify-content: center; padding: var(--sp-8) var(--sp-5); background: var(--paper); }
.auth__form { width: 100%; max-width: 420px; }
.auth__form h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-2); }
.auth__form > p { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-6); }
.auth__top { display: flex; justify-content: flex-end; margin-bottom: var(--sp-6); }
.auth__foot { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-muted); }
.auth__foot p { margin-bottom: .5rem; }
.auth__foot p:last-child { margin-bottom: 0; }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: .375rem; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0;
  cursor: pointer; color: var(--slate-400); border-radius: var(--r-sm);
}
.pw-toggle:hover { color: var(--navy-900); background: var(--fog-100); }
.pw-toggle svg { width: 17px; height: 17px; }
.pw-wrap .input { padding-right: 2.75rem; }

/* Admin login gets the inverted treatment so the two consoles never blur together. */
.auth--admin .auth__panel { background: var(--navy-850); }
.auth--admin .auth__form h2, .auth--admin .auth__form .label { color: #fff; }
.auth--admin .auth__form > p { color: var(--text-invert-muted); }
.auth--admin .input { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.16); color: #fff; }
.auth--admin .input::placeholder { color: #7E97B2; }
.auth--admin .input:hover { border-color: rgba(255,255,255,.3); }
.auth--admin .input:focus { border-color: var(--brass-500); box-shadow: 0 0 0 3px rgba(138,40,54,.2); }
.auth--admin .auth__foot { border-color: rgba(255,255,255,.12); color: #7E97B2; }
.auth--admin .pw-toggle { color: #7E97B2; }
.auth--admin .pw-toggle:hover { color: #fff; background: rgba(255,255,255,.08); }
.auth--admin .lang { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.16); }
.auth--admin .lang button { color: #A7BDD4; }
.auth--admin .lang button:hover { background: rgba(255,255,255,.08); color: #fff; }
.auth--admin .lang button[aria-pressed="true"] { background: var(--brass-500); color: #FFFFFF; }

/* Bare sign-in: no aside, no chrome — the form alone, centred in the viewport. */
.auth--bare { grid-template-columns: 1fr; }
.auth--bare .auth__panel { min-height: 100vh; }
.auth--bare .auth__form { max-width: 360px; }
/* Keep the surround dark so no light body shows through on overscroll. */
body:has(> .auth--bare.auth--admin) { background: var(--navy-850); }
@media (max-width: 980px) { .auth--bare .auth__panel { min-height: 100vh; } }

/* ---------- 20. Admin chrome ---------- */
.admin-bar { background: var(--navy-900); color: var(--text-invert-muted); font-size: var(--fs-xs); }
.admin-bar .wrap { display: flex; align-items: center; gap: var(--sp-4); min-height: 36px; justify-content: space-between; }
.admin-bar b { color: var(--brass-400); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: var(--fs-eyebrow); }
.admin-bar__right { display: flex; gap: var(--sp-4); align-items: center; }

.filters { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { min-width: 180px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--slate-400); pointer-events: none; }
.search .input { padding-left: 2.25rem; }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: .625rem var(--sp-4); font-size: var(--fs-sm); margin: 0; }
@media (max-width: 620px) { .kv { grid-template-columns: 1fr; gap: .125rem; } .kv dd { margin-bottom: .625rem; } }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--navy-900); overflow-wrap: anywhere; }

.balance-editor { display: grid; gap: var(--sp-3); }
.balance-editor__row {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--sp-3); align-items: end;
  padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--fog-100);
}
@media (max-width: 700px) { .balance-editor__row { grid-template-columns: 1fr; } }
.balance-editor__id { display: flex; align-items: center; gap: .625rem; }
.balance-editor__id .coin { width: 34px; height: 34px; font-size: .625rem; }
.balance-editor__id .coin__chain { width: 15px; height: 15px; right: -2px; bottom: -2px; }
.balance-editor__id b { display: block; font-size: var(--fs-sm); color: var(--navy-900); line-height: 1.3; }
.balance-editor__id span { display: block; font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- 21. Misc ---------- */
.divider-label { display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-6) 0; color: var(--slate-400); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.divider-label::before, .divider-label::after { content: ""; height: 1px; background: var(--line); flex: 1 1 auto; }

.skeleton { background: linear-gradient(90deg, var(--mist-100) 25%, var(--fog-100) 37%, var(--mist-100) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); color: transparent !important; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.app-footer { border-top: 1px solid var(--line); background: var(--paper); padding: var(--sp-5) 0; font-size: var(--fs-xs); color: var(--text-muted); }
.app-footer .wrap { display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.app-footer a { color: var(--steel-600); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 860px) {
  .app-nav { display: none; }
  .app-nav.is-mobile-open {
    display: flex; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column;
    align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md); padding: var(--sp-3) var(--sp-5) var(--sp-4); margin: 0; z-index: 60;
  }
  .app-nav.is-mobile-open a, .app-nav.is-mobile-open button { padding: .875rem .25rem; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
  .app-nav.is-mobile-open [aria-current="page"]::after, .app-nav.is-mobile-open .is-active::after { display: none; }
  .app-header__inner { position: relative; }
  .nav-toggle { display: inline-flex !important; }
  .profile__name { display: none; }
  .profile__btn { padding: .3125rem; }
}
.nav-toggle {
  display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; color: var(--navy-900);
}
.nav-toggle svg { width: 19px; height: 19px; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }

/* ---------- 22. Utility classes (kept out of style attributes so the
   Content-Security-Policy can stay strict: style-src 'self' only) ---------- */
.w-auto { width: auto; }
.push-right { margin-left: auto; }
.gap-2 { gap: var(--sp-2); }
.max-w-form { max-width: 460px; }
.offscreen { position: fixed; top: -1000px; left: 0; opacity: 0; pointer-events: none; }

/* Currency picker sitting on the dark vault panel */
.vault__picker { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.vault__picker .vault__label { margin: 0; }
.select--onDark {
  width: auto; padding-block: .35rem; color: #fff;
  background-color: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A7BDD4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.select--onDark:hover { border-color: rgba(255, 255, 255, .35); }
.select--onDark option { color: var(--text); background: var(--paper); }

/* Placeholder state for a KYC slot with nothing uploaded */
.doc__icon--empty { background: var(--fog-100); border-color: var(--line); }
.doc__icon--empty svg { color: var(--slate-400); }

/* Standalone centred page (404) */
.page-centred { display: grid; place-items: center; min-height: 100vh; }
.page-centred main { max-width: 520px; }
.page-centred .eyebrow { justify-content: center; }
.page-centred__mark { margin: 0 auto var(--sp-5); }

/* ---------- 23. Transaction ledger ---------- */
.vault__cell--held .vault__sub { color: var(--brass-400); }
.vault__note--fee { color: var(--brass-400); font-weight: 600; }
@media (max-width: 900px) { .vault__grid { grid-template-columns: 1fr; } }
@media (min-width: 901px) { .vault__grid:has(> :nth-child(4)) { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }

.wallet__pending--held {
  color: var(--alert-600); background: var(--alert-050); border-color: #F0DAD4;
}

.feed--tx li { align-items: flex-start; gap: var(--sp-4); }
.feed__icon--held { background: var(--alert-050); border-color: #F0DAD4; }
.feed__icon--held svg { color: var(--alert-600); }
.feed__title { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
.feed__amount .is-struck { text-decoration: line-through; color: var(--text-muted); }

.tx__hint { font-size: var(--fs-xs); color: var(--steel-600); margin: .375rem 0 0; line-height: 1.55; max-width: 68ch; }
.tx--rejected .feed__title > span:first-child { color: var(--text-muted); }
.tx__clearance { margin-top: var(--sp-4); }
.tx__clearance h4 { font-size: var(--fs-sm); margin-bottom: .25rem; }
.tx__fee { font-size: var(--fs-sm); margin-bottom: .5rem; }

.countdown {
  display: flex; align-items: baseline; gap: .625rem; flex-wrap: wrap;
  margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid rgba(16,36,29, .1);
}
.countdown__label { font-size: var(--fs-eyebrow); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; opacity: .8; }
.countdown__value {
  font-size: 1.125rem; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--navy-900); letter-spacing: -.01em;
}
.countdown__value--inline { font-size: var(--fs-xs); font-weight: 500; }
.countdown__value.is-urgent { color: var(--alert-600); }
.countdown__value.is-expired { color: var(--alert-600); font-weight: 600; }
.countdown__until { font-size: var(--fs-xs); opacity: .75; }

/* Admin ledger table */
.tx-table td { vertical-align: top; }
.tx-row__meta { font-size: var(--fs-xs); color: var(--text-muted); display: block; }
.tx-actions { display: flex; gap: .375rem; flex-wrap: wrap; justify-content: flex-end; }
.tx-form { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); background: var(--fog-100); }
.tx-form h4 { margin-bottom: var(--sp-4); }
.duration { display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--sp-2); }

.tile--alert { border-left: 3px solid var(--alert-600); }
table.data td.is-held { color: var(--alert-600); font-weight: 500; }

/* ---------- 24. Impersonation banner ---------- */
.impersonation {
  position: sticky; top: 0; z-index: 120;
  background: linear-gradient(90deg, var(--alert-600), #C4553E);
  color: #fff; box-shadow: 0 2px 12px rgba(180, 67, 46, .3);
  border-bottom: 1px solid rgba(0, 0, 0, .16);
}
.impersonation__inner {
  display: flex; align-items: center; gap: var(--sp-3);
  padding-block: .625rem; flex-wrap: wrap;
}
.impersonation__icon { display: grid; place-items: center; flex: none; opacity: .9; }
.impersonation b { display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; color: #fff; }
.impersonation span { display: block; font-size: var(--fs-xs); opacity: .85; font-family: var(--font-mono); }
.impersonation .btn--navy { background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .25); }
.impersonation .btn--navy:hover:not(:disabled) { background: rgba(0, 0, 0, .45); }
/* The app header is sticky too; stack it below the banner rather than over it. */
.has-impersonation .app-header { top: 0; }

/* ---------- 25. Bare sign-in, dressed ---------- */
.auth--bare .auth__panel { position: relative; overflow: hidden; }
.auth--bare .auth__panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(760px 420px at 50% -8%, rgba(193, 150, 60, .20), transparent 62%),
    radial-gradient(620px 460px at 12% 108%, rgba(30, 65, 102, .85), transparent 60%),
    radial-gradient(520px 380px at 92% 96%, rgba(193, 150, 60, .09), transparent 62%);
}
.auth--bare .auth__panel::after {
  content: ""; position: absolute; inset: 0; opacity: .55; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 40%, #000 18%, transparent 76%);
  mask-image: radial-gradient(ellipse 80% 65% at 50% 40%, #000 18%, transparent 76%);
}
.auth--bare .auth__form { position: relative; z-index: 1; }

/* The form sits on a raised card, capped with a brass seam. */
.auth--bare .auth__form {
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-lg);
  padding: var(--sp-7) var(--sp-6) var(--sp-6);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .75), 0 2px 10px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}
.auth--bare .auth__form::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-500) 22%, var(--brass-400) 50%, var(--brass-500) 78%, transparent);
}
@media (max-width: 480px) {
  .auth--bare .auth__form { padding: var(--sp-6) var(--sp-5) var(--sp-5); border-radius: var(--r-md); }
}

/* Decorative seal above the fields — no wordmark, no copy. */
.auth--bare .auth__seal {
  width: 46px; height: 46px; margin: 0 auto var(--sp-6); border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(193, 150, 60, .30), rgba(193, 150, 60, .10));
  border: 1px solid rgba(212, 174, 94, .45);
  box-shadow: 0 0 0 6px rgba(193, 150, 60, .06), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.auth--bare .auth__seal svg { width: 20px; height: 20px; color: var(--brass-400); }

.auth--bare .label { color: #C7D8E9; letter-spacing: .04em; text-transform: uppercase; font-size: var(--fs-eyebrow); }
.auth--bare .input {
  background: rgba(8, 20, 33, .55); border-color: rgba(255, 255, 255, .14);
  padding-block: .8125rem; border-radius: var(--r-md);
}
.auth--bare .input:hover { border-color: rgba(255, 255, 255, .28); }
.auth--bare .input:focus {
  background: rgba(8, 20, 33, .78); border-color: var(--brass-500);
  box-shadow: 0 0 0 3px rgba(193, 150, 60, .22);
}
.auth--bare .btn--primary { padding-block: .9375rem; letter-spacing: .01em; }
.auth--bare .form-error { background: rgba(180, 67, 46, .18); border-color: rgba(233, 123, 99, .4); color: #F3C3B7; }

/* ---------- 26. Narrow-screen header ---------- */
/* On a phone the brand, language switch, avatar and menu button all compete
   for one row. Give the brand less to say rather than letting it wrap. */
@media (max-width: 620px) {
  .app-header__inner { min-height: 62px; gap: var(--sp-2); }
  .brand__mark { width: 30px; height: 30px; }
  .brand__name { font-size: 1.0625rem; white-space: nowrap; }
  .brand__tag { display: none; }
  .app-header__actions { gap: var(--sp-2); }
  .lang button { padding: .35rem .5rem; }
  .avatar { width: 28px; height: 28px; font-size: .6875rem; }
  .profile__chev { display: none; }
}
@media (max-width: 380px) {
  .lang { display: none; }
}
