[hidden] { display: none !important; }
:root {
  --bg: #f4f6f8; --card: #fff; --text: #14212e; --muted: #5b6b7a; --line: #d9e0e6;
  --brand: #123a5c; --brand-2: #1e5a8a; --ok: #1d8a4e; --ok-bg: #e3f4ea; --bad: #c0392b; --bad-bg: #fbe5e2;
  --na: #6b7785; --na-bg: #eceff2; --warn: #9a6400; --warn-bg: #fff3d6; --focus: #f2b632;
  --info-bg: #fff8dc; --info-line: #f1d67a; --alt: #d98a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151c; --card: #17212b; --text: #e6edf3; --muted: #93a3b3; --line: #2a3744;
    --brand: #0b2a44; --brand-2: #4d9be0; --ok: #43c47d; --ok-bg: #143324; --bad: #ff7a6b; --bad-bg: #3a1a17;
    --na: #a3b0bd; --na-bg: #24303b; --warn: #ffc857; --warn-bg: #3a2e10;
    --info-bg: #2e2810; --info-line: #6b5a1c; --alt: #e39a17;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--brand-2); }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  background: var(--brand); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.net { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.15); }
.net.off { background: var(--warn); color: #000; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10;
}
.tabs a { flex: 1; text-align: center; padding: 8px 0 10px; text-decoration: none; color: var(--muted); font-size: 12px; }
.tabs a span { display: block; font-size: 20px; line-height: 24px; }
.tabs a.on { color: var(--brand-2); font-weight: 600; }
.tabs b { font-weight: inherit; }
h1 { font-size: 24px; margin: 4px 0 12px; }
h2 { font-size: 19px; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 15px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--card); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 11px 12px; min-height: 48px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.code-input { text-transform: uppercase; font-size: 22px; letter-spacing: 2px; font-weight: 700; }
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 12px 16px; min-height: 48px;
  background: var(--brand-2); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
}
button.secondary, .btn.secondary { background: var(--na-bg); color: var(--text); }
button.block, .btn.block { width: 100%; }
button.big { min-height: 60px; font-size: 19px; }
button:disabled { opacity: .5; }
.list-link {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.list-link .chev { margin-left: auto; color: var(--muted); font-size: 22px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--na-bg); color: var(--na); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.issue { border-left: 4px solid var(--bad); }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px; margin-bottom: 12px; font-size: 15px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }

/* checklist */
.section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.section > summary { list-style: none; padding: 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 18px; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary .prog { margin-left: auto; }
.section[open] > summary { border-bottom: 1px solid var(--line); }
.section.done > summary { background: var(--ok-bg); }
.item { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-of-type { border-bottom: 0; }
.item .txt { font-weight: 500; }
.item .req { color: var(--bad); font-weight: 700; }
.item .help { font-size: 14px; color: var(--muted); margin-top: 3px; white-space: pre-line; }
.infobox {
  display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 10px 12px;
  background: var(--info-bg); border: 1.5px solid var(--info-line); border-radius: 12px;
}
.infobox .txt { font-weight: 600; }
.i-icon {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: #f6c945; color: #000;
  font: 800 21px/34px Georgia, "Times New Roman", serif; text-align: center; box-shadow: 0 0 0 3px rgba(246,201,69,.3);
}
.item.invalid { background: var(--bad-bg); }
.item .known { font-size: 13px; color: var(--bad); margin-top: 4px; }
.item img.thumb { max-width: 120px; max-height: 90px; border-radius: 8px; margin-top: 6px; display: block; }
.choices { display: flex; gap: 8px; margin-top: 10px; }
.choices button { flex: 1; background: var(--na-bg); color: var(--text); border: 2px solid transparent; }
.choices button.sel-ok { background: var(--ok); color: #fff; }
.choices button.sel-notok { background: var(--bad); color: #fff; }
.choices button.sel-alt { background: var(--alt); color: #000; }
.choices button.sel-na { background: var(--na); color: #fff; }
.reading { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.reading input { max-width: 160px; font-size: 20px; font-weight: 700; }
.item .comment { margin-top: 8px; }
.sec-foot { padding: 12px 14px; background: var(--bg); }
.locked .choices button, .locked input, .locked textarea { pointer-events: none; }
.answer { margin-top: 6px; font-size: 15px; }

.badge.running-ind { background: var(--bad); color: #fff; animation: pulse-ind 2s ease-in-out infinite; }
@keyframes pulse-ind { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .badge.running-ind { animation: none; } }
details.others > summary { cursor: pointer; }
details.others .list-link { margin: 10px 0 0; }
.mcard.running { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
button.mstart { background: var(--ok); }
button.mstop { background: var(--bad); }
.ivline { font-size: 14px; margin-top: 4px; }
.ivline.warn { color: var(--warn); }
.ivline.bad { color: var(--bad); }
.mread input { max-width: none; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom));
  background: #14212e; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: 90%;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 15px;
}
.scanner { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner .frame { position: absolute; top: 50%; left: 50%; width: 64vmin; height: 64vmin; transform: translate(-50%, -50%); border: 3px solid var(--focus); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.scanner .bar { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 10px; background: #000; color: #fff; align-items: center; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.hist-item { font-size: 15px; padding: 4px 0; display: flex; gap: 8px; }
.hist-item .r { min-width: 22px; text-align: center; font-weight: 700; }
