:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1b1d22; --muted: #6a6f7a; --line: #e4e2dc;
  --accent: #1f4fd6; --accent-ink: #ffffff;
  --ask: #1f4fd6; --say: #13804a; --notes: #0f7b85; --general: #a3620a; --flag: #c2341f;
  --card: #fff7e0; --card-line: #f0d88a;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --panel: #1a1d23; --ink: #eceef2; --muted: #9aa1ad; --line: #2b2f37;
    --accent: #6d93ff; --accent-ink: #0d1020;
    --ask: #7fa2ff; --say: #4cc98a; --notes: #48c3cc; --general: #e0a447; --flag: #ff7a63;
    --card: #2a2515; --card-line: #5c4d1d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 14px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--flag); border-color: currentColor; background: transparent; }
button:disabled { opacity: .55; cursor: default; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 9px 11px; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.hidden { display: none !important; }

/* header */
.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; letter-spacing: .2px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--say); box-shadow: 0 0 0 4px color-mix(in srgb, var(--say) 20%, transparent); }
.dot.off { background: var(--flag); }

/* live layout */
.live { display: grid; grid-template-columns: minmax(0, 660px) 300px; justify-content: center; gap: 20px; padding: 14px 16px; }
@media (max-width: 860px) { .live { grid-template-columns: 1fr; } }
.prompts { display: flex; flex-direction: column; gap: 10px; }
.prompt { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.prompt.newest { border-color: var(--accent); }
.prompt.card { background: var(--card); border-color: var(--card-line); }
.prompt .trig { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prompt .ln { font-size: 18px; line-height: 1.4; margin: 3px 0; }
.prompt .answer { font-size: 19px; line-height: 1.5; }
.prompt.old .answer { font-size: 15.5px; }
.prompt .src { margin-top: 6px; font-size: 12.5px; color: var(--general); }
.prompt.old .ln { font-size: 15px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .6px; padding: 2px 7px; border-radius: 5px; margin-right: 8px; vertical-align: 2px; color: #fff; }
.tag.ASK { background: var(--ask); } .tag.SAY { background: var(--say); } .tag.NOTES { background: var(--notes); }
.tag.GENERAL { background: var(--general); } .tag.FLAG { background: var(--flag); } .tag.CARD { background: #8a6d12; }
.side { display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check .box { width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 5px; flex: none; margin-top: 2px; }
.check.done .box { background: var(--say); border-color: var(--say); }
.check.done span { color: var(--muted); text-decoration: line-through; }
.transcript { max-height: 38vh; overflow: auto; font-size: 13.5px; }
.tl { padding: 3px 0; }
.tl b { cursor: pointer; }
.tl.me b { color: var(--accent); }
.tl.partial { color: var(--muted); font-style: italic; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.notice { margin: 10px 16px 0; padding: 9px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--card-line); font-size: 14px; }
.practice { display: flex; gap: 8px; padding: 0 16px 16px; max-width: 1012px; margin: 0 auto; }
.practice input[name=speaker] { max-width: 160px; }
.pill { font-size: 12px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; color: var(--muted); }
h1 { font-size: 20px; margin: 0 0 6px; } h2 { font-size: 16px; margin: 0 0 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; }
.status.active { color: var(--say); } .status.upcoming { color: var(--ask); } .status.ended, .status.revoked { color: var(--muted); }
.center { min-height: 80vh; display: grid; place-items: center; padding: 16px; }

/* Must-read setup instructions (browser-tab listening) */
.must { margin: 10px 0 4px; padding: 14px 16px; border: 2px solid var(--flag); border-radius: 10px; background: color-mix(in srgb, var(--flag) 8%, var(--panel, #fff)); color: var(--ink); font-size: 14.5px; }
.must-title { font-weight: 700; font-size: 16px; color: var(--flag); margin-bottom: 6px; }
.must ol { margin: 6px 0; padding-left: 20px; }
.must li { margin: 4px 0; }
.must-alt { margin: 8px 0; font-size: 13.5px; }
.must-ok { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--panel, #fff); border: 1px solid var(--line); font-weight: 600; color: var(--ink); cursor: pointer; }
.must-ok input { width: auto; transform: scale(1.25); }

/* Listening status: turns green while the meeting is heard */
#capStatus.hearing { color: var(--say); border-color: var(--say); }
#capStatus.hearing::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--say); margin-right: 6px; vertical-align: 1px; }
