:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1f262f; --line: #2c3540; --text: #e8edf2; --muted: #8b97a5;
  --accent: #ff8a3d; --accent-ink: #1a0d00; --start: #ffd166; --tested: #4cc38a; --mine: #5aa9ff; --blank: #a07cff; --danger: #ff5c5c;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.small { font-size: 13px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: #10141a; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { width: 30px; height: 30px; border-radius: 6px; background: #fff; }
.brand .mark { background: var(--accent); color: var(--accent-ink); padding: 2px 6px; border-radius: 6px; margin-right: 4px; }
.top-right { display: flex; gap: 6px; align-items: center; }
.top-right select { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }

main { max-width: 640px; margin: 0 auto; padding: 12px 16px 120px; }
h1 { font-size: 20px; margin: 8px 0 4px; }
h2 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.chip.dim { opacity: .5; }

.list { display: flex; flex-direction: column; gap: 8px; }
.thick { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thick .t { min-width: 92px; }
.thick .t b { font-size: 17px; }
.thick .t span { display: block; color: var(--muted); font-size: 13px; }
.gas { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 8px 12px; cursor: pointer; min-height: 40px; }
.gas small { display: block; color: var(--muted); font-size: 11px; }
.gas.sel { outline: 2px solid var(--accent); }
.gas.custom { border-style: dashed; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.title-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tabs { display: flex; gap: 4px; margin: 12px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: none; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

table.vals { width: 100%; border-collapse: collapse; }
table.vals td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.vals td.l { color: var(--muted); width: 44%; }
table.vals td.v { font-weight: 700; font-size: 17px; }
table.vals td.v small { font-weight: 400; color: var(--muted); font-size: 12px; display: block; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.dot.start { background: var(--start); } .dot.tested { background: var(--tested); } .dot.mine { background: var(--mine); } .dot.blank { background: var(--blank); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 10px; }

.stages { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stage { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.stage h3 { margin: 0 0 6px; font-size: 14px; color: var(--accent); }
.stage div { display: flex; justify-content: space-between; gap: 6px; font-size: 14px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.stage div span:first-child { color: var(--muted); }

.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; text-decoration: none; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; }

label.f { display: block; margin: 10px 0; }
label.f span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 label.f { margin: 4px 0; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.warn { background: #3a2f12; border: 1px solid #6b5418; color: #ffe2a0; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.ok { background: #12301f; border: 1px solid #1f5a39; color: #b9f0d1; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.err { color: var(--danger); min-height: 20px; margin: 6px 0; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 11px; border-radius: 999px; padding: 2px 8px; background: var(--panel2); color: var(--muted); }
.pill.off { color: var(--danger); }

.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #10141aee; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; justify-content: center; z-index: 6; }
.sheet { position: fixed; inset: 0; background: #000a; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet .in { background: var(--panel); width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #222b36; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; z-index: 20; max-width: 90vw; }
.login { max-width: 380px; margin: 40px auto; }
code.link { display: block; word-break: break-all; background: var(--panel2); padding: 8px; border-radius: 8px; font-size: 13px; }
.offbar { background: #3a2f12; color: #ffe2a0; border-bottom: 1px solid #6b5418; padding: 8px 16px; font-size: 13px; position: sticky; top: 57px; z-index: 4; }
.top-right .btn { padding: 8px 10px; min-height: 40px; }
@media (max-width: 430px) { .brand .txt { display: none; } }
