:root {
	--bg: #0d1218;
	--card: #151d26;
	--line: #263241;
	--text: #e7ecf1;
	--muted: #93a2b3;
	--brass: #d9a84e;
	--brass-dim: #8a6a2f;
	--ok: #4cc38a;
	--bad: #f0645a;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: radial-gradient(1200px 600px at 50% -200px, #1b2633 0%, var(--bg) 60%) fixed, var(--bg); color: var(--text); font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; }
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.top h1 { margin: 0; font-size: 28px; letter-spacing: 0.02em; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.dial { width: 56px; height: 56px; flex: none; }
.dial .ring { fill: #1d2833; stroke: var(--brass); stroke-width: 3; }
.dial .face { fill: #111820; stroke: var(--brass-dim); stroke-width: 2; }
.dial .ticks { stroke: var(--brass); stroke-width: 2.5; stroke-linecap: round; }
.dial .handle { stroke: var(--brass); stroke-width: 4; stroke-linecap: round; transform-origin: 32px 32px; transition: transform 0.6s ease; }
.dial .hub { fill: var(--brass); }
body:has(.pill.open) .dial .handle { transform: rotate(90deg); }
.pill { margin-left: auto; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; }
.pill.sealed { color: var(--bad); border-color: #5a2a28; background: #2a1514; }
.pill.open { color: var(--ok); border-color: #1f4d39; background: #10241b; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
h2 { margin: 0 0 8px; font-size: 21px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
h3 small { color: var(--muted); font-weight: 400; }
p { margin: 8px 0 14px; }
.note { color: var(--muted); font-size: 14px; }
.once { border-left: 3px solid var(--brass); padding-left: 12px; }
button { font: inherit; border-radius: 10px; padding: 12px 18px; cursor: pointer; min-height: 44px; border: 1px solid transparent; }
button:disabled { opacity: 0.55; cursor: wait; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.primary { background: var(--brass); color: #1a1206; font-weight: 700; width: 100%; }
.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.danger { background: #3a1716; color: #ffb3ad; border-color: #6b2a27; }
.link { background: none; color: var(--brass); padding: 12px 0; text-decoration: underline; width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > button { flex: 1 1 160px; }
.steps { padding-left: 20px; color: var(--muted); }
.steps li.now { color: var(--text); font-weight: 600; }
.steps li.done { color: var(--ok); }
.words { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0; margin: 12px 0 18px; list-style: none; counter-reset: w; }
.words li { counter-increment: w; background: #0f161e; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 600 16px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.words li::before { content: counter(w); color: var(--brass-dim); display: inline-block; min-width: 2.2em; font-weight: 400; }
@media (min-width: 720px) { .words { grid-template-columns: repeat(4, 1fr); } main { padding-top: 48px; } }
label { display: block; margin: 10px 0; color: var(--muted); }
input, textarea { display: block; width: 100%; margin-top: 6px; background: #0f161e; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 16px ui-monospace, SFMono-Regular, Menlo, monospace; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.03em; }
.warn, .err { border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.warn { background: #3a1716; border: 1px solid var(--bad); color: #ffd0cb; }
.err { background: #2a1d10; border: 1px solid var(--brass-dim); color: #ffe2b0; }
.audit { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; border-top: 1px solid var(--line); }
.audit li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.audit li time { color: var(--muted); font-size: 12px; }
.audit li span { color: var(--muted); overflow-wrap: anywhere; }
.audit li.bad b { color: var(--bad); }
@media (min-width: 720px) { .audit li { grid-template-columns: 150px 170px 1fr; align-items: baseline; } }
footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding: 4px 4px 0; }
[hidden] { display: none !important; }
