:root {
  --bg: #0e1013;
  --bg-2: #13161b;
  --surface: #181c22;
  --surface-2: #20252d;
  --surface-3: #2a303a;
  --border: #2b313b;
  --border-2: #3a414d;
  --text: #e9ecf1;
  --text-2: #b4bac5;
  --muted: #8a919d;
  --primary: #7aa7ff;
  --primary-strong: #4f86f7;
  --primary-ink: #0b1a33;
  --success: #3ecf8e;
  --warning: #f5b544;
  --danger: #ef5350;
  --danger-strong: #e53935;
  --violet: #b69cff;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background-attachment: fixed !important;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(79, 134, 247, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(182, 156, 255, 0.08), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.in-call { background: #0b0c0f; overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; fill: currentColor; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1180px; margin: 0 auto; padding: 18px 24px;
}
body.in-call .topbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #4f86f7, #9b7bff); box-shadow: 0 6px 18px rgba(79, 134, 247, 0.35);
}
.brand-mark svg { width: 20px; height: 20px; fill: #fff; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 2px; }
.nav { display: flex; gap: 6px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: 14px; }
.nav a:hover, .nav a.active { background: var(--surface-2); color: var(--text); text-decoration: none; }

.page { max-width: 1180px; margin: 0 auto; padding: 8px 24px 64px; }
.page-narrow { max-width: 860px; }

/* ---------- common ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px;
}
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.lead { color: var(--text-2); margin: 0 0 24px; font-size: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer;
  transition: background 0.15s, transform 0.05s, border-color 0.15s, opacity 0.15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary-strong); border-color: transparent; color: #fff; }
.btn-primary:hover { background: #5d91fb; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-danger { background: var(--danger-strong); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #f0514d; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary-strong); box-shadow: 0 0 0 3px rgba(79, 134, 247, 0.2); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.seg { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.seg button {
  flex: 1 1 0; min-width: 0; height: 36px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0 6px; white-space: nowrap;
}
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }

.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice {
  text-align: left; border: 1px solid var(--border); background: var(--bg-2); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--border-2); }
.choice.on { border-color: var(--primary-strong); background: rgba(79, 134, 247, 0.1); }
.choice b { display: block; font-size: 14px; margin-bottom: 2px; }
.choice span { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.on { color: var(--text); border-color: var(--primary-strong); background: rgba(79, 134, 247, 0.12); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.pill.good { background: rgba(62, 207, 142, 0.14); color: var(--success); }
.pill.warn { background: rgba(245, 181, 68, 0.14); color: var(--warning); }
.pill.bad { background: rgba(239, 83, 80, 0.14); color: #ff7b78; }
.pill.info { background: rgba(122, 167, 255, 0.14); color: var(--primary); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: var(--primary); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #2b313b; color: var(--text); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; max-width: min(560px, 92vw); animation: rise 0.2s ease-out; }
.toast.err { background: #4a2020; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- gate ---------- */
.gate { min-height: 70vh; display: grid; place-items: center; }
.gate .card { width: min(420px, 100%); text-align: center; padding: 36px 32px; }
.gate .brand-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px; }
.gate .brand-mark svg { width: 30px; height: 30px; }
.gate form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.gate .input { text-align: center; font-size: 18px; letter-spacing: 0.08em; }

/* ---------- setup ---------- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.hero-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 18px 0 22px; }
.hero-title h1 { font-size: 36px; }
.hero-title h1 em { font-style: normal; background: linear-gradient(90deg, #7aa7ff, #b69cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-card { position: sticky; top: 16px; }
.steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; color: var(--text-2); font-size: 14px; }
.steps .n { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text); flex: none; }
.steps b { color: var(--text); display: block; font-size: 14px; }
.form-section { margin-bottom: 22px; }
.form-section:last-child { margin-bottom: 0; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.divider { height: 1px; background: var(--border); margin: 22px 0; }

/* ---------- lobby ---------- */
.lobby { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: center; min-height: calc(100vh - 140px); padding-bottom: 40px; }
.preview {
  position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #1a1d23;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview .avatar-center { position: absolute; inset: 0; display: grid; place-items: center; }
.preview .name-tag { position: absolute; left: 16px; top: 14px; font-weight: 600; font-size: 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.preview .tile-controls { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 14px; }
.round {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(20, 22, 26, 0.35);
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); color: #fff; transition: background 0.15s;
}
.round:hover { background: rgba(255, 255, 255, 0.12); }
.round.off { background: var(--danger-strong); border-color: transparent; }
.round svg { width: 22px; height: 22px; fill: currentColor; }
.meter { position: absolute; right: 16px; bottom: 22px; display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.meter i { width: 4px; border-radius: 2px; background: var(--success); height: 4px; transition: height 0.06s; }
.avatar {
  width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #5b7cfa, #9b6bff); position: relative; user-select: none;
}
.avatar.me { background: linear-gradient(135deg, #1fa37a, #2c7be5); }
.avatar.sm { width: 44px; height: 44px; font-size: 18px; }
.lobby-side { display: flex; flex-direction: column; gap: 18px; }
.lobby-side h1 { font-size: 30px; }
.iv-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.iv-card .who b { display: block; }
.iv-card .who span { font-size: 13px; color: var(--muted); }
.iv-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.iv-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.summary-list { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-2); }
.toggle input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--primary-strong); flex: none; }
.toggle b { display: block; font-size: 14px; }
.toggle span { font-size: 12px; color: var(--muted); }
.join-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- call ---------- */
.call { position: fixed; inset: 0; display: flex; flex-direction: column; background: #0b0c0f; }
.call-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 12px; min-height: 56px; }
.call-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.call-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.rec { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #ff8a80; background: rgba(239, 83, 80, 0.12); padding: 4px 10px; border-radius: 999px; }
.rec::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.timer { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 14px; }
.timer.over { color: var(--warning); }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.net i { display: inline-block; width: 3px; background: var(--success); border-radius: 1px; margin-right: 1px; }
.call-body { flex: 1; display: flex; min-height: 0; padding: 0 16px; gap: 16px; }
.stage { position: relative; flex: 1; min-width: 0; border-radius: 20px; overflow: hidden; background: radial-gradient(900px 500px at 50% 30%, #1f2533, #14171d 70%); }
.stage .iv { position: absolute; inset: 0; display: grid; place-items: center; }
.stage .avatar { width: 168px; height: 168px; font-size: 64px; z-index: 1; }
.ripple { position: absolute; left: 50%; top: 50%; width: 168px; height: 168px; margin: -84px 0 0 -84px; border-radius: 50%; background: rgba(122, 167, 255, 0.28); transform: scale(1); transition: transform 0.08s linear, opacity 0.2s; opacity: 0; }
.ripple.r2 { background: rgba(122, 167, 255, 0.14); }
.stage .tag { position: absolute; left: 16px; bottom: 14px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; background: rgba(0, 0, 0, 0.35); padding: 6px 12px; border-radius: 10px; backdrop-filter: blur(6px); z-index: 2; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--primary); border-radius: 2px; height: 3px; transition: height 0.08s; }
.self {
  position: absolute; right: 16px; bottom: 16px; width: 240px; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden;
  background: #232833; box-shadow: var(--shadow); border: 2px solid transparent; transition: border-color 0.15s; z-index: 3;
}
.self.speaking { border-color: var(--primary); }
.self video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.self .avatar-center { position: absolute; inset: 0; display: grid; place-items: center; }
.stage .self .avatar { width: 64px; height: 64px; font-size: 26px; }
.self .tag { left: 10px; bottom: 8px; font-size: 12px; padding: 3px 8px; }
.self .mute-badge { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--danger-strong); display: grid; place-items: center; }
.self .mute-badge svg { width: 15px; height: 15px; }
.captions { position: absolute; left: 24px; right: 272px; bottom: 60px; max-width: 820px; margin: 0 auto; z-index: 2; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.cap { background: rgba(8, 9, 12, 0.72); border-radius: 12px; padding: 8px 14px; font-size: 17px; line-height: 1.45; backdrop-filter: blur(4px); animation: rise 0.15s ease-out; }
.cap b { color: var(--primary); font-size: 13px; margin-right: 8px; font-weight: 700; }
.cap.me b { color: var(--success); }
.overlay-msg { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; background: rgba(11, 12, 15, 0.7); backdrop-filter: blur(4px); }
.overlay-msg .box { text-align: center; max-width: 420px; padding: 24px; }
.overlay-msg .spinner { width: 34px; height: 34px; border-width: 3px; margin: 0 auto 16px; }
.connect-steps { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; display: inline-flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 14px; }
.connect-steps li.on { color: var(--text); }
.connect-steps li.done { color: var(--success); }

.panel { width: 360px; flex: none; background: var(--surface); border-radius: 20px; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.transcript { flex: 1; overflow-y: auto; padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--primary); display: flex; gap: 8px; align-items: baseline; }
.msg.me .who { color: var(--success); }
.msg .who time { color: var(--muted); font-weight: 500; }
.msg .text { font-size: 14px; color: var(--text); margin-top: 2px; white-space: pre-wrap; }
.msg.partial .text { color: var(--text-2); }
.empty-note { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 8px; }

.controls { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 18px; gap: 12px; }
.controls .left, .controls .right { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.controls .right { justify-content: flex-end; }
.controls .center { display: flex; gap: 12px; align-items: center; }
.cbtn {
  width: 50px; height: 50px; border-radius: 50%; border: 0; background: #2a2f38; color: #fff; display: grid; place-items: center; cursor: pointer; transition: background 0.15s;
}
.cbtn:hover { background: #363c47; }
.cbtn.off { background: var(--danger-strong); }
.cbtn.active { background: #37507e; color: #cfe0ff; }
.cbtn svg { width: 22px; height: 22px; fill: currentColor; }
.cbtn.end { width: 72px; border-radius: 999px; background: var(--danger-strong); }
.cbtn.end:hover { background: #f0514d; }
.clock { color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; width: min(440px, 100%); box-shadow: var(--shadow); }
.modal p { color: var(--text-2); margin: 0 0 20px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- report ---------- */
.report-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
.score-ring { position: relative; width: 150px; height: 150px; }
.score-ring svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.score-ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .num b { font-size: 44px; line-height: 1; letter-spacing: -0.03em; display: block; }
.score-ring .num span { font-size: 12px; color: var(--muted); }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; margin: 10px 0 16px; }
.summary-text { color: var(--text-2); font-size: 15px; margin: 0; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.comp { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 44px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.comp:last-child { border-bottom: 0; }
.comp .name { font-weight: 600; font-size: 14px; }
.comp .comment { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin-top: -4px; }
.bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4f86f7, #9b7bff); }
.comp .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.list li { display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.list li svg { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.list.good svg { fill: var(--success); }
.list.bad svg { fill: #ff7b78; }
.impr { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-2); }
.impr + .impr { margin-top: 10px; }
.impr h4 { margin: 0 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.impr p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.impr p b { color: var(--text); font-weight: 600; }
.qa { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-2); overflow: hidden; }
.qa + .qa { margin-top: 10px; }
.qa summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .q { flex: 1; font-weight: 600; font-size: 14px; }
.qa summary .q small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; }
.qa .body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--text-2); }
.qa .body h5 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.quote { border-left: 3px solid var(--primary-strong); background: rgba(79, 134, 247, 0.07); padding: 10px 14px; border-radius: 0 10px 10px 0; color: var(--text); }
.score-badge { min-width: 42px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.tile b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.tile span { font-size: 12px; color: var(--muted); }
.kv { display: grid; gap: 10px; }
.kv div { font-size: 14px; color: var(--text-2); }
.kv div b { color: var(--text); display: block; font-size: 13px; }
.study li { flex-direction: column; gap: 2px; }
.study li b { color: var(--text); }
.study li small { color: var(--muted); }
.audio-card { display: flex; align-items: center; gap: 16px; }
.audio-card audio { flex: 1; min-width: 0; height: 40px; }
.tr-line { display: grid; grid-template-columns: 52px 1fr; gap: 10px; font-size: 14px; padding: 6px 0; }
.tr-line time { color: var(--muted); font-variant-numeric: tabular-nums; cursor: pointer; }
.tr-line time:hover { color: var(--primary); }
.tr-line .who { font-weight: 700; font-size: 12px; color: var(--primary); display: block; }
.tr-line.me .who { color: var(--success); }
.analyzing { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.analyzing .card { width: min(520px, 100%); padding: 36px; }
.analyzing .spinner { width: 42px; height: 42px; border-width: 3px; margin: 0 auto 20px; }
.progress-steps { list-style: none; padding: 0; margin: 20px auto 0; display: inline-flex; flex-direction: column; gap: 10px; text-align: left; font-size: 14px; color: var(--muted); }
.progress-steps li { display: flex; gap: 10px; align-items: center; }
.progress-steps li.on { color: var(--text); }
.progress-steps li.done { color: var(--success); }
.progress-steps svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- history ---------- */
.hist { display: flex; flex-direction: column; gap: 10px; }
.hist-item { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--border); background: var(--surface); border-radius: 16px; color: var(--text); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.hist-item:hover { border-color: var(--border-2); background: #1b2027; text-decoration: none; }
.hist-item .main { flex: 1; min-width: 0; }
.hist-item .main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .main span { font-size: 13px; color: var(--muted); }
.hist-score { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .setup-grid, .lobby { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .lobby { min-height: 0; padding-top: 8px; }
  .panel { position: absolute; right: 12px; top: 64px; bottom: 90px; z-index: 10; width: min(380px, calc(100% - 24px)); box-shadow: var(--shadow); }
  .captions { left: 12px; right: 12px; bottom: 64px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .hero-title { flex-direction: column; align-items: flex-start; }
  .hero-title h1 { font-size: 28px; }
  .row, .choice-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .call-body { padding: 0 8px; }
  .self { width: 120px; right: 10px; bottom: 10px; aspect-ratio: 3 / 4; }
  .stage .avatar { width: 120px; height: 120px; font-size: 46px; }
  .stage .self .avatar { width: 44px; height: 44px; font-size: 18px; }
  .captions { bottom: 150px; }
  .ripple { width: 120px; height: 120px; margin: -60px 0 0 -60px; }
  .controls .left, .controls .right { display: none; }
  .controls { justify-content: center; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .cbtn { width: 46px; height: 46px; }
  .cbtn.end { width: 62px; }
  .cap { font-size: 15px; }
  .report-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .report-actions { justify-content: center; }
  .meta-line { justify-content: center; }
  .comp { grid-template-columns: 1fr 44px; }
  .comp .bar { grid-column: 1 / -1; order: 3; }
  .nav a span { display: none; }
}
