:root, [data-theme="light"] {
  --bg: #f4f5f7;
  --bg2: #ffffff;
  --surface: #ffffff;
  --surface2: #f0f2f5;
  --surface3: #e7eaef;
  --border: #dde1e8;
  --border2: #c5cad3;
  --text: #1f2329;
  --muted: #646a73;
  --accent: #d4f000;
  --accent-hover: #e0ff2a;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(160, 180, 0, 0.22);
  --accent-text: #4d5c00;
  --speaking: #00a870;
  --interviewer: #7c6cf0;
  --user: #059669;
  --c-a: #ff6b6b;
  --c-b: #4dabf7;
  --c-c: #e6a700;
  --danger: #e11d48;
  --meeting-bg: #e9ebf0;
  --tile-bg: linear-gradient(145deg, #ffffff 0%, #f2f4f7 100%);
  --subtitle-bg: #ffffff;
  --name-tag-bg: rgba(15, 23, 42, 0.7);
  --toolbar-bg: #ffffff;
  --chip-active-fg: #1a1d21;
  --good-bg: #e8f5e9;
  --good-fg: #1b5e20;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #010102;
  --bg2: #07080a;
  --surface: #0f1011;
  --surface2: #141516;
  --surface3: #18191a;
  --border: #23252a;
  --border2: #34343a;
  --text: #f4f4f5;
  --muted: #8b8d98;
  --accent: #e8ff47;
  --accent-hover: #f2ff7a;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(232, 255, 71, 0.14);
  --accent-text: #e8ff47;
  --speaking: #3dd68c;
  --interviewer: #7c6cf0;
  --user: #34d399;
  --c-a: #ff6b6b;
  --c-b: #4dabf7;
  --c-c: #fcc419;
  --danger: #e11d48;
  --meeting-bg: #010102;
  --tile-bg: linear-gradient(145deg, #141516 0%, #0f1011 100%);
  --subtitle-bg: rgba(0, 0, 0, 0.75);
  --name-tag-bg: rgba(0, 0, 0, 0.65);
  --toolbar-bg: #0f1011;
  --chip-active-fg: #f4f4f5;
  --good-bg: #064e3b33;
  --good-fg: #6ee7b7;
  --shadow: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#app { flex: 1; min-height: 0; }
.boot-msg { margin: 2.5rem auto; text-align: center; color: var(--muted); font-size: 0.95rem; }

/* ── Lobby ── */
.lobby {
  display: flex; flex-direction: column; align-items: center;
  min-height: 100%; padding: 2rem 1.25rem 3rem;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(232, 255, 71, 0.08), transparent),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 45%);
}
[data-theme="light"] .lobby {
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(197, 224, 0, 0.14), transparent),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 45%);
}
.lobby-hero { text-align: center; margin-bottom: 1.5rem; max-width: 560px; }
.lobby-brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.lobby-brand-mark {
  width: 14px; height: 14px; background: var(--accent);
  clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%);
  flex-shrink: 0;
}
[data-theme="light"] .lobby-brand-mark { border-radius: 2px; clip-path: none; }
.lobby-brand-name {
  font-size: 1.35rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1;
}
.lobby-brand-en {
  font-size: 0.68rem; font-weight: 550; letter-spacing: 0.06em; color: var(--muted);
}
.lobby h1 {
  font-size: clamp(1.65rem, 4vw, 2.25rem); font-weight: 700; margin-bottom: 0.55rem;
  letter-spacing: -0.035em; line-height: 1.2;
}
.lobby h1 em { font-style: normal; color: var(--accent-text); }
.lobby .tagline { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.lobby-disclaimer {
  margin: 0.85rem auto 0;
  max-width: 34rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.88;
  text-align: left;
}
.site-icp {
  flex-shrink: 0;
  margin: 0;
  padding: 0.7rem 1rem 1.1rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.site-icp a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-icp[hidden] { display: none !important; }
.disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.disclaimer-modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: var(--shadow);
}
.disclaimer-modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.disclaimer-modal-body {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
.disclaimer-modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.15rem;
}
.lobby-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.35rem 1.25rem;
  width: 100%; max-width: 560px;
  box-shadow: var(--shadow);
}
.lobby-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.lobby-card .field label {
  display: block; text-align: left; font-size: 0.78rem;
  color: var(--muted); margin-bottom: 0.35rem; font-weight: 500;
}
.lobby-input {
  width: 100%; padding: 0.65rem 0.85rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.lobby-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-block { margin-bottom: 1rem; }
.filter-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.55rem;
}
.filter-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.filter-hint { font-size: 0.72rem; color: var(--muted); }
.chip-row {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  line-height: 1.3;
}
.chip:hover {
  border-color: #5a6478; color: var(--text);
  background: var(--surface3);
}
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--chip-active-fg);
  font-weight: 600;
}
[data-theme="light"] .chip.active {
  color: #0a0a0a;
  border-color: #9bb000;
}
.filter-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.65rem; margin-bottom: 0.35rem;
  border: 1px dashed var(--border); border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 0.78rem; cursor: pointer; font-family: inherit;
}
.filter-toggle:hover { border-color: var(--accent); color: var(--text); }
.filters-advanced {
  padding-top: 0.35rem; margin-bottom: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.match-summary {
  font-size: 0.78rem; color: var(--muted); text-align: center;
  margin: 0.85rem 0 0.75rem; line-height: 1.45;
}
.case-tag-preview {
  margin: 0 0 0.85rem; padding: 0.65rem 0.75rem;
  border-radius: 8px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.case-tag-preview.empty { font-size: 0.75rem; color: var(--muted); text-align: center; margin: 0; padding: 0.5rem; border: none; background: transparent; }
.case-tag-preview-head { font-size: 0.72rem; color: var(--muted); margin: 0 0 0.5rem; }
.case-tag-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.case-tag-row:last-child { border-bottom: none; }
.case-tag-title { grid-column: 1 / -1; font-size: 0.78rem; color: var(--text); line-height: 1.35; }
.case-tag-meta { font-size: 0.68rem; color: var(--accent-text); white-space: nowrap; }
.case-tag-list { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
.case-tag {
  font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 4px;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
}
.btn-start {
  width: 100%; padding: 0.85rem 1rem; font-size: 1rem;
  border-radius: 10px; margin-top: 0.15rem;
}
.btn-start:disabled { opacity: 0.45; cursor: not-allowed; }
.lobby-error { color: #f87171; font-size: 0.85rem; margin-top: 0.75rem; text-align: center; line-height: 1.55; word-break: break-word; }
.lobby-loading { color: var(--muted); font-size: 0.85rem; margin-top: 0.75rem; text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.25rem; border-radius: 6px; border: none;
  font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn:hover { opacity: 0.92; }
.btn-primary,
button.btn-primary {
  background: var(--accent); color: var(--accent-ink); border: none; font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: transparent; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }
.badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
.badge {
  font-size: 0.72rem; padding: 0.2rem 0.55rem; border-radius: 4px;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
}
.badge.live { color: #6ee7b7; border-color: #065f46; background: #064e3b33; }

/* ── Meeting room ── */
.meeting {
  display: grid;
  grid-template-rows: auto 1fr auto minmax(56px, auto);
  grid-template-columns: 1fr 280px;
  height: 100vh;
  background: var(--meeting-bg);
}

.meeting-header {
  grid-column: 1 / -1;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.meeting-header-main {
  flex: 1;
  min-width: 0;
}
.meeting-header .title { font-size: 0.9rem; font-weight: 600; }
.meeting-header .meta {
  font-size: 0.75rem; color: var(--muted);
  max-width: none;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
  margin-top: 0.15rem;
}
.meeting-header .timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; }

.meeting-main {
  display: flex; flex-direction: column; min-height: 0;
  padding: 0.75rem; gap: 0.75rem;
}

.phase-strip {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
}
.phase-chip {
  font-size: 0.68rem; padding: 0.15rem 0.45rem; border-radius: 4px;
  background: var(--surface2); color: var(--muted);
  border: none; cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.phase-chip:hover:not(.skipped) {
  background: #3a4558; color: var(--text);
}
.phase-chip.active { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.phase-chip.done { opacity: 0.5; }
.phase-chip.skipped { opacity: 0.35; cursor: not-allowed; }

.video-grid {
  flex: 1; display: flex; flex-direction: column; gap: 0.5rem; min-height: 0;
}
.video-row {
  flex: 1; display: grid; gap: 0.5rem; min-height: 0;
}
.video-row.top { grid-template-columns: repeat(3, 1fr); }
.video-row.bottom { grid-template-columns: repeat(2, 1fr); max-height: 38%; }

.video-tile {
  position: relative;
  background: var(--tile-bg);
  border-radius: var(--radius);
  border: 2px solid transparent;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.video-tile.speaking,
.video-tile.preparing {
  border-color: var(--speaking);
  box-shadow: 0 0 0 1px var(--speaking), 0 0 20px rgba(0, 168, 112, 0.25);
}
.video-tile .speak-prep {
  display: none;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--speaking);
  opacity: 0.95;
  margin-left: 2px;
}
[data-theme="light"] .video-tile .speak-prep { color: #fff; }
.video-tile.preparing .speak-prep { display: inline; }
.video-tile .avatar-large {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #fff;
}
.video-tile.interviewer .avatar-large { background: var(--interviewer); }
.video-tile.user .avatar-large { background: var(--user); }
.video-tile.c-a .avatar-large { background: var(--c-a); }
.video-tile.c-b .avatar-large { background: var(--c-b); }
.video-tile.c-c .avatar-large { background: var(--c-c); }

.video-tile .name-tag {
  position: absolute; bottom: 8px; left: 8px;
  background: var(--name-tag-bg); color: #fff; padding: 2px 8px; border-radius: 4px;
  font-size: 0.75rem; display: flex; align-items: center; gap: 4px;
}
.video-tile .mic-icon { font-size: 0.7rem; }
.video-tile .mic-icon.muted { color: #888; }
.video-tile .mic-icon.live { color: var(--speaking); }

.video-tile .fake-video {
  position: absolute; inset: 0; opacity: 0.15;
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 8px, rgba(255,255,255,0.03) 8px, rgba(255,255,255,0.03) 16px
  );
}

.subtitle-bar {
  background: var(--subtitle-bg);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  min-height: 56px;
  border: 1px solid var(--border);
}
.subtitle-bar .speaker-name { font-size: 0.8rem; color: var(--speaking); margin-bottom: 0.25rem; }
.subtitle-bar .subtitle-text { font-size: 1rem; line-height: 1.6; min-height: 1.6em; }
.subtitle-bar .subtitle-cursor { display: inline-block; width: 2px; height: 1em; background: var(--speaking); animation: blink 0.8s infinite; vertical-align: text-bottom; }
@keyframes blink { 50% { opacity: 0; } }

.debrief-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 10, 16, 0.72); backdrop-filter: blur(6px);
}
.debrief-overlay-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.75rem 1.5rem; width: min(92vw, 380px);
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}
.debrief-overlay-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.debrief-overlay-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.5; margin-bottom: 0.35rem; }
.debrief-overlay-hint { font-size: 0.8rem !important; opacity: 0.85; margin-bottom: 0 !important; }
.debrief-overlay-card .btn { margin-top: 1.1rem; min-width: 160px; }
.debrief-spinner {
  width: 40px; height: 40px; margin: 0 auto 1rem;
  border: 3px solid rgba(59,130,246,0.25); border-top-color: var(--accent);
  border-radius: 50%; animation: debrief-spin 0.8s linear infinite;
}
@keyframes debrief-spin { to { transform: rotate(360deg); } }

.thinking-banner {
  background: #1e3a5f; border: 1px solid #2563eb; border-radius: var(--radius);
  padding: 0.6rem 1rem; font-size: 0.85rem; color: #e2e8f0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.thinking-banner .countdown { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #93c5fd; }

.meeting-toolbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 0.45rem 1rem;
  background: var(--toolbar-bg); border-top: 1px solid var(--border);
  min-height: 56px;
}
.meeting-toolbar .hint-text { flex: 1; font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#skip-intro-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
#skip-intro-btn[hidden],
#skip-thinking-btn[hidden] {
  display: none !important;
}

.meeting-chat {
  grid-row: 2 / 5;
  grid-column: 2;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border);
  min-height: 0;
}
.chat-header {
  padding: 0.65rem 0.75rem; font-size: 0.85rem; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.chat-log {
  flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.chat-item { font-size: 0.78rem; line-height: 1.45; }
.chat-item .chat-time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 0.45rem; font-size: 0.72rem; }
.chat-item .who { color: var(--accent-text); font-weight: 600; margin-right: 0.35rem; }
.chat-item.system { color: var(--muted); font-style: italic; }
.chat-input-area {
  padding: 0.5rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.chat-input-area textarea {
  width: 100%; min-height: 72px; max-height: 120px; resize: vertical;
  padding: 0.5rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); font-size: 0.85rem; font-family: inherit;
}
.chat-input-area .input-actions { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }
.toolbar-left, .toolbar-right {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.toolbar-left { flex: 1; min-width: 0; }
.toolbar-right { flex-shrink: 0; justify-content: flex-end; }
.toolbar-mic {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 72px; padding: 0.35rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  cursor: pointer; gap: 0.1rem;
}
.toolbar-mic-icon { font-size: 1.1rem; line-height: 1; }
.toolbar-mic-label { font-size: 0.7rem; color: var(--muted); }
.toolbar-mic.on {
  background: color-mix(in srgb, var(--speaking) 16%, var(--surface2));
  border-color: var(--speaking);
  color: var(--text);
}
.toolbar-mic.on .toolbar-mic-label { color: var(--speaking); }
.toolbar-mic.off {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
  opacity: 0.92;
}
.toolbar-mic.off .toolbar-mic-label { color: var(--muted); }
#pause-btn.paused {
  background: #3a2a10;
  border-color: #d97706;
  color: #fcd34d;
}
[data-theme="light"] #pause-btn.paused {
  background: #fff7ed;
  border-color: #f59e0b;
  color: #b45309;
}
.btn-mic {
  background: #1f3a5f; color: #9ecbff; border: 1px solid #2b5a8a;
}
.btn-mic.recording {
  background: #7f1d1d; color: #fecaca; border-color: #ef4444;
  animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.asr-status {
  font-size: 0.75rem; color: #9ecbff; margin-top: 0.35rem; min-height: 1.1em;
}

/* ── Debrief ── */
.debrief-page { max-width: 820px; margin: 0 auto; padding: 1.5rem; overflow-y: auto; height: 100vh; }
.debrief-page h2 { margin-bottom: 0.5rem; }
.debrief-page .subtitle { color: var(--muted); margin-bottom: 1.5rem; }
.nav-tabs { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.nav-tabs button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.85rem; }
.nav-tabs button.active { color: var(--accent-text); font-weight: 650; }
.verdict { background: var(--surface); padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; border: 1px solid var(--border); }
.radar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.dim-card { background: var(--surface); padding: 0.75rem; border-radius: var(--radius); border: 1px solid var(--border); }
.dim-name { font-size: 0.75rem; color: var(--muted); }
.dim-score { font-size: 1.5rem; font-weight: 700; }
.dim-bar { height: 4px; background: var(--surface2); border-radius: 2px; margin-top: 0.35rem; }
.dim-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.highlights { margin-bottom: 1.5rem; }
.highlights ul { padding-left: 1.25rem; color: var(--muted); font-size: 0.9rem; }
.advice-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
.advice-card.advice-deep { padding: 1.1rem 1.15rem; }
.advice-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.advice-index {
  width: 1.6rem; height: 1.6rem; border-radius: 0.45rem; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
.advice-category {
  font-size: 0.72rem; font-weight: 650; padding: 0.15rem 0.5rem; border-radius: 0.25rem;
  background: var(--accent-soft); color: var(--accent-text);
}
.advice-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.45rem; line-height: 1.45; }
.advice-text { margin-bottom: 0.5rem; line-height: 1.65; font-size: 0.88rem; }
.advice-steps { margin: 0.35rem 0 0.6rem 1.1rem; font-size: 0.82rem; line-height: 1.55; color: var(--muted); }
.advice-script {
  font-size: 0.8rem; line-height: 1.6; padding: 0.65rem 0.75rem; margin-bottom: 0.55rem;
  background: var(--accent-soft); border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent-text) 25%, var(--border));
}
.advice-evidence { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; line-height: 1.5; }
.score-summary {
  text-align: center; padding: 1rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.score-summary-label { font-size: 0.82rem; color: var(--muted); }
.score-summary-val { font-size: 2.2rem; font-weight: 700; line-height: 1.1; margin: 0.2rem 0; }
.score-summary-val span { font-size: 1rem; color: var(--muted); font-weight: 500; }
.score-summary-hint { font-size: 0.75rem; color: var(--muted); }
.feedback-btns { display: flex; gap: 0.5rem; }
.feedback-btns button { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.75rem; cursor: pointer; color: var(--text); font-size: 0.8rem; }
.feedback-btns button.selected-useful { border-color: #34d399; background: #064e3b44; }
.feedback-btns button.selected-useless { border-color: #f87171; background: #7f1d1d44; }

.report-section { margin-bottom: 1.75rem; }
.report-section h3 { font-size: 0.95rem; margin-bottom: 0.65rem; }
.section-hint { font-size: 0.78rem; color: var(--muted); margin: -0.35rem 0 0.75rem; }
.solution-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; font-size: 0.88rem; line-height: 1.55; color: var(--muted); }
.dim-detail { font-size: 0.78rem; color: var(--muted); margin-top: 0.45rem; line-height: 1.55; }
.highlights-weaknesses { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 600px) { .highlights-weaknesses { grid-template-columns: 1fr; } }
.weaknesses ul { padding-left: 1.25rem; color: var(--muted); font-size: 0.9rem; }
.weaknesses h3 { font-size: 0.9rem; margin-bottom: 0.5rem; color: #f87171; }
.comparison-section p { background: var(--surface); border-left: 3px solid var(--accent); padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.88rem; color: var(--muted); }

.phase-list { display: flex; flex-direction: column; gap: 0.65rem; }
.phase-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; }
.phase-name { font-weight: 600; font-size: 0.85rem; color: var(--accent-text); }
.phase-summary { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0; line-height: 1.45; }
.phase-user { font-size: 0.85rem; margin: 0.35rem 0; line-height: 1.45; }
.phase-moments { padding-left: 1.1rem; margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }

.participant-list { display: flex; flex-direction: column; gap: 0.75rem; }
.participant-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.participant-card.is-user { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(59,130,246,0.15); }
.participant-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.65rem; }
.participant-name { font-weight: 600; font-size: 0.95rem; }
.participant-label { font-size: 0.72rem; color: var(--muted); margin-left: 0.4rem; }
.participant-you { font-size: 0.68rem; background: var(--accent); color: var(--accent-ink); padding: 0.1rem 0.4rem; border-radius: 4px; margin-left: 0.35rem; font-weight: 650; }
.participant-total { font-size: 1.35rem; font-weight: 700; }
.participant-score-wrap { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.advance-badge { font-size: 0.68rem; padding: 0.15rem 0.45rem; border-radius: 4px; font-weight: 600; }
.advance-high { background: #064e3b44; color: #34d399; border: 1px solid #34d399; }
.advance-mid { background: #3d2e0a44; color: #fbbf24; border: 1px solid #d97706; }
.advance-low { background: #7f1d1d44; color: #f87171; border: 1px solid #f87171; }
.participant-dims { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.p-dim { background: var(--surface2); border-radius: 6px; padding: 0.25rem 0.5rem; font-size: 0.72rem; display: flex; gap: 0.35rem; align-items: center; }
.p-dim-score { font-weight: 700; color: var(--accent-text); }
.participant-comment { font-size: 0.82rem; color: var(--muted); line-height: 1.45; margin: 0.35rem 0; }
.participant-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.participant-tags span { font-size: 0.7rem; padding: 0.15rem 0.45rem; border-radius: 4px; }
.participant-tags.good span { background: var(--good-bg); color: var(--good-fg); }
.participant-tags.bad span { background: #7f1d1d33; color: #fca5a5; }
[data-theme="light"] .participant-tags.bad span { background: #fff1f2; color: #be123c; }

.advance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.85rem; }
@media (max-width: 500px) { .advance-grid { grid-template-columns: 1fr; } }
.advance-box {
  border-radius: var(--radius); padding: 0.9rem 1rem;
  border: 1px solid var(--border); background: var(--surface);
}
.advance-box.pass {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}
.advance-box.eliminate {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}
.advance-label { font-size: 0.75rem; font-weight: 650; color: var(--muted); margin-bottom: 0.45rem; }
.advance-box.pass .advance-label { color: var(--accent-text); }
.advance-box.eliminate .advance-label { color: var(--danger); }
.advance-names { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.advance-names span {
  font-weight: 700; font-size: 0.95rem; color: var(--text);
  padding: 0.15rem 0.55rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
}
.advance-box.pass .advance-names span {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
}
.ranking-list {
  margin-bottom: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.ranking-list > .advance-label { margin-bottom: 0.55rem; }
.rank-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.rank-item:last-child { border-bottom: 0; }
.rank-num { width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--surface2); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; }
.rank-pass .rank-num { background: var(--accent); color: var(--accent-ink); }
.rank-pass .rank-name { font-weight: 700; color: var(--text); }
.rank-risk .rank-name { color: var(--muted); }
.advance-reason { font-size: 0.85rem; color: var(--muted); line-height: 1.55; margin-bottom: 0.65rem; }
.advance-reason strong { color: var(--text); }
.user-outlook {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  border-radius: var(--radius); padding: 0.85rem 1rem; font-size: 0.88rem; line-height: 1.5;
}

.history-section { width: 100%; max-width: 560px; margin-top: 1.75rem; text-align: left; }
.history-section h3 { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.55rem; font-weight: 600; }
.history-list { display: flex; flex-direction: column; gap: 0.45rem; max-height: 220px; overflow-y: auto; }
.history-item {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.85rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; font-size: 0.82rem;
  transition: border-color 0.15s, background 0.15s;
}
.history-item:hover { border-color: var(--accent); background: var(--surface2); }
.history-main { flex: 1; min-width: 0; }
.history-item .meta { color: var(--muted); font-size: 0.72rem; }
.history-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.btn-link {
  background: none; border: none; padding: 0.15rem 0.35rem;
  color: var(--accent-text); font-size: 0.72rem; cursor: pointer; text-decoration: underline;
}
.btn-link:hover { opacity: 0.85; }
.meeting-header .timer.discussion { color: #fbbf24; font-weight: 700; font-size: 1rem; }
.meeting-header .header-actions {
  display: flex; align-items: center; gap: 0.75rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.discussion-banner {
  background: #3d2e0a; border: 1px solid #d97706; border-radius: var(--radius);
  padding: 0.6rem 1rem; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.discussion-banner .countdown { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #fbbf24; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.debrief-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.debrief-tabs button {
  padding: 0.4rem 0.85rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted); cursor: pointer; font-size: 0.85rem;
}
.debrief-tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.transcript-page { max-height: 60vh; overflow-y: auto; }
.report-transcript { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.report-transcript .transcript-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.35rem 1rem;
  max-height: 70vh;
  overflow-y: auto;
}
.transcript-line {
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.transcript-line:last-child { border-bottom: none; }
.transcript-ts { color: var(--accent-text); font-weight: 650; font-variant-numeric: tabular-nums; margin-right: 0.35rem; }
.transcript-phase { color: var(--muted); margin-right: 0.35rem; }
.transcript-who { font-weight: 700; }

@media (max-width: 768px) {
  .lobby-row { grid-template-columns: 1fr; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; scroll-snap-type: x proximity; }
  .chip { flex-shrink: 0; scroll-snap-align: start; }
  .meeting { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto minmax(56px, auto) auto; }
  .meeting-chat { grid-row: 5; grid-column: 1; max-height: 200px; border-left: none; border-top: 1px solid var(--border); }
}


/* theme toggle / back icons */
.page-tools {
  position: fixed; top: 0.75rem; right: 0.75rem; z-index: 40;
  display: flex; gap: 0.45rem; align-items: center;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--border2); border-radius: 10px;
  background: var(--surface2); color: var(--text); cursor: pointer;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.icon-btn:hover { border-color: var(--accent); background: var(--surface3); }
.icon-btn.with-label {
  width: auto; height: 36px; padding: 0 0.75rem 0 0.55rem;
  font-size: 0.82rem; color: var(--muted); box-shadow: none; background: transparent;
}
.icon-btn.with-label:hover { color: var(--text); }
.icon-btn img { width: 20px; height: 20px; object-fit: contain; display: block; }
[data-theme="dark"] .icon-btn img.icon-theme { filter: invert(1); }
[data-theme="light"] .icon-btn img.icon-back { filter: invert(1); }
[data-theme="dark"] .icon-btn[data-theme-toggle] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border2));
  background: var(--surface3);
}
[data-theme="light"] .icon-btn[data-theme-toggle] {
  background: var(--accent); border-color: transparent;
}
[data-theme="light"] .icon-btn[data-theme-toggle] img.icon-theme { filter: none; }
.meeting-header .header-actions .icon-btn { width: 34px; height: 34px; }
[data-theme="light"] .discussion-banner {
  background: #fffbeb; border-color: #f59e0b; color: #92400e;
}
[data-theme="light"] .discussion-banner .countdown { color: #b45309; }
[data-theme="light"] .thinking-banner {
  background: #f0fdf4; border-color: #22c55e; color: #166534;
}
[data-theme="light"] .thinking-banner .countdown { color: #15803d; }
