:root {
  color-scheme: dark;
  --bg: #070b12; --surface: #0f1622; --surface-2: #151e2e; --border: #263247; --text: #f3f6fb; --muted: #93a1b8;
  --accent: #ff8a1e; --accent-2: #ffb347; --ok: #46c97a; --bad: #ff7a7a; --warn: #ffd166;
  --radius: 14px; --gap: 12px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { padding-bottom: env(safe-area-inset-bottom); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.shell { max-width: 980px; margin: 0 auto; padding: 0 16px 96px; }
header.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #070b12ee; border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
header.bar h1 { margin: 0; font-size: 16px; letter-spacing: .04em; flex: 1; }
header.bar h1 b { color: var(--accent); }
.chip { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--muted); background: var(--surface); }
nav.tabs { position: fixed; inset: auto 0 0 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #0b111c; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { min-height: 52px; border: 0; background: none; color: var(--muted); font-size: 12px; position: relative; }
nav.tabs button[aria-current="page"] { color: var(--accent-2); }
nav.tabs button[aria-current="page"]::after { content: ""; position: absolute; inset: 0 25% auto; height: 2px; background: var(--accent); }
nav.tabs .badge { position: absolute; top: 6px; right: 22%; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #111; font-size: 11px; font-weight: 800; }
h2 { font-size: 18px; margin: 20px 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span, .muted { color: var(--muted); font-size: 13px; }
.stat.alert { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.row { display: grid; gap: 4px; text-align: start; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
button.row:hover { border-color: var(--accent-2); }
.row .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.row .amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.status[data-s="proof_submitted"], .status[data-s="pending"] { color: var(--warn); border-color: var(--warn); }
.status[data-s="approved"] { color: var(--ok); border-color: var(--ok); }
.status[data-s="rejected"], .status[data-s="refunded"], .status[data-s="expired"], .status[data-s="cancelled"] { color: var(--bad); border-color: var(--bad); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.toolbar > * { flex: 1 1 140px; }
input, select, textarea { width: 100%; padding: 11px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 700; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1a0f00; border-color: transparent; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.actions .btn { flex: 1 1 140px; }
.login { max-width: 420px; margin: 12vh auto 0; display: grid; gap: 14px; padding: 0 16px; }
.login h1 { margin: 0; text-align: center; }
.login h1 b { color: var(--accent); }
.notice { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.notice.err { border-color: var(--bad); color: var(--bad); }
.notice.ok { border-color: var(--ok); color: var(--ok); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.timeline li { display: flex; gap: 8px; color: var(--muted); }
.timeline li b { color: var(--text); font-weight: 600; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 10; background: #000a; display: grid; align-items: end; }
.sheet { background: var(--surface); border-radius: 18px 18px 0 0; border: 1px solid var(--border); border-bottom: 0; max-height: 92dvh; overflow: auto; padding: 16px; width: min(100%, 720px); margin: 0 auto; }
.sheet .close { float: inline-end; }
.evidence { max-width: 100%; max-height: 60dvh; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; }
@media (min-width: 760px) {
  nav.tabs { position: static; grid-auto-flow: column; grid-auto-columns: max-content; gap: 6px; border: 0; background: none; padding: 10px 16px; max-width: 980px; margin: 0 auto; }
  nav.tabs button { padding: 0 16px; border-radius: 10px; min-height: 40px; }
  nav.tabs button[aria-current="page"] { background: var(--surface-2); }
  nav.tabs button[aria-current="page"]::after { display: none; }
  nav.tabs .badge { position: static; margin-inline-start: 6px; }
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 18px; border-bottom: 1px solid var(--border); }
  .shell { padding-bottom: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
