@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

/* ---------- Tokens. THEME=archetype (default) | mono | glacier | amber ---------- */
:root, [data-theme="archetype"], [data-theme="glacier"] {
  --bg: #10131b;
  --surface: #171b26;
  --surface-2: #1e2331;
  --raise: #262c3d;
  --line: #262c3c;
  --line-2: #363d53;
  --text: #edf0f7;
  --muted: #959bb0;
  --faint: #636982;
  --accent: #8ec5ff;
  --on-accent: #08121f;
  --accent-soft: rgba(142, 197, 255, .12);
  --ok: #86dcb4;
  --danger: #f28b82;
  --hover: #232839;
}
[data-theme="mono"] {
  --bg: #121214; --surface: #19191c; --surface-2: #202024; --raise: #29292e;
  --line: #2a2a2f; --line-2: #3a3a41; --text: #ededef; --muted: #9a9aa2; --faint: #66666e;
  --accent: #ededef; --on-accent: #121214; --accent-soft: rgba(237,237,239,.08); --hover: #26262b;
}
[data-theme="amber"] {
  --bg: #15120f; --surface: #1c1915; --surface-2: #24201b; --raise: #2d2822;
  --line: #2f2a24; --line-2: #433c33; --text: #f3eee7; --muted: #a79e92; --faint: #73695e;
  --accent: #f2b65c; --on-accent: #241604; --accent-soft: rgba(242,182,92,.12); --hover: #2a251f;
}
:root {
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --r-hero: 32px;
  --r-card: 24px;
  --r-inner: 14px;
  --r-ctl: 12px;
  --gap: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* legacy names used by inner pages */
  --card: var(--surface);
  --card-2: var(--surface-2);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--accent); color: var(--on-accent); }
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; font-variation-settings: "opsz" 48; }
h1 { font-size: clamp(40px, 6vw, 80px); line-height: .95; letter-spacing: -0.04em; }
h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1; letter-spacing: -0.035em; }
h3 { font-size: 20px; line-height: 1.2; letter-spacing: -0.02em; font-variation-settings: "opsz" 24; }
h4 { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
p { margin: 0; }
code { font: 500 12.5px var(--mono); background: var(--raise); padding: 2px 7px; border-radius: 6px; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.i { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: 1240px; margin: 0 auto; padding: 8px 24px 40px; display: grid; gap: var(--gap); }

/* ---------- Nav ---------- */
.nav-wrap { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 16px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 20px/1 var(--display); font-variation-settings: "opsz" 24; color: var(--text); text-decoration: none; letter-spacing: -0.03em; }
.brand .logo { width: 26px; height: 26px; flex: none; }
.links { display: flex; gap: 22px; flex: 1; }
.links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.links a:hover, .links a.on { color: var(--text); }
.nav-end { display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; }
.me img, .me .av { width: 30px; height: 30px; border-radius: 50%; }
.me .av { display: grid; place-items: center; background: var(--surface-2); font-weight: 600; font-size: 12px; }
.me .nm { font-weight: 500; font-size: 14px; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--r-ctl);
  font: 600 14.5px var(--sans); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.filled { background: var(--accent); color: var(--on-accent); }
.btn.filled:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn.outlined, .btn.tonal { background: var(--surface-2); color: var(--text); border-color: var(--line); font-weight: 500; }
.btn.outlined:hover, .btn.tonal:hover { background: var(--raise); border-color: var(--line-2); }
.btn.text { background: none; color: var(--muted); padding: 0 10px; font-weight: 500; }
.btn.text:hover { color: var(--text); }
.btn.danger { background: none; border-color: var(--line-2); color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.like.on { color: var(--text); border-color: var(--line-2); }
.btn.like.on .i { fill: var(--danger); stroke: var(--danger); }
.btn.wide { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn .discord { width: 18px; height: 18px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 7px; background: var(--raise); color: var(--muted); white-space: nowrap; }
.chip .i { width: 13px; height: 13px; }
.chip.lg { font-size: 13px; padding: 5px 10px; color: var(--text); }
.chip.accent, .chip.mint, .chip.amber { color: var(--text); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.action { cursor: pointer; border: 0; font: 500 13px var(--sans); padding: 6px 12px; }
.chip.action:hover { color: var(--text); background: var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tile { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; background: var(--raise); color: var(--muted); }
.tile.accent { background: var(--accent-soft); color: var(--accent); }
.tile .i { width: 17px; height: 17px; }
.brand .tile { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--on-accent); }

/* ---------- Bento ---------- */
.card { background: var(--surface); border-radius: var(--r-card); padding: 28px; }
.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* Top: headline, live build, steps */
.hero { grid-column: 1 / 8; grid-row: 1; border-radius: var(--r-hero); padding: 56px 52px 48px; display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; min-height: 470px; }
.hero-title { font-size: clamp(46px, 6.2vw, 88px); font-weight: 700; line-height: .95; letter-spacing: -0.022em;
  font-stretch: 100%; font-variation-settings: "opsz" 96; max-width: 11ch; text-wrap: balance; }
.lead { font-size: 17px; color: var(--muted); max-width: 46ch; line-height: 1.6; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cta.center { justify-content: center; }

.steps { grid-column: 1 / 8; grid-row: 2; list-style: none; margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.steps li { padding: 20px 20px 22px; border-radius: 18px; display: grid; gap: 6px; align-content: start; transition: background .35s var(--ease); }
.steps .n { font: 700 15px/1 var(--display); color: var(--faint); display: flex; align-items: center; gap: 10px; margin-bottom: 8px; transition: color .35s; }
.steps .n::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--line); transition: background .35s; }
.steps li:last-child .n::after { display: none; }
.steps h3 { font-size: 18px; }
.steps p { color: var(--muted); font-size: 14px; }
.steps li.on { background: var(--surface-2); }
.steps li.on .n, .steps li.done .n { color: var(--accent); }
.steps li.done .n::after { background: var(--accent); }

/* Live build demo */
.build-demo { grid-column: 8 / 13; grid-row: 1 / 3; padding: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-2); }
.bd-prompt { margin: 14px; display: flex; align-items: flex-start; gap: 10px; background: var(--bg); border-radius: var(--r-inner); padding: 14px 16px; font-size: 14.5px; min-height: 52px; }
.bd-prompt .cmd { font: 600 13px/1.65 var(--mono); color: var(--accent); flex: none; }
.bd-prompt .typed { color: var(--text); }
.bd-prompt .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--accent); vertical-align: -3px; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bd-server { flex: 1; display: grid; grid-template-columns: 56px 1fr; margin: 0 14px; border-radius: var(--r-inner) var(--r-inner) 0 0; overflow: hidden; background: #2b2d31; color: #949ba4; font-size: 14px; }
.bd-rail { background: #1e1f22; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.bd-rail i { width: 36px; height: 36px; border-radius: 50%; background: #313338; }
.bd-rail i.cur { border-radius: 12px; background: var(--accent); position: relative; }
.bd-rail i.cur::before { content: ""; position: absolute; left: -10px; top: 6px; width: 4px; height: 24px; border-radius: 0 4px 4px 0; background: #f2f3f5; }
.bd-rail hr { width: 24px; border: 0; border-top: 2px solid #35363c; margin: 2px 0; }
.bd-list { padding: 0 8px 16px; min-width: 0; }
.bd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #f2f3f5; font-weight: 600; padding: 14px 8px 12px; border-bottom: 1px solid #1f2023; margin: 0 -8px 6px; padding-left: 16px; padding-right: 14px; }
.bd-state { font: 500 11.5px var(--sans); color: #b5bac1; display: inline-flex; align-items: center; gap: 6px; }
.bd-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #80848e; }
.bd-state[data-s="plan"]::before { background: #f0b232; }
.bd-state[data-s="build"]::before { background: var(--accent); }
.bd-state[data-s="done"]::before { background: #23a55a; }
.bd-cat { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 14px 6px 4px; color: #949ba4; display: flex; align-items: center; gap: 4px; }
.bd-cat .i { width: 12px; height: 12px; }
.bd-ch { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; }
.bd-ch .h { width: 16px; text-align: center; color: #80848e; font-size: 16px; line-height: 1; }
.bd-ch .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-ch .t { font-size: 10.5px; background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 4px; color: #b5bac1; }
.bd-ch.cur { background: #404249; color: #f2f3f5; }
.bd-roles { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.bd-roles span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); padding: 4px 11px 4px 8px; border-radius: 999px; background: var(--bg); }
.bd-roles i { width: 9px; height: 9px; border-radius: 50%; }
.bd-replay { margin-left: auto; align-self: center; background: none; border: 0; color: var(--muted); font: 500 13px var(--sans); cursor: pointer; padding: 4px 6px; border-radius: 6px; display: inline-flex; gap: 6px; align-items: center; }
.bd-replay:hover { color: var(--text); }
.bd-replay .i { width: 14px; height: 14px; }
/* build sequence states (set by script) */
.js .build-demo [data-seq] { opacity: 0; transform: translateY(4px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.js .build-demo [data-seq].in { opacity: 1; transform: none; }
.build-demo .bd-ch.made .h { color: #dbdee1; }

/* Features */
.feature { display: flex; flex-direction: column; gap: 10px; }
.feature p { color: var(--muted); font-size: 14.5px; max-width: 44ch; }
.f-perms { grid-column: span 7; }
.f-backup { grid-column: span 5; }
.f-private { grid-column: span 4; }
.f-fast { grid-column: span 4; }
.f-stats { grid-column: span 4; }
.feature .art { margin-top: auto; padding-top: 18px; }

.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.matrix th { font-weight: 500; color: var(--muted); text-align: center; padding: 0 6px 10px; white-space: nowrap; font-size: 12.5px; }
.matrix th i { display: block; width: 9px; height: 9px; border-radius: 50%; margin: 0 auto 6px; }
.matrix th:first-child { text-align: left; }
.matrix td { padding: 9px 6px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }
.matrix td:first-child { text-align: left; color: var(--text); white-space: nowrap; }
.matrix .full, .matrix .read, .matrix .none { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.matrix .full { background: var(--accent); }
.matrix .read { box-shadow: inset 0 0 0 2px var(--accent); }
.matrix .none { width: 10px; height: 2px; border-radius: 2px; background: var(--line-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.slot { aspect-ratio: 3 / 4; border-radius: 12px; background: var(--surface-2); padding: 10px 9px; display: flex; flex-direction: column; gap: 5px; }
.slot i { display: block; height: 4px; border-radius: 2px; background: var(--line-2); }
.slot i:nth-child(3n+1) { width: 55%; background: var(--faint); margin-top: 4px; }
.slot i:nth-child(3n+2) { width: 85%; }
.slot i:nth-child(3n) { width: 70%; }
.slot.empty { background: none; box-shadow: inset 0 0 0 1.5px var(--line); border-radius: 12px; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; }
.slots + small { display: block; margin-top: 10px; color: var(--muted); font-size: 12.5px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-ctl); padding: 4px; }
.seg button { background: none; border: 0; color: var(--muted); font: 500 13.5px var(--sans); padding: 0 14px; height: 34px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .2s, color .2s; }
.seg button .i { width: 14px; height: 14px; }
.seg button.on { background: var(--raise); color: var(--text); }
.seg-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; min-height: 1.6em; }

.f-fast-unused { font: 720 64px/0.9 var(--display); font-stretch: 82%; font-variation-settings: "opsz" 96; letter-spacing: -0.05em; color: var(--accent); }
.f-fast-unused small { font-size: 22px; letter-spacing: -0.02em; color: var(--muted); font-weight: 600; margin-left: 6px; }

.f-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; align-content: center; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font: 700 36px/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.stats { grid-template-columns: repeat(4, 1fr); }

/* Templates */
.section { grid-column: 1 / -1; padding: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { margin-bottom: 8px; }
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 0 12px; height: 44px; color: var(--faint); min-width: 260px; }
.field:focus-within { border-color: var(--accent); }
.field input { background: none; border: 0; outline: 0; color: var(--text); font: inherit; flex: 1; height: 100%; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.tcard { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: 18px; padding: 20px; color: var(--text); text-decoration: none; transition: background .15s; }
.tcard:hover { background: var(--raise); }
.tcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tcard-top .chip { background: var(--bg); }
.dots { display: flex; gap: 3px; }
.dots i { width: 10px; height: 10px; border-radius: 3px; }
.tcard h3 { font-size: 18px; }
.tcard p { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-meta { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--muted); }
.tcard-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tcard-meta .i { width: 14px; height: 14px; }
.tcard-meta .by { margin-left: auto; color: var(--faint); }
.empty { color: var(--muted); }

/* Final call to action */
.final { grid-column: 1 / -1; position: relative; overflow: hidden; border-radius: var(--r-hero); background: var(--accent); color: var(--on-accent);
  padding: 64px 52px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 340px; justify-content: flex-end; }
.final h2 { font-size: clamp(40px, 5.4vw, 76px); font-weight: 700; font-variation-settings: "opsz" 96; letter-spacing: -0.022em; line-height: .95; max-width: 10ch; }
.final p { color: color-mix(in srgb, var(--on-accent) 72%, transparent); font-size: 16px; max-width: 44ch; }
.final code { background: color-mix(in srgb, var(--on-accent) 12%, transparent); color: var(--on-accent); }
.final .mark { position: absolute; right: 56px; bottom: -36px; width: min(30vw, 340px); height: auto; color: color-mix(in srgb, var(--on-accent) 10%, transparent); pointer-events: none; }
.final .mark path:last-child { fill: color-mix(in srgb, var(--on-accent) 22%, transparent); }
.final .btn.filled { background: var(--on-accent); color: var(--accent); }
.final .btn.filled:hover { background: color-mix(in srgb, var(--on-accent) 85%, var(--accent)); }
.final .btn.outlined { background: transparent; color: var(--on-accent); border-color: color-mix(in srgb, var(--on-accent) 30%, transparent); }
.final .btn.outlined:hover { background: color-mix(in srgb, var(--on-accent) 8%, transparent); }
.final > :not(.mark) { position: relative; }

/* Kept for other pages */
.example { display: flex; flex-direction: column; gap: 10px; }
.mock-input { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--r-inner); padding: 12px 14px; font-size: 14px; }
.mock-input span { color: var(--accent); display: flex; }
.mock-chan { background: var(--surface-2); border-radius: var(--r-inner); padding: 8px; font-size: 14px; color: var(--muted); }
.mc-cat { font-size: 11px; font-weight: 600; padding: 6px 8px 4px; }
.mc-row { padding: 5px 8px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.mc-row.on { background: var(--accent-soft); color: var(--text); }
.mock-progress { background: var(--surface-2); border-radius: var(--r-inner); padding: 14px; display: grid; gap: 10px; }
.mock-progress .bar { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mock-progress .bar i { display: block; height: 100%; width: 100%; background: var(--accent); }
.mock-progress small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.role-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.role-row i { width: 8px; height: 8px; border-radius: 2px; margin-right: -6px; }
.step { display: flex; flex-direction: column; gap: 8px; }
.step p { color: var(--muted); }
.how { grid-template-columns: repeat(3, 1fr); }
.feed { padding: 24px 20px 16px; display: flex; flex-direction: column; }
.feed h4 { padding: 0 8px 8px; }
.feed ul { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed li > div { flex: 1; min-width: 0; }
.feed b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed small, .tip-list small { display: block; color: var(--muted); font-size: 13px; }
.feed time { color: var(--faint); font-size: 13px; white-space: nowrap; }
.mini-sw { display: grid; grid-template-columns: 1fr 1fr; width: 28px; height: 28px; border-radius: 7px; overflow: hidden; flex: none; }
.page-title { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -0.035em; }


/* ---------- Inner pages ---------- */
/* ---------- Generate ---------- */
.gen-row { grid-template-columns: 1.6fr 1fr; }
.gen { display: flex; flex-direction: column; gap: 10px; padding: 40px; }
.gen h1 { font-size: clamp(32px, 4vw, 48px); }
#gen { display: grid; gap: 14px; margin-top: 18px; }
.prompt-box { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-inner); padding: 6px; display: grid; transition: border-color .15s, box-shadow .15s; }
.prompt-box:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prompt-box textarea { background: none; border: 0; outline: 0; resize: vertical; color: var(--text); font: 400 16px/1.5 "Instrument Sans", sans-serif; padding: 12px 14px; min-height: 130px; }
.prompt-box .send { justify-self: end; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tips { display: flex; flex-direction: column; gap: 6px; }
.tip-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.tip-list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.tip-list li:first-child { border-top: 0; }
.tip-list b { font-weight: 500; }
.status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-inner); }
.status[hidden] { display: none; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Template detail ---------- */
.detail-row { grid-template-columns: 1.6fr 1fr; }
.detail { display: flex; flex-direction: column; gap: 14px; padding: 40px; }
.detail h1 { font-size: clamp(32px, 4.4vw, 52px); }
blockquote { margin: 0; display: flex; gap: 10px; align-items: flex-start; border-left: 2px solid var(--accent); padding: 2px 0 2px 14px; color: var(--muted); }
blockquote .i { display: none; }
.build { display: flex; flex-direction: column; gap: 12px; }
#build { display: grid; gap: 12px; }
.lbl { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: -6px; }
select { appearance: none; background: var(--card-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239b9ea8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); color: var(--text); border-radius: var(--r-ctl); height: 42px; padding: 0 36px 0 12px; font: 500 14px "Instrument Sans", sans-serif; width: 100%; }
select:focus { outline: 0; border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s var(--ease), background .15s; }
.switch input:checked + span { background: var(--danger); }
.switch input:checked + span::after { transform: translateX(14px); background: var(--bg); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#build .status { align-items: flex-start; flex-direction: column; gap: 4px; }

.edit summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 500; list-style: none; }
.edit summary::-webkit-details-marker { display: none; }
.edit form { display: grid; gap: 14px; margin-top: 18px; max-width: 600px; }
.edit label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.edit input:not([type=checkbox]), .edit textarea { background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: var(--r-ctl); padding: 10px 12px; font: 400 15px "Instrument Sans", sans-serif; }
.edit input:not([type=checkbox]):focus, .edit textarea:focus { outline: 0; border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.edit label.check { display: flex; align-items: center; gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.preview { display: grid; grid-template-columns: 320px 1fr; gap: var(--gap); align-items: start; }
.discord { background: #2b2d31; border-radius: var(--r-card); padding: 10px 8px 18px; color: #949ba4; font-size: 15px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.server-name { color: #f2f3f5; font-weight: 600; padding: 10px 12px 14px; border-bottom: 1px solid #1f2023; margin-bottom: 6px; }
.cat-name { display: flex; align-items: center; gap: 4px; text-transform: uppercase; font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 16px 8px 4px; }
.cat-name .i, .chan .tag .i { width: 12px; height: 12px; }
.chan { padding: 5px 10px; border-radius: 6px; display: flex; gap: 6px; align-items: center; }
.chan:hover { background: #35373c; color: #dbdee1; }
.chan .cn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 18px; text-align: center; opacity: .8; }
.tag { display: inline-flex; font-size: 11px; background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 4px; color: #b5bac1; }
.roles h3 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.roles h3 .muted { font-weight: 400; }
.role { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.role > i { width: 10px; height: 10px; border-radius: 50%; }
.rn { font-weight: 500; }
.perms { width: 100%; font-size: 13px; color: var(--muted); padding-left: 20px; }

/* ---------- Pages added with the server dashboard ---------- */

/* My servers */
.dash-row { grid-template-columns: 2.2fr 1fr; align-items: start; }
.group { margin: 8px 0 10px; }
.glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-bottom: 18px; }
.gcard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-inner); background: var(--card-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
a.gcard:hover { border-color: var(--line-2); background: var(--card-3); }
.gcard > div { flex: 1; min-width: 0; }
.gcard b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard small { color: var(--faint); font-size: 13px; }
.gcard small.ok { color: var(--accent); }
.gcard > .i { color: var(--faint); }
.gcard.off { opacity: .85; }
.gicon { flex: none; border-radius: 14px; object-fit: cover; background: var(--card-3); display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.gicon.md { width: 44px; height: 44px; font-size: 14px; }
.gicon.lg { width: 72px; height: 72px; border-radius: 20px; font-size: 22px; }
.side { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.side hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.big-n { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; margin-right: 4px; }

/* One server */
.server-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sh-text { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; }
.crumb:hover { color: var(--text); }
.crumb .i { width: 14px; height: 14px; }
.sh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gen h2, .plan-title { font-size: 24px; }
.pick { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 4px; }
.pick a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.pick a:hover { background: var(--card-2); }
.pick .pn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .dots i { width: 8px; height: 8px; border-radius: 2px; }
.tweak-row { display: flex; gap: 8px; margin-top: 6px; }
.tweak-row input { flex: 1; min-width: 0; background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: var(--r-ctl); padding: 0 12px; height: 42px; font: inherit; }
.tweak-row input:focus { outline: 0; border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.layout-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 24px; align-items: start; }
.lc { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.lc b { color: var(--text); font-weight: 500; font-size: 13px; margin-bottom: 4px; }

/* My templates */
.mylist { display: grid; }
.myrow { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-top: 1px solid var(--line); }
.myrow:first-child { border-top: 0; }
.myrow .dots i { width: 10px; height: 10px; border-radius: 3px; }
.myrow .mn { flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.myrow .mn b { display: block; font-weight: 500; }
.myrow .mn small { color: var(--muted); font-size: 13px; }
.myrow .switch em { font-style: normal; min-width: 66px; }
.myrow .switch input:checked + span { background: var(--accent); }
.myrow .switch input:checked + span::after { background: var(--on-accent); }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; font: 500 12px "Instrument Sans", sans-serif; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--muted); text-decoration: none; white-space: nowrap; cursor: pointer; }
a.tag-chip:hover, button.tag-chip:hover { border-color: var(--line-2); color: var(--text); }
.tag-chip span { color: var(--faint); }
.tag-chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tag-chip.add { border-style: dashed; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 20px; }
.tag-row > .muted { margin-right: 4px; }
.detail .tags { margin-top: -4px; }
.myrow .mn .tags { margin-top: 6px; }

/* ---------- Backups ---------- */
.backup-row { grid-template-columns: 1fr 1.3fr; align-items: start; }
.blist { list-style: none; margin: 0; padding: 0; }
.blist li { display: flex; align-items: center; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.blist li:first-child { border-top: 0; }
.blist .bn { flex: 1; min-width: 0; }
.blist .bn b { display: block; font-weight: 500; }
.blist .bn small { color: var(--faint); font-size: 12px; }
.blist .btn.text.sm { padding: 0 8px; }
.btn:disabled[title] { cursor: not-allowed; }

/* ---------- Publish dialog ---------- */
#publish-dlg { background: var(--card); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 28px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
#publish-dlg::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
#publish-dlg form { display: grid; gap: 10px; }
#publish-dlg h3 { font-size: 20px; }
#publish-dlg input { background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: var(--r-ctl); height: 42px; padding: 0 12px; font: inherit; }
#publish-dlg input:focus { outline: 0; border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag-sugs { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }
.row.end { justify-content: flex-end; margin-top: 6px; }
.edit label small { font-weight: 400; }


/* ---------- Footer & toast ---------- */
.foot { max-width: 1192px; width: calc(100% - 48px); margin: 8px auto 32px; padding: 32px 4px 0; display: grid; grid-template-columns: 1fr auto; gap: 32px; border-top: 1px solid var(--line); }
.foot-brand { display: grid; gap: 10px; justify-items: start; align-content: start; }
.foot-brand p { color: var(--muted); }
.foot-cols { display: flex; gap: 64px; }
.foot-cols div { display: grid; gap: 8px; align-content: start; }
.foot-cols h5 { margin: 0 0 2px; font: 600 14px var(--sans); color: var(--text); }
.foot-cols a, .foot-cols span { color: var(--muted); font-size: 14px; text-decoration: none; }
.foot-cols span { font: 13px var(--mono); }
.foot-cols a:hover { color: var(--text); }
.foot-base { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0 0; font-size: 13px; color: var(--faint); }

#toast { visibility: hidden; position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 80px); background: var(--raise); padding: 10px 16px; border-radius: var(--r-ctl); transition: transform .25s var(--ease); z-index: 50; }
#toast.show { visibility: visible; transform: translate(-50%, 0); }
#toast.bad { box-shadow: inset 0 0 0 1px var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .hero, .steps, .build-demo { grid-column: 1 / -1; grid-row: auto; }
  .build-demo { min-height: 560px; }
  .f-perms, .f-backup { grid-column: 1 / -1; }
  .f-private, .f-fast, .f-stats { grid-column: span 6; }
  .f-stats { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .gen-row, .detail-row, .backup-row, .dash-row, .preview { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  main { padding: 4px 12px 24px; }
  .nav { padding: 12px 16px; gap: 12px; justify-content: space-between; }
  .links, .nav-end .tonal { display: none; }
  .card, .section { padding: 22px; }
  .build-demo { padding: 0; }
  .steps { padding: 6px; }
  .hero { padding: 40px 24px 28px; min-height: 0; }
  .steps { grid-template-columns: 1fr; }
  .steps .n::after { display: none; }
  .f-private, .f-fast, .f-stats { grid-column: 1 / -1; }
  .f-stats { grid-template-columns: 1fr 1fr; }
  .matrix th span { display: none; }
  .final { padding: 44px 24px; min-height: 0; }
  .field { min-width: 0; width: 100%; }
  .foot { width: calc(100% - 32px); grid-template-columns: 1fr; }
  .foot-cols { gap: 40px; }
  .myrow { flex-wrap: wrap; }
  .server-head { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Command list in the "Designed in seconds" card */
.cmds { display: grid; gap: 2px; }
.cmds div { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.cmds div:first-child { border-top: 0; }
.cmds code { min-width: 86px; text-align: center; background: var(--surface-2); color: var(--accent); }

/* ---------- Additions: tokens the inner pages use ---------- */
:root { --card-3: var(--raise); --shadow: 0 24px 60px -30px rgba(0, 0, 0, .6); }

/* Legend swatches in the "Permissions handled" card */
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.legend .lg-full { background: var(--accent); }
.legend .lg-read { box-shadow: inset 0 0 0 2px var(--accent); }
.legend .lg-none { height: 2px; border-radius: 2px; background: var(--line-2); }

/* Template cards: the whole card opens the template; the /apply line stays clickable on its own */
.tcard { position: relative; }
.tcard-link { color: inherit; text-decoration: none; }
.tcard-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tcard-link:focus-visible { outline: none; }
.tcard:has(.tcard-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.tcard .apply-line { position: relative; z-index: 1; margin-top: 12px; }

/* /apply id:… command with a copy button */
.apply-line { display: flex; align-items: center; gap: 4px; min-width: 0; background: var(--bg); border-radius: 10px; padding: 4px 4px 4px 12px; }
.apply-line code { flex: 1; min-width: 0; background: none; padding: 0; color: var(--accent); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: all; cursor: text; }
.apply-copy { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.apply-copy:hover { background: var(--raise); color: var(--text); }
.apply-copy .i { width: 15px; height: 15px; }
.apply-copy.done { color: var(--ok); }
.apply-line.lg { padding: 6px 6px 6px 16px; border-radius: var(--r-ctl); }
.apply-line.lg code { font-size: 15px; }
.apply-line.lg .apply-copy { width: 36px; height: 36px; }
.apply-line.compact { flex: none; width: 230px; background: var(--surface-2); }
.apply-box { display: grid; gap: 8px; background: var(--surface-2); border-radius: var(--r-inner); padding: 14px; }
.apply-box .lbl { margin: 0; }
.apply-box .apply-line { background: var(--bg); }
.apply-box > .small code { font-size: 12px; }

/* Open a template by ID (community templates) */
.open-id { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 22px; }
.open-id .field { flex: 1; max-width: 520px; }

/* ---------- Terms & Privacy ---------- */
.legal-row { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.legal-head { grid-column: 1 / -1; display: grid; gap: 10px; padding: 44px; }
.legal-head .lead { max-width: 64ch; }
.legal-toc { grid-column: 1 / 5; position: sticky; top: 84px; display: grid; gap: 10px; }
.legal-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--faint); font-size: 14px; }
.legal-toc a { color: var(--muted); text-decoration: none; }
.legal-toc a:hover { color: var(--text); }
.prose { grid-column: 5 / -1; padding: 40px 44px; display: grid; gap: 34px; }
.prose section { display: grid; gap: 12px; scroll-margin-top: 90px; }
.prose h2 { font-size: 26px; letter-spacing: -0.025em; }
.prose h3 { font-size: 16px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; margin-top: 6px; }
.prose p, .prose li { color: var(--muted); max-width: 68ch; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prose li::marker { color: var(--faint); }
.prose a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.foot-base a { color: var(--faint); text-decoration: none; }

@media (max-width: 1060px) {
  .legal-toc { grid-column: 1 / -1; position: static; }
  .prose { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .legal-head, .prose { padding: 26px 22px; }
  .apply-line.compact { width: 100%; order: 3; }
  .open-id .field { max-width: none; flex-basis: 100%; }
  .open-id .btn { flex: 1; }
}
