:root { color-scheme: light dark; --bg:#f3f4f6; --card:#fff; --text:#111827; --muted:#6b7280; --accent:#2563eb; --border:#e5e7eb; --warn:#fff7ed; --warnb:#fdba74; --danger:#dc2626; --ok:#16a34a; }
@media (prefers-color-scheme: dark) { :root { --bg:#0f172a; --card:#1e293b; --text:#f1f5f9; --muted:#94a3b8; --accent:#60a5fa; --border:#334155; --warn:#3b2a13; --warnb:#b45309; --ok:#4ade80; } }
* { box-sizing: border-box; }
body { margin:0; font: 16px/1.45 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--text); padding-bottom: env(safe-area-inset-bottom); }
header { display:flex; align-items:center; justify-content:space-between; padding: calc(env(safe-area-inset-top) + 14px) 18px 10px; position:sticky; top:0; background:var(--bg); }
h1 { margin:0; font-size:22px; }
h2 { margin:0 0 8px; font-size:17px; display:flex; justify-content:space-between; align-items:center; }
main { padding: 0 14px 30px; max-width: 560px; margin: 0 auto; }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px; margin-bottom:14px; }
.card.warn { background:var(--warn); border-color:var(--warnb); }
.pill { font-size:12px; padding:3px 10px; border-radius:999px; background:var(--border); color:var(--muted); }
.pill.ok { background:#dcfce7; color:#166534; } .pill.bad { background:#fee2e2; color:#991b1b; }
label { display:block; margin:10px 0; font-size:14px; color:var(--muted); }
input[type=text], input:not([type]) { display:block; width:100%; margin-top:4px; font-size:18px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--bg); color:var(--text); }
#code { font-family: ui-monospace, Menlo, monospace; letter-spacing:.25em; text-transform:uppercase; font-size:24px; }
button { font: inherit; padding:12px 16px; border-radius:10px; border:1px solid var(--border); background:var(--bg); color:var(--text); cursor:pointer; }
button.primary { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600; width:100%; margin-top:6px; }
button.danger { color:var(--danger); } button.small { padding:4px 10px; font-size:13px; font-weight:400; }
button:disabled { opacity:.5; }
.actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; } .actions .primary { width:auto; flex:1; margin:0; }
.row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:15px; }
.row > span:first-child { color:var(--muted); } .row input { width:60%; text-align:right; font-size:16px; padding:6px 8px; margin:0; }
.msg { font-size:14px; color:var(--muted); min-height:1.2em; margin:10px 0 0; white-space:pre-wrap; } .msg.err { color:var(--danger); } .msg.ok { color:var(--ok); }
.switch { position:relative; width:46px; height:28px; margin:0; } .switch input { opacity:0; width:0; height:0; }
.switch i { position:absolute; inset:0; background:var(--border); border-radius:999px; transition:.2s; }
.switch i:before { content:""; position:absolute; width:22px; height:22px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
.switch input:checked + i { background:var(--accent); } .switch input:checked + i:before { transform:translateX(18px); }
ul#history { list-style:none; margin:0; padding:0; }
#history li { padding:10px 0; border-bottom:1px solid var(--border); }
#history li:last-child { border-bottom:0; }
#history .t { font-weight:600; display:flex; justify-content:space-between; gap:8px; }
#history .t time { font-weight:400; color:var(--muted); font-size:13px; white-space:nowrap; }
#history .b { color:var(--text); font-size:15px; white-space:pre-wrap; word-break:break-word; }
#history .m { font-size:12px; color:var(--muted); margin-top:2px; }
#history .m .fail { color:var(--danger); }
#history a { color:var(--accent); }
.empty { color:var(--muted); font-size:14px; }
