/* dBank web app. Theme "adire night": deep indigo with frosted-glass surfaces.
   Glass needs something behind it to blur, so the page background carries a faint
   adire pattern and two soft glows (adire blue, kola-nut gold). The adire balance
   card stays the one bold element; everything else is quiet glass. */
:root {
  color-scheme: dark;
  --night: #0D1530;
  --night-2: #131F42;
  --text: #EEF1FA;
  --muted: #A9B3CE;
  --faint: #7D89A9;
  --blue: #5B7FE0;
  --blue-hover: #6E8FEA;
  --adire: #2F4FA2;
  --gold: #E2B457;
  --green: #4FD7A0;
  --rust: #FF907A;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .22);
  --glass: linear-gradient(150deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .045));
  --glass-solid: #18244A;
  --field: rgba(6, 11, 28, .42);
  --blur: blur(18px) saturate(140%);
  --shadow: 0 12px 32px rgba(2, 6, 20, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  --radius: 16px;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--night); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 400 15px/1.5 var(--font); font-variant-numeric: tabular-nums; }
/* The night sky sits on a fixed layer, so it always fills the screen while content scrolls over it
   (background-attachment: fixed is ignored on iOS and repaints badly elsewhere). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle, rgba(170, 190, 255, .06) 0 1.5px, transparent 2px) 0 0 / 28px 28px,
    radial-gradient(circle, transparent 0 8px, rgba(170, 190, 255, .035) 8px 9px, transparent 9.5px) 14px 14px / 28px 28px,
    radial-gradient(900px 600px at 8% -5%, rgba(47, 79, 162, .55), transparent 70%),
    radial-gradient(700px 520px at 100% 105%, rgba(200, 150, 46, .16), transparent 70%),
    radial-gradient(800px 700px at 85% 15%, rgba(68, 98, 196, .22), transparent 70%),
    linear-gradient(170deg, var(--night-2), var(--night) 60%);
}
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: #9DB4FF; }
a:hover { color: #C3D1FF; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--adire); color: #fff; padding: 8px 12px; z-index: 10; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- glass surfaces ---------- */
.panel, .action, .rail, .topbar, .bottombar, .toast, .auth-form .box, .ops-bar, .health div, details.tips, .segmented {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.panel {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}
.panel > h2, .panel > h3 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.stack > * + * { margin-top: 14px; }
.panel > p + form, .panel > p + .row, .panel > p + details { margin-top: 16px; }

/* ---------- layout: glass rail on desktop, glass bars on mobile ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail {
  background: rgba(8, 13, 32, .5); border-right: 1px solid var(--line); padding: 24px 14px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; color: #fff; font-weight: 600; font-size: 19px; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--gold); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--text); }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .11); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav .ico { width: 18px; height: 18px; flex: none; }
.rail-foot { margin-top: auto; padding: 12px; font-size: 13px; color: var(--faint); }
.rail-foot button { background: none; border: 0; color: var(--muted); padding: 0; cursor: pointer; text-decoration: underline; }

main { padding: 32px clamp(16px, 4vw, 48px) 40px; max-width: 1180px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }

.credit { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.credit p + p { margin-top: 4px; }
.credit b { color: var(--muted); font-weight: 600; }

.topbar, .bottombar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
    background: rgba(8, 13, 32, .6); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
  }
  .topbar .brand { padding: 0; }
  .topbar button { background: rgba(255, 255, 255, .06); border: 1px solid var(--line-strong); color: #fff; border-radius: 10px; padding: 6px 12px; }
  main { padding: 20px 16px 96px; }
  .bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(8, 13, 32, .72); border-top: 1px solid var(--line); z-index: 5; padding-bottom: env(safe-area-inset-bottom);
  }
  .bottombar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px;
    font-size: 12px; color: var(--faint); text-decoration: none;
  }
  .bottombar a[aria-current="page"] { color: var(--gold); }
  .bottombar .ico { width: 20px; height: 20px; }
}

.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.cols-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cols-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cols-2, .cols-even { grid-template-columns: minmax(0, 1fr); } }

/* ---------- the one bold thing: the adire balance card ---------- */
.balance {
  position: relative; overflow: hidden; border-radius: 20px; color: #fff; padding: 26px 28px 24px; min-height: 200px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 20px 50px rgba(10, 20, 60, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
  background: #1E3170;
}
.balance::before {
  /* Adire eleko: dotted rosettes and resist-dye diagonals, in pale indigo on indigo */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle, rgba(214, 224, 255, .26) 0 2.5px, transparent 3px) 0 0 / 26px 26px,
    radial-gradient(circle, transparent 0 8px, rgba(214, 224, 255, .15) 8px 9.5px, transparent 10px) 13px 13px / 26px 26px,
    repeating-linear-gradient(45deg, rgba(214, 224, 255, .08) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(-45deg, rgba(214, 224, 255, .06) 0 2px, transparent 2px 13px),
    linear-gradient(120deg, #1B2A5A 0%, #26408E 55%, #3A5FC4 100%);
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.4) 38%, #000 75%);
          mask-image: linear-gradient(100deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,.4) 38%, #000 75%);
}
.balance::after {
  /* a soft sheen across the top edge: the "glass" on the card */
  content: ""; position: absolute; inset: 0 0 55% 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), transparent);
}
.balance > * { position: relative; z-index: 1; }
.balance .label { color: #C9D3EC; font-size: 14px; }
.balance .amount { font-size: clamp(32px, 5vw, 46px); font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.balance .amount .kobo { font-size: .55em; opacity: .8; }
.balance .meta { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 14px; color: #DCE2F0; }
.balance .meta button {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); color: #fff;
  border-radius: 8px; padding: 3px 10px; cursor: pointer; font-size: 13px;
}
.balance .reveal { background: none; border: 0; color: #DCE2F0; cursor: pointer; padding: 0; text-decoration: underline; font-size: 13px; }
.tier { display: inline-block; border: 1px solid var(--gold); color: #F4DDA9; border-radius: 999px; padding: 1px 10px; font-size: 13px; }

/* ---------- actions ---------- */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 560px) { .actions { grid-template-columns: repeat(2, 1fr); } }
.action {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.action:hover { border-color: rgba(157, 180, 255, .5); background: linear-gradient(150deg, rgba(255,255,255,.15), rgba(255,255,255,.06)); color: var(--text); }
.action .ico { width: 22px; height: 22px; color: #9DB4FF; }
.action span { font-weight: 600; }
button.action { text-align: left; cursor: pointer; font: inherit; }
button.action small { font-size: 13px; }

/* ---------- buttons and forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px;
  padding: 10px 18px; border: 1px solid rgba(255, 255, 255, .18); cursor: pointer; font-weight: 600; text-decoration: none;
  background: linear-gradient(180deg, #6688E6, #4A6CD0); color: #fff; min-height: 44px;
  box-shadow: 0 6px 16px rgba(40, 70, 170, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn:hover { background: linear-gradient(180deg, #7495EE, #5577D8); color: #fff; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.secondary { background: rgba(255, 255, 255, .07); color: var(--text); border-color: var(--line-strong); box-shadow: none; }
.btn.secondary:hover { background: rgba(255, 255, 255, .13); }
.btn.quiet { background: none; color: #9DB4FF; padding: 6px 4px; min-height: 0; border: 0; box-shadow: none; }
.btn.danger { background: rgba(255, 144, 122, .08); color: var(--rust); border-color: rgba(255, 144, 122, .4); box-shadow: none; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

form.stack { max-width: 460px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
input, select {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; background: var(--field);
  min-height: 44px; width: 100%; color: var(--text);
}
input::placeholder { color: var(--faint); }
select option { background: #16213F; color: var(--text); }
input:focus-visible, select:focus-visible { outline: 3px solid rgba(110, 143, 234, .45); outline-offset: 0; border-color: #8FA8F3; }
input[aria-invalid="true"] { border-color: var(--rust); }
.inline-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: rgba(255, 255, 255, .06); }
.segmented button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: rgba(255, 255, 255, .16); color: #fff; }

.confirm-name { padding: 10px 12px; border-radius: 10px; background: rgba(91, 127, 224, .16); border: 1px solid rgba(91, 127, 224, .35); }
.confirm-name.bad { background: rgba(255, 144, 122, .12); border-color: rgba(255, 144, 122, .35); color: var(--rust); }
.error { color: var(--rust); font-size: 14px; }
details.tips { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--muted); background: rgba(255, 255, 255, .03); }
details.tips summary { cursor: pointer; color: var(--text); }
details.tips ul { margin: 8px 0 0; padding-left: 18px; }
details.tips code { color: var(--text); background: rgba(255, 255, 255, .08); padding: 0 5px; border-radius: 4px; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .what { min-width: 0; flex: 1; }
.list .what b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .what small { color: var(--muted); font-size: 13px; }
.list .amt { white-space: nowrap; font-weight: 600; text-align: right; }
.list li > .chip { align-self: center; }
.in { color: var(--green); }
.out { color: var(--text); }
.empty { color: var(--muted); padding: 18px 0; }

.chip { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .08); color: var(--muted); border: 1px solid var(--line); }
.chip.ok { background: rgba(79, 215, 160, .13); color: #7BE6BA; border-color: rgba(79, 215, 160, .3); }
.chip.bad { background: rgba(255, 144, 122, .13); color: #FFAD9C; border-color: rgba(255, 144, 122, .32); }
.chip.wait { background: rgba(226, 180, 87, .14); color: #F1CC7E; border-color: rgba(226, 180, 87, .32); }

.meter { height: 8px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, #5B7FE0, #8FA8F3); border-radius: 999px; width: 0; }
.meter.warn > i { background: linear-gradient(90deg, #C8962E, var(--gold)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 14px 0; }
.kv:last-child { margin-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* ---------- result screens ---------- */
.result { text-align: center; padding: 28px 20px; }
.result .mark {
  width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  font-size: 26px; font-weight: 700; border: 1px solid var(--line);
}
.result.ok .mark { background: rgba(79, 215, 160, .15); color: var(--green); }
.result.bad .mark { background: rgba(255, 144, 122, .15); color: var(--rust); }
.result.wait .mark { background: rgba(226, 180, 87, .15); color: var(--gold); }
.result .big { font-size: 30px; font-weight: 600; margin: 6px 0; }
.result .row { justify-content: center; margin-top: 18px; }
.token {
  margin: 14px auto 0; display: inline-block; padding: 12px 18px; border-radius: 12px; background: rgba(226, 180, 87, .12);
  border: 1px solid rgba(226, 180, 87, .4); color: #F6DDA6; font-size: 20px; letter-spacing: .06em; font-weight: 600;
}

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card-face {
  aspect-ratio: 1.586; border-radius: 16px; padding: 18px 20px; color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; background: #1E3170;
  border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 16px 36px rgba(5, 10, 35, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.card-face::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle, rgba(214, 224, 255, .18) 0 2px, transparent 2.5px) 0 0 / 20px 20px,
    linear-gradient(135deg, #2A458F, #1B2A5A 60%);
}
.card-face.frozen { filter: grayscale(.85); }
.card-face.frozen::after {
  content: "Frozen"; position: absolute; top: 14px; right: 16px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .18); padding: 2px 10px; border-radius: 999px;
}
.card-face > * { position: relative; }
.card-face .chipline { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #F0D58F, #C8962E); }
.card-face .pan { font-size: 20px; letter-spacing: .12em; }
.card-face .foot { display: flex; justify-content: space-between; font-size: 13px; color: #DCE2F0; }
.card-pick { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; width: 100%; border-radius: 16px; color: inherit; }
.card-pick[aria-pressed="true"] .card-face { outline: 3px solid var(--gold); outline-offset: 3px; }
.reveal-box { border: 1px solid rgba(226, 180, 87, .55); border-radius: var(--radius); padding: 20px; background: rgba(226, 180, 87, .08); }
.reveal-box .pan { font-size: 22px; letter-spacing: .1em; font-weight: 600; }
.preview { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; }
.more-links { display: grid; gap: 10px; }

/* ---------- passkey divider, camera ---------- */
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; margin: 16px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.camera-wrap { position: relative; border-radius: 16px; overflow: hidden; background: #000; max-width: 480px; aspect-ratio: 4 / 3; border: 1px solid var(--line-strong); }
.camera { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.camera-prompt { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; text-align: center; font-size: 19px; font-weight: 600;
  background: linear-gradient(0deg, rgba(5, 10, 30, .85), transparent); color: #fff; }
.camera-wrap::after { content: ""; position: absolute; left: 50%; top: 46%; width: 46%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border: 2px dashed rgba(226, 180, 87, .8); border-radius: 50%; pointer-events: none; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--blue); }
input[type="file"] { padding: 8px; }

/* ---------- authenticator setup ---------- */
.qr { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; display: block; }
.setup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 560px) { .setup { grid-template-columns: minmax(0, 1fr); } }
.secret-key { font-size: 15px; letter-spacing: .08em; overflow-wrap: anywhere; font-weight: 600; }
ol.howto { margin: 0; padding-left: 20px; color: var(--muted); }
ol.howto li + li { margin-top: 6px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 14px; border-radius: 12px;
  background: rgba(6, 11, 28, .4); border: 1px solid var(--line); font-size: 15px; letter-spacing: .06em; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-right: 1px solid var(--line); }
.auth-art::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle, rgba(214, 224, 255, .2) 0 3px, transparent 3.5px) 0 0 / 34px 34px,
    radial-gradient(circle, transparent 0 11px, rgba(214, 224, 255, .12) 11px 13px, transparent 13.5px) 17px 17px / 34px 34px,
    repeating-linear-gradient(45deg, rgba(214, 224, 255, .06) 0 2px, transparent 2px 17px),
    linear-gradient(160deg, rgba(27, 42, 90, .92), rgba(47, 79, 162, .85));
}
.auth-art > * { position: relative; }
.auth-art h1 { font-size: clamp(30px, 3.4vw, 46px); max-width: 12ch; }
.auth-art p { color: #C9D3EC; max-width: 38ch; margin-top: 12px; }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 20px; }
.auth-form .box {
  width: 100%; max-width: 430px; padding: 32px; border-radius: 20px; background: var(--glass);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.auth-form .credit { max-width: 430px; width: 100%; margin-top: 0; border-top: 0; padding-top: 0; text-align: center; }
.auth-form h2 { font-size: 24px; margin-bottom: 6px; }
.steps { display: flex; gap: 6px; margin: 14px 0 22px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: rgba(255, 255, 255, .12); }
.steps i.on { background: linear-gradient(90deg, #5B7FE0, #8FA8F3); }
.devcode { background: rgba(226, 180, 87, .1); border: 1px solid rgba(226, 180, 87, .4); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #F6DDA6; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px; min-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-art .tagline-foot { display: none; }
  .auth-form .box { padding: 24px 20px; }
}

/* ---------- tables (ops) ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(255, 255, 255, .05); }

/* ---------- ops console: denser ---------- */
.ops { font-size: 14px; }
.ops-bar { background: rgba(8, 13, 32, .6); border-bottom: 1px solid var(--line); color: #fff; padding: 14px clamp(16px, 3vw, 32px);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 5; }
.ops-bar .brand { padding: 0; font-size: 17px; }
.ops main { max-width: 1400px; padding-top: 22px; }
.ops .panel { padding: 16px; }
.health { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.health div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .05); }
.health .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.health .UP .dot { background: var(--green); box-shadow: 0 0 8px rgba(79, 215, 160, .7); }
.health .DOWN .dot, .health .UNREACHABLE .dot { background: var(--rust); box-shadow: 0 0 8px rgba(255, 144, 122, .7); }
.health .UNREACHABLE, .health .DOWN { border-color: rgba(255, 144, 122, .4); background: rgba(255, 144, 122, .1); }
.health b { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health small { color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ops h3.small { margin: 16px 0 6px; }
.stat { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 12px; }
.stat b { display: block; font-size: 20px; font-weight: 600; }
.stat.good { border-color: var(--green); }
.stat.bad { border-color: var(--rust); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 20; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: rgba(18, 28, 60, .85); border: 1px solid var(--line-strong); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); }
.toast.bad { background: rgba(120, 40, 30, .85); border-color: rgba(255, 144, 122, .5); }
@media (max-width: 860px) { .toasts { bottom: 76px; } }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(157, 180, 255, .25); border-top-color: #9DB4FF; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 24px 0; }

/* ---------- accessibility and fallbacks ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, .action, .auth-form .box { background: var(--glass-solid); }
  .rail, .topbar, .bottombar, .ops-bar { background: #0B1229; }
}
/* ---- Phase 5b: cash codes, agents, POS terminal, USSD phone, disputes ---- */
.gap-top { margin-top: 16px; }
.cash-code-box { text-align: center; }
.cash-code { font-size: clamp(34px, 6vw, 46px); font-weight: 600; letter-spacing: .14em; color: #F4DDA9; margin-bottom: 4px; }
li.dispute { align-items: flex-start; }
li.dispute .what b { white-space: normal; }
li.dispute form.stack, li.dispute .stack { max-width: 420px; }

.pos-wrap { max-width: 420px; margin: 0 auto; padding-top: 28px; }
.pos { background: linear-gradient(180deg, #1A2340, #0B1229); border: 1px solid var(--line-strong); border-radius: 28px;
  padding: 18px 18px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08); }
.pos-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 6px 12px; letter-spacing: .02em; }
.pos-top span:first-child { color: var(--gold); font-weight: 600; }
.pos-screen { background: #F3F1E8; color: #1B2233; border-radius: 16px; padding: 18px; min-height: 380px; text-align: center; }
.pos-screen .field > span, .pos-screen p { color: #1B2233; }
.pos-screen input { background: #fff; color: #1B2233; border-color: #C9C5B5; }
.pos-screen .error { color: #B23A22; }
.pos-screen .muted, .pos-screen .loading { color: #5A6278; }
.pos-merchant { font-weight: 600; font-size: 15px; }
.pos-amount { font-size: 34px; font-weight: 600; margin: 10px 0 14px; letter-spacing: -.01em; }
.pos-qr { margin: 0 auto 10px; border: 1px solid #DDD8C6; }
.pos-screen .btn + .btn, .pos-screen .error + .btn, .pos-screen p + .btn { margin-top: 12px; }
.pos-screen .btn.secondary { color: #1B2233; background: #E4E0D2; border-color: #CFCABA; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.key { font: inherit; font-size: 22px; font-weight: 600; min-height: 54px; border-radius: 12px; border: 1px solid #D5D0BF;
  background: #FFFFFF; color: #1B2233; cursor: pointer; }
.key:active { background: #E8E4D6; }
.pos-approved .mark { width: 64px; height: 64px; border-radius: 50%; margin: 30px auto 10px; display: grid; place-items: center;
  font-size: 32px; background: #DDF3E8; color: #13804F; }
.pos-approved b { font-size: 20px; }
.pos-foot { text-align: center; margin-top: 14px; }

.ussd-phone { max-width: 300px; background: #0B1229; border: 1px solid var(--line-strong); border-radius: 22px; padding: 14px; }
.ussd-screen { background: #C7D3B3; color: #1D2A15; border-radius: 8px; padding: 12px; min-height: 150px; margin: 0 0 10px;
  font: 500 14px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; }
.ussd-phone input { flex: 1; min-width: 0; }

/* ---- Phase 6: save & invest, ajo, credit, pay later ---- */
.sandbox-note { color: var(--gold); }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 16px 0; }
.goal { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: rgba(255, 255, 255, .03); }
.goal > * + * { margin-top: 10px; }
.goal.locked { border-color: rgba(226, 180, 87, .4); }
.goal.new { border-style: dashed; }
.goal .row input { flex: 1; min-width: 90px; }
.goal-balance { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }

.score { display: flex; align-items: baseline; gap: 14px; margin: 6px 0 14px; }
.score-number { font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.grade { font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }
.grade-A, .grade-B { color: #7BE6BA; border-color: rgba(79, 215, 160, .4); }
.grade-C { color: #F1CC7E; border-color: rgba(226, 180, 87, .4); }
.grade-D { color: #FFAD9C; border-color: rgba(255, 144, 122, .4); }
.scale { position: relative; display: grid; grid-template-columns: 200fr 100fr 100fr 150fr auto; height: 34px; margin-bottom: 12px;
  font-size: 12px; color: var(--faint); padding-top: 14px;
  background: linear-gradient(90deg, #C9604B 0%, #C9604B 36%, #C8962E 36%, #C8962E 54%, #8FA8F3 54%, #8FA8F3 73%, #3FB98A 73%) top / 100% 8px no-repeat;
  border-radius: 4px; }
.scale .marker { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; background: #fff; border-radius: 2px;
  box-shadow: 0 0 0 2px var(--night); }
.factors { list-style: none; margin: 16px 0 0; padding: 0; }
.factors li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.factors li:last-child { border-bottom: 0; }
.factors small { display: block; color: var(--muted); font-size: 13px; }
.pts { min-width: 48px; text-align: right; font-weight: 600; color: var(--muted); }
.pts.up { color: var(--green); }
.pts.down { color: var(--rust); }

.rounds { list-style: none; margin: 0; padding: 0; }
.rounds li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rounds li.now { border-left: 3px solid var(--gold); padding-left: 12px; }
.payers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.payer { font-size: 13px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; gap: 6px; align-items: center; }
.payer.paid { color: #7BE6BA; border-color: rgba(79, 215, 160, .3); }
.payer.missed { color: #FFAD9C; border-color: rgba(255, 144, 122, .4); }
.invite { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.overdue { border-color: rgba(255, 144, 122, .45); background: rgba(255, 144, 122, .08); }
.overdue b { color: #FFAD9C; display: block; margin-bottom: 4px; }
.paylater { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.paylater > * + * { margin-top: 10px; }

@media (prefers-reduced-transparency: reduce) {
  .panel, .action, .auth-form .box { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .rail, .topbar, .bottombar, .ops-bar, .toast { background: #0B1229; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(255, 255, 255, .35); --line-strong: rgba(255, 255, 255, .55); --muted: #CBD2E4; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  html, body { background: #fff; color: #000; }
  body::before { display: none; }
  .rail, .topbar, .bottombar { display: none; }
}

.consent { margin-top: 1rem; }
.consent h3 { margin: 0; }

/* ---------- Phase 4b: "Confirm it's you" dialog, devices, documents ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(4, 8, 22, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal {
  width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--glass-solid); border-color: var(--line-strong);
  box-shadow: 0 24px 60px rgba(2, 6, 20, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: modal-in .18s ease-out;
}
.modal h2 { margin: 0 0 6px; }
.modal .btn { width: 100%; }
.modal .spread .btn { width: auto; }
.modal form.stack { max-width: none; }
.modal > * + * { margin-top: 14px; }
.stepup-summary {
  margin: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(226, 180, 87, .35);
  background: rgba(226, 180, 87, .1); color: #F6DDA6; font-weight: 600; font-size: 17px;
}
.row.spread { justify-content: space-between; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

.consent-more summary { cursor: pointer; color: var(--muted); }
.consent-more summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.consent-more .preview { margin-top: 10px; }

.doc-preview {
  display: block; max-width: 100%; max-height: 360px; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25);
}

/* ---------- Phase 5: paying businesses, merchant tools ---------- */
.merchant-card { display: flex; gap: 14px; align-items: center; }
.merchant-card > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.merchant-card b { font-size: 18px; }
.merchant-card small { color: var(--muted); }
.merchant-mark {
  flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 700; font-size: 20px; color: var(--night); background: linear-gradient(140deg, var(--gold), #F3D08A);
}
/* A QR code reads best as a plain white card, whatever the theme */
.qr-frame {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 16px 14px;
  margin: 4px auto 0; max-width: 300px; border-radius: 16px; background: #fff; color: #111a33; text-align: center;
}
.qr-frame .qr.big { width: 220px; height: 220px; padding: 0; border-radius: 0; }
.qr-frame b { font-size: 16px; }
.qr-frame .amount { font-size: 22px; }
.qr-frame small { color: #4a5470; }
.camera.scan { transform: none; }
.stat small { display: block; }
.gap-top { margin-top: 18px; }
