/* comments portal — shared styles. Self-contained: no external fonts, no external assets. */

:root {
  color-scheme: light dark;
  --bg: #f7f8f4;
  --fg: #252b27;
  --muted: #69716a;
  --card: #ffffff;
  --border: #e0e4dc;
  --accent: #3157d5;
  --accent-hover: #2446b4;
  --accent-fg: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --info: #175cd3;
  --info-bg: #eff8ff;
  --code-bg: #edf0e8;
  --shadow: 0 2px 5px rgba(25, 40, 25, 0.025);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171b18;
    --fg: #e8ede5;
    --muted: #a1afa0;
    --card: #202620;
    --border: #384136;
    --accent: #7aa2f7;
    --accent-hover: #9db8fa;
    --accent-fg: #0f0e0d;
    --danger: #f97066;
    --danger-bg: #2a1614;
    --ok: #47cd89;
    --ok-bg: #0f2a1d;
    --warn: #fdb022;
    --warn-bg: #2b1f08;
    --info: #84caff;
    --info-bg: #10233a;
    --code-bg: #283026;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 0.85rem 1rem; border-radius: var(--radius); overflow-x: auto; margin: 0; }
pre code { background: none; padding: 0; font-size: 0.85rem; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -0.045em; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 0.75rem; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
[hidden] { display: none !important; }

/* --- layout --------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 20px max(24px, calc((100vw - 1136px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; text-decoration: none; color: var(--fg); font-size: 21px; letter-spacing: -0.045em; }
.brand::before { content: ""; width: 25px; height: 25px; flex-shrink: 0; background: var(--accent); mask: url("/assets/mark.svg") center / contain no-repeat; }
.site-header nav { display: flex; gap: 4px 24px; flex-wrap: wrap; font-size: 13px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; color: var(--muted); }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--fg); }

main.container {
  flex: 1;
  width: 100%;
  max-width: 1136px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 26px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.card > h2:first-child { margin-top: 0; }
.card h3 { margin-top: 1.25rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }

.hero { padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: 2.25rem; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.features li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.features strong { display: block; margin-bottom: 0.25rem; }

/* --- forms ---------------------------------------------------------------- */

form .field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; }
label { font-weight: 550; font-size: 0.8rem; }
.hint { color: var(--muted); font-size: 0.825rem; font-weight: 400; }

input[type="text"], input[type="email"], input[type="url"], input[type="datetime-local"], textarea, select {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  min-height: 44px;
  width: 100%;
}
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
textarea { min-height: 5.5rem; font-family: var(--mono); font-size: 0.875rem; }

.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1 1 200px; margin-bottom: 0; }
.row .field-narrow { flex: 0 1 240px; }

.check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; cursor: pointer; }

/* --- buttons -------------------------------------------------------------- */

.btn {
  font: inherit;
  font-weight: 550;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 8px;
  padding: 11px 16px;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  line-height: 1.4;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 11px; min-height: 36px; font-size: 12px; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* --- badges --------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-on, .badge-live, .badge-active, .badge-closed { color: var(--ok); background: var(--ok-bg); }
.badge-off, .badge-revoked, .badge-expired { color: var(--danger); background: var(--danger-bg); }
.badge-new { color: var(--info); background: var(--info-bg); }
.badge-in_review { color: var(--warn); background: var(--warn-bg); }
.badge-orphaned { color: var(--danger); background: var(--danger-bg); }
.badge-free, .badge-plan { color: var(--muted); background: var(--code-bg); }

/* --- tables --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; }
.empty { color: var(--muted); font-style: italic; }

/* --- banners -------------------------------------------------------------- */

.banners {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}
.banners:empty { display: none; }
.banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.925rem;
  background: var(--card);
}
.banner-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.banner-success { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
.banner-info { color: var(--info); background: var(--info-bg); border-color: var(--info); }
.banner-close { background: none; border: 0; color: inherit; font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0 0.2rem; }

/* --- reveal-once panels --------------------------------------------------- */

.reveal {
  border: 1px solid var(--warn);
  background: var(--warn-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
}
.reveal h3 { margin-top: 0; }
.reveal .warning { color: var(--warn); font-weight: 600; }
.secret-field { margin: 0.75rem 0; }
.secret-field .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.secret {
  display: block;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
  margin: 0.25rem 0;
  color: var(--fg);
}
.copy-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.copy-row .secret, .copy-row pre { flex: 1; min-width: 0; }
.copy-row > pre, .copy-row > .secret { max-width: 100%; }
.docs-layout > * { min-width: 0; }
.table-wrap table { min-width: 600px; }
.table-wrap td code { overflow-wrap: normal; white-space: nowrap; }

/* --- toggle --------------------------------------------------------------- */

.toggle { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 600; }
.toggle input {
  width: 2.4rem;
  height: 1.3rem;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  margin: 0;
  transition: background 0.15s;
}
.toggle input::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--card);
  transition: transform 0.15s;
}
.toggle input:checked { background: var(--ok); }
.toggle input:checked::after { transform: translateX(1.1rem); }
.toggle input:disabled { opacity: 0.5; }

/* --- account bar ---------------------------------------------------------- */

.account-bar {
  display: flex;
  gap: 0.75rem 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.account-bar strong { color: var(--fg); font-weight: 550; }

/* --- threads -------------------------------------------------------------- */

.thread {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.thread-in_review { border-left-color: var(--warn); }
.thread-closed { border-left-color: var(--ok); opacity: 0.85; }
.thread-head { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.snapshot { margin: 0.5rem 0 0.75rem; padding: 0.4rem 0.8rem; border-left: 3px solid var(--border); color: var(--muted); font-style: italic; }
.comments { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.comment { padding: 0.5rem 0; border-top: 1px solid var(--border); }
.comment p { margin: 0.2rem 0 0; white-space: pre-wrap; }
.comment-author { font-weight: 600; }
.comment-deleted p { color: var(--muted); font-style: italic; }

/* --- notices -------------------------------------------------------------- */

.notice { border: 1px solid var(--info); background: var(--info-bg); color: var(--info); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1.25rem; }
.notice-warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.notice p:last-child { margin-bottom: 0; }
.danger-zone { border-color: var(--danger); }

/* --- docs ----------------------------------------------------------------- */

.docs h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.docs h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.docs h3 { margin-top: 1.5rem; }
.docs pre { margin: 0.5rem 0 1rem; }
.docs .copy-row { margin: 0.5rem 0 1rem; }
.docs .copy-row pre { margin: 0; }
.docs table { margin-bottom: 1rem; }
.docs ul, .docs ol { padding-left: 1.4rem; }
.docs li { margin-bottom: 0.35rem; }
.toc { display: flex; gap: 0.5rem 1rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 1.5rem; }

/* --- demo article --------------------------------------------------------- */

.article { max-width: 44rem; margin: 0 auto; font-size: 1.05rem; line-height: 1.7; }
.article h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.article .byline { color: var(--muted); margin-bottom: 1.5rem; }
.article h2 { margin-top: 2rem; }
.article p { margin-bottom: 1rem; }
.article blockquote { margin: 1.25rem 0; padding: 0.5rem 1.25rem; border-left: 4px solid var(--accent); color: var(--muted); font-style: italic; }
.article ul { padding-left: 1.4rem; }
.article li { margin-bottom: 0.4rem; }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 600px) {
  .hero { padding-top: 1.5rem; }
  .hero h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -0.045em; }
  main.container { padding: 1rem 0.85rem 2.5rem; }
  .card { padding: 1rem; }
  .copy-row { flex-direction: column; }
  .copy-row > pre, .copy-row > .secret { width: 100%; }
}

/* --- header: session-aware links ------------------------------------------ */

.site-header nav { align-items: center; }
.site-header nav a.btn { color: var(--accent-fg); padding: 8px 15px; min-height: 36px; font-size: 12px; }

/* --- sections, steps, splits ------------------------------------------------ */

.section { margin: 2.5rem 0; }
.section > h2 { font-size: 1.5rem; margin-bottom: 0.35rem; letter-spacing: -0.01em; }
.section > .lead { color: var(--muted); max-width: 40rem; margin-bottom: 1.25rem; }

.steps { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; counter-reset: step; }
.steps li { position: relative; padding: 1.1rem 1.1rem 1.1rem 3.4rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 1rem; top: 1rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.steps strong { display: block; margin-bottom: 0.25rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; align-items: start; }
.reviewer-list { list-style: none; padding: 0; margin: 0; }
.reviewer-list li { padding: 0.5rem 0; border-top: 1px solid var(--border); }
.reviewer-list li:first-child { border-top: 0; }

/* --- tabs (harness pickers) and choice pills ------------------------------- */

.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.75rem; padding: 0; list-style: none; }
.tab { font: inherit; font-size: 0.9rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.choice { display: flex; flex-wrap: wrap; gap: 0.4rem; position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.choice label { display: inline-flex; align-items: center; min-height: 44px; font-weight: 550; font-size: 0.9rem; padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); cursor: pointer; color: var(--muted); }
.choice input:checked + label { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.choice input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

kbd { display: inline-block; padding: 0.05em 0.45em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--card); font-size: 0.85em; }

/* --- docs layout ------------------------------------------------------------- */

.docs-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.docs-side { position: sticky; top: 1rem; font-size: 0.9rem; }
.docs-side a { display: block; color: var(--muted); text-decoration: none; padding: 0.25rem 0 0.25rem 0.75rem; border-left: 2px solid var(--border); }
.docs-side a:hover { color: var(--fg); border-left-color: var(--fg); }
.docs-side .group { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1rem 0 0.3rem; font-weight: 700; }
.docs-side .group:first-child { margin-top: 0; }
@media (max-width: 800px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1rem; }
  .docs-side { position: static; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
  .docs-side .group { width: 100%; margin: 0.5rem 0 0; }
  .docs-side a { border-left: 0; padding: 0.2rem 0.4rem; }
}
.docs h1 { font-size: 2rem; letter-spacing: -0.02em; }
.docs .intro { font-size: 1.1rem; color: var(--muted); max-width: 40rem; }
.docs h2:first-of-type { margin-top: 1.5rem; }
.callout { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--card); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0; }
.callout p:last-child { margin-bottom: 0; }
details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 0.5rem 1rem; margin: 1rem 0; }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 0.75rem; }

/* --- guided setup ------------------------------------------------------------ */

.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 0.6rem; border: 1px solid var(--border); border-right: 0; border-radius: 6px 0 0 6px; background: var(--code-bg); color: var(--muted); font-family: var(--mono); font-size: 0.9rem; }
.input-prefix input { border-radius: 0 6px 6px 0; }
.result-step { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0.75rem; margin: 1.25rem 0; }
.result-step .n { width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.result-step h3 { margin: 0.3rem 0 0.35rem; }
.result-step pre { margin: 0.5rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-step .copy-row { margin: 0.5rem 0; }
.result-step .copy-row pre { margin: 0; }

/* --- demo bar ----------------------------------------------------------------- */

/* The demo page is one column: the intro shares the article's measure so their edges line up. */
.demo-intro { max-width: 44rem; margin: 0 auto; }
.demo-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; }
.demo-bar div { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.9rem; font-size: 0.9rem; }
.demo-bar strong { display: block; margin-bottom: 0.15rem; }
.demo-bar p { margin: 0; color: var(--muted); }

.docs .steps { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* --- demo UI block (things comment mode can box) ---------------------------- */

.demo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.25rem 0; font-size: 0.95rem; line-height: 1.5; }
.demo-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.demo-card--featured { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.demo-card h3 { margin: 0; }
.demo-card ul { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.demo-card li { margin: 0; }
.demo-card .btn { align-self: flex-start; margin-top: auto; }
.demo-price { font-size: 1.4rem; font-weight: 700; margin: 0; }
.demo-price span { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.demo-table { font-size: 0.95rem; margin: 1rem 0 1.5rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* --- agent setup panel ---------------------------------------------------------- */
.setup-panel { margin: 1.5rem 0 0; }
.setup-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.setup-head h2 { margin-bottom: 0.25rem; }
.setup-panel .choice { margin: 0.75rem 0 0.25rem; }
.setup-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.82rem; }

/* --- consent banner and the footer's links ------------------------------------- */
.consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: 640px;
  margin: 0 auto;
  padding: 0.9rem 1.1rem;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  font-size: 0.9rem;
}
.consent p { margin: 0; }
.consent .consent-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.site-footer a, .site-footer .link-button { color: var(--muted); }
.site-footer a:hover, .site-footer .link-button:hover { color: var(--fg); }
.link-button { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

/* --- shared page hierarchy ------------------------------------------------ */
.eyebrow { font-size: 10px; font-weight: 550; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-page main.container > h1 { margin-bottom: 14px; }
.app-page main.container > h1 + p { margin-bottom: 30px; max-width: 720px; }
.app-page .account-bar { font-size: 12px; padding-bottom: 18px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.app-page .account-bar:empty { display: none; }
.app-page main.container > .card, .app-page main.container > section.card { margin-top: 26px; }
.app-page .card > h2 { margin-bottom: 16px; }
.app-page .card > p { margin-bottom: 20px; }
.app-page .card .hint { line-height: 1.75; }
.app-page .card form + div:not(:empty) { margin-top: 24px; }
.site-list { list-style: none; padding: 0; margin: 0; }
.site-item { display: grid; grid-template-columns: 40px minmax(150px, 1fr) auto auto; align-items: center; gap: 18px; padding: 22px 0; border-top: 1px solid var(--border); }
.site-item:first-child { border-top: 0; padding-top: 10px; }
.site-item:last-child { padding-bottom: 8px; }
.site-item-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--code-bg); color: var(--muted); font-size: 21px; }
.site-item-identity { min-width: 0; }
.site-item-identity a { display: block; font-size: 15px; font-weight: 550; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
.site-item-identity a:hover { color: var(--accent); }
.site-item-identity > span { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.site-item-stats { display: flex; align-items: start; gap: 28px; margin: 0 12px 0 0; }
.site-item-stats dt { color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.site-item-stats dd { margin: 0; font-size: 12px; }
.site-item-stats .badge { font-size: 9px; }
.setup-page main.container { max-width: 850px; }
.setup-page #setup > .lead { max-width: 630px; color: var(--muted); font-size: 16px; line-height: 1.8; margin: 16px 0 28px; }
.setup-page #setup-form { padding: 30px; }
.setup-page #setup-form > .field { margin-bottom: 28px; gap: 10px; }
.setup-page #setup-form .choice { gap: 8px; }
.setup-page #setup-form > .actions { border-top: 1px solid var(--border); padding-top: 24px; margin-bottom: 0; gap: 12px; }
.label-text { font-size: 13px; font-weight: 550; }
.docs h1 { font-size: 40px; font-weight: 600; margin-bottom: 18px; }
.docs .intro { font-size: 16px; line-height: 1.8; margin-bottom: 36px; }
.docs h2 { padding-top: 32px; margin-top: 40px; margin-bottom: 18px; }
.docs h3 { margin-bottom: 12px; }
.docs-layout { gap: 52px; }
.docs-side { font-size: 12px; }
.docs-side a { padding: 7px 0 7px 14px; }
.docs-side .group { font-size: 9px; margin-top: 25px; }
.docs p, .docs li { font-size: 14px; line-height: 1.85; }
.docs .callout { padding: 20px 24px; border-left-width: 2px; }
.demo-page .demo-intro { max-width: 780px; }
.demo-page .demo-bar { gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.demo-page .demo-bar > div { border: 0; border-radius: 0; padding: 20px; font-size: 12px; }
.demo-page .demo-bar > div + div { border-left: 1px solid var(--border); }
.demo-page .article { background: var(--card); border: 1px solid var(--border); border-radius: 12px; max-width: 780px; padding: 48px; margin-top: 36px; font-size: 16px; line-height: 1.9; }
.demo-page .article h1 { font-size: 36px; line-height: 1.2; }
.demo-page .article .byline { font-size: 12px; padding-bottom: 28px; margin: 20px 0 32px; border-bottom: 1px solid var(--border); }
.demo-page .article h2 { margin: 32px 0 16px; }
body[data-page="callback"] main.container { display: grid; place-items: center; padding-top: 72px; padding-bottom: 100px; }
body[data-page="callback"] main.container > .card { width: 100%; max-width: 520px; padding: 40px; margin: 0; }
body[data-page="callback"] h1 { font-size: 30px; margin-bottom: 16px; }
body[data-page="callback"] #callback-status { color: var(--muted); font-size: 14px; line-height: 1.8; }
body[data-page="callback"] #callback-home { margin-top: 24px; margin-bottom: 0; }
.site-footer { justify-content: space-between; padding-left: max(24px, calc((100vw - 1136px) / 2)); padding-right: max(24px, calc((100vw - 1136px) / 2)); }
.site-footer > span { display: inline-flex; align-items: center; gap: 24px; }
.site-footer > span:first-child { color: var(--fg); font-weight: 600; }
.footer-tagline { color: var(--muted); font-weight: 400; }

@media (max-width: 800px) {
  .site-item { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; }
  .site-item-stats { grid-row: 2; grid-column: 2 / -1; margin: 0; gap: 26px; }
  .site-item-manage { grid-row: 1; grid-column: 3; }
  .site-item-icon { width: 36px; height: 36px; }
  .docs-layout { gap: 28px; }
  .docs-side a { padding: 6px 9px; }
}
@media (max-width: 600px) {
  .site-header { padding: 16px 18px; gap: 12px; }
  .brand { font-size: 19px; gap: 7px; }
  .brand::before { width: 23px; height: 23px; }
  .site-header nav { gap: 5px 14px; font-size: 12px; }
  .site-header nav a[href="#how-it-works"] { display: none; }
  .site-header nav a.btn { font-size: 11px; padding: 7px 12px; }
  main.container { padding: 28px 18px 48px; }
  .card { padding: 20px; }
  .app-page .account-bar { gap: 8px 12px; margin-bottom: 24px; }
  .site-item { column-gap: 10px; }
  .site-item-identity a { font-size: 13px; }
  .site-item-identity > span { font-size: 10px; }
  .site-item-manage { font-size: 11px; padding: 7px 10px; min-height: 40px; }
  .site-item-stats { gap: 20px; }
  .setup-page #setup-form { padding: 22px; }
  .setup-page #setup-form > .actions { align-items: stretch; flex-direction: column; }
  .choice label { font-size: 12px; padding-left: 12px; padding-right: 12px; }
  .docs h1 { font-size: 32px; }
  .docs .callout { padding: 16px 18px; }
  .demo-page .demo-bar { grid-template-columns: 1fr; }
  .demo-page .demo-bar > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .demo-page .article { padding: 24px; }
  .demo-page .article h1 { font-size: 29px; }
  body[data-page="callback"] main.container { padding-top: 40px; }
  body[data-page="callback"] main.container > .card { padding: 28px; }
  .site-footer { gap: 20px; justify-content: flex-start; }
  .site-footer > span { flex-wrap: wrap; gap: 16px; }
  .site-footer > span:first-child { flex-direction: column; align-items: flex-start; gap: 4px; }
  .consent { left: 12px; right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
