:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1d1f1c; --muted: #676b63; --line: #dddbd3; --line-2: #ecebe5;
  --accent: #2f6b4f; --accent-ink: #ffffff; --accent-soft: #e6efe9;
  --green: #2f6b4f; --green-bg: #e3efe7; --amber: #8a5a00; --amber-bg: #fbf0d6; --red: #a2392b; --red-bg: #f8e4e0;
  --blue: #2a537f; --blue-bg: #e2eaf3; --grey-bg: #ecebe5;
  --radius: 8px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161815; --panel: #1f221e; --ink: #e9e8e3; --muted: #a3a69d; --line: #353932; --line-2: #2a2d28;
    --accent: #6fb38f; --accent-ink: #0f1a14; --accent-soft: #23342a;
    --green: #8fcaa9; --green-bg: #22362a; --amber: #e7c27a; --amber-bg: #3a3020; --red: #f0a597; --red-bg: #43261f;
    --blue: #9fc0e6; --blue-bg: #1f2d3d; --grey-bg: #2c2f2a; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
h1 { font-size: 1.65rem; line-height: 1.25; margin: 0 0 .4rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .7rem; }
.panel h2:first-child, aside h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
code { font-family: var(--mono); font-size: .88em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.warn { color: var(--amber); }

.sample-banner { background: #2a2a2a; color: #f2f2f2; text-align: center; font-size: .82rem; padding: .35rem 1rem; }
.sample-banner a { color: #fff; }

.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .55rem; }
.mark { width: 18px; height: 18px; border-radius: 50% 50% 2px 2px; background: var(--accent); display: inline-block; }
.mainnav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.mainnav a { color: var(--muted); text-decoration: none; padding: .35rem .65rem; border-radius: 6px; }
.mainnav a:hover { color: var(--ink); background: var(--line-2); }
.mainnav a.on { color: var(--ink); background: var(--line-2); font-weight: 600; }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 .45rem; font-size: .75rem; font-weight: 700; }
.who { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.who small { color: var(--muted); margin-left: .25rem; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.container { max-width: 1040px; margin: 0 auto; padding: 1.6rem 16px 4rem; }
.container.wide { max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.crumbs { margin: 0 0 .2rem; font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; }
.panel.narrow { max-width: 520px; margin: 1rem auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.3rem; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.sticky { position: sticky; top: 1rem; }
@media (max-width: 900px) { .cols, .cols.even { grid-template-columns: 1fr; } .sticky { position: static; } }

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; }
.flash.ok { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.flash.err { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.flash.warn { background: var(--amber-bg); color: var(--amber); }
.callout { background: var(--accent-soft); border-radius: var(--radius); padding: .7rem .9rem; margin: .8rem 0 1rem; font-size: .92rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .55rem 1rem; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); }
.btn.small { padding: .32rem .7rem; font-size: .85rem; }
.btn.danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: .5rem; margin: 1rem 0 .6rem; }

.form { display: grid; gap: .95rem; }
.form label, label { display: grid; gap: .3rem; font-weight: 600; font-size: .93rem; }
label small { font-weight: 400; color: var(--muted); }
input, textarea, select { font: inherit; font-weight: 400; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .55rem .65rem; width: 100%; min-width: 0; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.55; }
textarea.mono { font-family: var(--mono); font-size: .92rem; }
input:disabled, textarea:disabled, select:disabled { background: var(--line-2); color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; align-items: end; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { background: var(--line-2); border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; padding: .55rem .6rem; color: var(--muted); font-weight: 400; font-size: .88rem; white-space: nowrap; display: flex; align-items: center; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.prefix-input input { border-radius: 0 6px 6px 0; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 120px; padding: .35rem .5rem; font-size: .9rem; }
input.copy { font-family: var(--mono); font-size: .85rem; }
input.copy.small { padding: .25rem .4rem; font-size: .75rem; min-width: 180px; }

.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; vertical-align: middle; letter-spacing: .01em; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.grey { background: var(--grey-bg); color: var(--muted); }
h1 .badge { font-size: .8rem; margin-left: .4rem; }

.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
.table td { padding: .6rem .5rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.panel .table { margin: 0 -.5rem; width: calc(100% + 1rem); }
@media (max-width: 700px) { .table { display: block; overflow-x: auto; } }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.2rem; }
.pipeline div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: grid; }
.pipeline .n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.pipeline span:last-child { color: var(--muted); font-size: .88rem; }
.pipeline .alert { border-color: var(--red); background: var(--red-bg); }
.pipeline .alert .n, .pipeline .alert span { color: var(--red); }
@media (max-width: 600px) { .pipeline { grid-template-columns: 1fr 1fr; } }

.attention { border-color: var(--red); }
.queue-cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-decoration: none; color: var(--ink); border-color: var(--accent); background: var(--accent-soft); flex-wrap: wrap; }
.queue-cta span { color: var(--accent); font-weight: 600; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
blockquote.note { margin: .4rem 0 0; padding: .5rem .8rem; border-left: 3px solid var(--amber); background: var(--amber-bg); border-radius: 0 6px 6px 0; font-size: .92rem; white-space: pre-wrap; }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.site-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.site-card-head { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.site-card h3 { margin: 0; font-size: 1.05rem; }
.site-card h3 a { color: var(--ink); text-decoration: none; }
.site-card p { margin: .35rem 0; }
.site-card .actions { margin-top: .8rem; }
.empty-state { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; text-align: center; grid-column: 1 / -1; }
.empty-state h3 { margin-top: 0; font-size: 1.15rem; }
.empty-state p { color: var(--muted); max-width: 46ch; margin: .4rem auto 1.1rem; }

.status-panel { border-radius: var(--radius); padding: .8rem 1.1rem; margin-bottom: 1.1rem; border: 1px solid var(--line); background: var(--panel); }
.status-panel p { margin: .3rem 0; }
.status-panel form { margin: .5rem 0 .2rem; }
.status-panel.in_review { background: var(--amber-bg); border-color: transparent; }
.status-panel.changes_requested { background: var(--red-bg); border-color: transparent; }
.status-panel.live { background: var(--green-bg); border-color: transparent; }
.status-panel:empty { display: none; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .9rem; }
.checklist li { padding-left: 1.7rem; position: relative; line-height: 1.4; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .05rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.checklist li.ok { color: var(--ink); }
.checklist li.ok::before { background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; border-color: var(--green); }
.checklist li.no { color: var(--muted); }
.submit-box { border-top: 3px solid var(--accent); }

.src-row { display: grid; grid-template-columns: auto 2fr 2fr 1.4fr 1fr auto; gap: .4rem; align-items: center; margin-bottom: .5rem; }
.src-row input { padding: .4rem .5rem; font-size: .88rem; }
.src-num { font-family: var(--mono); font-size: .85rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 6px; padding: .4rem .5rem; cursor: pointer; }
.src-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .3rem; }
.src-del:hover { color: var(--red); }
@media (max-width: 760px) { .src-row { grid-template-columns: auto 1fr auto; padding-bottom: .6rem; border-bottom: 1px solid var(--line-2); } .src-row input { grid-column: 2; } .src-row .src-del { grid-column: 3; grid-row: 1; } }

details.help, details.history, details.danger { font-size: .9rem; }
details summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.history { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
details.history ol { padding-left: 1.1rem; margin: .6rem 0 0; display: grid; gap: .4rem; }
details.danger { padding: .4rem 0; }
table.fmt { margin-top: .5rem; border-collapse: collapse; }
table.fmt td { padding: .2rem .8rem .2rem 0; vertical-align: top; }
.ai-box { border-style: dashed; }
.ai-box textarea { margin: .3rem 0 .6rem; }

.paper { font-size: 1.02rem; line-height: 1.7; }
.paper h2 { font-size: 1.2rem; }
.paper blockquote { margin: 1rem 0; padding: .2rem 1rem; border-left: 3px solid var(--accent); color: var(--ink); }
.paper .dek { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
sup.cite { font-size: .72em; line-height: 0; }
sup.cite a { text-decoration: none; font-weight: 700; }
sup.cite.bad { color: var(--red); font-weight: 700; }
mark.needs-source { background: var(--amber-bg); color: var(--amber); padding: 0 .2em; border-radius: 3px; }
.review-sources li { margin-bottom: .4rem; }
.src-host { font-size: .78rem; color: var(--muted); background: var(--line-2); padding: .05rem .4rem; border-radius: 4px; margin-left: .3rem; }
.decision h2 { font-size: 1.05rem; }
fieldset.checks { border: 0; padding: 0; margin: 0; display: grid; gap: .55rem; }
label.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; font-size: .92rem; }
label.check input { width: auto; margin-top: .25rem; accent-color: var(--accent); }
.invite-made { border-color: var(--accent); background: var(--accent-soft); }

.hero { max-width: 680px; margin: 2.5rem 0 2rem; }
.hero h1 { font-size: 2.3rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.hero .actions { margin-top: 1.4rem; }
.steps-row { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: s; }
.steps-row li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .3rem; }
.steps-row li strong::before { content: counter(s) ". "; color: var(--accent); }
.steps-row li span { color: var(--muted); font-size: .92rem; }
@media (max-width: 800px) { .steps-row { grid-template-columns: 1fr 1fr; } .hero h1 { font-size: 1.8rem; } }
@media (max-width: 480px) { .steps-row { grid-template-columns: 1fr; } }
ol.howto { padding-left: 1.2rem; display: grid; gap: .45rem; }
ol.howto.big { gap: .9rem; }
.prose ul { padding-left: 1.2rem; }
[hidden] { display: none !important; }
fieldset.choice { border: 0; padding: 0; margin: 0; display: grid; gap: .6rem; }
fieldset.choice label.check { padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
fieldset.choice label.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.paste-box { border-style: dashed; }
.paste-box[open] { border-style: solid; border-color: var(--accent); }
.paste-box summary { color: var(--ink); }
.paste-box textarea { margin: .4rem 0 .6rem; font-family: var(--mono); font-size: .85rem; }
.paste-box ol { margin: .8rem 0 .4rem; }
ul.plain-x { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .9rem; color: var(--muted); }
ul.plain-x li { padding-left: 1.7rem; position: relative; }
ul.plain-x li::before { content: "\2715"; position: absolute; left: .2rem; color: var(--red); font-weight: 700; }
pre.code { font-family: var(--mono); font-size: .82rem; background: var(--line-2); padding: .6rem .8rem; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
td.right { text-align: right; }
.connect-card details { margin: .8rem 0; border-top: 1px solid var(--line-2); padding-top: .6rem; }
.connect-card details summary { color: var(--ink); }
.consent h3 { margin-top: 1.1rem; }
textarea.copy { font-size: .82rem; }
.ai-note { margin: 0 0 .6rem; }
.join .callout { margin-top: 0; }
.tpl-row { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
.tpl-row label { flex: 1; min-width: 220px; }
#tpl-status { margin: -.4rem 0 0; }
details.login-way { border-top: 1px solid var(--line-2); padding: .8rem 0; }
details.login-way summary { color: var(--ink); margin-bottom: .6rem; }
.standards h2 { margin-top: 1.8rem; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; text-align: left; margin-top: 1rem; }
.choice-row > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--bg); }
.choice-row h4 { margin: 0 0 .3rem; }
.choice-row p { margin: .2rem 0 .9rem; max-width: none; }
@media (max-width: 640px) { .choice-row { grid-template-columns: 1fr; } }
.lib-filter { margin-bottom: 1rem; max-width: 640px; }
.lib-card p { margin: .4rem 0; }
.help .callout.anon { border-left: 4px solid var(--accent); padding: .9rem 1.1rem; }
.help .callout.anon h2 { margin: 0 0 .4rem; }
.help .callout.anon ul { margin: .4rem 0 0; }
.help h2 { margin-top: 2rem; }
.help textarea.copy { font-size: .8rem; margin-top: .4rem; }
table.ideas td { padding: .35rem .5rem; }
.panel.narrow.help, .panel.narrow.standards { max-width: 760px; }
.qr { width: 220px; max-width: 100%; margin: .8rem 0; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: auto; display: block; }
code.secret { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.checks-list li { padding: .35rem 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.checks-list li:last-child { border-bottom: 0; }
.source-checks .flash ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.source-checks q { font-style: italic; }
table.diff td { vertical-align: top; white-space: pre-wrap; font-size: .88rem; }
table.diff td.old { color: var(--muted); text-decoration: line-through; }
table.diff td.new { background: var(--green-bg); }
fieldset.themes { border: 0; padding: 0; margin: 0; }
fieldset.themes legend { font-weight: 600; font-size: .93rem; margin-bottom: .4rem; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.theme-card { display: grid; gap: .25rem; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; cursor: pointer; font-weight: 400; position: relative; }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.theme-card strong { font-size: .95rem; }
.theme-swatch { display: flex; height: 34px; border-radius: 5px; overflow: hidden; margin-bottom: .3rem; border: 1px solid var(--line); }
.theme-swatch i { flex: 1; }
.sw-archive i:nth-child(1) { background: #fbfaf7; } .sw-archive i:nth-child(2) { background: #e2e0d8; flex: .3; } .sw-archive i:nth-child(3) { background: #2f6b4f; flex: .3; }
.sw-bulletin i:nth-child(1) { background: #111; flex: .5; } .sw-bulletin i:nth-child(2) { background: #fff; } .sw-bulletin i:nth-child(3) { background: #a2392b; flex: .3; }
.sw-ledger i:nth-child(1) { background: #1f2420; flex: .6; } .sw-ledger i:nth-child(2) { background: #f2f3ef; } .sw-ledger i:nth-child(3) { background: #fff; flex: .5; }
.sw-atlas i:nth-child(1) { background: #2a537f; } .sw-atlas i:nth-child(2) { background: #f4f6f8; } .sw-atlas i:nth-child(3) { background: #10171e; flex: .4; }
.sw-chronicle i:nth-child(1) { background: #f7f3ea; } .sw-chronicle i:nth-child(2) { background: #ddd3c2; flex: .2; } .sw-chronicle i:nth-child(3) { background: #8a5a14; flex: .25; }
.sw-vigil i:nth-child(1) { background: #111213; } .sw-vigil i:nth-child(2) { background: #2a2b2c; flex: .3; } .sw-vigil i:nth-child(3) { background: #e9e6df; flex: .4; }
details.danger-zone { border: 1px solid var(--red); border-radius: 8px; padding: .7rem .9rem; }
details.danger-zone summary { color: var(--red); }
.sys-list li { font-size: .92rem; }
details.panel-sub { border: 1px dashed var(--line); border-radius: 8px; padding: .8rem 1rem; display: grid; gap: .8rem; }
details.panel-sub[open] { border-style: solid; }
details.panel-sub summary { color: var(--ink); }
