:root {
    --fg: #1a1a1a; --muted: #6b7280; --line: #e5e7eb; --bg: #fff; --soft: #f7f7f8;
    --accent: #2563eb; --ok: #0a7a2f; --err: #b00020;
}
@media (prefers-color-scheme: dark) {
    :root { --fg: #e8e8ea; --muted: #9ca3af; --line: #2c2f36; --bg: #16181d; --soft: #1e2127; --accent: #60a5fa; }
}
* { box-sizing: border-box; }
body {
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--fg); background: var(--bg); margin: 0; padding: 2rem 1rem;
}
main { max-width: 44rem; margin: 0 auto; }
h1 { font-size: 1.4rem; margin: 0 0 .3rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 .6rem; }
.sub { color: var(--muted); margin: 0 0 2rem; }
label { display: block; margin: 1rem 0 .3rem; font-weight: 500; }
input, select, textarea {
    font: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid var(--line);
    border-radius: 6px; background: var(--bg); color: var(--fg);
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; min-height: 9rem; }
button {
    font: inherit; font-weight: 500; padding: .55rem 1.1rem; border: 0; border-radius: 6px;
    background: var(--accent); color: #fff; cursor: pointer; margin-top: 1rem;
}
button:disabled { opacity: .5; cursor: default; }
button.secondary { background: var(--soft); color: var(--fg); border: 1px solid var(--line); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.3rem; margin: 1rem 0; background: var(--soft); }
.msg { padding: .7rem .9rem; border-radius: 6px; margin: 1rem 0; }
.msg.err { background: #fdecef; color: var(--err); }
.msg.ok { background: #eaf6ee; color: var(--ok); }
@media (prefers-color-scheme: dark) {
    .msg.err { background: #3a1e24; } .msg.ok { background: #16301f; }
}
.hidden { display: none; }
small, .muted { color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; margin-top: .6rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--soft); padding: .1em .35em; border-radius: 3px; }
#qr img { image-rendering: pixelated; max-width: 260px; height: auto; background: #fff; padding: 8px; border-radius: 6px; }
