/* The `hidden` attribute must win even over author rules that set `display` (e.g. .btn-row{display:flex},
   which otherwise un-hides a hidden flex row). */
[hidden] { display: none !important; }
:root {
  --ink: #1a1d21;
  --muted: #5b6470;
  --accent: #2563eb;
  --line: #e2e6ec;
  --card: #ffffff;
  --bg: #f6f7f9;
  --good: #15803d;
  --kibitz: #3fb950; /* Kibitz's brand green (its call buttons) — the "plain call" path */
  --kibitz-dark: #238636; /* hover */
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 32px 20px 64px; }
h1 { font-size: 24px; letter-spacing: -0.3px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 24px; }
a { color: var(--accent); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin-bottom: 16px;
}
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 4px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
.row { display: flex; gap: 12px; }
.row > div { flex: 1; }
.btn {
  display: inline-block; border: none; border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--accent); color: #fff;
  text-decoration: none; /* .btn is used on <a> as often as <button> — an underlined button reads as a link */
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: #eef1f6; color: var(--ink); }
/* Kibitz-green button — for the "plain Kibitz call" path (vs the blue Witbitz/agent path). */
.btn.kibitz { background: var(--kibitz); }
.btn.kibitz:hover { background: var(--kibitz-dark); }
.btn-row { margin-top: 20px; display: flex; gap: 10px; align-items: center; }
.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.err { color: #b91c1c; font-size: 13px; margin-top: 10px; }
.ok { color: var(--good); font-size: 13px; margin-top: 10px; }
.out { margin-top: 18px; }
.out textarea { font-family: "SF Mono", Consolas, monospace; font-size: 12px; }
.agent-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 10px; background: #fff;
}
.agent-card:hover { border-color: var(--accent); }
.agent-card .name { font-weight: 700; font-size: 16px; }
.agent-card .tag { color: var(--muted); font-size: 14px; margin-top: 2px; }
.agent-card .disc { color: var(--muted); font-size: 12px; margin-top: 8px; }
.seal-note { background: #f0f6ff; border: 1px solid #d6e4ff; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #1e3a8a; margin-top: 12px; }
.balance { margin-top: 12px; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.balance.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.balance.empty { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.success { margin-top: 14px; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.success.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
#code { letter-spacing: 1px; text-transform: uppercase; }
@media (max-width: 520px) {
  .row { flex-direction: column; gap: 0; }
  .wrap { padding: 20px 14px 48px; }
}

/* Refresh affordance + live call status (storefront pages). */
.linkbtn { background: none; border: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 6px 0 0; }
.linkbtn:disabled { opacity: 0.5; cursor: default; }
.live { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; font-size: 14px; }
.live-dot { margin-right: 4px; }

/* ── Operator dashboard (admin.html) ── */
.adm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.adm-row:first-of-type { border-top: none; }
.adm-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.adm-bal { color: var(--good); }
.adm-used { color: var(--muted); }
.adm-note { color: var(--muted); font-size: 12.5px; }
.adm-sess { padding: 12px 0; border-top: 1px solid var(--line); }
.adm-sess:first-of-type { border-top: none; }
.adm-sess-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 14px; }
.adm-agent { font-weight: 600; }
.adm-room { color: var(--muted); }
.adm-status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 7px; border-radius: 999px; background: #eef1f6; color: var(--muted); }
.adm-status-running, .adm-status-starting { background: #e7f6ec; color: var(--good); }
.adm-status-stopped { background: #f3f4f6; color: var(--muted); }
.adm-timeline { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.adm-ev b { color: var(--ink); font-weight: 600; }

/* ── Homepage / landing (index.html) ── */
.hero { padding: 8px 0 4px; }
.hero .logo { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.hero h1 { font-size: 30px; margin-bottom: 10px; } /* wraps to 2 lines on a phone — 4px crowded the sub */
.hero .sub { font-size: 16px; max-width: 32em; margin-bottom: 20px; }
/* Two-paragraph hero (the vision, then what you actually get) — tighten the gap between them so they
   read as one block rather than two separate claims. */
.hero .sub + .sub { margin-top: -10px; }
.lead-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.lead-cta .btn { padding: 12px 22px; }

.section { margin-top: 44px; }
.section > h2 { font-size: 17px; margin: 0 0 16px; letter-spacing: -0.2px; }

/* "How it works" — three numbered steps. */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.step .n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.step .t { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.step .d { color: var(--muted); font-size: 13px; }

/* Agent catalog highlight cards (reuses .agent-card; adds an emoji head + a free pill). */
.agent-card .emoji { font-size: 22px; margin-right: 7px; vertical-align: -3px; }
.agent-card .free { display: inline-block; margin-left: 7px; font-size: 11px; font-weight: 700; color: var(--good);
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 999px; padding: 1px 8px; vertical-align: 2px; }

/* Footer + the global legal/help links. */
.foot { margin-top: 52px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.foot .sep { opacity: 0.4; }
.foot .grow { flex: 1; }

/* Install page (per-platform "Add to Home Screen"). */
.install-os { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.install-os h3 { font-size: 14.5px; margin: 0 0 8px; }
.install-os ol { margin: 0; padding-left: 20px; color: var(--ink); font-size: 14px; }
.install-os ol li { margin: 4px 0; }
.install-os .icon { margin-right: 6px; }
.kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: #eef1f6;
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* Long-form legal copy (privacy / terms). */
.legal h2 { font-size: 16px; margin: 26px 0 6px; }
.legal h2:first-of-type { margin-top: 8px; }
.legal p, .legal li { font-size: 14px; color: var(--ink); }
.legal ul { padding-left: 20px; }
.legal .eff { color: var(--muted); font-size: 13px; margin-top: 0; }

@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .lead-cta { flex-direction: column; }
  .lead-cta .btn { text-align: center; }
}

/* ── Platform site chrome (index / spaces / call / trust / build) ──────────────────────────────
   The site is now platform-first: the front page describes the runtime, and the live call is ONE
   interaction mode among several. These rules are the shared chrome that reshuffle needed. */
.topnav {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  max-width: 680px; margin: 0 auto; padding: 14px 20px 0; font-size: 13.5px;
}
.topnav .grow { flex: 1; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--accent); }
.topnav a.brand { color: var(--ink); font-weight: 700; font-size: 15px; }
.topnav a.here { color: var(--accent); font-weight: 600; }

/* "Witbitz · interaction mode" breadcrumb over a sub-page title. */
.kicker { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.kicker a { color: var(--muted); }

/* A one-line claim that introduces a section, heavier than .note. */
.lede { font-size: 15px; color: var(--ink); margin: 0 0 14px; max-width: 34em; }

/* Two-up cards: the platform primitives, and the hosted/self-host pair. */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.prim { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; font-size: 13px; color: var(--muted); }
.prim b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 3px; }
/* A card whose body is a short SEQUENCE rather than a sentence — each step on its own line, with the
   later steps stepped in, so the progression reads as a ladder without needing numbers. */
.prim.ladder span { display: block; margin-top: 3px; }
.prim.ladder span + span { padding-left: 10px; border-left: 2px solid var(--line); }

/* The verifiability scoreboard. The `soon` row is load-bearing: a claims table that lists only
   what we cover is marketing, so the not-yet row must render as prominently as the others. */
.claims { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.claims td { border-top: 1px solid var(--line); padding: 11px 0; vertical-align: top; }
.claims tr:first-child td { border-top: none; }
.claims td:last-child { width: 9.5em; padding-left: 14px; text-align: right; font-size: 12px; font-weight: 700; }
.claims td.yes { color: var(--good); }
.claims td.soon { color: #92400e; font-weight: 600; }

/* Interaction-mode cards (async Space / live call / Bridge). */
.mode { display: block; text-decoration: none; color: inherit; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; margin-bottom: 10px; }
.mode:hover { border-color: var(--accent); }
.mode .name { font-weight: 700; font-size: 15.5px; }
.mode .tag { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.pill { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; vertical-align: 2px;
  border-radius: 999px; padding: 1px 8px; background: #eef1f6; color: var(--muted); border: 1px solid var(--line); }
.pill.live { background: #f0fdf4; color: var(--good); border-color: #bbf7d0; }

/* The "to be precise, this is not no-backend" caveat — visually a footnote, not a feature. */
.honest { background: #fbfcfe; }

/* A key shown ONCE next to its copy button. `break-all` because an API key has no break opportunities
   and would otherwise push the card into horizontal overflow on a phone. */
.keyrow { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 4px; }
.keyrow code { flex: 1; min-width: 0; overflow-wrap: break-word; word-break: break-all;
  font-size: 12.5px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); }
.keyrow .linkbtn { padding: 8px 0 0; white-space: nowrap; }

ul.plain { margin: 10px 0 0; padding-left: 20px; }
ul.plain li { font-size: 13.5px; color: var(--muted); margin: 6px 0; }
ul.plain li b { color: var(--ink); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
  background: #eef1f6; border-radius: 4px; padding: 1px 5px; }

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .topnav { padding: 12px 14px 0; }
  .claims td:last-child { width: 7.5em; }
}

/* ── Unified call app (app.html): launcher + the floating "Add an AI agent" affordance ── */
.app-launch { max-width: 460px; }
.app-launch .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 16px 0; }
.app-launch .or::before, .app-launch .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Floating "＋ AI agent" button — sits above the full-window Kibitz call. */
.fab {
  position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 2147483646;
  border: none; border-radius: 999px; padding: 13px 18px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: 0 6px 22px rgba(37, 99, 235, 0.45);
  display: inline-flex; gap: 8px; align-items: center;
}
.fab:active { transform: translateY(1px); }
.fab .em { font-size: 17px; }

/* Add-agent bottom sheet (modal). */
.sheet { position: fixed; inset: 0; z-index: 2147483647; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 12, 16, 0.5); }
.sheet[hidden] { display: none; }
.sheet-panel { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 560px) { .sheet { align-items: center; } .sheet-panel { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sheet-head h2 { font-size: 17px; margin: 0; letter-spacing: -0.2px; }
.sheet-x { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.sheet .byok summary { list-style: none; }

