:root {
  --bg: #0b0b0a;
  --surface: #161614;
  --line: #2b2c26;
  --ink: #f4f4ee;
  --muted: #b5b8a8;
  --acc: #d4ff3a;
  --on-acc: #0b0b0a;
  --warn: #ffc857;
  --stop: #ff8a7a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
a { color: var(--acc); text-underline-offset: 3px; }
#app { max-width: 680px; margin: 0 auto; padding: 0 20px 40px; }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: -0.01em; }
.conn { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--acc); }
.connect { display: flex; gap: 8px; }
.connect input { width: 220px; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 28px 0 6px; }
.intro p { color: var(--muted); margin: 0 0 8px; }
section { margin-top: 30px; }
h2 { display: flex; align-items: baseline; gap: 10px; font-size: 19px; margin: 0 0 12px; }
h2 span { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 13px; background: var(--acc); color: var(--on-acc); font-size: 14px; font-weight: 800; flex: none; }
h2 small { font-weight: 400; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.card.on { border: 2px solid var(--acc); padding: 13px; }
.card input { margin-top: 4px; accent-color: var(--acc); width: 18px; height: 18px; flex: none; }
.card b { display: block; }
.card small { display: block; color: var(--muted); font-size: 14px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
input[type=range] { accent-color: var(--acc); padding: 0; border: none; background: none; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--acc); }
input.short { width: 120px; }
label { display: block; margin-top: 12px; font-size: 15px; font-weight: 600; }
label > input, label > select { margin-top: 6px; font-weight: 400; }
label.inline, label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
label.inline input { width: 90px; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > label { flex: 1 1 140px; }
.row.between { justify-content: space-between; align-items: center; }
.unit { color: var(--muted); font-weight: 400; }
.fields { margin-top: 14px; padding: 4px 16px 16px; border: 1px solid var(--line); border-radius: 12px; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.hint.ok { color: var(--acc); }
.source { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.source b { color: var(--ink); }
button { font: inherit; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary, .connect button { background: var(--acc); color: var(--on-acc); border-color: var(--acc); font-weight: 700; }
button.ghost { margin-top: 10px; }
button.link { background: none; border: none; color: var(--acc); text-decoration: underline; padding: 0 4px; min-height: 0; }
button.icon { width: 44px; padding: 0; flex: none; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-top: 14px; }
.seg button { border: none; background: none; font-size: 14px; }
.seg button[aria-pressed=true] { background: var(--acc); color: var(--on-acc); font-weight: 700; }
.options { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; counter-reset: o; }
.options li { display: flex; gap: 6px; align-items: center; }
.options li::before { counter-increment: o; content: counter(o); width: 22px; color: var(--muted); font-size: 14px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips button { border-radius: 22px; font-size: 14px; }
.big { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.big #pct { color: var(--acc); }
.big #pword, .big .muted { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.muted { color: var(--muted); }
.pcts { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.pcts li { display: flex; align-items: center; gap: 10px; }
.pcts span { flex: 1; }
.pcts input { width: 90px; }
.checks p { margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 15px; }
.checks .stop { border-left: 3px solid var(--stop); }
.checks .warn { border-left: 3px solid var(--warn); }
.checks .ok { border-left: 3px solid var(--acc); }
.pcard { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pcard p { margin: 8px 0 0; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: var(--line); color: var(--acc); }
.stmt { font-size: 19px; font-weight: 650; line-height: 1.3; }
.acc { color: var(--acc); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
pre { white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.notice.ok { background: #1f2a0b; border: 1px solid #4b5f12; }
.notice.error { background: #2a1210; border: 1px solid #6b2a22; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.loading { color: var(--muted); padding: 40px 0; }
footer { max-width: 680px; margin: 0 auto; padding: 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
@media (max-width: 480px) { .connect { width: 100%; } .connect input { flex: 1; width: auto; } h1 { font-size: 26px; } }
.fields.quiet { padding: 12px 16px 16px; }
.fields.quiet p { margin: 4px 0 0; }
label small { font-weight: 400; margin-left: 6px; }
section > .link { margin-top: 12px; }
.tabs { display: flex; gap: 6px; margin-top: 14px; }
.tabs button { border-radius: 22px; }
.tabs button[aria-pressed=true] { background: var(--acc); color: var(--on-acc); border-color: var(--acc); font-weight: 700; }
h2.plain { font-size: 17px; }
.pcard.mine { margin-top: 10px; }
.pcard.mine > button { margin-top: 12px; }
.small { font-size: 13px; }
.fields.resolve { margin-top: 12px; }
.chips button[aria-pressed=true] { background: var(--acc); color: var(--on-acc); border-color: var(--acc); font-weight: 700; }
.connect.wide { margin-top: 14px; }
.connect.wide input { flex: 1; width: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 18px; }
.tile { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tile b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.tile span { color: var(--muted); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 10px; background: var(--line); color: var(--ink); }
.tag.warn { color: var(--warn); }

.forkof { border: 1px solid var(--acc); border-radius: 18px; padding: 18px 20px; background: color-mix(in srgb, var(--acc) 6%, var(--surface)); }
.forkof .label { margin: 0 0 6px; font: 700 12px 'JetBrains Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.forkof .stmt { margin: 0 0 6px; font-size: 1.2rem; font-weight: 600; }
.forkof .muted { margin: 0 0 8px; }
