:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #1b1f24; --muted: #5d6673; --border: #dde1e6;
  --accent: #2357d5; --accent-text: #ffffff; --danger: #b42318; --ok: #157347; --warn-bg: #fff6e0; --warn: #7a5200;
  --radius: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111317; --surface: #1a1d23; --text: #e8eaed; --muted: #9aa3ae; --border: #2c313a;
    --accent: #6c95ff; --accent-text: #0b1020; --danger: #ff8a80; --ok: #6fd39b; --warn-bg: #2c2410; --warn: #f2c66d; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; }
header.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
header.bar .brand { font-weight: 700; letter-spacing: .02em; }
header.bar nav { display: flex; gap: 14px; flex-wrap: wrap; }
header.bar nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
header.bar nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
main { max-width: 720px; margin: 32px auto; padding: 0 16px; }
main.narrow { max-width: 440px; }
main.wide { max-width: 1040px; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 12px; }
p.lead { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
button, .button { appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px;
  padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--danger); }
button.block, .button.block { width: 100%; }
button:disabled { opacity: .55; cursor: default; }
button.small { padding: 4px 10px; font-size: 13px; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.notice { border-radius: 8px; padding: 10px 12px; font-size: 14px; border: 1px solid var(--border); }
.notice.error { color: var(--danger); border-color: currentColor; }
.notice.ok { color: var(--ok); border-color: currentColor; }
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.code { font: 700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); }
.code-input { font: 700 22px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; width: 100%; text-align: center; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-all; }
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
ul.list li:first-child { border-top: 0; }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.accent { color: var(--accent); border-color: currentColor; }
.badge.danger { color: var(--danger); border-color: currentColor; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; border-top: 0; }
td.toggle { text-align: center; }
.dev { border: 2px dashed var(--warn); }
.device-summary { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.device-name { font-size: 20px; font-weight: 700; }
.device-place { color: var(--muted); margin-top: 2px; }
.mono { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; margin: 8px 0 0; }
details summary { cursor: pointer; font-size: 13px; }
.hidden { display: none !important; }
@media (max-width: 560px) { main { margin: 20px auto; } .code { font-size: 28px; } }
