:root {
  --fg: #1c1d1f; --muted: #5d6168; --bg: #fafaf8; --card: #ffffff; --line: #dedfe2;
  --accent: #e8590c; --accent-fg: #fff; --ok: #2b8a3e; --warn: #b7791f; --bad: #c92a2a;
  --warn-bg: #fff4e6; --warn-line: #f08c00;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --fg: #e9eaec; --muted: #a3a7ad; --bg: #141517; --card: #1c1e21; --line: #33363b;
          --warn-bg: #2b1f0f; --warn-line: #f08c00; --ok: #51cf66; --warn: #fcc419; --bad: #ff6b6b; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; font-size: 16px; }
main { max-width: 680px; margin: 0 auto; padding: 16px 16px 40px; }
main.narrow { max-width: 560px; padding-top: 32px; }
h1 { font-size: 1.6rem; margin: 8px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
a { color: var(--accent); }
.lead { color: var(--muted); margin: 0 0 16px; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.num { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%;
       background: var(--fg); color: var(--bg); font-size: 0.85em; margin-right: 6px; }
.optional { font-weight: normal; color: var(--muted); font-size: 0.85em; margin-left: 4px; }
.hint { color: var(--muted); font-size: 0.9rem; }

.warning { background: var(--warn-bg); border: 2px solid var(--warn-line); }
.warning h2 { color: var(--warn-line); }
.warning ul { margin: 0; padding-left: 20px; }
.warning li { margin: 4px 0; }

.gauge { padding: 12px 16px; }
.gauge-text { font-size: 0.95rem; margin-bottom: 8px; }
.bar { position: relative; height: 10px; margin-bottom: 18px; }
.bar progress { display: block; width: 100%; height: 10px; border: 0; border-radius: 5px; background: var(--line);
                -webkit-appearance: none; appearance: none; overflow: hidden; color: var(--accent); }
.bar progress::-webkit-progress-bar { background: var(--line); border-radius: 5px; }
.bar progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
.bar progress::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.mark { position: absolute; top: 12px; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); }
.mark::before { content: ""; position: absolute; left: 50%; top: -14px; width: 2px; height: 14px; background: var(--muted); }
/* milestones 100 and 300 of a 300 scale (config.MILESTONES) */
.mark.m1 { left: 33.333%; }
.mark.m2 { left: 100%; transform: translateX(-100%); }
.mark.m2::before { left: 100%; }
.mark.reached { color: var(--accent); font-weight: 600; }

/* Seed written as on a backup: one word under the other, numbered; 24 words in
   two columns read top to bottom (1-12 left, 13-24 right), as on the SeedSigner card */
.seed { list-style: none; counter-reset: w; padding: 0; margin: 14px 0 6px;
        display: grid; grid-template-columns: minmax(0, 15rem); gap: 6px; }
.seed.long { grid-template-columns: repeat(2, minmax(0, 15rem)); grid-template-rows: repeat(12, auto);
             grid-auto-flow: column; column-gap: 10px; }
.seed li { counter-increment: w; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
           font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.95rem; text-transform: uppercase; }
.seed li::before { content: counter(w) "."; display: inline-block; min-width: 2.2em; color: var(--muted);
                   margin-right: 4px; font-size: 0.8rem; }
.seed li.error { grid-column: 1 / -1; text-transform: none; font-family: inherit; color: var(--bad); }
.seed li.error::before { content: none; }

button, .button { font: inherit; cursor: pointer; }
.button { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--fg);
          border-radius: 8px; padding: 10px 14px; text-decoration: none; text-align: center; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.button.small { padding: 6px 10px; font-size: 0.9rem; }
.button.wide { width: 100%; margin-top: 12px; }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
button.danger { background: var(--bad); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 600; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.seed-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seed-tools .button { margin: 0; padding: 8px 14px; }
@media (max-width: 420px) { .segmented .seg { padding: 8px 12px; } }
.seed.loading { opacity: 0.4; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented .seg { background: var(--card); color: var(--fg); padding: 8px 16px; text-decoration: none; }
.segmented .seg[aria-current="true"] { background: var(--fg); color: var(--bg); font-weight: 600; }

.choice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; border: 0; padding: 0; }
.choice legend { width: 100%; font-size: 0.85rem; color: var(--muted); padding: 0; margin-bottom: 6px; }
.choice input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label { border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px;
                padding: 6px 12px; font-size: 0.9rem; cursor: pointer; user-select: none; }
.choice input:checked + label { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.choice input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Without JavaScript (or on the onion site): the native file field; with it, on the
   clear site, the camera / webcam / file buttons replace it */
.js-only { display: none !important; }
html.js .buttons.js-only { display: flex !important; }
html.js .button.js-only { display: inline-block !important; }
.file-field { margin-top: 12px; }
.file-field .file-label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.file-field input { width: 100%; font: inherit; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
html.js .clear-site .file-field { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.webcam video { width: 100%; border-radius: 8px; margin-top: 10px; background: #000; }
.preview { margin: 12px 0 0; }
.preview img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; }
.preview figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.status { min-height: 1.5em; margin: 8px 0 0; color: var(--muted); }

.result { border: 2px solid var(--fg); }
.score { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.score .big { font-size: 2rem; font-weight: 700; }
.badge { border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; font-weight: 600; color: #fff; }
.badge.ok { background: var(--ok); } .badge.warn { background: var(--warn); } .badge.bad { background: var(--bad); }
table.words { width: 100%; border-collapse: collapse; margin: 10px 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }
table.words th { text-align: left; font-family: system-ui, sans-serif; color: var(--muted); font-weight: 500; font-size: 0.8rem; }
table.words td, table.words th { padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.words tr.wrong td { color: var(--bad); }
table.words tr.right td:last-child { color: var(--ok); }
.doubt { display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; border-radius: 50%; background: var(--warn); color: #fff; font-size: 0.75rem; font-weight: 700; }
.delete-box { background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.delete-box p { margin: 4px 0; }
.delete-box .link { word-break: break-all; font-size: 0.85rem; }

footer { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 24px; }
footer p { margin: 4px 0; }
.prose h2 { margin-top: 20px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
footer .onion .mono { word-break: break-all; }
.fingerprint { border-left: 4px solid var(--muted); padding: 4px 10px; } .fingerprint.ok { border-color: var(--ok); } .fingerprint.warn { border-color: var(--warn); } .fingerprint code { font-size: 1.05rem; letter-spacing: 0.08em; }
/* Trust gauge: four segments, the fourth reserved for a seed verified by its fingerprint */
.trust-line { margin: 4px 0; }
.trust { display: inline-flex; gap: 3px; vertical-align: middle; }
.trust i { display: inline-block; width: 22px; height: 9px; border-radius: 2px; border: 1px solid var(--muted); }
.trust i.on { border-color: transparent; background: var(--warn); }
.trust.t1 i.on { background: var(--bad); } .trust.t4 i.on { background: var(--ok); }
.trust-label { font-weight: 600; font-size: 0.9rem; }
.seed-fp { display: inline-flex; align-items: baseline; gap: 10px; margin: 8px 0 0; padding: 8px 14px;
           border: 2px solid var(--accent); border-radius: 8px; }
.seed-fp-label { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.seed-fp code { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.12em; }
.fp-advice { border-left: 4px solid var(--accent); padding: 4px 10px; }
.news { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0 0 16px; }
