:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020; --bg-2: #0f1630; --card: #121a33; --field: #0d1430; --pre-bg: #0a1128;
  --line: #243060; --line-soft: #1d2750; --hover: #18214a;
  --ink: #e8ecff; --muted: #9aa6d1; --accent: #7c9cff; --accent-2: #43e0b5;
  --warn: #ffc56b; --bad: #ff8a8a; --logo-ink: #0b1020;
  --topbar: rgba(11, 16, 32, .7); --glow-1: #23305e; --glow-2: #0f3d3a;
  --dz-bg: rgba(18, 26, 51, .7); --dz-border: #34427e; --dz-over: rgba(16, 52, 56, .6);
  --pill-bg: #1b2550; --pill-line: #2a3670; --notice-bg: #111a3a;
  --ok-bg: #0f2e2c; --ok-line: #1d5c52; --warn-bg: #2e2410; --warn-line: #6b5220;
  --danger-bg: #3a1422; --danger-line: #6b2438; --danger-ink: #ffb3c2; --danger-card: #4a1d2c;
  --pro-line: #4b5fb3; --pro-glow: rgba(124, 156, 255, .15);
  --radius: 14px;
}
/* Light: explicit choice, or "system" (no data-theme / data-theme="system") on a light OS. */
:root[data-theme="light"] { color-scheme: light;
  --bg: #f6f7fc; --bg-2: #eef1fa; --card: #ffffff; --field: #ffffff; --pre-bg: #f3f5fb;
  --line: #d9deef; --line-soft: #e6e9f4; --hover: #eceffa;
  --ink: #141a33; --muted: #5a6386; --accent: #4f63e6; --accent-2: #12a07c;
  --warn: #9a6400; --bad: #c6283d; --logo-ink: #ffffff;
  --topbar: rgba(246, 247, 252, .8); --glow-1: #dfe5ff; --glow-2: #d6f5ec;
  --dz-bg: rgba(255, 255, 255, .8); --dz-border: #b7c0e6; --dz-over: rgba(214, 245, 236, .7);
  --pill-bg: #eef1fa; --pill-line: #d3d9ef; --notice-bg: #f1f3fb;
  --ok-bg: #e7f7f1; --ok-line: #a6dfcb; --warn-bg: #fff5e0; --warn-line: #f0cf8e;
  --danger-bg: #fdecef; --danger-line: #f1b6c0; --danger-ink: #b0223a; --danger-card: #f3c5cd;
  --pro-line: #9fb0f5; --pro-glow: rgba(79, 99, 230, .14); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]):not([data-theme="light"]) { color-scheme: light;
  --bg: #f6f7fc; --bg-2: #eef1fa; --card: #ffffff; --field: #ffffff; --pre-bg: #f3f5fb;
  --line: #d9deef; --line-soft: #e6e9f4; --hover: #eceffa;
  --ink: #141a33; --muted: #5a6386; --accent: #4f63e6; --accent-2: #12a07c;
  --warn: #9a6400; --bad: #c6283d; --logo-ink: #ffffff;
  --topbar: rgba(246, 247, 252, .8); --glow-1: #dfe5ff; --glow-2: #d6f5ec;
  --dz-bg: rgba(255, 255, 255, .8); --dz-border: #b7c0e6; --dz-over: rgba(214, 245, 236, .7);
  --pill-bg: #eef1fa; --pill-line: #d3d9ef; --notice-bg: #f1f3fb;
  --ok-bg: #e7f7f1; --ok-line: #a6dfcb; --warn-bg: #fff5e0; --warn-line: #f0cf8e;
  --danger-bg: #fdecef; --danger-line: #f1b6c0; --danger-ink: #b0223a; --danger-card: #f3c5cd;
  --pro-line: #9fb0f5; --pro-glow: rgba(79, 99, 230, .14); } }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--glow-1) 0, transparent 60%),
    radial-gradient(900px 500px at 105% 30%, var(--glow-2) 0, transparent 55%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code { font-size: .88em; background: var(--field); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 6px; }
h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.025em; line-height: 1.15; margin: 28px 0 10px; }
h2 { font-size: 20px; letter-spacing: -.01em; margin: 28px 0 12px; }
.card h2 { margin-top: 0; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 19px; color: var(--muted); max-width: 640px; }
.center .lead { margin-left: auto; margin-right: auto; }
.text-bad { color: var(--bad) !important; }
.inline { display: inline; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); background: var(--topbar); border-bottom: 1px solid var(--line-soft); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand .tld { color: var(--accent-2); }
.logo-mark { width: 28px; height: 28px; color: var(--accent); flex: none; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.nav-link:hover, .nav-link.active { color: var(--ink); background: var(--hover); text-decoration: none; }
.as-link { background: none; border: 0; font: inherit; cursor: pointer; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; background: linear-gradient(135deg, var(--accent), #9d7cff); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--hover); }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-ink); }
input, textarea, select { font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row input { flex: 1; }
.wrap-row { flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 16px 0; }
.card.danger { border-color: var(--danger-card); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--pill-bg); color: var(--muted); border: 1px solid var(--pill-line); }
.pill-ok { color: var(--accent-2); border-color: var(--ok-line); background: var(--ok-bg); }
.pill-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.notice { border: 1px solid var(--line); background: var(--notice-bg); border-radius: 12px; padding: 12px 14px; margin: 14px 0; color: var(--ink); }
.notice-ok { border-color: var(--ok-line); background: var(--ok-bg); }
.notice-warn { border-color: var(--warn-line); background: var(--warn-bg); }
.notice-error { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger-ink); }

/* hero + dropzone */
.hero { padding: 36px 0 20px; }
.eyebrow { display: inline-block; font: 600 12px/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-top: 24px; }
.hero h1 { font-size: clamp(38px, 7vw, 68px); margin: 14px 0 12px; }
.grad { background: linear-gradient(90deg, var(--accent), #b18cff 45%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dropzone { position: relative; margin: 28px 0 18px; border: 2px dashed var(--dz-border); border-radius: 20px; background: var(--dz-bg); padding: 44px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.dropzone:hover, .dropzone:focus { border-color: var(--accent); outline: none; }
.dropzone.is-over { border-color: var(--accent-2); background: var(--dz-over); transform: scale(1.01); }
.dropzone.is-busy { cursor: progress; border-style: solid; }
.dz-idle, .dz-busy { pointer-events: none; }
.dz-idle button, .dz-actions { pointer-events: auto; }
.dz-icon svg { width: 54px; height: 54px; color: var(--accent); }
.dz-title { font-size: 22px; font-weight: 700; margin: 6px 0; letter-spacing: -.01em; }
.dz-hint { color: var(--muted); font-size: 15px; }
.dz-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.dz-error { color: var(--bad); margin: 16px 0 0; font-weight: 600; }
.progress { height: 10px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); overflow: hidden; margin: 16px auto 10px; max-width: 520px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.ticks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 15px; }
.ticks li::before { content: "✓"; color: var(--accent-2); margin-right: 8px; font-weight: 700; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 30px auto 50px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); }

/* dashboard */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.head-pills { display: flex; gap: 6px; padding-bottom: 6px; }
.site-link { font-family: ui-monospace, monospace; font-size: 15px; }
.back { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 14px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.site-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink); transition: border-color .15s, transform .15s; }
.site-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.site-card-top { display: flex; align-items: center; gap: 8px; }
.site-name { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-url { font-family: ui-monospace, monospace; font-size: 13px; color: var(--accent); margin: 4px 0 8px; }
.site-desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.site-meta { font-size: 13px; color: var(--muted); margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-2 > .card { margin: 16px 0; }
table.files { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.files th, .files td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); }
.files th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.files td { word-break: break-all; }
.num { text-align: right !important; white-space: nowrap; }
details summary { cursor: pointer; color: var(--muted); }
.domains { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.domains li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; max-width: 800px; margin: 30px auto 60px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px; }
.plan h2 { margin: 0; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 20px; flex: 1; }
.plan li { padding: 5px 0; }
.plan li::before { content: "✓"; color: var(--accent-2); margin-right: 10px; font-weight: 700; }
.plan li.no { color: var(--muted); }
.plan li.no::before { content: "–"; color: var(--muted); }
.price { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.price span { font-size: 16px; color: var(--muted); font-weight: 500; }
.plan-pro { border-color: var(--pro-line); box-shadow: 0 20px 60px var(--pro-glow); }
.ribbon { position: absolute; top: -12px; right: 20px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), #9d7cff); }

/* auth */
.auth-page h1 { margin-top: 40px; }
.auth-card { padding: 18px; min-height: 360px; }
.authlock-mount { min-height: 320px; }

/* llm / docs */
.steps { padding-left: 22px; }
.steps li { margin: 12px 0; }
.keybox { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; }
.keybox pre, .keybox code { flex: 1; margin: 0; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; font-size: 14px; }
pre.md { background: var(--pre-bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow: auto; font-size: 13.5px; line-height: 1.55; }
pre.md { white-space: pre-wrap; max-height: 70vh; }

.footer { border-top: 1px solid var(--line-soft); margin-top: 40px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 20px; }
.footer .logo-mark { width: 18px; height: 18px; vertical-align: -4px; }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-direction: column; align-items: flex-start; }
  .nav { justify-content: flex-start; }
  .dropzone { padding: 32px 14px; }
  .row { flex-wrap: wrap; }
  .keybox { flex-direction: column; }
}

/* stack cards: the gap does the spacing, not element margins */
.stack > p, .stack > h2, .stack > .dropzone, .stack > details, .stack > .notice { margin: 0; }
.stack > .btn, .stack > form > .btn { align-self: flex-start; }
.head-pills { align-self: center; }
.authlock-mount { display: flex; flex-direction: column; align-items: center; }

/* admin */
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 18px; overflow-x: auto; }
.admin-tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tabs a.active, .admin-tabs a:hover { color: var(--ink); border-bottom-color: var(--accent); text-decoration: none; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.stat b { font-size: 24px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.filter { margin: 10px 0; }
.filter input[name=q] { flex: 1 1 260px; }
.filter select { width: auto; }
label.check { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
label.check input { width: auto; }
.table-scroll { overflow-x: auto; }
.admin-users td { word-break: normal; }
tr.is-blocked td { opacity: .6; }
table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 12px 6px 0; width: 38%; vertical-align: top; }
.kv td { padding: 6px 0; word-break: break-all; }
fieldset.card { margin: 16px 0; }
fieldset legend { font-weight: 700; font-size: 18px; padding: 0 6px; }
.admin .row label { flex: 1; }
.admin .row label.check, .filter label.check { flex: 0 0 auto; }

/* theme switch */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); margin-left: 6px; }
.theme-switch button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); padding: 5px 7px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--hover); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch.with-labels { margin-left: 0; border-radius: 12px; padding: 4px; }
.theme-switch.with-labels button { padding: 8px 14px; border-radius: 9px; }
.ribbon { color: #fff; }
.stack > .theme-switch { align-self: flex-start; }


/* ── API reference (/docs/api) ───────────────────────────────────────────── */
.docs { padding-bottom: 60px; }
.docs-hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: end; padding: 28px 0 26px; border-bottom: 1px solid var(--line-soft); margin-bottom: 28px; }
.docs-hero h1 { margin: 10px 0 8px; }
.docs-hero .lead { font-size: 17px; margin: 0 0 16px; }
.base-url { display: inline-flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; max-width: 100%; }
.base-url code { background: none; border: 0; padding: 0; font-size: 14px; overflow-wrap: anywhere; }
.llm-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ink); font-size: 14px; line-height: 1.5; }
.llm-card:hover { text-decoration: none; filter: brightness(1.05); }
.llm-icon { font-size: 22px; line-height: 1; }
.docs-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
.docs-toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 104px); overflow: auto; font-size: 14px; padding-right: 6px; }
.toc-group { margin-bottom: 20px; }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.docs-toc a, .toc-mobile a { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; color: var(--muted); }
.docs-toc a:hover, .toc-mobile a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.docs-toc a.active { background: var(--hover); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.toc-ep span:last-child { font-family: ui-monospace, monospace; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-mobile { display: none; }
.docs-body { min-width: 0; }
.docs-body h2 { font-size: 24px; margin: 0 0 14px; scroll-margin-top: 84px; }
.docs-body .guide { margin-bottom: 40px; scroll-margin-top: 84px; }
.docs-body .guide p, .docs-body .guide li { color: var(--ink); }
.docs-body pre, .codeblock pre { background: var(--pre-bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 12px 0; }
.docs-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.docs-body table { border-collapse: collapse; width: 100%; font-size: 14px; }
.docs-body .table-scroll { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; }
.docs-body th, .docs-body td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.docs-body tr:last-child td { border-bottom: 0; }
.docs-body th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg-2); white-space: nowrap; }
.group-title { padding-top: 14px; margin-top: 16px !important; border-top: 1px solid var(--line-soft); }
.method { display: inline-block; min-width: 52px; text-align: center; font: 700 11px/1 ui-monospace, monospace; letter-spacing: .03em; padding: 4px 6px; border-radius: 6px; flex: none; }
.m-get { color: #0f8a5f; background: rgba(18, 160, 124, .14); }
.m-post { color: #3a56d4; background: rgba(79, 99, 230, .14); }
.m-put, .m-patch { color: #a45f00; background: rgba(214, 140, 20, .16); }
.m-delete { color: #c6283d; background: rgba(214, 60, 80, .14); }
:root[data-theme="dark"] .m-get, :root:not([data-theme="light"]) .m-get { color: #43e0b5; }
:root[data-theme="dark"] .m-post, :root:not([data-theme="light"]) .m-post { color: #9db0ff; }
:root[data-theme="dark"] .m-put, :root[data-theme="dark"] .m-patch, :root:not([data-theme="light"]) .m-put, :root:not([data-theme="light"]) .m-patch { color: #ffc56b; }
:root[data-theme="dark"] .m-delete, :root:not([data-theme="light"]) .m-delete { color: #ff8a9a; }
@media (prefers-color-scheme: light) { :root[data-theme="system"] .m-get { color: #0f8a5f; } :root[data-theme="system"] .m-post { color: #3a56d4; } :root[data-theme="system"] .m-put, :root[data-theme="system"] .m-patch { color: #a45f00; } :root[data-theme="system"] .m-delete { color: #c6283d; } }
.endpoint { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin: 18px 0; scroll-margin-top: 84px; }
.endpoint-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.endpoint-path { background: none; border: 0; padding: 0; font-size: 16px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.p-param { color: var(--accent); }
.anchor { margin-left: auto; color: var(--muted); opacity: 0; font-weight: 700; }
.endpoint:hover .anchor { opacity: 1; }
.endpoint-summary { font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
.endpoint h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.endpoint .req { font-size: 11px; font-weight: 600; color: var(--warn); margin-left: 4px; }
.endpoint code.type { color: var(--accent-2); }
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.examples:empty { display: none; }
.codeblock { min-width: 0; margin-top: 14px; }
.codeblock pre { margin: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.codeblock-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 6px 8px 6px 14px; }
.copy-btn { font: inherit; font-size: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 7px; padding: 3px 9px; cursor: pointer; }
.copy-btn:hover { background: var(--hover); }
.errors { margin: 14px 0 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 900px) {
  .docs-hero { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); }
  .docs-toc { display: none; }
  .toc-mobile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 20px; }
  .toc-mobile summary { cursor: pointer; font-weight: 600; }
  .toc-mobile nav { margin-top: 12px; }
  .endpoint { padding: 16px; }
  .endpoint-path { font-size: 14px; }
}
@media (max-width: 640px) {
  /* Parameters: stacked rows instead of a cramped 4-column table. */
  .params thead { display: none; }
  .params tr { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
  .params tr:last-child { border-bottom: 0; }
  .params td { border: 0 !important; padding: 0 !important; }
  .params td:nth-child(1) { grid-column: 1 / -1; }
  .params td:nth-child(2)::before { content: "in "; }
  .params td:nth-child(4) { grid-column: 1 / -1; color: var(--muted); }
}

/* {{{workflow}}} tags — account card */
pre.snippet { margin: 0; background: var(--pre-bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.6; overflow-x: auto; white-space: pre; }
pre.snippet code { background: none; border: 0; padding: 0; font-size: inherit; color: var(--ink); }
.gd-connected { align-items: center; gap: 10px; }
.gd-connected code { font-size: 13px; word-break: break-all; }
.gd-connected form { margin-left: auto; }

/* ── editor (/p/:id/edit) — docs/EDITOR.md ─────────────────────────────────── */
body:has(.editor-app) { overflow: hidden; }
.editor-app [hidden] { display: none !important; }
.editor-app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
.ed-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 54px; border-bottom: 1px solid var(--line); background: var(--card); }
.ed-back { flex: none; font-size: 18px; line-height: 1; text-decoration: none; color: var(--muted); padding: 6px 9px; border-radius: 8px; }
.ed-back:hover { background: var(--bg-2); color: var(--ink); }
.ed-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ed-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-title span { font: 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: nowrap; }
.ed-status { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.ed-status[data-kind="ok"] { color: var(--accent-2); }
.ed-status[data-kind="error"] { color: var(--danger-ink); }
.ed-bar .theme-switch { flex: none; }
.ed-tabs { display: none; }
.ed-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1fr); }
.ed-files, .ed-code, .ed-preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-files { border-right: 1px solid var(--line); background: var(--card); }
.ed-preview { border-left: 1px solid var(--line); background: var(--card); }
.ed-panehead { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ed-panehead .btn svg { width: 14px; height: 14px; vertical-align: -2px; }
.ed-panehead > span:first-child { font-weight: 600; }
.ed-fileactions, .ed-previewactions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.ed-panehead:has(> button:last-child) > button:last-child { margin-left: auto; }
.ed-tree { list-style: none; margin: 0; padding: 6px 0; overflow: auto; flex: 1; font: 13px/1.35 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.ed-tree li { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px calc(12px + var(--depth, 0) * 14px); border-left: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.ed-tree li .ed-name { overflow: hidden; text-overflow: ellipsis; }
.ed-tree li:hover, .ed-tree li:focus-visible { background: var(--bg-2); outline: none; }
.ed-tree li.is-current { background: var(--bg-2); border-left-color: var(--accent); color: var(--ink); }
.ed-tree li.is-dirty .ed-name::after { content: " ●"; color: var(--accent); }
.ed-tree li.is-binary { color: var(--muted); }
.ed-tree li.ed-dir { cursor: default; color: var(--muted); font-size: 12px; padding-top: 10px; }
.ed-tree li.ed-dir:hover { background: none; }
.ed-tag { font: 600 10px/1 ui-sans-serif, system-ui, sans-serif; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--ok-line); background: var(--ok-bg); color: var(--accent-2); }
.ed-filename { font: 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-filename[data-dirty="1"]::after { content: "  ● unsaved"; color: var(--accent); font: 12px ui-sans-serif, system-ui, sans-serif; }
.ed-cm { flex: 1; min-height: 0; overflow: hidden; background: var(--field); }
.ed-cm .cm-editor { height: 100%; }
.ed-cm .cm-editor.cm-focused { outline: none; }
.ed-empty, .ed-binary { flex: 1; display: grid; place-content: center; gap: 4px; text-align: center; padding: 24px; color: var(--muted); }
.ed-empty p, .ed-binary p { margin: 0; }
.ed-binary img { max-width: 100%; max-height: 50vh; margin: 12px auto; border-radius: 8px; border: 1px solid var(--line); }
.ed-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.ed-note { margin: 0; padding: 6px 10px; border-top: 1px solid var(--line); }
.ed-previewpick { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; margin: 0; font-weight: 600; }
.ed-previewpick select { font-size: 13px; padding: 4px 8px; max-width: 240px; min-width: 0; }
.card-head { justify-content: space-between; align-items: center; }
.card-head h2 { margin: 0; }
@media (max-width: 900px) {
  .ed-bar { gap: 8px; padding: 8px; }
  .ed-title span, .ed-bar .theme-switch, .ed-status { display: none; }
  .ed-tabs { display: flex; gap: 2px; margin-left: auto; padding: 3px; border-radius: 10px; background: var(--bg-2); }
  .ed-tabs button { font: inherit; font-size: 13px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
  .ed-tabs button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
  .ed-panes { grid-template-columns: minmax(0, 1fr); }
  .editor-app[data-pane="files"] :is(.ed-code, .ed-preview),
  .editor-app[data-pane="code"] :is(.ed-files, .ed-preview),
  .editor-app[data-pane="preview"] :is(.ed-files, .ed-code) { display: none; }
  .ed-files, .ed-preview { border: 0; }
}

/* ── AI chat in the editor sidebar — docs/AI.md ─────────────────────────────── */
.editor-app[data-side="ai"] .ed-panes { grid-template-columns: 360px minmax(0, 1fr) minmax(0, 1fr); }
.ed-sidetabs { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--bg-2); }
.ed-sidetabs button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.ed-sidetabs button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ed-newbtn { margin-left: auto; }
.ed-ai { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-ai-log { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.ai-empty { color: var(--muted); padding: 8px 4px; }
.ai-empty b { color: var(--ink); }
.ai-empty p { margin: 6px 0 0; }
.ai-msg { padding: 9px 12px; border-radius: 12px; max-width: 100%; overflow-wrap: anywhere; }
.ai-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; max-width: 88%; }
.ai-assistant { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg pre { margin: 6px 0; padding: 8px; border-radius: 8px; background: var(--pre-bg); border: 1px solid var(--line); font-size: 12px; overflow-x: auto; white-space: pre; color: var(--ink); }
.ai-msg code { font-size: 12.5px; }
.ai-chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px 2px; padding: 2px 8px; border-radius: 999px; font: 600 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--accent-2); cursor: pointer; }
.ai-chip.is-delete { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-ink); cursor: default; }
.ai-chip.is-writing { background: var(--bg); border-color: var(--line); color: var(--muted); cursor: default; animation: ai-pulse 1.2s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .55; } }
.ai-typing { color: var(--muted); animation: ai-pulse 1.2s ease-in-out infinite; }
.ai-error { color: var(--danger-ink); }
.ai-changes { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.ai-change { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ai-change > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-change em { color: var(--accent-2); font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ai-change.is-reverted > span { opacity: .5; text-decoration: line-through; }
.ai-change-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.ed-ai-form { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.ed-ai-form textarea { width: 100%; resize: vertical; min-height: 64px; max-height: 40vh; font: inherit; font-size: 13.5px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--ink); }
.ed-ai-form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.ed-ai-actions { display: flex; align-items: center; gap: 8px; }
.ed-ai-actions [data-ai-status] { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .editor-app[data-side="ai"] .ed-panes { grid-template-columns: minmax(0, 1fr); }
  .editor-app[data-pane="ai"] :is(.ed-code, .ed-preview) { display: none; }
  .editor-app[data-pane="ai"] .ed-files { display: flex; }
  .ed-sidetabs { display: none; } /* the top-bar tabs switch Files / AI on phones */
}

/* ── visitor login card (project page) — docs/SITE-LOGIN.md ─────────────────── */
#visitor-login h3 { margin: 10px 0 0; font-size: 15px; }
.acc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-head .small { flex: 1; min-width: 200px; }
.acc-tree td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.acc-tree td:first-child { width: 45%; }
.acc-name { display: inline-block; padding-left: calc(var(--d, 0) * 18px); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.acc-dir .acc-name { font-weight: 600; }
.acc-tree select { font-size: 13px; padding: 5px 8px; max-width: 100%; }
.acc-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.acc-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; flex-direction: row; margin: 0; font-weight: 500; }
.acc-chip input { width: auto; margin: 0; }
.acc-newrole { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; width: 130px; }
.acc-rolelist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
[data-access-status][data-kind="ok"] { color: var(--accent-2); }
[data-access-status][data-kind="error"] { color: var(--danger-ink); }
@media (max-width: 600px) { .acc-tree td:first-child { width: auto; } .acc-tree tr { display: grid; } }

/* edge cache line (project page) — docs/CDN.md */
.cdn-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
