/* Custody console design system. Faces first, then tokens, then the shell, then components.
   The faces are served from this origin (fonts/, pinned like every other file; licence in
   fonts/OFL.txt), so every operating system shows the same type and the CSP stays 'self'. */

@font-face {
  font-family: "Console Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Console Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Console Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* surfaces */
  --bg: #f4f5f7;
  --card: #ffffff;
  --sunken: #f8f9fb;
  --raised: #ffffff;
  /* text */
  --text: #0e1726;
  --text-2: #3a4556;
  --muted: #5f6b7c;
  --faint: #8a94a3;
  /* lines */
  --line: #e2e5ea;
  --line-strong: #cfd4dc;
  /* brand */
  --accent: #1f4fd1;
  --accent-hover: #1a43b3;
  --accent-soft: #edf2fe;
  --accent-line: #c9d6f8;
  --on-accent: #ffffff;
  /* status */
  --ok: #0f7a4b;
  --ok-soft: #e8f5ee;
  --ok-line: #bfe3cf;
  --warn: #8f5600;
  --warn-soft: #fdf4e3;
  --warn-line: #f0d6a6;
  --bad: #b42318;
  --bad-soft: #fdeeec;
  --bad-line: #f4c7c1;
  --info: #3b5bab;
  /* navigation */
  --side: #0b1220;
  --side-2: #111a2c;
  --side-text: #a9b3c4;
  --side-strong: #f2f5fa;
  --side-line: rgba(255, 255, 255, .08);
  --side-active: rgba(255, 255, 255, .07);
  /* networks */
  --testnet: #e0a43a;
  --mainnet: #c0271d;
  /* shape */
  --radius-s: 4px;
  --radius: 6px;
  --radius-l: 10px;
  --shadow-1: 0 1px 2px rgba(14, 23, 38, .05);
  --shadow-2: 0 4px 12px rgba(14, 23, 38, .08), 0 1px 3px rgba(14, 23, 38, .06);
  --shadow-3: 0 24px 48px rgba(14, 23, 38, .18), 0 4px 12px rgba(14, 23, 38, .08);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  /* type */
  --font: "Console Sans", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Console Mono", "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --side-w: 256px;
  --top-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --card: #121826;
    --sunken: #0f1420;
    --raised: #172033;
    --text: #e7ebf2;
    --text-2: #c3cad6;
    --muted: #8f9aac;
    --faint: #6b7587;
    --line: #232c3d;
    --line-strong: #2f3a4f;
    --accent: #7c9cff;
    --accent-hover: #98b1ff;
    --accent-soft: #18233d;
    --accent-line: #2b3c66;
    --on-accent: #0b1220;
    --ok: #4cc58a;
    --ok-soft: #10261c;
    --ok-line: #1d4a34;
    --warn: #e5b450;
    --warn-soft: #2a2110;
    --warn-line: #4f3d16;
    --bad: #ff8073;
    --bad-soft: #2d1513;
    --bad-line: #5a2621;
    --info: #9bb2f0;
    --side: #070b13;
    --side-2: #0c1220;
    --testnet: #d79a35;
    --mainnet: #e5483c;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 4px 12px rgba(0, 0, 0, .35);
    --shadow-3: 0 24px 48px rgba(0, 0, 0, .5);
  }
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; margin: 0 0 4px; }
h2 { font-size: 15px; line-height: 1.35; font-weight: 600; letter-spacing: -.005em; margin: 0 0 14px; }
h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
p { margin: 8px 0; }
strong { font-weight: 600; }
pre { white-space: pre-wrap; margin: 8px 0 0; padding: 10px 12px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius); }
details > summary { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: none; box-shadow: var(--focus); }
svg { display: block; }

/* ------------------------------------------------------------------ network ribbon */

.env-ribbon {
  position: sticky; top: 0; z-index: 40;
  height: 26px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: #241600; background: var(--testnet);
}
.env-ribbon .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.env-ribbon .sub { font-weight: 500; letter-spacing: .02em; text-transform: none; opacity: .9; }
.env-ribbon.mainnet { background: var(--mainnet); color: #fff; }
.env-ribbon.mainnet.locked { background: repeating-linear-gradient(135deg, var(--mainnet) 0 14px, color-mix(in srgb, var(--mainnet) 82%, #000) 14px 28px); }

/* ------------------------------------------------------------------ shell */

.app { display: flex; min-height: 100%; }
body:not(.auth) .app { background: linear-gradient(90deg, var(--side) 0 var(--side-w), transparent 0); }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; max-width: 1320px; padding: 28px 40px 56px; }

.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--side-line);
}
body.has-ribbon .sidebar { top: 26px; height: calc(100vh - 26px); }
.sidebar.hidden { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 16px; color: var(--side-strong); }
.brand-mark { width: 28px; height: 28px; color: #8fb0ff; flex: none; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: .01em; color: var(--side-strong); }
.brand-sub { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-text); opacity: .75; }

.tenant { margin: 0 12px 8px; padding: 12px; border: 1px solid var(--side-line); border-radius: var(--radius); background: var(--side-2); }
.tenant-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.tenant-name { color: var(--side-strong); font-weight: 600; margin: 2px 0 6px; overflow-wrap: anywhere; }
.tenant-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tenant-meta .pill, .tenant-meta .pill.neutral { border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: var(--side-strong); }
.tenant-meta .small { opacity: .8; }

.sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; padding: 4px 12px 12px; }
.sidebar nav .group { margin: 16px 8px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--side-text); opacity: .55; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--side-text); padding: 7px 10px; border-radius: var(--radius);
  font-size: 13.5px; position: relative;
}
.sidebar nav a svg { width: 16px; height: 16px; flex: none; opacity: .75; }
.sidebar nav a:hover { background: var(--side-active); color: var(--side-strong); text-decoration: none; }
.sidebar nav a.active { background: var(--side-active); color: var(--side-strong); font-weight: 600; }
.sidebar nav a.active svg { opacity: 1; color: #8fb0ff; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: #8fb0ff; }
.sidebar-foot { display: flex; gap: 8px; align-items: flex-start; margin: 0 12px 14px; padding: 12px 8px 0; border-top: 1px solid var(--side-line); font-size: 11.5px; line-height: 1.45; opacity: .7; }
.sidebar-foot svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h); display: flex; align-items: center; gap: 16px;
  padding: 0 24px 0 40px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
body.has-ribbon .topbar { top: 26px; }
.topbar.hidden { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.crumb-group { color: var(--muted); }
.crumb-group:not(:empty)::after { content: "/"; margin-left: 8px; color: var(--line-strong); }
.crumb-page { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--text); }
.user-chip:hover { background: var(--sunken); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.user-text { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; }
.user-roles { font-size: 11.5px; color: var(--muted); }
.menu-button { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(5, 10, 20, .45); z-index: 44; }

/* network switch */
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; }
.segmented button { border: 0; background: transparent; padding: 4px 12px; height: 28px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; text-transform: capitalize; }
.segmented button:hover { color: var(--text); border: 0; }
.segmented button .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--testnet); }
.segmented button[data-network="mainnet"] .dot { background: var(--mainnet); }
.segmented button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.segmented button .lock { width: 12px; height: 12px; opacity: .7; }

/* ------------------------------------------------------------------ page layout */

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.page-head p.muted { max-width: 82ch; margin: 6px 0 0; color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow .sep { color: var(--line-strong); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px 22px; margin: 0 0 16px; box-shadow: var(--shadow-1); }
.card > h2:first-child, .card > form > h2:first-child { padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.card > .table-wrap:last-child { margin-bottom: -8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; padding: 0; border: 0; }
.card-head a { font-size: 12.5px; font-weight: 500; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid2 > .card { margin: 0 0 16px; }

/* KPI tiles */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-link { color: inherit; display: block; border-radius: var(--radius-l); }
.stat-link:hover { text-decoration: none; }
.stat-link:hover .stat { border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.stat { height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 6px; }
.stat .label { order: -1; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.stat .value { font-size: 28px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.stat .meta { color: var(--muted); font-size: 12.5px; }
.stat .meta.warn { color: var(--warn); }
.stat.attention { border-color: var(--warn-line); background: linear-gradient(var(--warn-soft), var(--card) 70%); }

/* ------------------------------------------------------------------ forms */

label { display: block; margin-bottom: 14px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px;
  height: 36px; padding: 0 11px;
  font: inherit; font-size: 14px; font-weight: 400; color: var(--text);
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: inset 0 1px 1px rgba(14, 23, 38, .03);
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 88px; padding: 9px 11px; line-height: 1.5; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 50%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--sunken); color: var(--muted); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 16px; height: 16px; margin: 0 8px 0 0; padding: 0; vertical-align: middle; accent-color: var(--accent); box-shadow: none; }
input[type=file] { height: auto; padding: 7px; }
input.otp { font-family: var(--mono); font-size: 20px; letter-spacing: .35em; text-align: center; height: 46px; }
label.check { display: flex; align-items: center; gap: 2px; color: var(--text); font-size: 14px; font-weight: 400; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
form.row { align-items: flex-end; }
form.row label { margin-bottom: 0; flex: 1 1 180px; }
form.row > .bad:empty { display: none; }
p.bad:empty { display: none; }

/* ------------------------------------------------------------------ buttons */

button, .button {
  font: inherit; font-size: 13.5px; font-weight: 500; line-height: 1;
  height: 36px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: background .12s, border-color .12s, color .12s;
}
button:hover, .button:hover { background: var(--sunken); border-color: color-mix(in srgb, var(--line-strong) 40%, var(--muted)); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger, .button.danger { color: var(--bad); border-color: var(--bad-line); }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
button.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover { background: var(--sunken); color: var(--text); }
button.small, .button.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
button.block { width: 100%; }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; background: var(--card); }
button.primary:disabled { background: var(--accent); }
.icon-button { width: 36px; padding: 0; }
.icon-button svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ text */

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; letter-spacing: -.01em; }
.hidden { display: none !important; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.kv { font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { color: var(--muted); padding: 22px 0; margin: 0; text-align: center; font-size: 13.5px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--sunken); }
.card > .empty:last-child { margin-bottom: 2px; }
.divider-text { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; border-top: 0; border-bottom: 1px solid var(--line); padding-top: 4px; padding-bottom: 8px; white-space: nowrap; }
thead + tbody tr:first-child td { border-top: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 3.5%, transparent); }
td, dd, .stat .value, .kv { font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; white-space: nowrap; }
.day-strip { display: inline-flex; gap: 2px; align-items: center; padding: 2px 0; text-decoration: none; }
.day-strip .day { width: 6px; height: 16px; border-radius: 2px; background: var(--line); }
.day-strip .day.matched { background: var(--ok); }
.day-strip .day.difference { background: var(--bad); }
.day-strip .day.failed { background: var(--warn); }
td .mono { font-size: 12px; color: var(--text-2); }
td > .pill:only-child { margin-top: -1px; }

/* ------------------------------------------------------------------ status */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: var(--radius-s); border: 1px solid var(--accent-line);
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent);
}
.pill::first-letter { text-transform: uppercase; }
.pill.ok, .pill.warn, .pill.bad, .pill.neutral { padding-left: 7px; }
.pill.ok::before, .pill.warn::before, .pill.bad::before, .pill.neutral::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.pill.neutral { background: var(--sunken); color: var(--text-2); border-color: var(--line); }
.pill.neutral::before { background: var(--faint); }
.pill.small { height: 20px; font-size: 11px; }
.tenant-meta .pill.neutral::before { display: none; }
.pill[class*="tier-"] { text-transform: uppercase; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; height: 20px; padding: 0 7px; }
.pill.tier-hot { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.pill.tier-warm { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.tier-cold { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
h2 .pill { vertical-align: 2px; margin-left: 2px; }

/* callouts */
.callout { display: block; position: relative; border: 1px solid var(--accent-line); border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text-2); padding: 11px 14px; border-radius: var(--radius); margin: 0 0 16px; font-size: 13.5px; }
.callout strong { color: var(--text); }
.callout.warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-soft); }
.callout.bad { border-color: var(--bad-line); border-left-color: var(--bad); background: var(--bad-soft); }
/* The ribbon already says testnet; the in-page banner stays only for mainnet. */
.callout.network:not(.mainnet) { display: none; }
.callout.network { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 12.5px; background: var(--card); border-color: var(--line); border-left-color: var(--testnet); color: var(--muted); }
.callout.network strong { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--warn); }
.callout.network.mainnet { border-color: var(--bad-line); border-left-color: var(--mainnet); background: var(--bad-soft); color: var(--text-2); }
.callout.network.mainnet strong { color: var(--mainnet); }

/* ------------------------------------------------------------------ navigation within pages */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 10px 14px; color: var(--muted); font-size: 13.5px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* ------------------------------------------------------------------ lists */

dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; font-size: 13.5px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; color: var(--text); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 11px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 2px; }
.list li > a { font-weight: 500; }
.roles { display: flex; flex-wrap: wrap; gap: 4px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: var(--mono); font-size: 13px; padding: 12px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius); }
.qr { background: #fff; padding: 10px; border-radius: var(--radius); display: inline-block; border: 1px solid var(--line); }

/* ------------------------------------------------------------------ overlays */

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--raised); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 11px 16px; box-shadow: var(--shadow-2); max-width: 400px; font-size: 13.5px; animation: toast-in .18s ease-out; }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

.dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: var(--card); color: var(--text); max-width: 460px; width: calc(100vw - 32px); box-shadow: var(--shadow-3); }
.dialog::backdrop { background: rgba(5, 10, 20, .5); backdrop-filter: blur(2px); }
.dialog h2 { font-size: 17px; margin-bottom: 6px; }
.dialog .row:last-child { margin-top: 20px; }
.dialog-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.dialog-icon svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ sign-in */

body.auth { background: var(--card); }
body.auth .workspace { flex-direction: row; }
body.auth .main { max-width: none; padding: 0; display: flex; min-height: 100vh; }
.auth-layout { display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; width: 100%; min-height: 100vh; }
.auth-aside { background: var(--side); color: var(--side-text); padding: 40px 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; inset: auto -20% -30% auto; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(closest-side, rgba(95, 135, 255, .22), transparent); pointer-events: none; }
.auth-aside .brand { padding: 0; }
.auth-aside h1 { color: var(--side-strong); font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; margin: auto 0 14px; max-width: 16ch; }
.auth-aside .lead { font-size: 15px; max-width: 44ch; margin: 0 0 32px; }
.assurances { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 14px; max-width: 46ch; }
.assurances li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; font-size: 13.5px; }
.assurances li svg { width: 18px; height: 18px; color: #8fb0ff; margin-top: 2px; }
.assurances strong { color: var(--side-strong); display: block; font-weight: 600; }
.auth-aside .legal { margin-top: 40px; font-size: 11.5px; opacity: .6; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--card); }
.auth-page { width: 100%; max-width: 400px; }
.auth-page .card { border: 0; box-shadow: none; padding: 0; background: transparent; }
.auth-page .card > h2:first-child { font-size: 22px; font-weight: 650; letter-spacing: -.015em; border: 0; padding: 0; margin: 0 0 6px; }
.auth-page .card > h2:first-child + * { margin-top: 0; }
.auth-page form button.primary { min-width: 120px; }
.auth-page .brand-name { display: none; }
.auth-page .foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .main { padding: 24px 24px 48px; }
  .topbar { padding: 0 16px 0 24px; }
  .user-text { display: none; }
}
@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .menu-button { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  body:not(.auth) .app { background: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; z-index: 45; transform: translateX(-100%); transition: transform .2s ease; }
  body.has-ribbon .sidebar { top: 0; height: 100vh; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-3); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-aside { padding: 28px 24px; }
  .auth-aside h1, .auth-aside .lead, .assurances, .auth-aside .legal { display: none; }
}
@media (max-width: 640px) {
  .main { padding: 18px 16px 40px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  #logout { display: none; }
  .crumb-group { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 24px; }
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ identifiers */

.addr {
  display: inline-flex; align-items: center; gap: 6px;
  height: auto; padding: 2px 6px; margin: -2px -6px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 400; letter-spacing: -.01em;
  color: var(--text-2); background: transparent; border: 0; border-radius: var(--radius-s); box-shadow: none;
}
.addr:hover { background: var(--sunken); border: 0; color: var(--text); }
.addr svg { width: 13px; height: 13px; opacity: 0; transition: opacity .12s; }
.addr:hover svg, .addr:focus-visible svg { opacity: .7; }
.addr svg:last-child, .addr.copied svg:nth-of-type(1) { display: none; }
.addr.copied svg:last-child { display: block; opacity: 1; color: var(--ok); }
td .addr { font-size: 12px; }
.full-value { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: flex-start; }
.full-value span { padding-top: 6px; }
.full-value .explorer { white-space: nowrap; padding-top: 6px; }

/* ------------------------------------------------------------------ facts strip */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); overflow: hidden; }
.fact { padding: 12px 16px; border-left: 1px solid var(--line); margin-left: -1px; }
.fact-label { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fact-value { font-size: 16px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.fact-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card > .facts { margin: 4px 0 4px; }
.vault-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.vault-head h2 { margin: 0 0 2px; padding: 0; border: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vault-head h2 a { color: var(--text); }
.vault-head p { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.back svg { width: 14px; height: 14px; }
.back:hover { color: var(--text); text-decoration: none; }
h1 .pill { vertical-align: 5px; margin-left: 6px; }
.figure { font-size: 30px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figure .unit { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 6px; }

/* ------------------------------------------------------------------ lifecycle timeline */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 2px; width: 2px; background: var(--line); border-radius: 1px; }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--ok-line); }
.timeline .marker { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); background: var(--card); color: var(--faint); font-size: 11px; font-weight: 650; }
.timeline .marker svg { width: 14px; height: 14px; }
.timeline .step-title { font-weight: 600; color: var(--text); line-height: 28px; }
.timeline .step-text { color: var(--muted); font-size: 12.5px; margin-top: -2px; }
.timeline li.todo .step-title { color: var(--muted); font-weight: 500; }
.timeline li.done .marker { border-color: var(--ok); background: var(--ok); color: #fff; }
.timeline li.current .marker { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline li.current .step-title::after { content: "in progress"; margin-left: 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.timeline li.stop .marker { border-color: var(--bad); background: var(--bad); color: #fff; }
.timeline li.stop .step-title { color: var(--bad); }
.timeline li.unknown .marker { border-style: dashed; }
.row-link { font-weight: 500; }
.timeline .step-time { margin-left: 10px; font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline li.stop .step-text { color: var(--text-2); }

/* ------------------------------------------------------------------ lists */

.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 0 0 14px; }
.filters label { margin: 0; flex: 1 1 140px; min-width: 120px; }
.filters label.wide { flex: 1 1 100%; max-width: none; }
.card:has(> .filters) { scroll-margin-top: calc(var(--top-h) + 40px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { height: 28px; padding: 0 11px; border-radius: 999px; box-shadow: none; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: var(--card); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.chip.on .n { color: var(--accent); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager .row { margin: 0; }
.list-total { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.card-head .list-total { font-weight: 500; }
[aria-busy="true"] { opacity: .55; pointer-events: none; transition: opacity .15s; }
.empty.loading { border-style: solid; color: var(--faint); }
.title-count { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.row.center { justify-content: center; }
.empty .row.center { margin-top: 12px; }
.pager-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager-wrap .pager { flex: 1; margin: 0; padding: 0; border: 0; }
.pager-wrap select { width: auto; height: 30px; margin: 0; font-size: 12.5px; }
@media (max-width: 640px) {
  .filters label, .filters label.wide { flex: 1 1 100%; max-width: none; }
  .filters label:has(select), .filters label:has(input[type=date]) { flex-basis: calc(50% - 6px); }
}


/* ------------------------------------------------------------------ vaults */

.card-head .row.tight { margin-top: 0; }
.kv.warn { color: var(--warn); }
.wallet-list > .list-total { margin: 2px 0 10px; }
.outcomes { list-style: none; margin: 4px 0 16px; padding: 0; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.outcomes li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.outcomes li:first-child { border-top: 0; }
.outcomes li > :first-child + span, .outcomes li > strong { flex: 1; }
.outcomes li.ok svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.outcomes li.bad { background: var(--bad-soft); }
.outcomes li.bad strong { color: var(--bad); }
.outcomes li.neutral { color: var(--muted); }
.outcomes li .muted { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* Reconciliation items inside the Treasury card: a compact table in a cell. */
.recon-items { min-width: 440px; }
.recon-items .table-wrap { margin: 0; }
.recon-items th, .recon-items td { padding: 4px 8px; font-size: 12.5px; }
.recon-items .callout { margin: 8px 0 0; }
