:root {
    --bg: #0f1221;
    --panel: #ffffff;
    --ink: #1b2030;
    --muted: #7a8194;
    --brand: #5b6cff;
    --brand-2: #8a5bff;
    --green: #16a34a;
    --blue: #2563eb;
    --gray: #6b7280;
    --line: #e7e9f0;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: #f4f5fb;
    line-height: 1.5;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
.topbar h1 { margin: 0 0 4px; font-size: 28px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* Cards */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    margin: 18px 0;
    box-shadow: 0 1px 2px rgba(20,25,50,.04);
}
.card h2 { margin-top: 0; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.form-grid label span { font-weight: 600; }
.form-grid .full { grid-column: 1 / -1; }
input[type=text], textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 9px; font: inherit; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

/* Buttons */
.btn {
    display: inline-block; cursor: pointer; border: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; padding: 11px 18px; border-radius: 10px;
    font: inherit; font-weight: 600; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn-small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-big { padding: 15px 30px; font-size: 18px; border-radius: 12px; }
.btn-ghost { background: #eef0fb; color: var(--brand); }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; }
.rating { font-weight: 700; color: var(--brand); }

/* Badges */
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-gray { background: #eef0f4; color: #555; }
.badge-blue { background: #e0ebff; color: var(--blue); }
.badge-green { background: #dcfce7; color: var(--green); }

/* Alerts */
.alert { padding: 14px 16px; border-radius: 10px; margin: 16px 0; }
.alert-error { background: #fdecec; color: #b42318; }
.alert-success { background: #e7f8ee; color: #0f7a40; }
.alert-info { background: #eef2ff; color: #3b4ce0; }
.copyrow { display: flex; gap: 8px; margin-top: 10px; }
.copyrow input { flex: 1; }

/* ---------- Results ---------- */
.result-card { display: flex; gap: 26px; flex-wrap: wrap; }
.score-block { text-align: center; min-width: 180px; }
.big-score { font-size: 64px; font-weight: 800; color: var(--brand); line-height: 1; }
.big-score span { font-size: 26px; color: var(--muted); }
.stars { font-size: 26px; color: #f5a623; letter-spacing: 3px; margin: 6px 0; }
.rec { font-size: 14px; color: var(--muted); }
.result-body { flex: 1; min-width: 260px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-col h3 { margin-bottom: 6px; }

/* Chat transcript */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 80%; }
.msg-who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg-ai { background: #eef1ff; align-self: flex-start; }
.msg-user { background: #f0f2f6; align-self: flex-end; }

/* ---------- Interview (candidate) ---------- */
.interview-body { background: radial-gradient(1200px 600px at 50% -10%, #1d2444, #0f1221); min-height: 100vh; }
.interview-wrap { max-width: 620px; margin: 0 auto; padding: 40px 18px; }
.interview-card { background: #fff; }
.screen h1 { margin-top: 0; }
.tips { list-style: none; padding: 0; margin: 18px 0; }
.tips li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }

.live-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.timer { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.timer-warn { color: #d92d20; }
.status-pill { background: #eef0fb; color: var(--brand); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }

.orb-wrap { display: flex; justify-content: center; margin: 26px 0; }
.orb {
    width: 130px; height: 130px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #9fb0ff, #5b6cff 60%, #3a2fae);
    box-shadow: 0 0 0 0 rgba(91,108,255,.5);
    transition: transform .2s ease;
}
.orb-speaking { animation: pulse 1.1s infinite ease-in-out; }
.orb-listening { background: radial-gradient(circle at 35% 30%, #a6f3c8, #16a34a 60%, #0c7a37); animation: pulse 1.4s infinite ease-in-out; }
.orb-thinking { background: radial-gradient(circle at 35% 30%, #ffe39f, #f5a623 60%, #b9760a); animation: pulse 1.6s infinite ease-in-out; }
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(120,140,255,.45); }
    70% { transform: scale(1.06); box-shadow: 0 0 0 26px rgba(120,140,255,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(120,140,255,0); }
}

.transcript {
    background: #f7f8fc; border: 1px solid var(--line); border-radius: 12px;
    padding: 14px; height: 200px; overflow-y: auto; font-size: 14px;
}
.tline { margin-bottom: 8px; }
.tline-who { font-weight: 700; }
.tline-ai .tline-who { color: var(--brand); }
.tline-you .tline-who { color: var(--green); }

.live-actions { margin-top: 16px; text-align: center; }

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
}
