:root {
  --bg: #f4f6f5; --card: #fff; --soft: #eef1ef; --fg: #1b2420; --muted: #5f6b66; --line: #dde3e0;
  --accent: #1f6feb; --on-accent: #fff; --ok: #1a7f45; --ok-bg: #e3f4ea; --warn: #9a5b00; --warn-bg: #fdf1dc;
  --err: #b3261e; --err-bg: #fbe7e5; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111614; --card: #1b221f; --soft: #232c28; --fg: #e7ece9; --muted: #9aa6a1; --line: #2e3833;
          --accent: #4c8dff; --ok: #5fd28f; --ok-bg: #173324; --warn: #f0b24a; --warn-bg: #3a2c12;
          --err: #ff8a80; --err-bg: #3b1b18; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header .brand { font-weight: 600; }
nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
nav a, nav button { padding: 6px 12px; border-radius: var(--radius); color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
nav a.on { background: var(--soft); color: var(--fg); }
main { max-width: 860px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 16px 0 4px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.metric { background: var(--soft); border-radius: var(--radius); padding: 12px; }
.metric b { display: block; font-size: 20px; font-weight: 600; }
.pill { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--soft); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.err { background: var(--err-bg); color: var(--err); }
.status { display: flex; align-items: center; gap: 14px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }
.qr { display: block; width: 280px; max-width: 100%; aspect-ratio: 1; margin: 16px auto; background: #fff; border-radius: 8px; }
.code { font: 600 32px/1.2 ui-monospace, monospace; letter-spacing: 4px; text-align: center; margin: 16px 0; }
button, .btn { font: inherit; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
button:hover { background: var(--soft); }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button.danger { color: var(--err); }
input, select { font: inherit; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--fg); }
input[type=text], input[type=password], input[type=search] { width: 100%; }
.field { display: flex; gap: 8px; } .field input { flex: 1; font-family: ui-monospace, monospace; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; }
.chip button { border: 0; padding: 0 2px; background: none; color: var(--muted); }
.results button { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--line); cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions.end { justify-content: flex-end; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list li:first-child { border-top: 0; }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); margin-bottom: 16px; }
.notice.err { background: var(--err-bg); color: var(--err); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: var(--radius); }
.login { max-width: 360px; margin: 12vh auto; }
pre { background: var(--soft); padding: 10px; border-radius: var(--radius); overflow-x: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
[hidden] { display: none !important; }
.full { width: 100%; } .center { text-align: center; } .mt { margin-top: 12px; }
