/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f1117;
    --bg-surface: #1a1d27;
    --bg-bubble-ai: #1e2235;
    --bg-bubble-user: #2a4a7f;
    --bg-input: #1a1d27;
    --text: #e4e4e7;
    --text-dim: #9ca3af;
    --accent: #6b8afd;
    --accent-hover: #8ba4ff;
    --correction-bg: #1c2a1e;
    --correction-border: #2d5a32;
    --correction-original: #f87171;
    --correction-suggestion: #6ee7b7;
    --correction-note: #a1a1aa;
    --recording: #ef4444;
    --call-green: #22c55e;
    --call-red: #ef4444;
    --radius: 14px;
    --radius-sm: 8px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.hidden { display: none !important; }

/* ══════════ APP LAYOUT ══════════ */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}

/* ── Header ── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
header h1 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
}
.topic-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(107, 138, 253, 0.15);
    color: var(--accent);
    border-radius: 10px;
    font-weight: 500;
}
.btn-header {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-header:hover {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(107, 138, 253, 0.08);
}
.btn-icon { padding: 6px 8px; }
.btn-call-start {
    border-color: var(--call-green);
    color: var(--call-green);
}
.btn-call-start:hover {
    background: rgba(34, 197, 94, 0.12);
    color: var(--call-green);
    border-color: var(--call-green);
}

/* ── Topic Bar ── */
.topic-bar {
    padding: 8px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}
.topic-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}
.chip:hover {
    background: rgba(107, 138, 253, 0.12);
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Chat Area ── */
main {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}
#messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Messages ── */
.msg {
    display: flex;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; }
.msg-system { align-self: center; max-width: 90%; }

.bubble {
    padding: 11px 15px;
    border-radius: var(--radius);
    line-height: 1.6;
    font-size: 15px;
    position: relative;
}
.msg-ai .bubble {
    background: var(--bg-bubble-ai);
    border-bottom-left-radius: 4px;
}
.msg-user .bubble {
    background: var(--bg-bubble-user);
    border-bottom-right-radius: 4px;
}
.msg-system .bubble {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 13px;
    text-align: center;
}
.msg-label {
    display: block;
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bubble p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Replay Button ── */
.btn-replay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-dim);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.bubble:hover .btn-replay { opacity: 1; }
.btn-replay:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

/* ── Corrections ── */
.corrections {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.corr-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--correction-suggestion);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}
.corr-title::before {
    content: '>';
    display: inline-block;
    transition: transform 0.2s;
    font-size: 10px;
}
.corrections.expanded .corr-title::before { transform: rotate(90deg); }
.corr-item {
    display: none;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    margin-top: 6px;
    padding: 7px 9px;
    background: var(--correction-bg);
    border-left: 3px solid var(--correction-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    line-height: 1.5;
}
.corrections.expanded .corr-item { display: flex; }
.corr-original { color: var(--correction-original); text-decoration: line-through; opacity: 0.8; }
.corr-arrow { color: var(--text-dim); font-size: 11px; }
.corr-suggestion { color: var(--correction-suggestion); font-weight: 500; }
.corr-note { display: block; width: 100%; color: var(--correction-note); font-size: 11px; margin-top: 2px; }

/* ── Typing Indicator ── */
.typing { display: flex; gap: 5px; padding: 12px 16px; }
.typing span {
    width: 7px; height: 7px;
    background: var(--text-dim);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Footer / Input ── */
footer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px 18px;
    background: var(--bg-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.input-wrapper { flex: 1; }
#input-message {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--text);
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 120px;
    transition: border-color 0.2s;
}
#input-message:focus { border-color: var(--accent); }
#input-message::placeholder { color: var(--text-dim); }

.btn-mic, .btn-send {
    width: 42px; height: 42px;
    border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.2s;
}
.btn-mic { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }
.btn-mic:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.btn-mic.recording {
    background: var(--recording); color: white;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}
.btn-send { background: var(--accent); color: white; }
.btn-send:hover { background: var(--accent-hover); }

/* ── Toast ── */
.toast {
    position: fixed; bottom: 100px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-bubble-ai); color: var(--text);
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-size: 13px; opacity: 0; transition: all 0.3s;
    z-index: 200; border: 1px solid rgba(255, 255, 255, 0.1);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Scrollbar ── */
main::-webkit-scrollbar { width: 5px; }
main::-webkit-scrollbar-track { background: transparent; }
main::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

/* ══════════════════════════════════════════════ */
/*  CALL MODE                                     */
/* ══════════════════════════════════════════════ */

.call-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
}
.call-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.call-bg-blur {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1040 40%, #0d1a2d 100%);
}
.call-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 30px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

/* ── Avatar ── */
.call-avatar {
    position: relative;
    margin-bottom: 20px;
}
.avatar-circle {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    position: relative;
    z-index: 2;
}

/* Ringing animation */
.call-avatar.ringing .ring-wave {
    position: absolute;
    top: 50%; left: 50%;
    width: 100px; height: 100px;
    margin: -50px 0 0 -50px;
    border: 2px solid var(--call-green);
    border-radius: 50%;
    animation: ringPulse 2s ease-out infinite;
}
.call-avatar.ringing .ring-wave.delay {
    animation-delay: 0.5s;
}
@keyframes ringPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Speaking animation */
.call-avatar.speaking .avatar-circle {
    animation: speakGlow 1.2s ease-in-out infinite;
}
.call-avatar.speaking::after {
    content: '';
    position: absolute;
    top: -8px; left: -8px; right: -8px; bottom: -8px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: speakRing 1.2s ease-in-out infinite;
}
@keyframes speakGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(107, 138, 253, 0.3); }
    50% { box-shadow: 0 0 40px rgba(107, 138, 253, 0.6); }
}
@keyframes speakRing {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.08); opacity: 0.8; }
}

.call-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}
.call-subtitle {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 50px;
}
.call-status {
    color: var(--call-green);
    font-size: 14px;
    margin-bottom: 16px;
    min-height: 20px;
}
.call-timer {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
}

/* ── Incoming Call Actions ── */
.call-actions-incoming {
    display: flex;
    gap: 50px;
}
.call-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    transition: transform 0.2s;
}
.call-btn:hover { transform: scale(1.08); }
.call-btn svg {
    width: 56px; height: 56px;
    padding: 14px;
    border-radius: 50%;
}
.call-btn.decline svg { background: var(--call-red); }
.call-btn.answer svg {
    background: var(--call-green);
    animation: answerPulse 2s infinite;
}
@keyframes answerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

/* ── Call Transcript ── */
.call-transcript {
    width: 100%;
    min-height: 80px;
    max-height: 150px;
    overflow-y: auto;
    margin: 10px 0 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.call-transcript p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}
.call-transcript p.interim {
    color: var(--text-dim);
    font-style: italic;
}

/* ── Call Corrections (floating) ── */
.call-corrections {
    width: 100%;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.call-corr-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: var(--correction-bg);
    border-left: 3px solid var(--correction-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    line-height: 1.5;
}

/* ── Call Controls ── */
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}
.call-ctrl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 11px;
    transition: all 0.2s;
}
.call-ctrl-btn:hover { color: var(--text); }
.call-ctrl-btn svg {
    padding: 12px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}
.call-ctrl-btn:hover svg { background: rgba(255, 255, 255, 0.14); }

/* Mic button in call */
.mic-btn svg { width: 60px; height: 60px; padding: 16px; }
.mic-btn.active svg {
    background: var(--call-green);
    color: white;
    animation: pulse 1.5s infinite;
}

/* End call button */
.end-btn svg {
    background: var(--call-red);
    color: white;
}
.end-btn:hover svg { background: #dc2626; }

/* Muted speaker */
.call-ctrl-btn.muted svg {
    background: rgba(239, 68, 68, 0.2);
    color: var(--call-red);
}

/* ══════════════════════════════════════════════ */
/*  VOICE & SPEED CONTROLS                        */
/* ══════════════════════════════════════════════ */
.voice-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}
.voice-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    max-width: 90px;
}
.voice-select:hover { border-color: var(--accent); }
.voice-select option { background: var(--bg-surface); color: var(--text); }
#speed-slider {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
#speed-label {
    font-size: 10px;
    color: var(--text-dim);
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════ */
/*  MODAL (Session Report)                        */
/* ══════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal {
    background: var(--bg-surface);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-header h2 {
    font-size: 17px;
    font-weight: 600;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ── Report Loading ── */
.report-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-dim);
}
.report-loading .typing { justify-content: center; margin-bottom: 12px; }
.report-loading p { font-size: 14px; }

.report-error {
    text-align: center;
    padding: 30px;
    color: #fca5a5;
    font-size: 14px;
}

/* ── Report Score ── */
.report-score {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.score-circle {
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-num {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}
.score-label {
    font-size: 11px;
    color: var(--text-dim);
}

/* ── Report Sections ── */
.report-section {
    margin-bottom: 20px;
}
.report-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.report-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}
.report-section ul {
    list-style: none;
    padding: 0;
}
.report-section li {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    padding: 4px 0 4px 16px;
    position: relative;
}
.report-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ── Mistakes ── */
.report-mistake-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(239, 68, 68, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--correction-original);
}
.mistake-original {
    color: var(--correction-original);
    text-decoration: line-through;
    font-size: 14px;
    opacity: 0.85;
}
.mistake-arrow {
    color: var(--text-dim);
    font-size: 10px;
    margin: 2px 0;
}
.mistake-corrected {
    color: var(--correction-suggestion);
    font-weight: 500;
    font-size: 14px;
}
.mistake-explanation {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 4px;
}

/* ── Expressions ── */
.report-expr-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(107, 138, 253, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}
.expr-eng {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
}
.expr-meaning {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}
.expr-example {
    font-size: 12px;
    color: var(--text);
    font-style: italic;
    margin-top: 4px;
    opacity: 0.8;
}

/* ── Homework ── */
.report-homework {
    background: rgba(107, 138, 253, 0.05);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(107, 138, 253, 0.2);
}

/* ── User badge / Logout ── */
.user-badge {
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}
.btn-logout {
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}
.btn-logout:hover { background: rgba(248, 113, 113, 0.15) !important; }

/* ══════════════════════════════════════
   HELP & MENU BUTTONS
   ══════════════════════════════════════ */
.btn-help-trigger {
    color: var(--accent) !important;
    border-color: var(--accent) !important;
    font-weight: 700;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    font-size: 15px;
}
.btn-help-trigger:hover {
    background: rgba(107, 138, 253, 0.15) !important;
}
.btn-menu-toggle {
    display: none;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    border-radius: 50% !important;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════════
   MOBILE DROPDOWN MENU
   ══════════════════════════════════════ */
.mobile-menu {
    position: absolute;
    top: 54px;
    right: 12px;
    width: 240px;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 500;
    overflow: hidden;
    animation: menuSlide 0.15s ease;
}
@keyframes menuSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.mobile-menu-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 499;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    font-family: inherit;
}
.menu-item:hover,
.menu-item:active { background: rgba(255, 255, 255, 0.06); }
.menu-item-danger { color: #f87171 !important; }
.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0;
}
.menu-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

/* ══════════════════════════════════════
   HELP MODAL CONTENT
   ══════════════════════════════════════ */
.help-modal {
    max-width: 480px;
}
.help-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    margin: 20px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.help-content h3:first-child { margin-top: 0; }
.help-content p,
.help-content li {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text);
}
.help-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.help-content li {
    padding: 2px 0 2px 20px;
    position: relative;
}
.help-content li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: var(--accent);
}
.help-content .help-tip {
    background: rgba(107, 138, 253, 0.08);
    border: 1px solid rgba(107, 138, 253, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 16px;
}
.help-content .help-tip h3 {
    margin-top: 0;
    margin-bottom: 6px;
}
.help-content .help-tip li {
    font-size: 13px;
    color: var(--text-dim);
}

/* ══════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════ */
.login-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 60px 24px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700;
    margin: 0 auto 16px;
}
.login-header h1 { font-size: 22px; margin-bottom: 4px; }
.login-subtitle { color: var(--text-dim); font-size: 14px; }

.user-cards {
    display: flex; flex-wrap: wrap; gap: 12px;
    justify-content: center;
    margin-bottom: 24px; width: 100%;
}
.user-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; transition: all 0.2s;
    min-width: 90px;
}
.user-card:hover { border-color: var(--accent); background: rgba(107, 138, 253, 0.08); }
.user-card.selected { border-color: var(--accent); background: rgba(107, 138, 253, 0.12); }
.user-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
}
.user-name-label { font-size: 13px; font-weight: 600; }
.no-users { color: var(--text-dim); font-size: 14px; text-align: center; padding: 20px; }

.pin-section { width: 100%; text-align: center; margin-bottom: 24px; }
.pin-label { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }
.pin-input {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 28px; font-weight: 700;
    text-align: center;
    letter-spacing: 12px;
    padding: 12px 16px;
    width: 180px;
    outline: none;
}
.pin-input:focus { border-color: var(--accent); }
.pin-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.pin-error { color: #f87171; font-size: 13px; margin-top: 8px; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none; border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); }
.btn-full { width: 100%; }
.btn-small {
    background: var(--accent);
    color: #fff;
    border: none; border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
}

.btn-new-user {
    background: transparent;
    color: var(--accent);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    width: 100%; max-width: 300px;
}
.btn-new-user:hover { border-color: var(--accent); background: rgba(107, 138, 253, 0.06); }

/* ══════════════════════════════════════
   ONBOARDING PAGE
   ══════════════════════════════════════ */
.onboard-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    min-height: 100vh;
}
.onboard-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 32px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.onboard-step h2 { font-size: 20px; margin-bottom: 4px; }
.step-desc { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.form-input:focus { border-color: var(--accent); }
.form-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; display: block; }
.form-error { color: #f87171; font-size: 13px; margin-bottom: 12px; }

.step-nav { display: flex; gap: 12px; margin-top: 24px; }
.step-nav .btn-primary { flex: 1; }
.step-nav .btn-secondary { flex: 0 0 auto; }

/* Interest grid */
.interest-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
}
.interest-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer; transition: all 0.2s;
}
.interest-chip:hover { border-color: var(--accent); }
.interest-chip.selected {
    background: rgba(107, 138, 253, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.interest-chip.custom { font-style: italic; }
.custom-interest { display: flex; gap: 8px; margin-bottom: 24px; }
.custom-interest .form-input { flex: 1; }

/* Assessment chat */
.assessment-chat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 320px;
    overflow-y: auto;
    padding: 16px;
    margin-bottom: 12px;
}
.assessment-messages { display: flex; flex-direction: column; gap: 10px; }
.assess-msg {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    max-width: 85%;
    line-height: 1.5;
}
.assess-ai {
    background: rgba(107, 138, 253, 0.12);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.assess-user {
    background: rgba(255, 255, 255, 0.08);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.assess-system { color: #f87171; font-size: 12px; align-self: center; }
.assess-ai:hover .btn-replay { opacity: 1; }

.assessment-input-area { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.assessment-input-area .btn-mic { width: 38px; height: 38px; flex-shrink: 0; }
.assessment-input-area textarea { flex: 1; min-width: 0; }
.assessment-buttons { display: flex; gap: 8px; }
.assessment-buttons .btn-primary { flex: 1; }
.btn-accent {
    background: #22c55e;
    color: #fff;
    border: none; border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
}
.btn-accent:hover { opacity: 0.9; }
.btn-accent:disabled { opacity: 0.5; }

/* Results */
.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    margin: 24px 0;
}
.result-level { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.result-score { margin-bottom: 16px; }
.score-big { font-size: 48px; font-weight: 700; }
.score-label { font-size: 18px; color: var(--text-dim); }
.result-summary { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.result-details { text-align: left; }
.result-section { margin-bottom: 16px; }
.result-section h4 { font-size: 14px; color: var(--accent); margin-bottom: 8px; }
.result-section ul { list-style: none; padding: 0; }
.result-section li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-dim);
    padding-left: 16px;
    position: relative;
}
.result-section li::before {
    content: '•';
    position: absolute; left: 0;
    color: var(--accent);
}

/* ── Mobile ── */
@media (max-width: 600px) {
    header { padding: 10px 12px; }
    header h1 { font-size: 14px; }
    .header-right { gap: 4px; }

    /* Hide desktop-only controls on mobile */
    .voice-controls { display: none !important; }
    #btn-report { display: none !important; }
    #btn-new { display: none !important; }
    #btn-logout { display: none !important; }

    /* Show mobile menu button */
    .btn-menu-toggle { display: flex !important; }

    .btn-header { font-size: 11px; padding: 5px 8px; }
    .btn-call-start { padding: 5px 10px; font-size: 12px; }
    .btn-help-trigger { width: 28px; height: 28px; font-size: 13px; }

    main { padding: 12px; }
    footer { padding: 8px 10px 14px; gap: 6px; }
    .msg { max-width: 92%; }
    .bubble { font-size: 14px; padding: 10px 13px; }

    .call-controls { gap: 20px; }
    .call-actions-incoming { gap: 36px; }

    .modal { max-height: 92vh; margin: 8px; }
    .modal-body { padding: 16px; }

    .login-container { padding: 40px 16px 30px; }
    .onboard-container { padding: 16px 16px 30px; }
    .user-badge { display: none; }

    .topic-badge {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-menu { top: 48px; right: 8px; }
}
