/* Voice Pipeline demo styles. Plain CSS, no external fonts. */
:root {
  --bg: #F5F3EF;
  --panel: #FFFFFF;
  --ink: #1E1C19;
  --soft: #5E5A53;
  --muted: #837E75;
  --line: #E4DFD6;
  --accent: #2F5D62;
  --accent-ink: #213F43;
  --accent-soft: #E3EEEE;
  --iron: #3A3631;
  --ok: #1E7A4C;
  --ok-bg: #E2F3E9;
  --sample: #9A5B00;
  --sample-bg: #FDF0D5;
  --bad: #B3261E;
  --bad-bg: #FBE3E1;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: 84px; overflow-x: hidden;
}
@media (max-width: 900px) { body { padding-bottom: 104px; } }
@media (max-width: 640px) { body { padding-bottom: 156px; } }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
p { margin: 0 0 10px; }
b { font-weight: 600; }
.muted { color: var(--soft); }
.small { font-size: 13px; }
button, input, textarea, select { font: inherit; }
textarea, input[type=text] { font-size: 16px; }

/* ---- header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; flex-wrap: wrap; }
.brand .mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--iron); color: #fff; font-size: 12px; letter-spacing: .04em; }
.brand .app { color: var(--soft); font-weight: 500; }
.brand .app::before { content: "/"; margin-right: 8px; color: var(--line); }
.who { margin-left: auto; color: var(--soft); font-size: 13px; }
.who b { color: var(--ink); }
.steps { max-width: 1180px; margin: 0 auto; padding: 4px 20px 10px; display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps a.step { flex: none; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--soft); font-weight: 500; font-size: 14px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid transparent; }
.steps a.step .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.steps a.step.done .n { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.steps a.step:hover { background: var(--bg); color: var(--ink); }
.steps a.step.is-active { background: var(--accent); color: #fff; }
.steps a.step.is-active .n { background: #fff; color: var(--accent); border-color: #fff; }
.steps .sep { flex: none; width: 14px; height: 1px; background: var(--line); }
.steps .reset { flex: none; margin-left: auto; font-size: 13px; color: var(--muted); padding: 6px 4px 6px 12px; }

/* ---- layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 28px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 20px; margin-bottom: 18px; }
.page-head .lead { max-width: 720px; }
.page-head .lead p { margin: 6px 0 0; color: var(--soft); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split.rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
@media (max-width: 900px) { .grid2, .split, .split.rev { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card + .card { margin-top: 14px; }
.card h2 { margin-bottom: 8px; }
.card .sub { color: var(--soft); font-size: 13px; margin: -4px 0 10px; }
.stack > * + * { margin-top: 14px; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 9px 16px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.good { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--bg); color: var(--soft); border: 1px solid var(--line); white-space: nowrap; }
.pill.type { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok); }
.pill.sample { background: var(--sample-bg); border-color: var(--sample-bg); color: var(--sample); }
.pill.bad { background: var(--bad-bg); border-color: var(--bad-bg); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }

/* ---- screen 1: posts + profile */
.post { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel); }
.post + .post { margin-top: 10px; }
.post .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.post h3 { margin: 0 0 4px; font-size: 15px; }
.post .excerpt { color: var(--soft); font-size: 14px; margin: 0; }
.post details summary { cursor: pointer; font-size: 13px; color: var(--accent); margin-top: 6px; list-style: none; }
.post details summary::-webkit-details-marker { display: none; }
.post details[open] summary { margin-bottom: 6px; }
.post details p { font-size: 14px; margin: 0 0 6px; }

.run { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; background: #FBFAF7; }
.run ol { list-style: none; margin: 0; padding: 0; }
.run li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 4px 0; color: var(--muted); }
.run li .dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); margin-top: 2px; }
.run li.on { color: var(--ink); }
.run li.on .dot { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.run li.done { color: var(--ink); }
.run li.done .dot { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 3px #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .run li.on .dot { animation: none; } }

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
.pf { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel); min-width: 0; }
.pf.wide { grid-column: 1 / -1; }
.pf .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.pf p { font-size: 14px; margin: 0 0 6px; }
.quote { display: block; font-size: 13px; color: var(--soft); border-left: 3px solid var(--accent-soft); padding: 2px 0 2px 10px; margin: 6px 0 0; font-style: italic; }
.quote cite { font-style: normal; color: var(--muted); display: block; font-size: 12px; }
.phr { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }
.phr:first-of-type { border-top: 0; }
.phr .t { font-weight: 600; font-size: 14px; }
.phr .c { font-size: 12px; color: var(--muted); white-space: nowrap; }
.never { display: flex; flex-wrap: wrap; gap: 6px; }
.never span { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; margin: 8px 0 4px; }
.bars i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bars i.out { background: var(--line); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.big { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.skel { list-style: none; margin: 0; padding: 0; counter-reset: sk; }
.skel li { counter-increment: sk; font-size: 13px; padding: 3px 0; display: flex; gap: 8px; }
.skel li::before { content: counter(sk); flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: 11px; display: grid; place-items: center; margin-top: 1px; }
.skel-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 800px) { .skel-cols { grid-template-columns: minmax(0, 1fr); } }
pre.json { margin: 8px 0 0; background: #1E1C19; color: #E9E4DA; border-radius: 10px; padding: 12px 14px; font: 12px/1.5 ui-monospace, Consolas, monospace; overflow: auto; max-height: 420px; white-space: pre; }
.empty { text-align: center; padding: 26px 16px; color: var(--soft); }
.empty .btn { margin-top: 10px; }

/* ---- screen 2: setup */
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .opts { grid-template-columns: minmax(0, 1fr); } }
.opt { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .t { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.opt .d { font-size: 13px; color: var(--soft); margin-top: 4px; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt.checked { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt svg { flex: none; width: 40px; height: 28px; color: var(--iron); }
table.facts { width: 100%; border-collapse: collapse; font-size: 14px; }
table.facts th, table.facts td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.facts th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
table.facts td.src { color: var(--soft); font-size: 13px; white-space: nowrap; }
table.facts tr.hit td { background: var(--ok-bg); }
.tablewrap { overflow-x: auto; }
textarea { width: 100%; min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--ink); resize: vertical; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.go { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 16px; }

/* ---- screen 3: draft */
.brief { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--soft); align-items: center; }
.brief b { color: var(--ink); }
.writing { padding: 36px 16px; text-align: center; color: var(--soft); }
.writing .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); margin: 0 auto 12px; animation: spin .8s linear infinite; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cols.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .cols.two { grid-template-columns: minmax(0, 1fr); } }
.doc-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
article.post-doc { font-size: 16px; line-height: 1.65; }
article.post-doc h1 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
article.post-doc h2 { font-size: 19px; margin: 22px 0 8px; font-family: Georgia, "Times New Roman", serif; }
article.post-doc p { margin: 0 0 12px; }
article.post-doc ol, article.post-doc ul { margin: 0 0 12px; padding-left: 22px; }
article.post-doc li { margin-bottom: 6px; }
article.post-doc .byline { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
article.post-doc .signoff { font-style: italic; }
article.generic { color: #4A4640; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.checks { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.checks li { display: flex; gap: 10px; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks .v { font-weight: 600; white-space: nowrap; text-align: right; }
.checks .v.ok { color: var(--ok); }
.checks .v.bad { color: var(--bad); }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.cmp th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cmp td.ok { color: var(--ok); font-weight: 600; }
.cmp td.bad { color: var(--bad); font-weight: 600; }

/* ---- screen 4: guard */
.claim { border-radius: 4px; padding: 1px 2px; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.claim.ok { background: var(--ok-bg); border-bottom: 2px solid var(--ok); }
.claim.sample { background: var(--sample-bg); border-bottom: 2px solid var(--sample); }
.claim.bad { background: var(--bad-bg); border-bottom: 2px solid var(--bad); text-decoration: line-through; text-decoration-color: rgba(179, 38, 30, .6); }
.claim.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tally div { border-radius: 10px; padding: 10px; text-align: center; }
.tally .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.tally .l { font-size: 12px; font-weight: 600; }
.tally .ok { background: var(--ok-bg); color: var(--ok); }
.tally .sample { background: var(--sample-bg); color: var(--sample); }
.tally .bad { background: var(--bad-bg); color: var(--bad); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { border-top: 1px solid var(--line); padding: 8px 0; cursor: pointer; }
.ledger li:first-child { border-top: 0; }
.ledger li:hover .txt { color: var(--accent-ink); }
.ledger li.sel .txt { font-weight: 600; }
.ledger .row1 { display: flex; gap: 8px; align-items: flex-start; }
.ledger .txt { font-size: 14px; flex: 1; min-width: 0; }
.ledger .why { font-size: 13px; color: var(--soft); margin-top: 3px; padding-left: 2px; }
.ledger .why b { color: var(--ink); }
.cover { list-style: none; margin: 0; padding: 0; font-size: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.cover li::before { content: "\2713"; color: var(--ok); font-weight: 700; margin-right: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.sticky { position: sticky; top: 12px; }
@media (max-width: 900px) { .sticky { position: static; } }
.scrollbox { max-height: 460px; overflow: auto; }
@media (max-width: 900px) { .scrollbox { max-height: none; } }

/* ---- screen 5: export */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font-weight: 600; color: var(--soft); cursor: pointer; font-size: 14px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.sample-label { font-size: 12px; font-weight: 600; color: var(--sample); background: var(--sample-bg); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.banner { font-size: 13px; background: var(--sample-bg); color: #6B4200; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.cta-line { font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; color: var(--soft); }
.status { font-size: 14px; font-weight: 600; }
.decide { display: flex; flex-wrap: wrap; gap: 8px; }

#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(10px); z-index: 2147482000; background: var(--iron); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 900px) { #toast { bottom: 112px; } }
@media (max-width: 640px) { #toast { bottom: 160px; } }

/* ---- demo bar (same pattern as the other TKBS static demos) */
#tkbsDemoBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px;
  padding: 9px 16px; background: #0F1720; color: #E6EDF5;
  font: 500 13px/1.35 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; border-top: 2px solid #3DDC97;
}
#tkbsDemoBar b { color: #3DDC97; letter-spacing: .06em; font-weight: 700; }
#tkbsDemoBar a { color: #fff; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
#tkbsDemoBar a.cta { background: #3DDC97; color: #0F1720; text-decoration: none; font-weight: 700; padding: 6px 12px; border-radius: 999px; }

@media (max-width: 640px) {
  .top-inner { padding: 10px 16px 6px; }
  .who { margin-left: 0; width: 100%; }
  .steps { padding: 4px 16px 10px; }
  .wrap { padding: 16px 16px 24px; }
  h1 { font-size: 22px; }
  .card { padding: 14px; }
  .page-head .actions { margin-left: 0; }
  .cover { grid-template-columns: minmax(0, 1fr); }
  article.post-doc h1 { font-size: 21px; }
}
