:root {
  --bg: #06070f;
  --bg2: #0b0d1c;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --panel-solid: #0f1226;
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.16);
  --text: #eceefb;
  --muted: #9096b8;
  --dim: #5f6488;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --pink: #f472b6;
  --orange: #fb923c;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px rgba(124, 92, 255, 0.35), 0 10px 40px -10px rgba(124, 92, 255, 0.6);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(124, 92, 255, 0.45); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 800px at 70% -10%, #1a1440 0%, transparent 60%), radial-gradient(900px 700px at -10% 110%, #08283a 0%, transparent 55%), var(--bg); }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; mix-blend-mode: screen; animation: drift 26s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: #6d4bff; top: -120px; right: 8%; }
.b2 { width: 460px; height: 460px; background: #0ea5c6; bottom: -140px; left: -80px; animation-duration: 32s; }
.b3 { width: 340px; height: 340px; background: #c2418f; top: 40%; left: 45%; opacity: 0.18; animation-duration: 38s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.12); } 100% { transform: translate(-40px, 70px) scale(0.95); } }
.grid-overlay { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 75%); }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px; padding: 14px 28px; background: rgba(6, 7, 15, 0.6); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 15px; white-space: nowrap; }
.brand b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d8ccff, var(--accent) 55%, var(--accent-2)); box-shadow: 0 0 22px rgba(124, 92, 255, 0.8); position: relative; animation: pulse 3.2s ease-in-out infinite; }
.brand-mark span { position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(124, 92, 255, 0.5); animation: ripple 3.2s ease-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes ripple { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.7); opacity: 0; } }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: 0.2s; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--border-2); }
.trainee-chip { border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 6px 14px 6px 6px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.trainee-chip .ava { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: linear-gradient(135deg, var(--accent), var(--pink)); }

/* ---------- layout ---------- */
.view { max-width: 1320px; margin: 0 auto; padding: 28px 28px 120px; animation: viewIn 0.45s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(10px); }
.panel h3 { font-size: 14px; letter-spacing: 0.02em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section { margin-top: 34px; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-title h2 { font-size: 18px; }
.section-title .step { font-family: var(--font-display); font-size: 12px; color: var(--accent-2); border: 1px solid rgba(34, 211, 238, 0.35); padding: 2px 9px; border-radius: 999px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--panel-2); font-weight: 700; font-size: 14px; cursor: pointer; transition: transform 0.15s, background 0.2s, box-shadow 0.2s, opacity 0.2s; white-space: nowrap; }
.btn:hover { background: rgba(255, 255, 255, 0.11); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { border: 0; background: linear-gradient(135deg, var(--accent), #5b8cff 60%, var(--accent-2)); box-shadow: var(--glow); color: white; }
.btn.primary:hover { box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.5), 0 14px 50px -10px rgba(124, 92, 255, 0.85); }
.btn.danger { border: 0; background: linear-gradient(135deg, #ef4444, #db2777); color: white; box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.7); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 16px 28px; font-size: 16px; border-radius: 16px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; transition: 0.2s; }
.icon-btn:hover { background: var(--panel-2); }

/* ---------- forms ---------- */
.input, select.input, textarea.input { width: 100%; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-2); border-radius: 12px; padding: 11px 14px; outline: none; transition: border 0.2s, box-shadow 0.2s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.45; }
select.input { 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: 34px; }
select.input option { background: var(--panel-solid); }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: 14px; }
.switch input { display: none; }
.switch .tr { width: 42px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); position: relative; transition: 0.25s; }
.switch .tr::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: 0.25s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + .tr { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.switch input:checked + .tr::after { left: 21px; }
input[type="range"] { accent-color: var(--accent); width: 100%; }

/* ---------- segmented ---------- */
.seg { display: inline-flex; padding: 4px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); border-radius: 14px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 16px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; transition: 0.25s; }
.seg button.on { background: linear-gradient(135deg, rgba(124, 92, 255, 0.9), rgba(34, 211, 238, 0.7)); color: white; box-shadow: 0 6px 20px -6px rgba(124, 92, 255, 0.8); }

/* ---------- choice cards ---------- */
.choice { position: relative; text-align: left; border: 1px solid var(--border); background: var(--panel); border-radius: 16px; padding: 16px; cursor: pointer; transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), border 0.25s, background 0.25s, box-shadow 0.25s; overflow: hidden; display: grid; gap: 6px; align-content: start; }
.choice::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--pink)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: 0.3s; }
.choice:hover { transform: translateY(-3px); background: var(--panel-2); }
.choice.on { background: linear-gradient(160deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.06)); box-shadow: 0 12px 40px -16px rgba(124, 92, 255, 0.8); }
.choice.on::before { opacity: 1; }
.choice .ic { font-size: 26px; line-height: 1; }
.choice .t { font-weight: 800; font-size: 14.5px; }
.choice .s { font-size: 12.5px; color: var(--muted); }
.choice .badge { position: absolute; top: 12px; right: 12px; }
.choice .check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-size: 12px; transform: scale(0); transition: 0.3s cubic-bezier(.3, 1.6, .5, 1); }
.choice.on .check { transform: scale(1); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip.good { color: var(--good); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.chip.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.chip.bad { color: var(--bad); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.chip.accent { color: #c4b5fd; border-color: rgba(124, 92, 255, 0.4); background: rgba(124, 92, 255, 0.1); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; min-height: 300px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.08; }
.hero h1 .grad { background: linear-gradient(90deg, #a78bfa, var(--accent-2) 50%, var(--pink)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.hero p { font-size: 16.5px; color: var(--muted); max-width: 560px; margin: 16px 0 22px; }
.hero-orb { position: relative; height: 330px; }
.hero-orb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; min-width: 120px; }
.stat b { display: block; font-family: var(--font-display); font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- start bar ---------- */
.startbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; width: min(1100px, calc(100% - 32px)); display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 20px; border-radius: 20px; background: rgba(12, 14, 30, 0.82); backdrop-filter: blur(20px); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: barIn 0.5s cubic-bezier(.2, .8, .2, 1); }
@keyframes barIn { from { transform: translate(-50%, 40px); opacity: 0; } }
.startbar .sum { flex: 1; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.startbar .sum b { color: var(--text); }

/* ---------- call ---------- */
.call { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 18px; height: calc(100vh - 140px); min-height: 640px; }
.call-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.call-center { display: flex; flex-direction: column; min-height: 0; border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)); border: 1px solid var(--border); overflow: hidden; position: relative; }
.call-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.call-ava { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(244, 114, 182, 0.25)); border: 1px solid var(--border-2); }
.call-who b { display: block; font-size: 16px; }
.call-who span { font-size: 12.5px; color: var(--muted); }
.timer { font-family: var(--font-display); font-size: 15px; font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); display: inline-block; margin-right: 8px; animation: blink 1.2s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0.25; } }
.stage { position: relative; height: 360px; flex-shrink: 0; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-status { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-family: var(--font-display); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); transition: color 0.4s; }
.stage-status.listen { color: var(--accent-2); }
.stage-status.speak { color: var(--pink); }
.stage-status.think { color: #c4b5fd; }
.interim { position: absolute; left: 24px; right: 24px; top: 16px; text-align: center; font-size: 15px; color: var(--accent-2); min-height: 24px; opacity: 0.9; text-shadow: 0 0 20px rgba(34, 211, 238, 0.5); }
.call.chat .stage { height: 150px; }
.transcript { flex: 1; overflow-y: auto; padding: 16px 20px 10px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; scrollbar-width: thin; min-height: 0; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; animation: msgIn 0.35s cubic-bezier(.2, .8, .2, 1); position: relative; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.msg .who { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.6; margin-bottom: 2px; }
.msg.op { align-self: flex-end; background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(124, 92, 255, 0.18)); border: 1px solid rgba(34, 211, 238, 0.25); border-bottom-right-radius: 4px; }
.msg.cand { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; font-size: 12.5px; color: var(--muted); background: transparent; padding: 4px 10px; }
.msg .emo { font-size: 11px; color: var(--pink); margin-left: 6px; font-weight: 700; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
.controls { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.18); }
.controls .input { border-radius: 14px; }
.mic { width: 58px; height: 58px; flex-shrink: 0; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: white; position: relative; transition: transform 0.15s, filter 0.2s; box-shadow: 0 10px 30px -8px rgba(34, 211, 238, 0.7); }
.mic:hover { transform: scale(1.05); }
.mic.off { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.mic.live::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(34, 211, 238, 0.7); animation: ripple 1.4s ease-out infinite; }
.mic svg { width: 24px; height: 24px; }
.chat-tools { display: flex; gap: 8px; padding: 0 16px 12px; flex-wrap: wrap; }

.checklist { display: grid; gap: 6px; }
.ck { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; transition: background 0.3s; font-size: 13.5px; }
.ck .box { width: 20px; height: 20px; flex-shrink: 0; border-radius: 7px; border: 1.5px solid var(--border-2); display: grid; place-items: center; font-size: 12px; transition: 0.35s cubic-bezier(.3, 1.6, .5, 1); margin-top: 1px; }
.ck.done { background: rgba(52, 211, 153, 0.07); }
.ck.done .box { background: var(--good); border-color: var(--good); color: #052e1c; transform: scale(1.1); box-shadow: 0 0 14px rgba(52, 211, 153, 0.6); }
.ck.next { background: rgba(124, 92, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35); }
.ck.next .box { border-color: var(--accent); animation: pulse 1.4s infinite; }
.ck.pop { animation: pop 0.6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.04); background: rgba(52, 211, 153, 0.2); } }
.ck .ttl { font-weight: 700; }
.ck .ds { font-size: 12px; color: var(--muted); }
.progress-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 4px 0 12px; }
.progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--good), var(--accent-2)); border-radius: inherit; transition: width 0.7s cubic-bezier(.2, .8, .2, 1); }

.gauge { display: flex; align-items: center; gap: 14px; }
.gauge svg { width: 120px; height: 70px; }
.gauge .val { font-family: var(--font-display); font-size: 24px; }
.ivr-card .kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13.5px; }
.ivr-card .kv span:nth-child(odd) { color: var(--muted); }

.hint-card { position: relative; border-radius: 16px; padding: 14px 16px; background: linear-gradient(160deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.08)); border: 1px solid rgba(124, 92, 255, 0.4); animation: msgIn 0.4s; }
.hint-card .lbl { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #c4b5fd; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.hint-card .txt { font-size: 14.5px; line-height: 1.45; }
.warn-card { border-radius: 14px; padding: 12px 14px; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.35); font-size: 13.5px; animation: shake 0.5s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.kb-card { border-radius: 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); font-size: 13.5px; animation: slideIn 0.45s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } }
.kb-card b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-2); margin-bottom: 4px; }
.source-pop { position: absolute; top: 70px; right: 20px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.95); color: #111; font-weight: 800; font-size: 13px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); animation: popIn 4s forwards; }
.source-pop i { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: white; font-style: normal; font-size: 12px; }
@keyframes popIn { 0% { transform: scale(0.3) translateY(-20px); opacity: 0; } 10% { transform: scale(1.08); opacity: 1; } 15% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ---------- report ---------- */
.report-head { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; }
.ring { position: relative; width: 200px; height: 200px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .num b { font-family: var(--font-display); font-size: 54px; line-height: 1; display: block; }
.ring .num span { font-size: 12px; color: var(--muted); }
.ring circle.fg { transition: stroke-dashoffset 1.6s cubic-bezier(.2, .8, .2, 1); }
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.crit { display: grid; gap: 5px; margin-bottom: 14px; }
.crit .top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; }
.crit .bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.crit .bar i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.crit .cm { font-size: 12.5px; color: var(--muted); }
.radar { width: 100%; max-width: 420px; margin: 0 auto; display: block; }
.radar .shape { transform-origin: center; animation: radarIn 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes radarIn { from { transform: scale(0); opacity: 0; } }
.mistake { border-radius: 16px; border: 1px solid var(--border); background: var(--panel); padding: 16px; display: grid; gap: 10px; }
.mistake .q { font-style: italic; padding-left: 12px; border-left: 3px solid var(--bad); color: #fecaca; }
.mistake .b { padding-left: 12px; border-left: 3px solid var(--good); color: #bbf7d0; }
.stages-line { display: flex; gap: 6px; flex-wrap: wrap; }
.stages-line .st { display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; font-size: 13px; font-weight: 700; border: 1px solid var(--border); background: var(--panel); }
.stages-line .st.ok { border-color: rgba(52, 211, 153, 0.4); color: var(--good); background: rgba(52, 211, 153, 0.07); }
.stages-line .st.no { border-color: rgba(248, 113, 113, 0.35); color: var(--bad); background: rgba(248, 113, 113, 0.06); }
.list-clean { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.list-clean li { display: flex; gap: 10px; font-size: 14px; }
.list-clean li::before { content: "→"; color: var(--accent-2); font-weight: 800; }
.list-clean.plus li::before { content: "✓"; color: var(--good); }
.exercise { display: grid; gap: 8px; align-content: space-between; }

.analyzing { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.analyzing .steps { display: grid; gap: 10px; margin-top: 24px; text-align: left; }
.analyzing .steps div { display: flex; gap: 10px; align-items: center; color: var(--dim); transition: color 0.4s; font-weight: 600; }
.analyzing .steps div.on { color: var(--text); }
.analyzing .steps div.done { color: var(--good); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent-2); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.table tr.click { cursor: pointer; transition: background 0.2s; }
.table tr.click:hover { background: var(--panel); }
.score-pill { font-family: var(--font-display); font-size: 13px; padding: 3px 10px; border-radius: 999px; display: inline-block; min-width: 44px; text-align: center; }

/* ---------- library ---------- */
.ref-line { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; transition: background 0.3s, box-shadow 0.3s; }
.ref-line.playing { background: rgba(124, 92, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.4); }
.ref-line .w { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.ref-line.op .w { background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.ref-line.cand .w { background: rgba(255, 255, 255, 0.1); }
.ref-line .note { margin-top: 6px; font-size: 12.5px; color: var(--warn); }

/* ---------- KB editor ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { border: 1px solid var(--border); background: var(--panel); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.tabs button.on { color: var(--text); border-color: var(--accent); background: rgba(124, 92, 255, 0.14); }
.edit-item { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: var(--panel); display: grid; gap: 12px; }
.edit-item .head { display: flex; align-items: center; gap: 10px; }
.edit-item .head b { flex: 1; }
details.edit-item > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 700; }
details.edit-item > summary::-webkit-details-marker { display: none; }
details.edit-item > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: 0.2s; }
details.edit-item[open] > summary::after { transform: rotate(180deg); }

/* ---------- login ---------- */
.login { min-height: 88vh; display: grid; place-items: center; }
.login-card { width: min(440px, 100%); text-align: center; padding: 34px 30px; }
.login-card .orbbox { height: 220px; position: relative; margin: -10px 0 6px; }
.login-card .orbbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-card form { display: grid; gap: 12px; margin-top: 20px; text-align: left; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 76px; right: 20px; z-index: 100; display: grid; gap: 10px; width: min(380px, calc(100% - 40px)); }
.toast { padding: 12px 16px; border-radius: 14px; background: rgba(15, 18, 38, 0.95); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 14px; animation: slideIn 0.35s; }
.toast.err { border-color: rgba(248, 113, 113, 0.5); }
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; width: 100%; height: 100%; }

.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); z-index: 80; display: grid; place-items: center; padding: 16px; animation: viewIn 0.25s; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 8px; }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-2); background: rgba(0, 0, 0, 0.3); }
.notice { padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.07); font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .call { grid-template-columns: 260px minmax(0, 1fr); height: auto; }
  .call-side.right { grid-column: 1 / -1; }
  .call-center { height: 78vh; }
}
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; }
  .brand-text { display: none; }
  .trainee-chip { margin-left: auto; }
  .view { padding: 18px 16px 120px; }
  .hero { grid-template-columns: 1fr; }
  .hero-orb { height: 220px; order: -1; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .call { grid-template-columns: 1fr; }
  .call-side.left { order: 2; }
  .call-side.right { order: 3; }
  .call-center { height: 82vh; }
  .stage { height: 240px; }
  .report-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .startbar { flex-wrap: wrap; }
  .startbar .sum { flex-basis: 100%; white-space: normal; }
  .startbar .btn { flex: 1; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .bg, .topbar, .no-print, .toasts { display: none !important; }
  body { background: white; color: #111; }
  .panel { border-color: #ddd; background: white; }
}
