:root {
  --bg: #0b0e13;
  --bg-2: #10151c;
  --panel: #151b24;
  --panel-2: #1b2330;
  --line: #263142;
  --ink: #e6edf3;
  --mut: #8b98a9;
  --dim: #5b6778;
  --acc: #f5a524;
  --acc-ink: #1a1203;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --info: #58a6ff;
  --r-milspec: #4b69ff;
  --r-restricted: #8847ff;
  --r-classified: #d32ce6;
  --r-covert: #eb4b4b;
  --r-gold: #e4ae39;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg) radial-gradient(1200px 500px at 70% -10%, #1a2433 0%, transparent 60%) no-repeat;
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; letter-spacing: .02em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.mut { color: var(--mut); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.mode-banner { text-align: center; font-size: 12px; padding: 4px 12px; font-weight: 600; letter-spacing: .04em; }
.mode-banner.mock { background: #3a2a05; color: #f5c451; border-bottom: 1px solid #5b4310; }
.mode-banner.live { background: #0d2b18; color: #6fdc8c; border-bottom: 1px solid #1a4d2b; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 60px;
  background: rgba(11, 14, 19, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: .12em; font-size: 16px; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--acc); }
.logo-mark { width: 22px; height: 16px; border-radius: 3px; background: var(--acc); position: relative; }
.logo-mark::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 3px; background: var(--bg); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: var(--mut); padding: 8px 12px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--panel); text-decoration: none; }
.nav a.active { color: var(--ink); background: var(--panel-2); }
.topbar-right { display: flex; gap: 10px; align-items: center; }
/* wallet: active balance + currency menu */
.wallet { position: relative; display: flex; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.wallet:hover, .wallet:focus-within { border-color: #3a475b; }
.balance {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer;
  padding: 3px 8px 3px 4px; border-radius: 999px; color: var(--ink); font: 700 14px system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.balance:hover .caret { color: var(--ink); }
.wallet-cur { font: 800 10.5px var(--mono); letter-spacing: .06em; background: var(--bg-2); color: var(--acc); border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; }
.balance .caret { color: var(--dim); font-size: 10px; }
.wallet .plus { background: var(--acc); color: var(--acc-ink); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.wallet .plus:hover { text-decoration: none; filter: brightness(1.08); }
.wallet-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 230px;
  background: #0e131a; border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.55); animation: pop .12s;
}
.wm-head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 6px 8px 4px; }
.wm-row {
  display: grid; grid-template-columns: 44px 1fr 16px; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; border-radius: 7px; padding: 8px; color: var(--ink); font: inherit; cursor: pointer; text-align: left;
}
.wm-row:hover { background: var(--panel-2); }
.wm-row.on { background: #2a1f08; }
.wm-cur { font: 800 12px var(--mono); color: var(--mut); }
.wm-row.on .wm-cur { color: var(--acc); }
.wm-bal { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.wm-tick { color: var(--acc); font-weight: 800; }
.wm-dep { display: block; margin-top: 4px; border-top: 1px solid var(--line); padding: 8px 8px 4px; font-weight: 600; }
.user-btn { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; white-space: nowrap; }
.user-btn:hover { border-color: var(--mut); }
.user-btn.compact { padding: 6px 10px; font-weight: 800; letter-spacing: .05em; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---------- generic ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font: 600 14px system-ui, sans-serif; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--mut); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.good { background: #1d4d2a; border-color: #2e7d43; }
.btn.danger { background: #4d1d1d; border-color: #7d2e2e; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.lg { padding: 13px 22px; font-size: 16px; }
.btn.ghost { background: none; }
input, select, textarea {
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font: inherit; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); }
textarea { font-family: var(--mono); font-size: 12.5px; width: 100%; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mut); }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--mut); font-size: 13px; cursor: pointer; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; border: 1px solid transparent; white-space: nowrap; }
.pill.ok { background: #12301b; color: #6fdc8c; border-color: #1f5130; }
.pill.warn { background: #33270a; color: #f0c254; border-color: #5b4310; }
.pill.bad { background: #3a1414; color: #ff8a84; border-color: #6b2323; }
.pill.info { background: #0f2540; color: #79b8ff; border-color: #1d4372; }
.pill.mutp { background: var(--panel-2); color: var(--mut); border-color: var(--line); }
.empty { text-align: center; color: var(--mut); padding: 48px 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--mut); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #1d2532; vertical-align: top; }
tr:hover td { background: #171e29; }
.table-wrap { overflow-x: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--mut); padding: 10px 14px; font: 600 14px system-ui; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--acc); }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--mut); }

/* ---------- auth ---------- */
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth .logo { justify-content: center; font-size: 24px; margin-bottom: 8px; }
.auth .tag { text-align: center; color: var(--mut); margin-bottom: 24px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth .optional { border-top: 1px dashed var(--line); padding-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth .optional .full { grid-column: 1 / -1; }
.form-error { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- case cards ---------- */
.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.case-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform .15s, border-color .15s;
}
.case-card:hover { transform: translateY(-3px); border-color: var(--c1); text-decoration: none; }
.case-art {
  width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 120%, var(--c1), transparent 70%), linear-gradient(160deg, #1d2633, #0f141b);
  display: grid; place-items: center;
}
.case-box {
  width: 62%; height: 58%; border-radius: 8px; position: relative;
  background: linear-gradient(170deg, var(--c2), var(--c1) 55%, color-mix(in srgb, var(--c1) 60%, #000));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--c1) 45%, transparent), inset 0 2px 0 rgba(255,255,255,.35);
}
.case-box::before { content: ""; position: absolute; left: 0; right: 0; top: 38%; height: 9%; background: rgba(0,0,0,.35); }
.case-box::after { content: ""; position: absolute; left: 42%; width: 16%; top: 30%; height: 26%; border-radius: 3px; background: #1a1f27; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.case-card .name { font-weight: 700; }
.case-card .price { color: var(--acc); font-weight: 800; font-size: 16px; }

/* ---------- items ---------- */
.item {
  --rc: var(--r-milspec);
  position: relative; background: linear-gradient(180deg, #1b2330 0%, #121821 100%);
  border: 1px solid var(--line); border-bottom: 3px solid var(--rc); border-radius: 8px; padding: 10px 10px 8px;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden; min-width: 0;
}
.item::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 28%, transparent), transparent 65%); pointer-events: none; }
.item .art { height: 64px; display: grid; place-items: center; position: relative; }
.item .art svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.item .w { font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.item .f { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.item .meta { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; position: relative; gap: 6px; }
.item .val { color: var(--acc); font-weight: 800; font-variant-numeric: tabular-nums; }
.item .st { color: #cf6a32; font-weight: 700; font-size: 10.5px; }
.item.sel { outline: 2px solid var(--acc); outline-offset: -2px; }
.r-milspec { --rc: var(--r-milspec); } .r-restricted { --rc: var(--r-restricted); } .r-classified { --rc: var(--r-classified); }
.r-covert { --rc: var(--r-covert); } .r-gold { --rc: var(--r-gold); }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.items-grid .item { cursor: pointer; }
.gold-mystery .art { font-size: 40px; color: var(--r-gold); font-weight: 900; }

/* ---------- case page ---------- */
.case-hero { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: center; }
.case-hero .case-art { aspect-ratio: 4 / 3; }
.open-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.count-pick { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.count-pick button { background: none; border: 0; color: var(--mut); padding: 9px 13px; font: 700 14px system-ui; cursor: pointer; }
.count-pick button.active { background: var(--panel-2); color: var(--ink); }
.odds { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.odds span { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--bg-2); border-left: 3px solid var(--rc); }

.reels { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.reel {
  position: relative; height: 150px; overflow: hidden; border-radius: 10px; background: #0a0d12; border: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.reels.multi .reel { height: 116px; }
.reel-track { display: flex; gap: 6px; padding: 8px 0; height: 100%; will-change: transform; }
.reel-track .item { flex: 0 0 140px; height: 100%; }
.reels.multi .reel-track .item { flex-basis: 116px; }
.reels.multi .item .art { height: 44px; }
.reel-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--acc); box-shadow: 0 0 12px var(--acc); z-index: 2; }
.reel-marker::before, .reel-marker::after { content: ""; position: absolute; left: -7px; border: 8px solid transparent; }
.reel-marker::before { top: 0; border-top-color: var(--acc); }
.reel-marker::after { bottom: 0; border-bottom-color: var(--acc); }
.reel .item.win { animation: winpulse 1s ease-in-out 2; }
@keyframes winpulse { 50% { box-shadow: 0 0 24px var(--rc); } }

/* ---------- drop modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .2s; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(720px, 100%); max-height: 90vh; overflow: auto; }
.modal h2 { display: flex; align-items: center; gap: 10px; }
.drops { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.drops .item .art { height: 90px; }
.drops .item { animation: pop .35s ease-out backwards; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- deposit ---------- */
.acting-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.acting-bar .mono { word-break: break-all; }
.acting-bar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 6px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--acc); color: var(--acc-ink); font-weight: 800; margin-right: 8px; }
.code-input { font: 700 20px var(--mono); letter-spacing: .12em; text-transform: uppercase; flex: 1; }
.preview { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--bg-2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; word-break: break-word; }
.big-credit { font-size: 28px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }
.countdown { font-variant-numeric: tabular-nums; }

/* deposit: wallet picker + per-currency preview */
.wallet-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  display: flex; align-items: baseline; gap: 8px; background: none; border: 1px solid transparent; border-radius: 7px;
  color: var(--mut); padding: 6px 12px; font: 600 13px system-ui, sans-serif; cursor: pointer; font-variant-numeric: tabular-nums;
}
.seg button b { font: 800 12px var(--mono); letter-spacing: .04em; }
.seg button span { font-size: 12px; color: var(--dim); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel-2); border-color: #5b4310; color: var(--ink); }
.seg button.on b { color: var(--acc); }
.seg button.on span { color: var(--mut); }
.fiat-table { margin-top: 12px; font-size: 12.5px; }
.fiat-table th { font-size: 11px; padding: 6px 8px; }
.fiat-table td { padding: 6px 8px; vertical-align: middle; }
.fiat-table tr.pickable { cursor: pointer; }
.fiat-table tr.on td { background: #1d1708; }
.fiat-table tr.on td:first-child { box-shadow: inset 3px 0 0 var(--acc); }

/* ---------- logs ---------- */
.log-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.log-toolbar input[type=search] { flex: 1; min-width: 180px; }
.flow-list { display: flex; flex-direction: column; gap: 6px; }
.flow-row {
  display: grid; grid-template-columns: 150px 120px 1fr auto; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--good); border-radius: 8px; padding: 10px 14px; cursor: pointer; color: var(--ink);
}
.flow-row:hover { border-color: var(--mut); text-decoration: none; }
.flow-row.has-err { border-left-color: var(--bad); }
.flow-row.has-warn { border-left-color: var(--warn); }
.flow-row .msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mut); }
.entries { display: flex; flex-direction: column; gap: 6px; }
.entry { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.entry > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 96px 64px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; font-size: 13px;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary:hover { background: #18202b; }
.entry .ts { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.entry .line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12.5px; }
.entry.api { border-left: 3px solid var(--info); }
.entry.api.err { border-left-color: var(--bad); }
.entry.event { border-left: 3px solid #39424f; }
.entry.event.warn { border-left-color: var(--warn); }
.entry.event.error { border-left-color: var(--bad); }
.entry-body { padding: 12px 14px; border-top: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; gap: 12px; }
.http-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.http-cols h4 { margin: 0 0 6px; font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
pre.json {
  margin: 0; padding: 10px 12px; background: #080b10; border: 1px solid #1d2532; border-radius: 6px;
  font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 420px; overflow: auto;
}
.j-k { color: #79c0ff; } .j-s { color: #a5d6ff; } .j-n { color: #ffa657; } .j-b { color: #ff7b72; } .j-null { color: #8b949e; }
.flow-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- admin ---------- */
.console-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.config-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13px; }
.config-list dt { color: var(--mut); }
.config-list dd { margin: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: pop .2s; }
.toast.err { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--good); }
.toast .t-title { font-weight: 700; }
.toast .t-sub { color: var(--mut); font-size: 12.5px; margin-top: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .grid2, .steps, .console-grid, .http-cols, .case-hero { grid-template-columns: 1fr; }
  .case-hero .case-art { max-width: 320px; }
  .flow-row { grid-template-columns: 1fr auto; }
  .flow-row .ops, .flow-row .who { display: none; }
}
/* Top bar on mid-size screens: shorter labels first, then the nav gets its own row. */
@media (max-width: 1240px) {
  .lbl-long, .sw-back span { display: none; }
}
@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; }
  .topbar-right { margin-left: auto; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; flex-basis: 100%; }
  .topbar-right { margin-left: auto; }
  main { padding: 16px 16px 60px; }
  .entry > summary { grid-template-columns: 70px 1fr auto; }
  .entry > summary .kindcol { display: none; }
  .reel-track .item { flex-basis: 112px; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ---------- API hover hints (test tooling) ---------- */
.hints-btn { color: var(--mut); font-size: 12.5px; }
.hints-btn.on { color: var(--acc); border-color: #5b4310; background: #2a1f08; }
.api-hint {
  position: fixed; z-index: 80; width: min(460px, calc(100vw - 16px));
  background: #0e131a; border: 1px solid var(--line); border-top: 3px solid var(--acc); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 12px 32px rgba(0,0,0,.55); font-size: 12.5px; line-height: 1.45; pointer-events: none;
  animation: pop .12s;
}
.api-hint .ah-title { font-weight: 700; margin-bottom: 6px; }
.api-hint .ah-calls { display: flex; flex-direction: column; gap: 4px; }
.api-hint .ah-call { display: grid; grid-template-columns: 12px auto 1fr; align-items: baseline; column-gap: 6px; row-gap: 2px; }
.api-hint .ah-tags { grid-column: 3; display: flex; align-items: center; gap: 6px; }
.api-hint .ah-call .mono { font-size: 12px; overflow-wrap: anywhere; }
.api-hint .ah-arrow { color: var(--dim); }
.api-hint .ah-m { font: 700 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--panel-2); color: var(--info); }
.api-hint .ah-m.m-post { color: #6fdc8c; }
.api-hint .ah-m.m-patch { color: #f0c254; }
.api-hint .ah-note { color: var(--mut); font-size: 11.5px; }
.api-hint .ah-body { margin: 8px 0 0; padding: 6px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font: 11.5px/1.4 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow: hidden; }
.api-hint .ah-h { margin-top: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); }
.api-hint .ah-steps { margin: 4px 0 0; padding-left: 18px; }
.api-hint .ah-steps li { margin: 1px 0; }
.api-hint .ah-warn { margin-top: 8px; color: #f0c254; background: #33270a; border: 1px solid #5b4310; border-radius: 6px; padding: 4px 8px; }

/* ---------- API log sidebar ---------- */
.dock-btn { display: inline-flex; align-items: center; gap: 7px; color: var(--mut); font-size: 12.5px; position: relative; }
.dock-btn.on { color: var(--info); border-color: #1d4372; background: #0f2540; }
.dock-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--info); color: #04111f; font: 800 10.5px/18px system-ui; text-align: center; }
.dock-badge.err { background: var(--bad); color: #fff; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.live-dot.on { background: var(--good); box-shadow: 0 0 0 0 rgba(63,185,80,.6); animation: livepulse 2s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 6px rgba(63,185,80,0); } 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); } }

body { --dock-w: 440px; }
@media (min-width: 1100px) {
  body.dock-open { padding-right: var(--dock-w); }
  body.dock-open .toasts { right: calc(var(--dock-w) + 16px); }
}
body.dock-resizing { cursor: ew-resize; user-select: none; }
.logdock {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(var(--dock-w), 100vw);
  display: flex; flex-direction: column; background: #0d1117; border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(0,0,0,.35); animation: dockin .18s ease-out;
}
@keyframes dockin { from { transform: translateX(24px); opacity: 0; } }
.ld-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.ld-resize:hover, body.dock-resizing .ld-resize { background: linear-gradient(90deg, transparent 3px, var(--acc) 3px, var(--acc) 5px, transparent 5px); }
.ld-head { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 14px; height: 52px; border-bottom: 1px solid var(--line); flex: none; }
.ld-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ld-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-actions { display: flex; gap: 2px; }
.ld-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: none; border: 1px solid transparent; color: var(--mut); cursor: pointer; font: 600 13px system-ui; }
.ld-icon:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.ld-icon.on { color: var(--warn); border-color: #5b4310; background: #2a1f08; }
.ld-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex: none; }
.ld-chips { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.chip { background: var(--bg-2); color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font: 600 12px system-ui; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--ink); border-color: #3a475b; background: var(--panel-2); }
.chip[data-f="errors"][aria-pressed="true"] { color: #ff8a84; border-color: #6b2323; background: #3a1414; }
.ld-scope { padding: 3px 8px; font-size: 12px; border-radius: 999px; }
.ld-filters input[type=search] { flex-basis: 100%; padding: 6px 10px; font-size: 12.5px; }
.ld-held { flex: none; }
.ld-held button { width: 100%; background: #0f2540; color: #79b8ff; border: 0; border-bottom: 1px solid #1d4372; padding: 7px; font: 600 12.5px system-ui; cursor: pointer; }
.ld-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.ld-empty { color: var(--mut); text-align: center; padding: 40px 20px; line-height: 1.7; }
.ld-e { border-bottom: 1px solid #1a212c; border-left: 3px solid transparent; }
.ld-e.api { border-left-color: #1d4372; }
.ld-e.api.err { border-left-color: var(--bad); background: #160d0e; }
.ld-e.ev.warn { border-left-color: var(--warn); }
.ld-e.ev.error { border-left-color: var(--bad); }
.ld-e.fresh { animation: ldfresh 1.6s ease-out; }
@keyframes ldfresh { from { background: #1d2b40; } }
.ld-e > summary {
  list-style: none; cursor: pointer; display: grid; align-items: center; column-gap: 8px; row-gap: 2px; padding: 7px 12px 7px 10px; font-size: 12.5px;
}
.ld-e > summary::-webkit-details-marker { display: none; }
.ld-e > summary:hover { background: #141a23; }
.ld-e[open] > summary { background: #141a23; }
.ld-e.api > summary { grid-template-columns: 84px auto 1fr auto auto; }
.ld-e.ev > summary { grid-template-columns: 84px auto 1fr; }
.ld-ts { font: 11px var(--mono); color: var(--dim); }
.ld-m { font: 700 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--panel-2); color: var(--info); }
.ld-m.m-post { color: #6fdc8c; }
.ld-path { font: 12px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ld-ms { font: 11px var(--mono); color: var(--dim); text-align: right; min-width: 44px; }
.ld-lv { font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.ld-e.ev.warn .ld-lv { color: var(--warn); }
.ld-e.ev.error .ld-lv { color: var(--bad); }
.ld-ev { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.ld-ev b { font: 600 12px var(--mono); }
.ld-sub { grid-column: 2 / -1; display: flex; gap: 10px; font-size: 11px; color: var(--dim); min-width: 0; overflow: hidden; white-space: nowrap; }
.ld-sub a { color: var(--dim); }
.ld-sub a:hover { color: var(--info); }
.ld-body { padding: 4px 12px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.ld-body h4 { margin: 4px 0 0; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.ld-body pre.json { max-height: 260px; font-size: 11.5px; }
.ld-hdrs > summary { cursor: pointer; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.ld-hdrs[open] > summary { margin-bottom: 6px; }
.ld-foot { display: flex; justify-content: space-between; padding: 7px 12px; border-top: 1px solid var(--line); flex: none; }
kbd { font: 700 10.5px var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--mut); }
@media (max-width: 640px) {
  .dock-btn { font-size: 0; gap: 0; padding: 9px; }
  .dock-btn .live-dot { width: 9px; height: 9px; }
}

/* ---------- account switcher (admin test tool) ---------- */
.switcher { position: relative; display: flex; align-items: center; gap: 6px; }
.sw-btn {
  display: flex; align-items: center; gap: 8px; max-width: 230px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); border-radius: 999px;
  padding: 3px 10px 3px 3px; font: inherit; font-size: 12.5px; transition: border-color .15s, box-shadow .15s;
}
.sw-btn:hover, .sw-btn[aria-expanded="true"] { border-color: #3a4a62; }
.sw-label { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; text-align: left; }
.sw-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-as { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #f0c254; }
.sw-btn .caret { color: var(--dim); font-size: 10px; }
.switcher.acting .sw-btn { border-color: #5b4310; background: #2a1f08; box-shadow: 0 0 0 3px rgba(245,165,36,.12); }
.sw-back {
  display: flex; align-items: center; gap: 4px; max-width: 150px; cursor: pointer; white-space: nowrap;
  background: none; border: 1px solid #5b4310; color: #f0c254; border-radius: 999px; padding: 6px 10px; font: inherit; font-size: 12px;
}
.sw-back span { overflow: hidden; text-overflow: ellipsis; }
.sw-back:hover { background: #2a1f08; }
.av {
  --h: 210; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 800 10.5px/1 var(--mono); color: hsl(var(--h) 80% 88%); background: hsl(var(--h) 45% 26%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) 50% 40%);
}
.switch-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; width: 370px; max-width: calc(100vw - 24px);
  background: #0e131a; border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,.6); animation: pop .12s; transform-origin: top right;
}
.sm-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
#switch-q { width: 100%; margin-bottom: 6px; }
.sm-list { max-height: min(60vh, 420px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sw-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center; width: 100%;
  background: none; border: 0; border-radius: 8px; padding: 7px 8px; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.sw-row:hover, .sw-row.kb { background: var(--panel-2); }
.sw-row.on { background: #2a1f08; }
.sw-row.on.kb, .sw-row.on:hover { background: #33260b; }
.sw-main { display: flex; flex-direction: column; min-width: 0; }
.sw-uname { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sw-sub { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-bal { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--mut); }
.sw-tick { color: var(--acc); font-weight: 800; }
.sw-empty { padding: 18px; text-align: center; color: var(--dim); }
.sm-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 6px 2px; font-size: 12px; }
.sm-foot kbd { margin-right: 2px; }
@media (max-width: 640px) {
  /* Phone: the right-hand controls wrap instead of widening the page; the menu spans the top bar. */
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .hints-btn { display: none; } /* hover hints don't apply to touch */
  .switcher { position: static; }
  .switch-menu { left: 12px; right: 12px; top: calc(100% + 4px); width: auto; max-width: none; transform-origin: top center; }
  .sw-as { display: none; }
  .sw-name { max-width: 96px; }
}

/* Redeem again (test bypass of the local-duplicate guard) */
.again-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.again-res { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); display: grid; gap: 6px; }
.again-body { margin: 0; max-height: 220px; overflow: auto; font: 12px/1.45 var(--mono); white-space: pre-wrap; word-break: break-all; }
