:root {
  --bg: #111214; --panel: #1b1d21; --line: #2c2f35; --fg: #e8e8ea; --dim: #9a9ca3;
  --accent: #1ed760; --warn: #ffb547; --bad: #ff6b6b; --call: #7cb7ff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.45; }
a { color: var(--accent); }
header, main, footer { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
header { padding-top: 28px; }
h1 { margin: 0 0 4px; font-size: 28px; }
h2 { margin: 36px 0 12px; font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h3 { margin: 18px 0 10px; font-size: 16px; }
h4 { margin: 16px 0 8px; font-size: 14px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.lede { color: var(--dim); margin: 0 0 8px; }
nav { font-size: 14px; }
footer { color: var(--dim); font-size: 12px; padding: 40px 20px; }
.hint, .mini { color: var(--dim); font-size: 12px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.card.wide { max-width: 760px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.card .sub { color: var(--dim); font-size: 12px; margin: -4px 0 8px; word-break: break-all; }
.tag { font-size: 11px; color: #000; background: var(--accent); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.tag.alt { background: var(--warn); }
.tag.dim { background: var(--dim); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.form label, .row label { display: flex; flex-direction: column; font-size: 12px; color: var(--dim); gap: 3px; }
.form label:has(input[type=checkbox]), .row label:has(input[type=checkbox]), fieldset label { flex-direction: row; align-items: center; color: var(--fg); }
.grow { flex: 1 1 220px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 10px 8px; }
legend { font-size: 12px; color: var(--dim); }
input, select, button { background: #0d0e10; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 13px; }
input[type=checkbox] { padding: 0; }
button { cursor: pointer; background: #262930; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
button.danger { border-color: var(--bad); color: var(--bad); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
.code { background: #0b0c0e; border: 1px solid var(--line); border-radius: 6px; padding: 8px; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; }
.embed-host { margin-top: 10px; }
.methods .m { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; font-size: 13px; }
.methods .m label { flex-direction: row; align-items: center; color: var(--fg); font-size: 12px; }
.state { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.state div { background: #0d0e10; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; display: flex; flex-direction: column; }
.state span { color: var(--dim); font-size: 11px; }
.state b { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.progress { height: 6px; background: #0d0e10; border-radius: 3px; margin: 8px 0; overflow: hidden; }
#st-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.log { background: #0b0c0e; border: 1px solid var(--line); border-radius: 8px; height: 420px; overflow: auto; font-family: ui-monospace, monospace; font-size: 12px; }
.log .e { padding: 4px 8px; border-bottom: 1px solid #1a1c20; display: grid; grid-template-columns: 96px 60px 1fr; gap: 8px; }
.log .t { color: var(--dim); }
.log .k.in { color: var(--call); }
.log .k.out { color: var(--accent); }
.log .k.raw { color: var(--warn); }
.log .k.err { color: var(--bad); }
.log pre { margin: 2px 0 0; white-space: pre-wrap; word-break: break-all; color: #c9cbd1; }
.notes { font-size: 14px; }
.notes table { border-collapse: collapse; width: 100%; font-size: 13px; }
.notes th, .notes td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.notes th { background: var(--panel); }
.notes td code { color: var(--accent); }
