/* Xalon: a quiet, precise wallet surface. Ink navy, cool paper, one teal accent. */
:root {
  --ink: #0c1a2b; --ink-2: #1e2d40; --muted: #5b6878; --line: #d9dfe6; --line-2: #eef1f4;
  --paper: #f3f5f7; --card: #ffffff; --accent: #0f6f68; --accent-2: #0b5550; --accent-soft: #e3f1ef;
  --gold: #a7802c; --good: #1f7a4d; --good-soft: #e5f3eb; --warn: #9a5b00; --warn-soft: #fbf0dc;
  --bad: #b42318; --bad-soft: #fbe9e7;
  --radius: 10px; --shadow: 0 1px 2px rgba(12,26,43,.06), 0 8px 24px rgba(12,26,43,.06);
  --serif: 'IBM Plex Serif', Georgia, serif; --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.num, .money { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
button, .btn { font: 600 .92rem var(--sans); border-radius: 8px; border: 1px solid transparent; padding: .7rem 1.1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; } .btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); } .btn-ghost:hover { border-color: var(--ink-2); }
.btn-danger { background: var(--card); color: var(--bad); border-color: #f0c4bf; } .btn-danger:hover { background: var(--bad-soft); }
.btn-link { background: none; border: 0; color: var(--accent); padding: .3rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid #7cc4bd; outline-offset: 2px; }
input, select, textarea { font: 1rem var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: grid; gap: .35rem; font-weight: 600; font-size: .88rem; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.stack { display: grid; gap: 1rem; } .row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.notice { border-radius: 8px; padding: .8rem 1rem; font-size: .9rem; border: 1px solid var(--line); background: #fff; }
.notice.good { background: var(--good-soft); border-color: #bfe0cd; } .notice.warn { background: var(--warn-soft); border-color: #efd6a8; } .notice.bad { background: var(--bad-soft); border-color: #f0c4bf; }
.mono-box { font: .85rem/1.5 var(--mono); background: var(--line-2); border-radius: 8px; padding: .7rem .8rem; word-break: break-all; }

/* ── landing ── */
.landing { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1rem, 4vw, 3rem); }
.brand { display: flex; align-items: center; gap: .6rem; font: 600 1.15rem var(--serif); color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding: 2rem clamp(1rem, 4vw, 3rem) 4rem; max-width: 1180px; margin: 0 auto; width: 100%; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.08; }
.hero .lede { font-size: 1.1rem; color: var(--ink-2); max-width: 36ch; margin-top: 1rem; }
.signin { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; box-shadow: var(--shadow); display: grid; gap: 1rem; }
.signin h2 { font-size: 1.4rem; }
.provider { width: 100%; justify-content: flex-start; padding: .85rem 1rem; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.provider:hover { border-color: var(--ink-2); } .provider svg { width: 20px; height: 20px; flex: none; }
.provider[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 1180px; margin: 0 auto 3rem; padding: 0 clamp(1rem, 4vw, 3rem); width: 100%; }
.fact { border-top: 2px solid var(--ink); padding-top: .9rem; }
.fact h3 { margin-bottom: .35rem; }
.foot { padding: 1.5rem clamp(1rem, 4vw, 3rem); border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr; } }

/* ── app shell ── */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #dfe6ee; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; } .side .brand-mark { background: var(--accent); }
.nav { display: grid; gap: .2rem; }
.nav a { color: #c9d3de; text-decoration: none; padding: .6rem .75rem; border-radius: 8px; display: flex; gap: .7rem; align-items: center; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); } .nav a[aria-current="page"] svg { opacity: 1; }
.side-foot { margin-top: auto; font-size: .78rem; color: #93a1b1; }
.main { min-width: 0; }
.appbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.appbar .who { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-weight: 700; color: var(--accent); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.lockstate { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; }
.content { padding: clamp(1rem, 3vw, 2rem); max-width: 1100px; display: grid; gap: 1.5rem; }
.page-head { display: grid; gap: .3rem; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .side { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: grid; justify-items: center; gap: .15rem; padding: .5rem 0; font-size: .7rem; color: var(--muted); text-decoration: none; }
  .tabbar a svg { width: 20px; height: 20px; } .tabbar a[aria-current="page"] { color: var(--accent); }
  .content { padding-bottom: 5.5rem; }
}

/* ── dashboard ── */
.balance { background: var(--ink); color: #fff; border-radius: 14px; padding: 1.5rem; display: grid; gap: 1rem; }
.balance .amount { font: 600 clamp(2rem, 5vw, 2.8rem) var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.balance .amount small { font-size: .45em; color: #9fb0c2; margin-left: .35rem; }
.balance .split { display: flex; gap: 2rem; flex-wrap: wrap; font-size: .88rem; color: #b8c4d1; }
.balance .split b { color: #fff; font-family: var(--mono); font-weight: 600; }
.balance .actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.balance .actions .btn-ghost { background: transparent; color: #fff; border-color: #3a4a5e; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
.list { display: grid; }
.list-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.icon-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.icon-dot.in { background: var(--good-soft); color: var(--good); } .icon-dot.out { background: var(--line-2); }
.icon-dot svg { width: 18px; height: 18px; }
.item-title { font-weight: 600; } .item-sub { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt-in { color: var(--good); } .amt-out { color: var(--ink); }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; padding: .9rem 0; border-bottom: 1px solid var(--line-2); }
.account-row:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }

/* ── forms, steps, modal ── */
.steps { display: flex; gap: .5rem; flex-wrap: wrap; }
.step { font-size: .78rem; font-weight: 600; color: var(--muted); padding: .3rem .6rem; border-radius: 999px; background: var(--line-2); }
.step[aria-current="step"] { background: var(--ink); color: #fff; } .step.done { background: var(--good-soft); color: var(--good); }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 1.75rem; text-align: center; background: #fff; cursor: pointer; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.choice button { flex-direction: column; align-items: flex-start; text-align: left; background: #fff; border: 1px solid var(--line); color: var(--ink); padding: 1.1rem; gap: .3rem; }
.choice button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice small { font-weight: 400; color: var(--muted); }
@media (max-width: 600px) { .choice { grid-template-columns: 1fr; } }
.review { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.25rem; }
.review dt { color: var(--muted); font-size: .88rem; } .review dd { margin: 0; text-align: right; font-weight: 600; word-break: break-all; }
.review .total { border-top: 1px solid var(--line); padding-top: .6rem; }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(12,26,43,.25); }
dialog::backdrop { background: rgba(12,26,43,.55); }
.modal { padding: 1.5rem; display: grid; gap: 1rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pinpad button { background: var(--line-2); color: var(--ink); font: 600 1.2rem var(--mono); padding: .9rem; }
.pin-dots { display: flex; gap: .5rem; justify-content: center; min-height: 18px; }
.pin-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.qr { width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.table .r { text-align: right; }
.table-wrap { overflow-x: auto; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 8px; font-size: .9rem; z-index: 50; }
@media (max-width: 860px) { .toast { bottom: 5rem; } }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ── printable statement ── */
.statement { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2rem; }
.statement header { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1rem; }
@media print {
  body { background: #fff; } .side, .appbar, .tabbar, .no-print { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; } .statement { border: 0; padding: 0; }
}
.btn svg, button svg { width: 18px; height: 18px; flex: none; }
.lockstate svg { width: 16px; height: 16px; vertical-align: -3px; }
.brand-logo { width: 32px; height: 32px; border-radius: 50%; flex: none; }

/* ═══ Acid theme: the DLT / xCoin brutalist look. Layout above is unchanged; this re-skins it. ═══ */
:root {
  --ink: #0a0a0a; --ink-2: #1c1c1c; --muted: #5e5e5e; --line: #0a0a0a; --line-2: #e4e4e4;
  --paper: #ffffff; --card: #ffffff; --accent: #c7ff2e; --accent-2: #b4ee12; --accent-ink: #101600; --accent-soft: #f2ffd0;
  --wash: #f7ffd9; --panel: #f6f6f3;
  --good: #1a6b2f; --good-soft: #e3f7c8; --warn: #7a4a00; --warn-soft: #fff1c9; --bad: #b3140c; --bad-soft: #ffe3df;
  --radius: 0; --shadow: 8px 8px 0 var(--accent);
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --serif: var(--mono); --sans: var(--mono);
}
body { background: var(--panel); font-size: 14px; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.04em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); text-transform: uppercase; }
h2 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: -.02em; }
.eyebrow, label.field, .table th, .step, .pill { text-transform: uppercase; letter-spacing: .08em; }
label.field { font-size: .74rem; font-weight: 800; }
label.field .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* hard edges everywhere */
.card, .signin, .statement, .dropzone, .notice, .mono-box, input, select, textarea, button, .btn, dialog, .qr, .avatar, .pill, .step, .icon-dot, .toast, .pinpad button { border-radius: 0; }
.card { border: 2px solid var(--ink); box-shadow: none; }
.signin { border: 2px solid var(--ink); box-shadow: 12px 12px 0 var(--accent); }
input, select, textarea { border: 2px solid var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 4px 4px 0 var(--accent); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--accent); }

/* buttons: lime block, black text, hard shadow on press */
button, .btn { font: 800 .8rem var(--mono); text-transform: uppercase; letter-spacing: .06em; border: 2px solid var(--ink); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--wash); }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn-link { border: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .btn-primary:hover { transform: none; } }

/* landing */
.landing { background: #fff; }
.topbar { border-bottom: 2px solid var(--ink); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1; }
.hero h1::after { content: ""; display: block; width: 96px; height: 12px; background: var(--accent); margin-top: 1rem; border: 2px solid var(--ink); }
.provider { border: 2px solid var(--ink); text-transform: none; letter-spacing: 0; font-size: .92rem; }
.provider:hover { background: var(--wash); }
.fact { border-top: 4px solid var(--ink); }
.foot { border-top: 2px solid var(--ink); background: var(--ink); color: #cfcfcf; }
.foot a { color: var(--accent); }

/* app shell */
.side { background: var(--ink); border-right: 2px solid var(--ink); }
.side .brand { color: #fff; }
.nav a { color: #d9d9d9; border: 2px solid transparent; border-radius: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.nav a:hover { background: transparent; color: var(--accent); border-color: #333; }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.side-foot { color: #9a9a9a; }
.appbar { border-bottom: 2px solid var(--ink); background: #fff; }
.avatar { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--ink); }
.tabbar { border-top: 2px solid var(--ink); }
.tabbar a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }

/* balance: black slab with lime shadow, like the DLT stat grid */
.balance { border-radius: 0; border: 2px solid var(--ink); box-shadow: 12px 12px 0 var(--accent); }
.balance .amount { color: var(--accent); }
.balance .amount small { color: #bdbdbd; }
.balance .actions .btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.balance .actions .btn-ghost:hover { background: #fff; color: var(--ink); }

/* lists, pills, notices */
.list-item, .account-row { border-bottom: 1px solid var(--line-2); }
.icon-dot { border: 2px solid var(--ink); background: #fff; }
.icon-dot.in { background: var(--accent); color: var(--accent-ink); }
.pill { border: 1px solid var(--ink); background: #fff; font-size: .66rem; font-weight: 800; }
.pill.good { background: var(--accent); color: var(--accent-ink); border-color: var(--ink); }
.notice { border: 2px solid var(--ink); }
.notice.good { background: var(--wash); border-color: var(--ink); }
.step { border: 1px solid var(--ink); background: #fff; }
.step[aria-current="step"] { background: var(--ink); color: var(--accent); }
.step.done { background: var(--accent); color: var(--accent-ink); }
.choice button { border: 2px solid var(--ink); text-transform: none; letter-spacing: 0; }
.choice button[aria-pressed="true"] { background: var(--wash); box-shadow: 6px 6px 0 var(--accent); }
.dropzone { border: 2px dashed var(--ink); }
.dropzone.drag { background: var(--wash); }
.mono-box { background: var(--wash); border: 2px solid var(--ink); }
.table th { border-bottom: 2px solid var(--ink); }
dialog { border: 2px solid var(--ink); box-shadow: 12px 12px 0 var(--accent); }
dialog::backdrop { background: rgba(10,10,10,.6); }
.pinpad button { background: #fff; border: 2px solid var(--ink); }
.pinpad button:hover { background: var(--accent); }
.pin-dots i { border-radius: 0; background: var(--ink); }
.qr { border: 2px solid var(--ink); }
.toast { border: 2px solid var(--ink); background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.statement { border: 2px solid var(--ink); }
.statement header { border-bottom: 4px solid var(--ink); }
.brand-logo { border: 2px solid var(--ink); }
[hidden] { display: none !important; }
.mark { display: inline-block; line-height: 0; border: 2px solid var(--ink); background: #0b0f1a; flex: none; }
.mark svg { display: block; width: 100%; height: 100%; }
.mark { cursor: zoom-in; }
.mark:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.mark-zoom { position: fixed; z-index: 60; background: #0b0f1a; border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--accent); pointer-events: none; }
.mark-zoom svg { display: block; width: 100%; height: auto; }
.mark-zoom-seed { background: #fff; color: var(--ink); font: 600 .7rem/1.4 var(--mono); padding: .45rem .55rem; word-break: break-all; border-top: 2px solid var(--ink); }

/* new-wallet seed: a blurred decoy until revealed */
.seed-box { font-size: 1.05rem; letter-spacing: .04em; filter: blur(7px); user-select: none; transition: filter .15s; }
.seed-box.shown { filter: none; user-select: text; }
@media (prefers-reduced-motion: reduce) { .seed-box { transition: none; } }

/* backup tiers */
.choice.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.choice.tiers button { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; text-align: left; }
.pill.bad { background: #ffd9d9; color: #7a0000; }

.btn-sm { padding: .3rem .7rem; font-size: .75rem; min-height: 0; gap: .35rem; }
.btn-sm svg { width: 14px; height: 14px; }
.balance .btn-sm { color: #fff; border-color: #9fb0c2; background: transparent; }

/* addresses page */
.wallet-tabs { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.wallet-tabs button { display: inline-flex; align-items: center; gap: .6rem; padding: .5rem .9rem .5rem .6rem; background: #fff; border: 2px solid var(--ink); color: var(--ink); }
.wallet-tabs button span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.wallet-tabs button small { font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.wallet-tabs button[aria-selected="true"] { background: var(--accent); }
.chip { display: inline-flex; gap: .3rem; align-items: center; font-family: var(--mono); font-size: .72rem; font-weight: 700; border: 1px solid var(--ink); padding: .05rem .4rem; background: #fff; color: var(--ink); }
.addr-list { display: grid; }
.addr-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .7rem .6rem; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.addr-row:last-child { border-bottom: 0; }
.addr-row:hover, .addr-row:focus-visible { background: var(--wash); outline: none; }
.addr-row.sel { background: var(--accent-soft, #f4ffd0); box-shadow: inset 4px 0 0 var(--accent); }
.addr-row.is-hidden { opacity: .6; }
.addr-row .item-sub { display: flex; gap: .5rem; align-items: center; white-space: normal; }
.qr-wrap { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.open-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; align-items: end; }
.open-grid .field { margin: 0; }
.idx-wrap { display: flex; gap: .4rem; align-items: stretch; } .idx-wrap input { flex: 1; min-width: 0; }
.seg { display: inline-flex; border: 2px solid var(--ink); }
.seg button { border: 0; border-right: 2px solid var(--ink); background: #fff; color: var(--ink); padding: .55rem .8rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"], .seg button:hover { background: var(--accent); }
.req { font-size: .65rem; color: var(--bad, #b00020); margin-left: .3rem; }
.seg.wrap { flex-wrap: wrap; } .seg.wrap button { border-right: 2px solid var(--ink); border-bottom: 0; }

/* addresses page: alignment */
.addr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: stretch; }
.copy-row .mono-box { margin: 0; display: flex; align-items: center; }
.copy-row button { align-self: stretch; }
.qr-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.qr-wrap .field { margin: 0; }
.open-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 1rem 1.25rem; align-items: end; }
.open-grid .field { display: grid; gap: .4rem; align-content: end; margin: 0; }
.open-grid .lbl { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); white-space: nowrap; }
.req { display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: #7a0000; background: #ffd9d9; padding: .05rem .35rem; margin-left: .4rem; vertical-align: middle; }
.seg button { padding: .8rem .9rem; line-height: 1.2; }
.seg.wrap { display: flex; }
@media (max-width: 720px) { .addr-grid, .open-grid { grid-template-columns: 1fr; } .qr-wrap { grid-template-columns: 1fr; justify-items: center; } }
/* random-index sizes: equal cells that fill the row, wrapping into equal rows */
.seg.wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); border: 2px solid var(--ink); }
.seg.wrap button { border: 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); margin: 0 0 -2px 0; padding: .8rem .4rem; text-align: center; white-space: nowrap; }
.seg.wrap button:nth-last-child(1) { border-right: 0; }
/* one row of nine, always */
.seg.wrap { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.seg.wrap button { padding: .8rem .2rem; font-size: .72rem; letter-spacing: .03em; min-width: 0; }
.seg.wrap button:nth-last-child(1) { border-right: 0; }
@media (max-width: 1100px) { .seg.wrap button { font-size: .62rem; letter-spacing: 0; } }
@media (max-width: 720px) { .seg.wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); } .seg.wrap button:nth-last-child(1) { border-right: 2px solid var(--ink); } }

/* home: wallet → addresses tree */
.acct-tree { display: grid; gap: .25rem; }
.wallet-group { padding: .5rem 0; border-bottom: 1px solid var(--line-2); }
.wallet-group:last-child { border-bottom: 0; }
.wallet-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center; padding: .4rem 0; }
.sub-row { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .45rem 0 .45rem 1.1rem; color: inherit; text-decoration: none; }
.sub-row:hover { background: var(--wash); }
.tree-line { display: block; width: 14px; height: 18px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); margin-top: -14px; }
.item-title.small { font-size: .9rem; }
.money.small { font-size: .95rem; }
.item-sub.full { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-all; font-size: .78rem; }

/* The animated Xalon mark (js/knot.js) */
.brand-knot { display: inline-block; width: 32px; height: 32px; border: 0 !important; border-radius: 0; overflow: visible; }
.brand-knot canvas, .brand-knot img { width: 100% !important; height: 100% !important; display: block; }
.hero-knot { width: min(62vw, 300px); aspect-ratio: 1; margin: 0 0 1.25rem -1rem; }
.hero-knot canvas { width: 100% !important; height: 100% !important; display: block; }
@media (max-width: 860px) { .hero-knot { width: min(70vw, 260px); margin: 0 auto 1rem; } }

/* ── landing: copy left, knot centre, sign-in right ── */
.hero.hero-tri {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center; gap: clamp(1rem, 2.5vw, 2.5rem);
  max-width: 1480px; min-height: calc(100vh - 160px); padding: 2rem clamp(1rem, 3vw, 3rem) 3rem;
}
.hero-tri .hero-copy { position: relative; z-index: 1; }
.hero-tri .eyebrow { margin: 0 0 1rem; }
.hero-tri h1 { font-size: clamp(2rem, 3.3vw, 3.6rem); line-height: 1; letter-spacing: -.05em; }
.hero-tri .lede { max-width: 34ch; font-size: clamp(.98rem, 1.1vw, 1.1rem); line-height: 1.6; margin-top: 1.4rem; }
.hero-stage { display: grid; justify-items: center; gap: .5rem; }
.hero-tri .hero-knot { width: min(100%, 560px); margin: 0; }
.hero-tri .signin { position: relative; z-index: 1; justify-self: end; width: 100%; max-width: 400px; }
.hero-hint { margin: 0; font: 700 .7rem var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
@media (max-width: 1100px) {
  .hero.hero-tri { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
  .hero-stage { grid-column: 1 / -1; order: -1; }
  .hero-tri .hero-knot { width: min(70vw, 420px); }
  .hero-tri .signin { justify-self: stretch; max-width: none; }
}
@media (max-width: 760px) {
  .hero.hero-tri { grid-template-columns: 1fr; }
  .hero-tri .hero-knot { width: min(82vw, 360px); }
  .hero-tri .lede { max-width: none; }
}
.hero-tri ~ .facts { max-width: 1480px; padding: 0 clamp(1rem, 3vw, 3rem); }

/* ── landing: black, white type, acid-lime brutalist accents ── */
.landing { --muted: #a6a6a6; background: #0a0a0a; color: #fff; }
.landing .topbar { border-bottom: 2px solid var(--accent); }
.landing .brand { color: #fff; }
.landing .brand-logo { border: 0; }
.landing .topbar .btn-primary:hover { box-shadow: 4px 4px 0 #fff; }
.landing h1, .landing h2, .landing h3 { color: #fff; }
.landing .eyebrow { color: var(--accent); }
.landing .hero h1::after { border-color: #fff; }
.landing .lede { color: #e6e6e6; }
.landing .muted { color: var(--muted); }
.landing mark.hl { background: var(--accent); color: #0a0a0a; padding: 0 .14em; margin: 0 -.04em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.landing .hl-text { color: var(--accent); font-weight: 700; }
.landing .signin { background: #0a0a0a; border: 2px solid #fff; box-shadow: 12px 12px 0 var(--accent); }
.landing .provider { background: #0a0a0a; color: #fff; border: 2px solid #fff; }
.landing .provider:hover { background: #1a1a1a; }
.landing .provider[href="/auth/google"] { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.landing .provider[href="/auth/google"]:hover { box-shadow: 4px 4px 0 #fff; transform: translate(-2px, -2px); }
.landing .provider[href="/auth/google"] svg { background: #fff; padding: 2px; }
.landing .pill { background: transparent; color: #fff; border-color: #fff; }
.landing .notice { background: #141414; color: #fff; border: 2px solid var(--accent); }
.landing .notice.bad { border-color: #ff6b5e; }
.landing .hero-hint { color: var(--accent); }
.landing .fact { border-top: 4px solid var(--accent); }
.landing .fact .muted { color: #bdbdbd; }
.landing .foot { background: #0a0a0a; border-top: 2px solid var(--accent); color: #a6a6a6; }
.landing :focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) { .landing .provider[href="/auth/google"]:hover { transform: none; } }
.landing .hero-tri h1 { line-height: 1.14; }
.landing h1 mark.hl { padding: .02em .14em 0; }
/* knot: two-thirds size, pops in once its canvas appears */
.hero-tri .hero-knot { width: min(66%, 373px); }
@media (max-width: 1100px) { .hero-tri .hero-knot { width: min(47vw, 280px); } }
@media (max-width: 760px) { .hero-tri .hero-knot { width: min(55vw, 240px); } }
.hero-knot canvas { animation: knot-pop 2.2s cubic-bezier(.16, 1, .3, 1) .15s both; transform-origin: 50% 50%; }
.hero-stage .hero-hint { animation: knot-hint .5s ease-out 2s both; }
@keyframes knot-pop { 0% { opacity: 0; transform: scale(.02) rotate(-720deg); filter: blur(6px); } 20% { opacity: 1; } 65% { transform: scale(1.12) rotate(12deg); filter: blur(0); } 82% { transform: scale(.98) rotate(-3deg); } 100% { opacity: 1; transform: scale(1) rotate(0); filter: none; } }
@keyframes knot-hint { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-knot canvas, .hero-stage .hero-hint { animation: none; } }

/* ═══ Balance arithmetic: the XID Wallet look (lime slab, big numerals, before − sent − fee = now) ═══ */
.tag { display: inline-block; font: 700 .68rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: .4rem .5rem; background: var(--ink); color: var(--accent); border: 2px solid var(--ink); }
.tag.ink { background: var(--ink); color: var(--accent); }
.tag.lime { background: var(--accent); color: var(--accent-ink); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.page-top { align-items: flex-start; }
.balance-panel { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: #fff; }
.balance-panel .balance-main { background: var(--accent); color: var(--accent-ink); padding: 1.4rem 1.5rem; border-right: 3px solid var(--ink); display: grid; gap: .8rem; align-content: start; }
.balance-panel .amt { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.balance-panel .amt b { font: 800 clamp(2.6rem, 6vw, 4.6rem)/.9 var(--mono); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.balance-panel .amt span { font: 700 1.1rem var(--mono); }
.balance-panel .bal-note { margin: 0; font-size: .85rem; }
.balance-panel .actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-ink { background: var(--ink); color: var(--accent); }
.balance-panel .btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.stats { display: grid; grid-auto-rows: 1fr; margin: 0; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .8rem 1.1rem; border-bottom: 2px solid var(--ink); }
.stats div:last-child { border-bottom: 0; }
.stats dt { font: 700 .68rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font: 800 1.35rem var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.adds { display: grid; gap: .8rem; }
.math { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .9rem; font-variant-numeric: tabular-nums; }
.math > div { display: grid; gap: .3rem; }
.math b { font: 800 1.45rem/1 var(--mono); letter-spacing: -.04em; }
.math i { font: 700 .62rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-style: normal; }
.math .op { font: 800 1.3rem/1 var(--mono); padding-bottom: .7rem; }
.math .res { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--ink); padding: .4rem .6rem; }
.math .res i { color: var(--accent-ink); }
.pending-box { display: grid; gap: .8rem; box-shadow: 6px 6px 0 var(--accent); }
.pend-line { margin: 0; }
.why { display: grid; gap: .5rem; margin: 0; border-top: 2px dashed var(--ink); padding-top: .8rem; }
.why dt { font-weight: 800; } .why dd { margin: 0 0 .3rem; color: var(--muted); font-size: .88rem; }
.mark-empty { background: var(--line-2); width: 36px; height: 36px; }
.table tr.sum td { border-top: 2px solid var(--ink); }
.icon-dot.change { background: #fff; }
@media (max-width: 860px) { .balance-panel { grid-template-columns: 1fr; } .balance-panel .balance-main { border-right: 0; border-bottom: 3px solid var(--ink); } }
@media (prefers-reduced-motion: reduce) { .btn-ink:hover { transform: none; } }

/* ═══ Alignment pass ═══ */
/* the content column uses the width the header uses, up to a comfortable reading limit */
.content { max-width: 1440px; }
/* arithmetic rows: every term is the same box, so numbers share one baseline and labels another */
.math > div { border: 2px solid transparent; padding: .4rem .6rem; }
.math > div:first-child { padding-left: 0; }
.math .op { padding: 0 0 calc(1.395rem + 2px); }
/* one shadow language: lime under the things that are about your money right now */
.balance-panel { box-shadow: 8px 8px 0 var(--accent); }
.pending-box { box-shadow: 8px 8px 0 var(--accent); }
/* wallet → addresses: one continuous line from the wallet's mark through each address */
.wallet-group { position: relative; }
.wallet-head .item-sub { white-space: nowrap; }
.sub-row { position: relative; grid-template-columns: auto minmax(0, 1fr) auto; padding-left: 2.6rem; }
.sub-row .tree-line { position: absolute; left: 17px; top: 0; bottom: 0; width: 14px; height: auto; margin: 0; border-bottom: 0; }
.sub-row .tree-line::after { content: ""; position: absolute; left: -2px; top: 50%; width: 16px; border-top: 2px solid var(--ink); }
.wallet-group .sub-row:last-child .tree-line { bottom: 50%; }
.sub-row > .mark { margin-left: 0; }
/* a wallet whose XID identity has not been worked out yet: a button that asks for the key tap */
.mark-empty { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; background: #fff; border: 2px dashed var(--ink); color: var(--ink); font: 800 1rem var(--mono); cursor: pointer; letter-spacing: 0; }
.mark-empty.sm { width: 32px; height: 32px; cursor: inherit; }
button.mark-empty:hover { background: var(--accent); border-style: solid; transform: none; box-shadow: none; }
.xid-link { padding: 0; font-size: .78rem; text-transform: none; letter-spacing: 0; font-weight: 700; }
/* transfer: the form beside its live arithmetic */
.transfer-grid { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.live-math { position: sticky; top: 6rem; }
.live-math .math b { font-size: 1.25rem; }
@media (max-width: 1100px) { .transfer-grid { grid-template-columns: 1fr; } .live-math { position: static; } }
/* activity amounts line up on the decimal side */
.list-item .money { text-align: right; white-space: nowrap; }
.wallet-head + .sub-row .tree-line { top: -.45rem; }
.ledger { margin: 0; display: grid; font-variant-numeric: tabular-nums; }
.ledger div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem .6rem; border-bottom: 1px solid var(--line-2); }
.ledger dt { font: 700 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ledger dt .op { display: inline-block; width: 1.4em; color: var(--ink); font-size: 1rem; }
.ledger dd { margin: 0; font: 800 1.15rem var(--mono); letter-spacing: -.03em; }
.ledger .res { border: 2px solid var(--ink); border-bottom-width: 2px; background: var(--accent); padding: .6rem calc(.6rem - 2px); margin-top: .4rem; }
.ledger .res dt { color: var(--accent-ink); }
.ledger .res dd { font-size: 1.15rem; }
/* arithmetic terms (operator + value) */
.math { align-items: flex-end; }
.math .term { display: inline-flex; align-items: flex-end; gap: .9rem; }
.math .val { display: grid; gap: .3rem; border: 2px solid transparent; padding: .4rem .6rem; }
.math .term:first-child .val:not(.res) { padding-left: 0; }
.math .op { padding: 0 0 calc(1.395rem + 2px); }
@media (max-width: 600px) {
  .math { display: grid; gap: 0; }
  .math .term { display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid var(--line-2); padding: .15rem 0; }
  .math .term:last-child { border-bottom: 0; }
  .math .op { padding: 0; width: 1rem; flex: none; }
  .math .term:first-child::before { content: ""; width: 1rem; flex: none; }
  .math .val { flex: 1; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .45rem .5rem; }
  .math .term:first-child .val:not(.res) { padding-left: .5rem; }
  .math b { font-size: 1.15rem; }
  .math .res { margin: .2rem 0; }
  /* header: the email and lock text give way on a phone */
  .appbar { padding: .6rem 1rem; gap: .5rem; }
  #who-name { display: none; }
  .appbar .btn, .appbar button { padding: .5rem .7rem; }
}
.math .val.res { border-color: var(--ink); }

/* ═══ Phones: nothing may be wider than the screen ═══ */
/* clip (not hidden) so the page never pans sideways and sticky headers keep working */
html, body { max-width: 100%; overflow-x: clip; }
/* grid children may shrink below their content; wide tables then scroll inside their own box */
.content > *, .grid-2 > *, .transfer-grid > *, .addr-grid > *, .stack > * { min-width: 0; }
.table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
.toast { max-width: calc(100vw - 32px); text-align: center; }
img, canvas, svg, video { max-width: 100%; }
.mark svg, .mark-zoom svg { max-width: none; }
@media (max-width: 600px) {
  .statement { padding: 1rem; }
  .statement header { flex-wrap: wrap; gap: .75rem; }
  .statement header > div:last-child { text-align: left !important; }
  .page-top > .row, .spread.no-print > .row { width: 100%; }
  .spread.no-print select { flex: 1; min-width: 0; }
  .wallet-tabs button { max-width: 100%; }
  .copy-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) { .balance-panel { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .balance-panel .amt b { font-size: min(4.6rem, 10vw); }
  .balance-panel .balance-main { padding: 1.1rem 1rem; }
  .stats div { padding: .7rem 1rem; }
  .stats dd { font-size: min(1.35rem, 5.4vw); }
  .open-grid .lbl { white-space: normal; }
}
/* transfer: the ledger sits beside the form only when it has room (300 px+), otherwise it moves underneath */
.transfer-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.transfer-grid > section { flex: 1 1 420px; max-width: 640px; min-width: 0; }
.transfer-grid > .live-math { flex: 1 1 300px; max-width: 640px; min-width: 0; }
.ledger div { flex-wrap: wrap; row-gap: .2rem; }
.ledger dd { margin-left: auto; }

/* ═══ Balance panel sized by the space it actually has (container queries), not the window ═══ */
.content { container: page / inline-size; }
.balance-panel .balance-main { container: bal / inline-size; }
.balance-panel .amt b { font-size: min(4.6rem, 12.5cqi); }
.balance-panel .actions .btn { white-space: nowrap; }
/* not enough room beside the slab: the four figures become a strip underneath */
@container page (max-width: 900px) {
  .balance-panel { grid-template-columns: minmax(0, 1fr); }
  .balance-panel .balance-main { border-right: 0; border-bottom: 3px solid var(--ink); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; }
  .stats div { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: .35rem; border-bottom: 0; border-right: 2px solid var(--ink); }
  .stats div:last-child { border-right: 0; }
}
@container page (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div { border-bottom: 2px solid var(--ink); }
  .stats div:nth-child(2n) { border-right: 0; }
  .stats div:nth-last-child(-n+2) { border-bottom: 0; }
}
/* a narrow slab: buttons stack at full width instead of breaking two-and-one */
@container bal (max-width: 480px) {
  .balance-panel .actions { display: grid; grid-template-columns: minmax(0, 1fr); }
}

/* ═══ Easier to use: setup checklist, readable amounts, guided transfer, dated activity, popups ═══ */
/* overview */
.balance-panel button.amt { all: unset; display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; cursor: pointer; }
.balance-panel button.amt:hover b { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.balance-panel button.amt:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.balance-panel .bal-note b { font-weight: 800; }
.stats { grid-template-rows: none; }
@container page (max-width: 900px) { .stats { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); } }
@container page (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; } }
details.adds > summary, details.advanced > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; list-style: none; }
details.adds > summary::-webkit-details-marker, details.advanced > summary::-webkit-details-marker { display: none; }
details.adds > summary .sum-hint { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
details.adds[open] > summary, details.advanced[open] > summary { margin-bottom: .4rem; }
details.advanced > summary::after { content: "+"; font: 800 1.3rem/1 var(--mono); }
details.advanced[open] > summary::after { content: "−"; }
details.advanced > summary .muted { margin-right: auto; }
.adv-body { margin-top: .8rem; }
.adv-body #open-idx { border-top: 2px dashed var(--ink); padding-top: 1rem; }
/* a figure that just changed flashes lime once */
@keyframes flash { 0% { background: var(--accent); box-shadow: 0 0 0 4px var(--accent); } 100% { background: transparent; box-shadow: none; } }
.flash { animation: flash 1.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
/* setup checklist */
.setup { display: grid; gap: .8rem; border-style: dashed; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; }
.todo li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line-2); }
.todo li:first-child { border-top: 0; }
.todo-box { width: 18px; height: 18px; border: 2px solid var(--ink); }
@media (max-width: 600px) { .todo li { grid-template-columns: auto minmax(0, 1fr); } .todo li > :last-child { grid-column: 2; justify-self: start; } }
/* lock pill */
.lock-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border: 2px solid var(--ink); font: 700 .74rem var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.lock-pill.open { background: var(--accent); color: var(--accent-ink); }
.lock-pill b { font-weight: 800; }
.side-help { display: block; color: var(--accent); font-weight: 700; margin-bottom: .6rem; }
.back { padding: 0; align-self: flex-start; }
/* activity */
.day { font: 800 .68rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 1rem 0 .3rem; border-bottom: 2px solid var(--ink); }
.list > .day:first-child { padding-top: 0; }
a.list-item.act { color: inherit; text-decoration: none; }
a.list-item.act:hover { background: var(--wash); }
a.list-item.act:hover .item-title { text-decoration: underline; text-underline-offset: 3px; }
.icon-dot.mined { background: var(--accent); color: var(--accent-ink); }
.seg.filters, .seg.tabs { align-self: flex-start; }
.seg.tabs a { display: inline-flex; align-items: center; padding: .55rem .9rem; font: 800 .75rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink); text-decoration: none; border-right: 2px solid var(--ink); background: var(--card); }
.seg.tabs a:last-child { border-right: 0; }
.seg.tabs a[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.seg.filters button { padding: .55rem .9rem; }
.tx-link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
/* transfer */
.payee-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.payee-pick { justify-content: flex-start; text-align: left; text-transform: none; letter-spacing: 0; background: var(--card); color: var(--ink); padding: .5rem .6rem; gap: .6rem; min-width: 0; }
.payee-pick:hover { background: var(--wash); }
.payee-pick span { display: grid; min-width: 0; }
.payee-pick b { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payee-pick small { font-weight: 400; font-size: .72rem; color: var(--muted); }
.recipient { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: center; min-width: 0; }
.addr-ok { display: grid; gap: .6rem; padding: .8rem; border: 2px solid var(--ink); background: var(--wash); justify-items: start; }
.quick { display: flex; gap: .4rem; flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; }
.scan video { width: 100%; max-height: 60vh; background: #000; border: 2px solid var(--ink); }
/* receive */
.receive-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: start; }
.qr-box { display: grid; justify-items: center; gap: .4rem; }
@container page (max-width: 700px) { .receive-main { grid-template-columns: minmax(0, 1fr); } .qr-box { order: -1; } }
.prefs { align-items: start; }
.anchor { scroll-margin-top: 6rem; }
/* transaction popup: the explorer's page in a small window */
dialog.txpop { width: min(920px, calc(100vw - 32px)); height: min(80vh, 760px); padding: 0; display: none; flex-direction: column; background: var(--card); color: var(--ink); }
dialog.txpop[open] { display: flex; }
.txpop-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; border-bottom: 2px solid var(--ink); }
.txpop-id { overflow-wrap: anywhere; }
.txpop iframe { flex: 1; width: 100%; border: 0; background: #fff; }
@media (max-width: 600px) { dialog.txpop { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; box-shadow: none; } }

/* ═══ Dark mode: follows the device, app only, screen only (statements print black on white) ═══ */
@media screen and (prefers-color-scheme: dark) {
  html:has(.shell) {
    --ink: #ecece6; --ink-2: #d6d6d0; --muted: #a3a39c; --line: #ecece6; --line-2: #2b2b28;
    --paper: #0e0e0d; --panel: #0e0e0d; --card: #171716; --wash: #1f2810; --accent-soft: #232d0f;
    --good: #a8e36a; --good-soft: #1f2e12; --warn: #ffcf6e; --warn-soft: #33280c; --bad: #ff8a7e; --bad-soft: #3a1714;
    color-scheme: dark;
  }
  html:has(.shell) body { background: var(--panel); color: var(--ink); }
  /* surfaces that were literal white */
  html:has(.shell) :is(.appbar, .card, input, select, textarea, .btn-ghost, .btn-danger, .chip, .pill, .step, .icon-dot, .wallet-tabs button, .seg button, .choice button, .dropzone, .statement, .notice, .balance-panel, .mark-zoom-seed, dialog, .tabbar, .payee-pick) { background-color: var(--card); color: var(--ink); }
  html:has(.shell) .btn-ghost:hover, html:has(.shell) .payee-pick:hover { background: var(--wash); }
  html:has(.shell) .side { background: #000; }
  html:has(.shell) .appbar { border-bottom-color: var(--line-2); }
  /* lime surfaces keep black ink */
  html:has(.shell) :is(.balance-main, .math .res, .ledger .res, .tag.lime, .lock-pill.open, .seg.tabs a[aria-selected="true"], .seg button[aria-pressed="true"], .icon-dot.in, .icon-dot.mined, .step.done, .pill.good, .toast, .btn-primary, .nav a[aria-current="page"], .tabbar a[aria-current="page"], .wallet-tabs button[aria-selected="true"]) { --ink: #0a0a0a; --muted: #2f3a12; background-color: var(--accent); color: #0a0a0a; }
  html:has(.shell) .balance-main .btn-ghost { background: transparent; color: #0a0a0a; border-color: #0a0a0a; }
  /* black fills stay black */
  html:has(.shell) :is(.tag, .tag.ink, .btn-ink, .step[aria-current="step"]) { background: #000; color: var(--accent); border-color: #000; }
  html:has(.shell) .tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
  html:has(.shell) .balance-main .btn-ink { border-color: #000; }
  html:has(.shell) .addr-row.sel { background: var(--wash); }
  html:has(.shell) .seed-box, html:has(.shell) .mono-box { background: var(--wash); }
  html:has(.shell) .qr { background: #fff; }
  html:has(.shell) .mark-empty { background: transparent; }
  html:has(.shell) a { color: var(--ink); }
  html:has(.shell) .side a, html:has(.shell) .side-help { color: var(--accent); }
  html:has(.shell) .nav a { color: #d9d9d9; }
  html:has(.shell) .nav a[aria-current="page"] { color: #0a0a0a; }
}
#view:focus, #view:focus-visible { outline: none; box-shadow: none; }   /* focus lands here after each page change, for screen readers; no ring */
.review { column-gap: 0; } .review dd { padding-left: 1.25rem; }

/* rows with action buttons (Keys, Zones): the buttons never squeeze the name; on a phone they go on their own line */
.list-item > .row { flex-wrap: wrap; justify-content: flex-end; gap: .4rem .9rem; }
@media (max-width: 640px) {
  .list-item:has(> .row) { grid-template-columns: auto minmax(0, 1fr); row-gap: .5rem; }
  .list-item > .row { grid-column: 2; justify-content: flex-start; }
  .list-item:has(> .row) .item-sub { white-space: normal; overflow: visible; text-overflow: clip; }
}
