:root {
  /* light chrome (Pam-aligned) */
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --ink: #0f1731;
  --body: #4b5563;
  --muted: #94a3b8;
  --border: #e5e7eb;
  --accent: #00b4d8;
  --accent-hover: #0096b8;
  --accent-soft: #e0f7fc;

  /* dark canvas (the "stage") */
  --canvas-bg: #0b1120;

  /* status colors */
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fca5a5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-border: #fcd34d;
  --ok: #10b981;

  /* persona colors (unchanged — agents' identity) */
  --persona-0: #fbbf24;
  --persona-1: #60a5fa;
  --persona-2: #34d399;
  --persona-3: #a78bfa;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 1px 2px rgba(15, 23, 49, 0.04), 0 1px 3px rgba(15, 23, 49, 0.03);
  --shadow-stage-inset: inset 0 0 0 1px rgba(0, 180, 216, 0.18),
    inset 0 6px 24px rgba(0, 0, 0, 0.55);
  --shadow-landing: 0 24px 60px rgba(15, 23, 49, 0.12),
    0 4px 16px rgba(15, 23, 49, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--body);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.topbar,
.layout {
  position: relative;
  z-index: 1;
}

/* ---------- top bar ---------- */
.topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  gap: 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
  min-width: 0;
}

.wordmark {
  height: 28px;
  display: block;
}

.wordmark-fallback {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  height: auto;
}

.subtitle {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  color: var(--body);
  letter-spacing: 0.01em;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition: background 200ms ease, box-shadow 200ms ease;
}

.health-badge[data-state="ok"] .health-dot {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}
.health-badge[data-state="ok"] {
  color: #065f46;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.health-badge[data-state="down"] .health-dot {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.45);
}
.health-badge[data-state="down"] {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.health-badge[data-state="warn"] .health-dot {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(180, 83, 9, 0.45);
}
.health-badge[data-state="warn"] {
  color: var(--warn);
  border-color: var(--warn-border);
  background: var(--warn-soft);
}

.version-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: help;
  transition: color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.version-tag:hover {
  color: var(--ink);
  border-color: var(--muted);
}

/* ---------- main layout ---------- */
.layout {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  min-height: 0;
  height: calc(100vh - 64px);
  padding: 14px;
  gap: 14px;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  overflow: hidden;
}

.stage {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--canvas-bg);
  border: 1px solid rgba(0, 180, 216, 0.2);
  box-shadow: var(--shadow-stage-inset);
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
}

/* ---------- sidebar ---------- */
.sidebar {
  flex: 0 0 400px;
  width: 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px;
  background: transparent;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* default: every direct sidebar child holds its natural height */
.sidebar > * {
  flex: 0 0 auto;
  min-height: 0;
}

/* sidebar inner cards (persona section + transcript get the surface treatment) */
.persona-section,
.transcript {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.persona-section {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- persona cards (compact, click to open modal) ---------- */
.persona-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.persona-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
}

.persona-card:hover {
  border-color: color-mix(in srgb, currentColor 40%, var(--border));
  background: var(--surface);
}

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

.persona-card.speaking {
  border-color: currentColor;
  background: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent),
    var(--shadow-card);
}

.persona-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.persona-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow 240ms ease;
}

.persona-card.speaking .persona-dot {
  box-shadow: 0 0 10px currentColor;
}

.persona-card-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.persona-card-edit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease;
}

.persona-card:hover .persona-card-edit,
.persona-card:focus-visible .persona-card-edit {
  opacity: 1;
  color: var(--ink);
}

.persona-role {
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 17px; /* align under the name (past dot+gap) */
}

/* compact 4-up row when meeting active */
.meeting-active .persona-cards {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.meeting-active .persona-card {
  padding: 8px 8px;
  gap: 4px;
}

.meeting-active .persona-card .persona-role,
.meeting-active .persona-card .persona-card-edit {
  display: none;
}

.meeting-active .persona-card .persona-card-name {
  font-size: 11px;
}

.meeting-active .persona-card .persona-dot {
  width: 8px;
  height: 8px;
}

/* ---------- field ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field-rounds { flex: 0 0 auto; min-width: 90px; }
.field-demo {
  flex: 1 1 auto;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.field-demo label[for="demo-toggle"] {
  margin: 0;
}

/* switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 180ms ease, border-color 180ms ease;
}
.slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--muted);
  border-radius: 999px;
  transition: transform 180ms ease, background 180ms ease;
}
.switch input:checked + .slider {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.switch input:checked + .slider::before {
  transform: translate(16px, -50%);
  background: var(--accent);
}

.demo-note {
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* ---------- topic chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 2px;
}

.chip {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  min-height: 26px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease, transform 120ms ease;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.chip:active {
  transform: translateY(0);
}

.chip.chip-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.chip.chip-disabled,
.chip[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface-2);
  transform: none;
}

.chip.chip-disabled:hover,
.chip[disabled]:hover {
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface-2);
}

.chip.chip-has-demo {
  border-color: var(--accent);
}

.chip .chip-demo-tag {
  font-size: 10px;
  color: var(--accent);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
  margin-left: 4px;
}

.chip.chip-active .chip-demo-tag {
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- inputs / select ---------- */
.sidebar input,
.sidebar select {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  min-height: 34px;
}

.sidebar select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2394a3b8' d='M6 8.5L2 4.5h8z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.sidebar input::placeholder {
  color: var(--muted);
}

.sidebar input:focus,
.sidebar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- start button ---------- */
#start {
  width: 100%;
  padding: 9px 16px;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 38px;
  transition: background 120ms ease, transform 120ms ease, opacity 120ms ease,
    border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 2px rgba(0, 180, 216, 0.18);
}

#start:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.22);
}

#start.stop-mode {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-border);
  box-shadow: none;
}

#start.stop-mode:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

#start:active:not(:disabled) {
  transform: scale(0.99);
}

#start:disabled {
  background: var(--accent);
  border-color: var(--accent);
  color: rgba(255, 255, 255, 0.7);
  cursor: not-allowed;
  opacity: 0.55;
}

/* ---------- ollama-down panel ---------- */
.ollama-panel {
  border: 1px solid var(--warn-border);
  background: var(--warn-soft);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--body);
}

.ollama-panel strong { color: var(--warn); font-weight: 600; }
.ollama-panel code {
  display: inline-block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--ink);
}

.ollama-panel button {
  align-self: flex-start;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--warn);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.ollama-panel button:hover {
  background: var(--warn);
  color: #ffffff;
  border-color: var(--warn);
}

/* ---------- round indicator ---------- */
.round-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.round-group {
  display: flex;
  gap: 5px;
}

.round-group + .round-group { margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--border); }

.round-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.25;
  transition: opacity 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.round-dot.past { opacity: 0.7; }

.round-dot.active {
  opacity: 1;
  box-shadow: 0 0 8px currentColor, 0 0 0 3px var(--accent-soft);
  transform: scale(1.15);
}

/* ---------- sidebar status ---------- */
.sidebar-status {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  min-height: 0;
  height: 0;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 200ms ease, color 200ms ease, height 200ms ease,
    padding 200ms ease, border-color 200ms ease;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-status[data-active="true"] {
  height: 28px;
  padding: 6px 10px;
  border-color: var(--border);
}

.sidebar-status[data-active="true"] {
  opacity: 1;
  color: var(--body);
}

.sidebar-status[data-pulse="true"]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.55);
  animation: pulse 1.4s ease-in-out infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.55); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(0, 180, 216, 0); }
  100% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(0, 180, 216, 0); }
}

/* ---------- transcript ---------- */
.sidebar > .transcript,
.transcript {
  flex: 1 1 auto;
  min-height: 100px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  overflow-wrap: anywhere;
}

.transcript::-webkit-scrollbar { width: 8px; }
.transcript::-webkit-scrollbar-track { background: transparent; }
.transcript::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.transcript-hero {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 12px;
}

.hero-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 12px;
  color: var(--body);
  max-width: 320px;
  overflow-wrap: anywhere;
}

.hero-arrow {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  animation: arrow-bob 2.4s ease-in-out infinite;
}

@keyframes arrow-bob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(2px); opacity: 1; }
}

.transcript .utterance {
  margin-bottom: 12px;
  animation: utt-in 240ms ease-out both;
}

.transcript .utterance:last-child {
  margin-bottom: 0;
}

@keyframes utt-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.transcript .who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--persona-accent, var(--accent));
  border: 1px solid var(--persona-accent, var(--accent));
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  margin-right: 8px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  vertical-align: middle;
  line-height: 1.2;
  color: #ffffff;
}

.transcript .who > * {
  color: #ffffff;
}

.transcript .who .persona-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #ffffff;
}

/* hide the colon that follows the persona pill */
.transcript .utterance .who + ::before {
  content: none;
}

.transcript .text,
.transcript .said {
  color: var(--ink);
}

/* ---------- interject row ---------- */
.interject {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.interject input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.interject input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.primary-btn-sm {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.primary-btn-sm:hover {
  background: var(--accent-hover);
}

.utterance.utterance-user {
  background: var(--accent-soft);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.utterance .who-user {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.utterance.utterance-pending .pending-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- transcript actions ---------- */
.transcript-actions {
  display: flex;
  gap: 6px;
}

.ghost-btn {
  flex: 1 1 0;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  min-height: 30px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.ghost-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-2);
}

.ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--surface-2);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  box-shadow: 0 10px 28px rgba(15, 23, 49, 0.25);
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sidebar-footer {
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  padding: 6px 4px 2px;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: color 120ms ease, border-color 120ms ease;
}
.sidebar-footer a:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ---------- persona section head ---------- */
.persona-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 16px;
}

.persona-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.link-btn {
  background: transparent;
  border: none;
  padding: 4px 6px;
  margin: -4px -6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: color 120ms ease;
  border-radius: 4px;
}
.link-btn:hover { color: var(--accent-hover); background: var(--accent-soft); }

.link-btn-muted {
  color: var(--muted);
  font-size: 11px;
}
.link-btn-muted:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- landing overlay ---------- */
.landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 350ms ease, transform 350ms ease;
}

.landing.dismissing {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.landing-card {
  max-width: 640px;
  width: 100%;
  padding: 48px 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-landing);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  animation: landing-in 200ms ease-out both;
}

@keyframes landing-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.landing-wordmark {
  width: 280px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 4px;
}

.landing-wordmark-fallback {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--ink);
  width: auto;
}

.landing-tagline {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.landing-summary {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  max-width: 540px;
  overflow-wrap: anywhere;
}

.landing-credits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 22px;
  margin: 4px 0 8px;
}

.landing-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.landing-credit-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.landing-credit-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--body);
  letter-spacing: 0.01em;
  font-family: "Inter", system-ui, sans-serif;
  overflow-wrap: anywhere;
  max-width: 100px;
  text-align: center;
}

.landing-begin {
  margin-top: 4px;
  padding: 14px 32px;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.25);
}
.landing-begin:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 180, 216, 0.32);
}
.landing-begin:active { transform: translateY(0); }

.landing-customize-link {
  font-size: 13px;
  min-height: 36px;
}

/* ---------- persona edit modal ---------- */
.persona-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.persona-modal[hidden] {
  display: none !important;
}

.persona-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 41, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 200ms ease;
}

.persona-modal.open .persona-modal-backdrop {
  opacity: 1;
}

.persona-modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 24px 60px rgba(15, 23, 49, 0.18),
    0 4px 16px rgba(15, 23, 49, 0.10);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.persona-modal.open .persona-modal-card {
  opacity: 1;
  transform: scale(1);
}

.persona-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  padding: 0;
  z-index: 1;
}

.persona-modal-x:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}

.persona-modal-head {
  padding: 22px 28px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}

.persona-modal-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.persona-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.persona-modal-body {
  padding: 14px 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-field-aside {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  opacity: 0.8;
}

.modal-field input[type="text"],
.modal-field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.modal-field textarea {
  resize: vertical;
  min-height: 120px;
  max-height: 360px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.modal-field input[type="text"]:focus,
.modal-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}

.modal-swatch {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: currentColor;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 120ms ease, box-shadow 120ms ease;
  flex: 0 0 auto;
}

.modal-swatch::after {
  content: "";
  position: absolute;
  inset: -6px;
}

.modal-swatch:hover {
  transform: scale(1.08);
}

.modal-swatch.selected {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor;
}

.modal-voice {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-voice-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-voice-text {
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.5;
  color: var(--body);
  overflow-wrap: anywhere;
}

.persona-modal-foot {
  padding: 12px 28px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
}

.modal-done {
  padding: 10px 22px;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 38px;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 2px rgba(0, 180, 216, 0.18);
}

.modal-done:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.22);
}

.modal-done:active {
  transform: scale(0.99);
}

@media (max-width: 540px) {
  .persona-modal {
    padding: 16px;
    align-items: flex-start;
  }
  .persona-modal-card {
    max-height: 92vh;
    margin-top: 4vh;
  }
  .persona-modal-head { padding: 22px 20px 6px; }
  .persona-modal-body { padding: 12px 20px 16px; }
  .persona-modal-foot { padding: 12px 20px 18px; }
  .modal-swatch { width: 32px; height: 32px; }
  .modal-done { min-height: 44px; padding: 12px 22px; }
}

/* ---------- responsive: tablet (≤768px) ---------- */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    height: calc(100vh - 64px);
  }
  .stage {
    flex: 0 0 50vh;
    height: 50vh;
    min-height: 240px;
    border-radius: var(--radius-md);
  }
  .sidebar {
    flex: 1 1 auto;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    padding: 0;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .topbar { padding: 0 16px; }
  .subtitle { display: none; }
}

/* ---------- responsive: phone (≤414px) ---------- */
@media (max-width: 414px) {
  body { overflow-y: auto; height: auto; }
  .layout {
    padding: 10px;
    gap: 10px;
    height: auto;
    overflow: visible;
  }
  .stage {
    flex: 0 0 45vh;
    height: 45vh;
    min-height: 240px;
  }
  .sidebar {
    height: auto;
    overflow: visible;
  }

  .topbar {
    height: auto;
    flex: 0 0 auto;
    min-height: 56px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-end;
  }
  .wordmark { height: 24px; }

  .persona-section { padding: 14px; }
  .persona-cards { gap: 8px; }
  .persona-card { padding: 10px; min-height: 44px; }

  .chip {
    font-size: 13px;
    padding: 9px 13px;
    white-space: normal;
    overflow-wrap: anywhere;
    min-height: 36px;
  }

  .field-row { gap: 10px; }
  .field-rounds { min-width: 90px; }

  .ghost-btn {
    font-size: 13px;
    min-height: 44px;
  }

  .transcript { padding: 14px; min-height: 200px; }

  .landing { padding: 16px; }
  .landing-card {
    padding: 32px 22px;
    gap: 14px;
    border-radius: 14px;
  }
  .landing-tagline { font-size: 26px; }
  .landing-summary { font-size: 14px; }
  .landing-wordmark { width: 220px; }
  .landing-credits { gap: 10px 14px; }
  .landing-credit-name { max-width: 80px; font-size: 10px; }
  .landing-begin {
    width: 100%;
    padding: 14px 24px;
  }

  /* meeting-active still 4-up but tighter */
  .meeting-active .persona-card { padding: 6px 6px; min-height: 0; }
  .meeting-active .persona-card .persona-card-name { font-size: 10px; }

  .toast { right: 12px; bottom: 12px; left: 12px; text-align: center; }
}

/* ---------- responsive: very wide (≥1280px) ---------- */
@media (min-width: 1280px) {
  .sidebar { flex: 0 0 400px; }
}

/* ---------- focus ring (accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- wrap-up utterance (closing turn) ---------- */
.transcript .utterance[data-wrapup="true"] {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
}

.transcript .utterance[data-wrapup="true"] .who::before {
  content: "▌ CLOSING";
  display: inline-block;
  margin-right: 8px;
  padding: 2px 7px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  vertical-align: middle;
  line-height: 1.2;
}

/* ---------- killshot utterance (sharp falsification) ---------- */
.transcript .utterance.utterance-killshot {
  position: relative;
  background: #fff7ed;
  border-left: 3px solid #f97316;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.transcript .utterance.utterance-killshot .killshot-tag {
  position: absolute;
  top: 6px;
  right: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #c2410c;
  background: #ffedd5;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.2;
  text-transform: uppercase;
}

/* ---------- topic chip phase badges ---------- */
.chip {
  position: relative;
  overflow: visible;
}

.chip[data-phase]::after {
  content: attr(data-phase);
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.chip.chip-active[data-phase]::after {
  background: #ffffff;
  color: var(--accent);
  border-color: #ffffff;
}

.chip.chip-disabled[data-phase]::after,
.chip[disabled][data-phase]::after {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
}

.chips-hint {
  display: block;
  margin: 4px 2px 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* ---------- landing credit dot tooltip ---------- */
.landing-credit {
  position: relative;
  cursor: help;
}

.landing-credit[data-voice]::after {
  content: attr(data-voice);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 280px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  box-shadow: 0 8px 24px rgba(15, 23, 49, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 10;
  white-space: normal;
  overflow-wrap: anywhere;
}

.landing-credit[data-voice]:hover::after,
.landing-credit[data-voice]:focus-within::after,
.landing-credit[data-voice].voice-open::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 414px) {
  .landing-credit[data-voice]::after {
    max-width: 220px;
    font-size: 11px;
    padding: 10px;
  }
  .chip[data-phase]::after {
    width: 16px;
    height: 16px;
    font-size: 8px;
    top: -3px;
    right: -3px;
  }
}
