/* Royal Exchange card portal.
   All brand values are tokens in :root – adjust them here to match royalex.world exactly. */
:root {
  --bg: #0a0a0b;
  --bg-raise: #131315;
  --bg-raise-2: #1a1a1d;
  --line: #2a2a2e;
  --line-strong: #3a3a40;
  --text: #f3efe6;
  --text-dim: #a8a39a;
  --text-faint: #77736c;
  --gold: #c9a45c;
  --gold-bright: #e4c88a;
  --gold-deep: #8f6f33;
  --on-gold: #17130a;
  --ok: #6fbf8f;
  --warn: #e0b45c;
  --bad: #e2766c;
  --radius: 14px;
  --radius-sm: 9px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(900px 500px at 85% -10%, rgba(201,164,92,.13), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(201,164,92,.06), transparent 60%); }
a { color: var(--gold-bright); text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: .01em; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; font-family: var(--font); font-weight: 600; }
p { margin: 0; }
.boot { padding: 4rem 1rem; text-align: center; color: var(--text-dim); }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* ---------- header / footer ---------- */
.top { border-bottom: 1px solid var(--line); background: rgba(10,10,11,.85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { font-family: var(--display); font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: .04em; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--gold); display: grid; place-items: center; font-size: .7rem; color: var(--gold); letter-spacing: 0; }
.brand small { font-family: var(--font); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); border-left: 1px solid var(--line-strong); padding-left: 10px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { white-space: nowrap; color: var(--text-dim); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .93rem; }
.nav a:hover { color: var(--text); background: var(--bg-raise); }
.nav a[aria-current="page"] { color: var(--gold-bright); background: var(--bg-raise); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--text-dim); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 36px 20px 72px; }
main.narrow { max-width: 520px; }
main.mid { max-width: 760px; }
.foot { border-top: 1px solid var(--line); color: var(--text-faint); font-size: .8rem; }
.foot-in { max-width: 1080px; margin: 0 auto; padding: 22px 20px 30px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.foot a { color: var(--text-dim); text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot .legal { flex-basis: 100%; line-height: 1.5; }
.foot .grow { flex: 1; }

/* ---------- building blocks ---------- */
.panel { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.lede { color: var(--text-dim); margin-top: 10px; max-width: 60ch; }
.eyebrow { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.muted { color: var(--text-dim); }
.small { font-size: .86rem; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 26px; }
.mt { margin-top: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dash { display: grid; grid-template-columns: minmax(0, 400px) 1fr; gap: 28px; align-items: start; }
@media (max-width: 800px) { .dash { grid-template-columns: 1fr; } .nav { display: none; } .who span { display: none; } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .panel { padding: 18px; } main { padding-top: 24px; } }
.mobile-nav { display: none; border-bottom: 1px solid var(--line); overflow-x: auto; }
.mobile-nav .nav { display: flex; padding: 6px 12px; }
@media (max-width: 800px) { .mobile-nav { display: block; } }

.btn { appearance: none; border: 1px solid transparent; border-radius: 999px; padding: 11px 22px; font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; transition: background .15s, border-color .15s, color .15s; }
.btn-gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-bright); color: var(--on-gold); }
.btn-line { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-line:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn-quiet { background: transparent; color: var(--text-dim); padding: 8px 12px; min-height: 36px; font-weight: 500; }
.btn-quiet:hover { color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(226,118,108,.5); color: var(--bad); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }

label { display: block; font-size: .86rem; color: var(--text-dim); margin-bottom: 6px; }
label .opt { color: var(--text-faint); }
input, select { width: 100%; background: var(--bg); border: 1px solid var(--line-strong); color: var(--text); border-radius: var(--radius-sm); padding: 11px 13px; font: inherit; min-height: 46px; }
input:hover, select:hover { border-color: #55555c; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,92,.18); }
input::placeholder { color: var(--text-faint); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
.field-err { color: var(--bad); font-size: .82rem; margin-top: 6px; }
.hint { color: var(--text-faint); font-size: .8rem; margin-top: 6px; }
.phone { display: grid; grid-template-columns: minmax(0, 190px) 1fr; gap: 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .93rem; color: var(--text); margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; accent-color: var(--gold); flex: none; padding: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { float: left; width: 100%; font-family: var(--display); font-size: 1.15rem; padding: 0; margin-bottom: 4px; color: var(--text); }
legend + * { clear: both; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.notice { border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 13px 16px; background: var(--bg-raise-2); font-size: .92rem; }
.notice.bad { border-left-color: var(--bad); }
.notice.ok { border-left-color: var(--ok); }
.notice.warn { border-left-color: var(--warn); }
.notice strong { display: block; margin-bottom: 2px; }

.chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 4px 11px; font-size: .78rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--text-dim); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); border-color: rgba(111,191,143,.4); }
.chip.warn { color: var(--warn); border-color: rgba(224,180,92,.4); }
.chip.bad { color: var(--bad); border-color: rgba(226,118,108,.4); }

/* ---------- onboarding steps ---------- */
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 30px; counter-reset: s; }
.steps li { flex: 1; counter-increment: s; font-size: .78rem; color: var(--text-faint); padding-top: 12px; border-top: 2px solid var(--line); }
.steps li::before { content: counter(s) ". "; }
.steps li.done { border-color: var(--gold-deep); color: var(--text-dim); }
.steps li.now { border-color: var(--gold-bright); color: var(--gold-bright); font-weight: 600; }
@media (max-width: 520px) { .steps li { font-size: 0; } .steps li::before { font-size: .78rem; content: counter(s); } .steps li.now { font-size: .78rem; } .steps li.now::before { content: counter(s) ". "; } }

.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo .n { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold-deep); color: var(--gold); display: grid; place-items: center; font-size: .8rem; }

/* ---------- the card ---------- */
.card-art { aspect-ratio: 1.586; width: 100%; max-width: 400px; border-radius: 18px; padding: 7% 7% 6%; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #2a2a2d 0%, #0d0d0e 42%, #19191b 100%); border: 1px solid #3c3c41; box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08); container-type: inline-size; }
.card-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(228,200,138,.10) 50%, transparent 62%); pointer-events: none; }
.card-art .c-brand { font-family: var(--display); letter-spacing: .08em; font-size: 5.2cqw; color: var(--gold-bright); }
.card-art .c-brand small { display: block; font-family: var(--font); font-size: 2.6cqw; letter-spacing: .32em; color: var(--text-dim); margin-top: 2px; }
.card-art .c-chip { width: 12%; aspect-ratio: 1.25; border-radius: 5px; background: linear-gradient(135deg, #e9d19a, #9c7a3a); opacity: .9; }
.card-art .c-num { font-family: var(--mono); font-size: 5.4cqw; letter-spacing: .14em; color: #e9e5dc; }
.card-art .c-name { font-size: 3.5cqw; letter-spacing: .14em; text-transform: uppercase; color: #cfcac0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.4em; }
.card-art.frozen { filter: grayscale(1) brightness(.75); }

.balance { font-family: var(--display); font-size: clamp(2.2rem, 6vw, 3rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
dl { margin: 0; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .a { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .a.in { color: var(--ok); }
.list .a.void { color: var(--text-faint); text-decoration: line-through; }
.list .s { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; color: var(--text-faint); font-size: .8rem; }
.empty { color: var(--text-faint); padding: 26px 0; text-align: center; font-size: .93rem; }
.tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs button { appearance: none; border: 0; background: transparent; color: var(--text-dim); padding: 8px 16px; border-radius: 999px; font: 500 .9rem var(--font); cursor: pointer; min-height: 38px; }
.tabs button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); font-weight: 600; }
.select-sm { width: auto; min-height: 40px; padding: 8px 12px; font-size: .9rem; }

/* ---------- deposit ---------- */
.deposit { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: start; }
@media (max-width: 620px) { .deposit { grid-template-columns: 1fr; } .qr { max-width: 220px; margin: 0 auto; } }
.qr { background: #fff; border-radius: 12px; padding: 8px; line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.addr { font-family: var(--mono); font-size: .95rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 13px 14px; overflow-wrap: anywhere; user-select: all; }

/* ---------- tester panel ---------- */
.dev { position: fixed; right: 16px; bottom: 16px; z-index: 20; width: min(330px, calc(100vw - 32px)); }
.dev-toggle { margin-left: auto; display: flex; background: #2b2110; border: 1px dashed var(--gold); color: var(--gold-bright); border-radius: 999px; padding: 8px 14px; font: 600 .8rem var(--font); cursor: pointer; }
.dev-body { background: #17130b; border: 1px dashed var(--gold); border-radius: var(--radius); padding: 16px; margin-bottom: 8px; font-size: .86rem; }
.dev-body h3 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.dev-body .btn { min-height: 36px; padding: 6px 14px; font-size: .84rem; }
.dev-body input { min-height: 36px; padding: 6px 10px; }
@media (max-width: 800px) { .dev { position: static; width: auto; margin: 0 16px 16px; } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: #111; padding: 10px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600; z-index: 30; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.btn-sm { min-height: 34px; padding: 5px 13px; font-size: .82rem; flex: none; }
.bank .kv { align-items: center; }
.bank .kv dt { flex: none; max-width: 45%; }
.bank .kv dd { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.bank .kv dd .mono { overflow-wrap: anywhere; min-width: 0; user-select: all; }
@media (max-width: 520px) { .bank .kv { flex-direction: column; align-items: stretch; gap: 4px; } .bank .kv dt { max-width: none; } .bank .kv dd { justify-content: space-between; text-align: left; } }

.notice.otp { border-left-color: var(--gold-bright); display: grid; gap: 6px; }
.otp-code { font-size: 2rem; letter-spacing: .18em; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
