/* ===========================================================================
   MeetViz — "Phosphor"

   The whole app is one instrument: a debate read out by a machine and drawn
   on a dark screen. Everything is monospaced, every surface is near-black,
   and colour only ever appears as emitted light — a rim, a glow, a trace.
   The six kinds keep their hues; nothing else in the UI is coloured except
   the system cyan.
   =========================================================================== */

:root {
  --bg: #04070a;
  --bg-panel: #070c11;
  --border: #16222a;
  --border-lit: #24404c;
  --text: #dcecef;
  --text-dim: #6d8792;
  --accent: #3ed3e8;

  /* Mindmap node strokes (board view). */
  --topic: #5b9dff;
  --argument: #3ed687;
  --counter: #ff6b6b;
  --question: #b18cff;
  --decision: #ffc53d;
  --fact: #3ed3e8;

  /* Phosphor emission colours per kind — the light a note gives off. */
  --st-topic: #7fb8ff;
  --st-argument: #6ee7a5;
  --st-counter: #ff8f8f;
  --st-question: #c5aaff;
  --st-decision: #ffd76b;
  --st-fact: #6fe3f2;

  --mono: ui-monospace, "SF Mono", Menlo, "DejaVu Sans Mono", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* CRT overlay: scanlines + vignette over the whole app. Kept off the bot
   camera so the encoded video stays clean. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(62, 211, 232, 0.022) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55));
}

body.bot::after { display: none; }

/* The blinking terminal caret, reused wherever the app is "still typing". */
@keyframes caret { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* ---------- Landing page ---------- */

.landing {
  max-width: 680px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.landing h1 {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.landing h1 span {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(62, 211, 232, 0.55);
}

.landing h1::after {
  content: "▌";
  color: var(--accent);
  margin-left: 4px;
  animation: caret 1.15s steps(1) infinite;
}

.landing .tagline {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 44px;
  line-height: 1.65;
  max-width: 62ch;
}

.landing .tagline::before { content: "// "; opacity: 0.6; }

.card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 22px 24px 24px;
  margin-bottom: 18px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

/* scanlines inside every panel */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(62, 211, 232, 0.028) 0 1px, transparent 1px 3px);
}

.card > * { position: relative; }

.card h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.card h2::before { content: "> "; color: var(--accent); }

.card p {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.6;
}

.row { display: flex; gap: 10px; }

input[type="url"] {
  flex: 1;
  min-width: 0;
  background: #020406;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  caret-color: var(--accent);
  font-family: var(--mono);
  padding: 11px 13px;
  font-size: 13px;
}

input[type="url"]::placeholder { color: #3f5661; }

input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(62, 211, 232, 0.25), 0 0 18px -6px var(--accent);
}

button {
  background: #061014;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: var(--accent);
  font-family: var(--mono);
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 0 22px -14px var(--accent);
  transition: background 0.18s, box-shadow 0.18s, color 0.18s;
}

button:hover {
  background: #0a1c22;
  color: #d8fbff;
  box-shadow: inset 0 0 22px -8px var(--accent), 0 0 20px -6px var(--accent);
}

button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button.secondary {
  border-color: var(--border-lit);
  color: var(--text-dim);
  box-shadow: none;
}

button.secondary:hover { color: var(--text); border-color: var(--accent); }

.error {
  color: var(--counter);
  font-size: 12.5px;
  margin-top: 12px;
  text-shadow: 0 0 12px rgba(255, 107, 107, 0.5);
}

.error::before { content: "! "; }

.hint {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 14px;
  line-height: 1.6;
}

.hint code {
  background: #020406;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 1px 5px;
}

/* ---------- Board / wall chrome ---------- */

body.board { overflow: hidden; }

.board-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(to bottom, rgba(4, 7, 10, 0.96) 60%, rgba(4, 7, 10, 0));
  z-index: 10;
}

.board-header .brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.board-header .brand span {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(62, 211, 232, 0.5);
}

.badge {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.badge.live {
  border-color: var(--argument);
  color: var(--argument);
  text-shadow: 0 0 12px rgba(62, 214, 135, 0.6);
  box-shadow: inset 0 0 18px -12px var(--argument);
}

.badge.live::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--argument);
  box-shadow: 0 0 8px var(--argument);
  margin-right: 7px;
  vertical-align: 1px;
  animation: pulse 1.6s infinite;
}

@keyframes pulse { 50% { opacity: 0.25; } }

#map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

/* Bottom-right, out of the header's way — it has grown too many controls to
   share that row. */
.legend {
  position: fixed;
  bottom: 16px;
  right: 20px;
  max-width: 46vw;
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 11; /* above the ticker's gradient */
  display: flex;
  gap: 14px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  z-index: 10;
}

/* Each swatch carries its kind as `color`, so it can glow in its own light. */
.legend i {
  display: inline-block;
  width: 8px; height: 8px;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
  margin-right: 6px;
}

/* ---------- Transcript ticker ---------- */

.ticker {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 16px 20px 18px;
  background: linear-gradient(to top, rgba(4, 7, 10, 0.97) 55%, rgba(4, 7, 10, 0));
  z-index: 10;
  pointer-events: none;
}

.ticker { padding-right: 24px; }
body:not(.bot) .ticker .line { max-width: calc(100vw - 48px - 48vw); }

.ticker .line {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 1100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker .line.latest {
  color: var(--text);
  text-shadow: 0 0 14px rgba(220, 236, 239, 0.25);
}

.ticker .speaker { color: var(--accent); font-weight: 600; }
.ticker .speaker::before { content: "> "; opacity: 0.7; }
.ticker .line.interim { color: var(--text-dim); opacity: 0.75; }

/* ---------- SVG mindmap (board view) ---------- */

.link {
  fill: none;
  stroke: var(--border-lit);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  opacity: 0.9;
}

.node rect {
  rx: 2;
  stroke-width: 1.2;
  fill: #05090d;
}

.node text {
  fill: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  dominant-baseline: middle;
}

.node.root rect { fill: #061318; stroke: var(--accent); filter: drop-shadow(0 0 8px rgba(62, 211, 232, 0.45)); }
.node.root text { fill: #d8fbff; font-size: 15px; font-weight: 600; }

.node.topic rect { stroke: var(--topic); filter: drop-shadow(0 0 6px rgba(91, 157, 255, 0.4)); }
.node.argument rect { stroke: var(--argument); filter: drop-shadow(0 0 6px rgba(62, 214, 135, 0.4)); }
.node.counter rect { stroke: var(--counter); filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.4)); }
.node.question rect { stroke: var(--question); filter: drop-shadow(0 0 6px rgba(177, 140, 255, 0.4)); }
.node.decision rect { stroke: var(--decision); fill: #0d0b05; filter: drop-shadow(0 0 6px rgba(255, 197, 61, 0.4)); }
.node.fact rect { stroke: var(--fact); filter: drop-shadow(0 0 6px rgba(62, 211, 232, 0.4)); }

.node.topic text { fill: var(--st-topic); }
.node.argument text { fill: var(--st-argument); }
.node.counter text { fill: var(--st-counter); }
.node.question text { fill: var(--st-question); }
.node.decision text { fill: var(--st-decision); }
.node.fact text { fill: var(--st-fact); }

.node { transform-box: fill-box; transform-origin: center; }
.node.fresh { animation: pop 0.5s ease-out; }

/* Power-on: the box strikes bright, then settles. */
@keyframes pop {
  0% { opacity: 0; transform: scaleY(0.04); }
  35% { opacity: 1; transform: scaleY(1.04); }
  55% { opacity: 0.65; }
  100% { opacity: 1; transform: scaleY(1); }
}

.empty-state {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  z-index: 5;
}

.empty-state .big {
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-shadow: 0 0 18px rgba(62, 211, 232, 0.3);
}

.empty-state .big::after {
  content: "▌";
  color: var(--accent);
  margin-left: 3px;
  animation: caret 1.15s steps(1) infinite;
}

/* ---------- Microphone mode ---------- */

.mic-btn {
  background: #061014;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 7px 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0;
}

.mic-btn.listening {
  border-color: var(--counter);
  color: var(--counter);
  background: #140708;
  box-shadow: inset 0 0 24px -12px var(--counter), 0 0 18px -8px var(--counter);
  animation: pulse 1.6s infinite;
}

.mic-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }

.mic-meter {
  width: 52px;
  height: 6px;
  background: #020406;
  border: 1px solid var(--border);
  overflow: hidden;
  flex: none;
}

.mic-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--argument);
  box-shadow: 0 0 10px var(--argument);
  transition: width 0.06s linear;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  overflow: hidden;
  flex: none;
}

.lang-switch button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 10px;
  box-shadow: none;
}

.lang-switch button.on {
  background: #0a1c22;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(62, 211, 232, 0.6);
}

.mic-debug {
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Bot mode: the page is rendered as the bot's 1280x720 camera. */
body.bot .board-header .badge,
body.bot .view-toggle,
body.bot .mic-tools,
body.bot .legend { display: none; }
body.bot .ticker .line { font-size: 17px; }
body.bot .ticker .line.latest { font-size: 19px; }

/* ---------- View toggle + header title ---------- */

.view-toggle {
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 4px 11px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  text-transform: none;
  box-shadow: none;
}

.view-toggle:hover { border-color: var(--accent); color: var(--text); background: transparent; }

.map-title {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 32vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-title::before { content: "// "; opacity: 0.6; }

/* ---------- Sticky wall ---------- */

body.sticky-wall { overflow: hidden; }

#wall {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* A board is a lit panel of the instrument: grid ruling, vignette, cut corner. */
.sticky-board {
  position: absolute;
  background: #05090d;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 90px 10px rgba(0, 0, 0, 0.85);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s;
}

.sticky-board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(62, 211, 232, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 211, 232, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(78% 78% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(78% 78% at 50% 50%, #000 30%, transparent 100%);
}

.sticky-board .board-title {
  position: absolute;
  top: 0; left: 0; right: 52px;
  padding: 13px 0 0 18px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: #cfe9ef;
  text-shadow: 0 0 16px rgba(62, 211, 232, 0.3);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sticky-board .board-title::before { content: "> "; color: var(--accent); }

.sticky-board .board-count {
  position: absolute;
  top: 13px;
  right: 22px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
}

.sticky-board .board-count::before { content: "["; }
.sticky-board .board-count::after { content: "]"; }

.sticky-board.fresh { animation: board-in 0.5s ease-out; }
.sticky-board.gone { opacity: 0; }

@keyframes board-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Links: signal traces between notes ---------- */

#links {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

#links .link-layer { animation: links-in 0.9s ease-out 0.3s both; }

@keyframes links-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.link-string {
  fill: none;
  stroke-width: 1.6;
  stroke-dasharray: 7 6;
  opacity: 0.55;
  animation: trace 2.4s linear infinite;
}

@keyframes trace { to { stroke-dashoffset: -26; } }

.link-pin { opacity: 0.9; }

.link-string.k-topic { stroke: var(--st-topic); }
.link-string.k-argument { stroke: var(--st-argument); }
.link-string.k-counter { stroke: var(--st-counter); }
.link-string.k-question { stroke: var(--st-question); }
.link-string.k-decision { stroke: var(--st-decision); }
.link-string.k-fact { stroke: var(--st-fact); }
.link-pin.k-topic { fill: var(--st-topic); }
.link-pin.k-argument { fill: var(--st-argument); }
.link-pin.k-counter { fill: var(--st-counter); }
.link-pin.k-question { fill: var(--st-question); }
.link-pin.k-decision { fill: var(--st-decision); }
.link-pin.k-fact { fill: var(--st-fact); }

/* ---------- Notes ---------- */

/* The outer .note carries position (translate + tilt, transitioned so notes
   glide, including across boards when the LLM re-parents them); the inner
   .note-card carries the phosphor look and the scale animations. */
.note {
  position: absolute;
  width: 150px;
  height: 150px;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Every kind emits its own light; the card body stays near-black. */
.note[data-kind="topic"] { --kc: var(--topic); --kc-soft: var(--st-topic); }
.note[data-kind="argument"] { --kc: var(--argument); --kc-soft: var(--st-argument); }
.note[data-kind="counter"] { --kc: var(--counter); --kc-soft: var(--st-counter); }
.note[data-kind="question"] { --kc: var(--question); --kc-soft: var(--st-question); }
.note[data-kind="decision"] { --kc: var(--decision); --kc-soft: var(--st-decision); }
.note[data-kind="fact"] { --kc: var(--fact); --kc-soft: var(--st-fact); }

.note-card {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #05090c;
  border: 1px solid color-mix(in srgb, var(--kc, var(--accent)) 45%, transparent);
  color: var(--kc-soft, var(--text));
  /* clip-path eats box-shadow, so the outward bloom comes from a filter. */
  box-shadow: inset 0 0 30px -14px var(--kc, var(--accent));
  --bloom: drop-shadow(0 0 9px color-mix(in srgb, var(--kc, var(--accent)) 30%, transparent));
  filter: var(--bloom);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: border-color 0.5s, color 0.5s, box-shadow 0.5s;
}

/* scanlines */
.note-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.75;
  background: repeating-linear-gradient(
    to bottom,
    color-mix(in srgb, var(--kc, var(--accent)) 11%, transparent) 0 1px,
    transparent 1px 3px);
}

/* the emitter edge along the top */
.note-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% - 12px);
  height: 2px;
  background: var(--kc, var(--accent));
  box-shadow: 0 0 12px var(--kc, var(--accent));
}

.note-label {
  position: relative;
  z-index: 2;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.01em;
  text-shadow: 0 0 14px color-mix(in srgb, var(--kc, var(--accent)) 55%, transparent);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

/* Every note carries a dim caret; only the one that just landed blinks,
   so the eye goes straight to what the bot is writing right now. */
.note-label::after {
  content: "▌";
  color: var(--kc, var(--accent));
  margin-left: 2px;
  opacity: 0.25;
}

.note:last-child .note-label::after {
  opacity: 1;
  animation: caret 1.15s steps(1) infinite;
}

.note-kind {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kc, var(--accent));
  opacity: 0.9;
  text-shadow: 0 0 10px color-mix(in srgb, var(--kc, var(--accent)) 65%, transparent);
}

.note-kind::before { content: "◤"; opacity: 0.55; }

/* A note arrives the way a CRT draws it: strikes bright, flickers, settles. */
.note.fresh .note-card { animation: slap 0.45s steps(1, end); }

@keyframes slap {
  0% { opacity: 0; transform: scaleY(0.06); }
  25% { opacity: 1; transform: scaleY(1.05); }
  40% { opacity: 0.5; transform: scaleY(1); }
  55% { opacity: 1; }
  70% { opacity: 0.75; }
  100% { opacity: 1; transform: scaleY(1); }
}

/* The LLM reassigned this note's kind — retune while the colour crossfades. */
.note.recolor .note-card { animation: recolor 0.55s ease; }

@keyframes recolor {
  0% { transform: scaleX(1); filter: var(--bloom) brightness(1); }
  30% { transform: scaleX(1.04); filter: var(--bloom) brightness(1.9); }
  60% { transform: scaleX(0.99); filter: var(--bloom) brightness(0.8); }
  100% { transform: scaleX(1); filter: var(--bloom) brightness(1); }
}

/* Powering down. */
.note.gone { pointer-events: none; }
.note.gone .note-card {
  opacity: 0;
  transform: scaleY(0.04);
  transition: opacity 0.4s, transform 0.4s;
}

/* ---------- Key ideas panel ---------- */

.key-ideas {
  position: fixed;
  top: 64px;
  right: 20px;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 15px 18px 18px;
  z-index: 10;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  box-shadow: inset 0 0 60px 6px rgba(0, 0, 0, 0.6);
}

.key-ideas h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(62, 211, 232, 0.45);
  margin-bottom: 12px;
}

.key-ideas ol {
  list-style: none;
  counter-reset: idea;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.key-ideas li {
  counter-increment: idea;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  padding-left: 30px;
  position: relative;
}

.key-ideas li::before {
  content: "[" counter(idea, decimal-leading-zero) "]";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(62, 211, 232, 0.5);
}

.key-ideas li.fresh { animation: pop 0.5s ease-out; }

.key-ideas .idea-quote {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
}

/* Bot camera: hide the key-ideas panel — the ticker + wall carry the feed */
body.bot .key-ideas { display: none; }

@media (max-width: 900px) {
  .key-ideas { width: 45vw; }
}

/* ---------- Live transcript panel ---------- */

.transcript-panel {
  position: fixed;
  top: 64px;
  left: 20px;
  width: 340px;
  max-height: 62vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 14px 16px 16px;
  z-index: 10;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  box-shadow: inset 0 0 60px 6px rgba(0, 0, 0, 0.6);
}

.transcript-panel[hidden] { display: none; }

.transcript-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(62, 211, 232, 0.45);
  margin-bottom: 11px;
}

.tcount {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 1px 7px;
}

.tcopy {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  box-shadow: none;
}

.tcopy:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.transcript-log {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
  line-height: 1.55;
}

.transcript-log .t-line { color: var(--text); }
.transcript-log .t-line .t-speaker { color: var(--accent); font-weight: 600; margin-right: 4px; }
.transcript-log .t-line .t-speaker::before { content: "> "; opacity: 0.7; }
.transcript-log .t-line.t-interim { color: var(--text-dim); opacity: 0.8; }
.transcript-log .t-empty { color: var(--text-dim); opacity: 0.8; }

/* Thin phosphor scrollbars for the two panels. */
.transcript-log::-webkit-scrollbar,
.key-ideas::-webkit-scrollbar { width: 6px; }
.transcript-log::-webkit-scrollbar-thumb,
.key-ideas::-webkit-scrollbar-thumb { background: var(--border-lit); }

/* The bot camera shows only the wall. */
body.bot .transcript-panel, body.bot #transcriptToggle { display: none; }

.view-toggle.on {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 20px -12px var(--accent);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===========================================================================
   Session chrome: right rail (what the meeting produced), note inspector
   (where a note came from + how to correct it), replay scrubber, ingest
   progress and the export menu. All of it is hidden in the bot camera.
   =========================================================================== */

.board-header .brand { text-decoration: none; color: inherit; }

/* ---------- Header menu ---------- */

.menu-wrap { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 232px;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-lit);
  z-index: 40;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: 0 18px 40px -18px #000;
}

.menu[hidden] { display: none; }

.menu > * {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  padding: 11px 14px;
  cursor: pointer;
  box-shadow: none;
}

.menu > *:last-child { border-bottom: 0; }
.menu > *:hover { color: var(--accent); background: rgba(62, 211, 232, 0.06); }

/* ---------- Right rail ---------- */

.right-rail {
  position: fixed;
  top: 64px;
  right: 20px;
  width: 320px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 10;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 15px 18px 18px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  box-shadow: inset 0 0 60px 6px rgba(0, 0, 0, 0.6);
}

.panel[hidden] { display: none; }

/* The key-ideas panel now lives inside the rail rather than floating itself. */
.right-rail .key-ideas {
  position: static;
  width: auto;
  max-height: none;
  right: auto;
  top: auto;
}

.panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(62, 211, 232, 0.45);
  margin-bottom: 12px;
}

.panel h4 {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 16px 0 8px;
}

/* ---------- Commitments / open questions ---------- */

.ag-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }

.ag-list li {
  position: relative;
  padding-left: 15px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
}

.ag-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.7;
}

.ag-list li:hover .ag-label { color: var(--accent); }
.ag-list.commit li::before { content: "✔"; color: var(--st-decision); }
.ag-list li.open::before { content: "?"; color: var(--st-decision); font-weight: 700; }
.ag-list li.answered { color: var(--text-dim); }
.ag-list li.answered::before { content: "✓"; color: var(--text-dim); }
.ag-list li.answered .ag-label { text-decoration: line-through; opacity: 0.75; }

.ag-who {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}

.ag-empty { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }

/* ---------- Note inspector ---------- */

.inspector {
  position: fixed;
  left: 20px;
  bottom: 104px;
  width: 420px;
  max-height: 46vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-lit);
  padding: 14px 16px 16px;
  z-index: 30;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  box-shadow: 0 24px 60px -24px #000, inset 0 0 60px 6px rgba(0, 0, 0, 0.6);
}

.inspector[hidden] { display: none; }

/* With the inspector open the transcript has to give up the bottom half of
   the left column rather than sliding under it. */
body.inspecting .transcript-panel { max-height: 34vh; }

/* The scrubber runs the full width at the bottom, so an open inspector would
   sit on top of its ŽIVĚ button and swallow the click. */
body.scrubbing .inspector { bottom: 152px; max-height: 40vh; }

.insp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.insp-kind {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kc-soft, var(--accent));
  border: 1px solid color-mix(in srgb, var(--kc, var(--accent)) 45%, transparent);
  padding: 3px 8px;
}

.insp-meta { font-size: 10.5px; color: var(--text-dim); letter-spacing: 0.05em; }

.insp-close {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  padding: 2px 8px;
  box-shadow: none;
}

.insp-close:hover { color: var(--counter); border-color: var(--counter); background: transparent; }

.insp-label {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  border: 1px dashed transparent;
  padding: 6px 8px;
  margin: 0 -8px 12px;
  outline: none;
}

.insp-label:hover { border-color: var(--border); }
.insp-label:focus { border-color: var(--accent); border-style: solid; background: rgba(62, 211, 232, 0.04); }

.insp-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.insp-actions button,
.kind-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 9px;
  box-shadow: none;
  cursor: pointer;
}

.insp-actions button:hover { color: var(--accent); border-color: var(--accent); background: transparent; }
.insp-actions button.danger:hover { color: var(--counter); border-color: var(--counter); }

.insp-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.kind-chip[data-kind]:hover { color: var(--kc-soft, var(--accent)); border-color: var(--kc, var(--accent)); }

.kind-chip.on {
  color: var(--kc-soft, var(--accent));
  border-color: var(--kc, var(--accent));
  box-shadow: inset 0 0 18px -10px var(--kc, var(--accent));
}

.insp-sources { display: flex; flex-direction: column; gap: 10px; }

.insp-sources blockquote {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  border-left: 2px solid var(--border-lit);
  padding-left: 10px;
}

.insp-sources blockquote b { color: var(--accent); font-weight: 600; margin-right: 6px; }
.insp-sources blockquote time { color: var(--text-dim); font-size: 10px; margin-right: 8px; }

/* Waiting for the merge target — every note is a drop target. */
body.merging .note { cursor: crosshair; }
body.merging .note-card { opacity: 0.85; }

/* ---------- Notes: speaker, pin, selection ---------- */

.note { cursor: pointer; }

.note-kind .nk { margin-right: auto; }

.note-kind .nw {
  font-size: 8.5px;
  letter-spacing: 0.08em;
  opacity: 0.75;
  max-width: 62px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.note.pinned .note-card::after { box-shadow: 0 0 12px var(--kc, var(--accent)), 0 0 26px var(--kc, var(--accent)); }

.note.pinned .note-card {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--kc, var(--accent)) 85%, transparent);
}

.note.selected .note-card {
  border-color: var(--kc, var(--accent));
  box-shadow: inset 0 0 30px -14px var(--kc, var(--accent)), 0 0 0 2px color-mix(in srgb, var(--kc, var(--accent)) 55%, transparent);
}

.note.selected { z-index: 5; }

/* Utterances the selected note was built from. */
.transcript-log .t-line.cited {
  background: rgba(62, 211, 232, 0.07);
  box-shadow: -8px 0 0 rgba(62, 211, 232, 0.35);
  margin-left: 8px;
  padding-left: 4px;
}

/* ---------- Replay scrubber ---------- */

.scrubber {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 96px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 9px 14px;
  z-index: 12;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.scrubber[hidden] { display: none; }

.scrub-live {
  font-size: 10px;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid var(--border-lit);
  color: var(--text-dim);
  padding: 5px 10px;
  box-shadow: none;
}

body.replaying .scrub-live { color: var(--counter); border-color: var(--counter); }
.scrub-live:hover { color: var(--accent); border-color: var(--accent); background: transparent; }

.scrubber input[type="range"] {
  flex: 1;
  appearance: none;
  height: 3px;
  background: linear-gradient(to right, var(--border-lit), var(--accent));
  outline: none;
}

.scrubber input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 20px;
  background: var(--bg);
  border: 1px solid var(--accent);
  box-shadow: 0 0 12px -2px var(--accent);
  cursor: ew-resize;
}

.scrub-label {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  min-width: 168px;
  text-align: right;
}

/* The wall is history while scrubbing — say so, loudly but not in the way. */
body.replaying #wall { filter: saturate(0.82); }

body.replaying #wall::after {
  content: "REPLAY";
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--counter);
  border: 1px solid var(--counter);
  padding: 3px 10px;
  z-index: 11;
  pointer-events: none;
}

/* ---------- Ingest progress ---------- */

.ingest-bar {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 96px;
  height: 26px;
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  z-index: 11;
  overflow: hidden;
}

.ingest-bar[hidden] { display: none; }

.ingest-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(62, 211, 232, 0.28), rgba(62, 211, 232, 0.06));
  border-right: 1px solid var(--accent);
  transition: width 0.4s ease;
}

.ingest-bar span {
  position: relative;
  padding-left: 14px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* A scrubber and an ingest bar never both matter; stack them if they do. */
.scrubber:not([hidden]) ~ .ingest-bar { bottom: 140px; }

/* ---------- Status badge note ---------- */

.badge.with-note::after {
  content: attr(data-note);
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border-lit);
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ---------- Bot camera: only the wall ---------- */

body.bot .right-rail,
body.bot .inspector,
body.bot .scrubber,
body.bot .ingest-bar,
body.bot .menu-wrap,
body.bot #agendaToggle,
body.bot #replayToggle { display: none; }

/* ---------- Landing: template picker, ingest, session list ---------- */

.template-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

.tpl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 9px 12px;
  box-shadow: none;
  letter-spacing: 0.04em;
  font-size: 11.5px;
  text-transform: none;
}

.tpl:hover { color: var(--text); border-color: var(--border-lit); background: transparent; }

.tpl.on {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 24px -14px var(--accent);
}

.tpl-kinds { display: flex; gap: 3px; }
.tpl-kinds i { width: 13px; height: 3px; display: block; opacity: 0.85; }

textarea#transcriptText {
  width: 100%;
  margin-top: 10px;
  background: #05090c;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 11px 13px;
  resize: vertical;
}

textarea#transcriptText:focus { outline: none; border-color: var(--accent); }
textarea#transcriptText::placeholder { color: #3f5661; }

.session-list { display: flex; flex-direction: column; }

.session-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.session-row:last-child { border-bottom: 0; }
.session-row .s-title { color: var(--text); text-decoration: none; flex: 1; }
.session-row .s-title:hover { color: var(--accent); }
.session-row .s-meta { color: var(--text-dim); font-size: 10.5px; letter-spacing: 0.04em; }
.session-row .s-live { color: var(--argument); }
.session-row .s-links { display: flex; gap: 8px; align-items: center; }

.session-row .s-links a {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 2px 7px;
}

.session-row .s-links a:hover { color: var(--accent); border-color: var(--accent); }

.session-row .s-links button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  padding: 2px 7px;
  box-shadow: none;
}

.session-row .s-links button:hover { color: var(--counter); border-color: var(--counter); background: transparent; }

/* ---------- Which services this works with ---------- */

.platform-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.plogo {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.82;
  transition: opacity 0.25s, filter 0.25s, transform 0.25s;
}

.plogo svg { width: 24px; height: 24px; display: block; }

.plogo b {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

/* The one that matches what you pasted steps forward; the rest step back. */
.plogo.on { opacity: 1; transform: translateY(-1px); }
.plogo.on b { color: var(--text); }
.plogo.on svg { filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.28)); }
.plogo.off { opacity: 0.24; filter: grayscale(1); }


/* ===========================================================================
   Drawers — the board is full screen, panels are windows on top of it.
   Nothing here reserves layout space: opening a panel never reshapes the wall.
   =========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 56px 0 0;
  background: rgba(2, 5, 8, 0.5);
  backdrop-filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 20;
}

body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
body.bot .drawer-backdrop { display: none; }

/* Left drawer: the transcript. */
.transcript-panel {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: min(400px, 88vw);
  max-height: none;
  display: flex;
  flex-direction: column;
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 25;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  clip-path: none;
  box-shadow: 24px 0 60px -30px #000, inset 0 0 60px 6px rgba(0, 0, 0, 0.6);
}

.transcript-panel.open { transform: translateX(0); }

/* `hidden` used to drive this panel; the class does now, so a hidden
   attribute left over from an older state must not black-hole the drawer. */
.transcript-panel[hidden] { display: flex; }

/* Right drawer: what the meeting produced, plus the key ideas. */
.right-rail {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: min(380px, 92vw);
  max-height: none;
  padding: 16px 16px 24px;
  overflow-y: auto;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-lit);
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 25;
  box-shadow: -24px 0 60px -30px #000;
}

.right-rail.open { transform: translateX(0); }

/* Inside the rail the sections are plain blocks — the drawer is the frame. */
.right-rail .panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  clip-path: none;
  padding: 0 0 22px;
}

.right-rail .panel + .panel {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* The inspector steps aside rather than sitting on top of the left drawer. */
body.drawer-left-open .inspector { left: min(420px, calc(88vw + 20px)); }
body.inspecting .transcript-panel { max-height: none; }

@media (max-width: 900px) {
  .inspector { width: auto; right: 20px; }
  body.drawer-left-open .inspector { left: 20px; }
}


/* ---------- Read-only viewers ---------- */

/* Someone holding a share link sees the wall, the provenance and the exports —
   but not the controls that would change somebody else's meeting. */
body.readonly .insp-actions,
body.readonly .insp-kinds,
body.readonly .mic-tools,
body.readonly #exportSend { display: none; }

body.readonly .insp-label { border-color: transparent !important; cursor: default; }

body.readonly .badge::after {
  content: "jen ke čtení";
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border-lit);
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ---------- Sign in ---------- */

.userbar {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
  z-index: 20;
}

.userbar[hidden] { display: none; }
.user-who { color: var(--text-dim); }
.user-who::before { content: "◉ "; color: var(--argument); }
.user-out { color: var(--text-dim); text-decoration: none; border: 1px solid var(--border); padding: 4px 10px; }
.user-out:hover { color: var(--accent); border-color: var(--accent); }

.card.signin[hidden] { display: none; }

.gbtn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-lit);
  padding: 12px 20px;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.gbtn svg { width: 18px; height: 18px; }
.gbtn:hover { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 30px -18px var(--accent); }
