/* Phone first: one column, large buttons. Always dark. */
:root {
  --bg: #15171a; --panel: #1d2024; --ink: #e7e9ec; --muted: #9aa0a8; --line: #30343a; --soft: #23292e;
  --accent: #6fb3d2; --accent-ink: #0d1114; --danger: #e07a66; --ok: #6cc28f; --warn: #e0b04d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h2 { font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h3 { font-size: 15px; margin: 14px 0 6px; }
p { margin: 0 0 10px; }
small { font-size: 13px; font-weight: 400; }
.muted { color: var(--muted); }
.top { position: sticky; top: 0; z-index: 5; padding: 10px 16px calc(10px); background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; justify-content: space-between; }
.brand { font-weight: 700; font-size: 18px; } .brand span { color: var(--accent); }
.private { font-size: 13px; color: var(--ok); }
#modes { display: flex; gap: 6px; width: 100%; margin-top: 6px; }
#modes button { flex: 1; min-height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: inherit; cursor: pointer; }
#modes button.on { background: var(--soft); color: var(--ink); font-weight: 700; border-color: var(--accent); }
.version { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: var(--bg); cursor: pointer; font-size: 14px; }
.version.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.version .body { white-space: pre-wrap; max-height: 9em; overflow: auto; color: var(--muted); }
main { max-width: 640px; margin: 0 auto; padding: 14px 12px 70px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card.done { border-color: var(--ok); }
.stepnum { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--accent);
  font-size: 15px; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--soft); color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; text-align: center; }
.btn.big { display: flex; width: 100%; min-height: 54px; font-size: 17px; font-weight: 600; margin: 8px 0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row.between { justify-content: space-between; }
input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: var(--accent); margin: 2px 0 0; }
input:not([type=checkbox]), select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; min-height: 44px; max-width: 100%; }
textarea { width: 100%; min-height: 260px; font-size: 14px; line-height: 1.45; }
.opt { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.opt span { display: block; } .opt small { display: block; color: var(--muted); }
.field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.field input { flex: 1 1 140px; }
details > summary { cursor: pointer; list-style: none; } details > summary::-webkit-details-marker { display: none; }
details > summary h2 { margin: 0; } details[open] > summary h2 { margin-bottom: 10px; }
details > summary h2::after { content: "▾"; margin-left: auto; color: var(--muted); }
details[open] > summary h2::after { content: "▴"; }
.file { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: var(--bg); }
.file.on { border-color: var(--accent); }
.file .head { display: flex; gap: 12px; padding: 12px; cursor: pointer; align-items: flex-start; }
.file .name { font-weight: 600; overflow-wrap: anywhere; }
.file .meta { font-size: 13px; color: var(--muted); }
.file .body { padding: 0 12px 10px; }
.file details summary { color: var(--accent); font-size: 14px; padding: 6px 0; }
.doc { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.doc .t { overflow-wrap: anywhere; } .doc .n { margin-left: auto; color: var(--muted); white-space: nowrap; }
.note-warn, .check { display: flex; gap: 8px; font-size: 14px; padding: 8px 10px; border-radius: 8px; margin: 6px 0; background: var(--soft); }
.check.ok::before { content: "✓"; color: var(--ok); font-weight: 700; }
.check.warn { border: 1px solid var(--warn); } .check.warn::before { content: "!"; color: var(--warn); font-weight: 800; }
.check.stop { border: 1px solid var(--danger); } .check.stop::before { content: "✕"; color: var(--danger); font-weight: 800; }
.note-warn { border: 1px solid var(--warn); flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.fact { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.fact .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; } .fact .k { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.sub { font-size: 12px; color: var(--muted); }
.ov { font-size: 14px; padding: 7px 0; border-top: 1px solid var(--line); }
.ov i { color: var(--muted); }
.restore { border: 2px solid var(--warn); border-radius: 10px; padding: 12px; margin: 10px 0; font-weight: 600; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.citem { border-left: 4px solid var(--line); padding: 6px 0 6px 10px; margin: 8px 0; font-size: 14px; }
.citem .w { font-style: italic; } .citem .c { white-space: pre-wrap; color: var(--muted); max-height: 7.5em; overflow: hidden; }
.citem.open .c { max-height: none; color: var(--ink); }
footer { text-align: center; font-size: 13px; padding: 10px 0; }
#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px;
  border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 92vw; text-align: center; z-index: 9; }
#toast.on { opacity: .97; }
[hidden] { display: none !important; }
