/* ══════════════════════════════════════════════════════════════
   Voice Chat — Dark Theme Styles
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #000000;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-dim: #6e6e73;
    --accent: #10a37f;
    --accent-hover: #1a7f64;
    --btn-bg: #ffffff;
    --btn-text: #000000;
    --danger: #ff3b30;
    --orb-color-1: #4a9eff;
    --orb-color-2: #6eb5ff;
    --orb-color-3: #93caff;
    --orb-color-4: #b8dfff;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

#screen-welcome {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    padding: 0;
}

/* ── Screen System ────────────────────────────────────────── */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding: 20px;
    opacity: 0;
}

.screen.active {
    visibility: visible;
    opacity: 1;
}

.screen-content {
    position: relative;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 60px 0 40px;
}

.screen-content-scrollable {
    height: auto;
    min-height: 100%;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.screen-content.center {
    align-items: center;
    text-align: center;
    justify-content: center;
}

.ready-screen-content {
    max-width: 860px;
}

#screen-ready {
    justify-content: center;
    overflow: hidden;
}

#screen-ready .ready-screen-content {
    height: 100%;
    min-height: 0;
    justify-content: space-between;
    padding: 10px 0 max(12px, env(safe-area-inset-bottom));
}

#screen-ready #btn-start {
    margin-top: 4px;
}

/* ── Screen 1: Welcome ────────────────────────────────────── */
.welcome-title {
    font-size: 32px;
        text-align: center;
    line-height: 1.2;
    margin-bottom: 36px;
}

.features {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.feature-icon {
    font-size: 20px;
    width: 32px;
    flex-shrink: 0;
    text-align: center;
    margin-top: 2px;
}

.feature h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.disclaimer {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    margin: 24px 0;
}

/* ── Landing Page ─────────────────────────────────────────── */
.landing-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.landing-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.lang-globe {
    flex-shrink: 0;
    opacity: 0.8;
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-label {
    font-size: 13px;
    letter-spacing: 1px;
}

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 28px 20px 48px;
    min-height: calc(100% - 56px);
}

.landing-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.landing-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 36px;
}

/* ── Scenario Cards (Landing Page) ───────────────────────── */
.scenario-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 480px;
}

.scenario-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 16px 22px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.scenario-card:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.scenario-card:active {
    transform: translateY(0);
}

.scenario-card.active {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.15);
}

.scenario-card-icon {
    font-size: 36px;
    line-height: 1;
}

.scenario-card-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.scenario-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 480px) {
    .landing-title {
        font-size: 22px;
    }
    .scenario-card {
        padding: 20px 10px 16px;
        gap: 6px;
    }
    .scenario-card-name {
        font-size: 14px;
    }
    .scenario-card-desc {
        font-size: 11px;
    }
}

@media (max-width: 320px) {
    .scenario-cards {
        grid-template-columns: 1fr;
        max-width: 260px;
    }
}

.scenario-alert {
    color: #f87171;
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
    animation: scenario-alert-shake 0.4s ease;
}

@keyframes scenario-alert-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ── Scenario Header Bar (Chat Screen) ───────────────────── */
.scenario-header-bar {
    text-align: center;
    padding: 8px 16px;
    margin-bottom: 4px;
}

.scenario-header-name {
    font-size: 18px;
    font-weight: 700;
    color: #4ade80;
    letter-spacing: 0.5px;
}

/* ── Scenario Badge (Ready Screen) ─────────────────────── */
.ready-scenario-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.35);
    margin-bottom: 8px;
}

.ready-scenario-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.ready-scenario-name {
    font-size: 13px;
    color: #4ade80;
    font-weight: 600;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-text);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: auto;
}

.btn-primary:hover {
    background: #e5e5e5;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    cursor: wait;
    background: #c8c8c8;
    color: #555;
}

/* ── Bootstrap Lazy Loading Overlay ──────────────────────── */
.bootstrap-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1200;
}

.bootstrap-loading.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bootstrap-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-radius: 14px;
    background: rgba(10, 10, 10, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.16);
    min-width: 220px;
}

.bootstrap-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.24);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: bootstrapSpin 0.9s linear infinite;
}

.bootstrap-loading-text {
    font-size: 14px;
    color: var(--text-primary);
    text-align: center;
}

@keyframes bootstrapSpin {
    to { transform: rotate(360deg); }
}

/* ── Screen 2: Voice Selection ────────────────────────────── */
.ready-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 48px;
}

.voice-avatar {
    margin-bottom: 24px;
}

.small-orb {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, var(--orb-color-1), var(--orb-color-2), var(--orb-color-3));
    position: relative;
    animation: floatOrb 4s ease-in-out infinite;
}

.orb-inner {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent 60%);
}

@keyframes floatOrb {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.voice-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
}

.voice-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.voice-slider {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 820px;
    margin-bottom: 14px;
    gap: 10px;
}

.voice-nav {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.voice-track-wrap {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 14px;
    touch-action: pan-x;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.voice-track-wrap::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.voice-track {
    display: flex;
    gap: 10px;
    padding: 2px;
}

.voice-card {
    flex: 0 0 clamp(150px, 28vw, 220px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 10px;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.voice-card.active {
    background: rgba(128, 128, 128, 0.28);
    border-color: rgba(210, 210, 210, 0.55);
}

@media (max-width: 640px) {
    .ready-screen-content {
        width: 100%;
        max-width: 420px;
    }

    .ready-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .small-orb {
        width: 88px;
        height: 88px;
    }

    .voice-avatar {
        margin-bottom: 12px;
    }

    .voice-name {
        font-size: 20px;
    }

    .voice-desc {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .voice-slider {
        margin-bottom: 10px;
        gap: 8px;
    }

    .voice-card {
        flex: 0 0 clamp(98px, 38vw, 132px);
        padding: 6px 8px;
        min-height: 40px;
    }

    .voice-card-title {
        font-size: 10px;
    }

    .provider-picker {
        margin-bottom: 14px;
    }

    .selection-row .provider-btn {
        max-width: 126px;
    }

    .voice-dots {
        margin-bottom: 14px;
    }

    .mic-permission-hint {
        margin: -8px 0 10px;
        min-height: 34px;
        font-size: 12px;
    }

    #btn-start {
        position: static;
        margin-top: 6px;
    }
}

@media (max-height: 760px) {
    #screen-ready .ready-screen-content {
        max-width: 640px;
        padding-top: 4px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        gap: 4px;
    }

    .ready-title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .small-orb {
        width: 76px;
        height: 76px;
    }

    .voice-avatar {
        margin-bottom: 6px;
    }

    .voice-name {
        font-size: 18px;
    }

    .voice-desc {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .voice-slider {
        margin-bottom: 6px;
    }

    .voice-card {
        flex: 0 0 clamp(92px, 30vw, 120px);
        padding: 5px 7px;
        min-height: 36px;
    }

    .provider-picker {
        gap: 8px;
        margin-bottom: 10px;
    }

    .provider-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .selection-row .provider-btn {
        max-width: 108px;
    }

    .selection-label {
        font-size: 12px;
        margin: -4px 0 6px;
    }

    .voice-personality-row {
        margin-bottom: 10px;
    }

    .voice-dots {
        margin-bottom: 8px;
    }

    .mic-permission-hint {
        font-size: 11px;
        min-height: 24px;
        margin: -2px 0 2px;
        line-height: 1.25;
    }

    .ready-loading {
        margin: 0 0 8px;
        font-size: 12px;
    }

    .btn-primary {
        padding: 12px 18px;
        font-size: 15px;
        margin-top: 2px;
    }
}

@media (max-height: 700px) {
    .voice-name,
    .voice-desc {
        display: none;
    }

    .tts-buffer-panel {
        display: none !important;
    }

    .timeline-log,
    .log-sync-dot {
        display: none;
    }
}

@media (max-height: 860px), (max-width: 430px) {
    .ready-title {
        display: none;
    }

    .tts-buffer-panel {
        display: none !important;
    }

    .timeline-log {
        bottom: 132px;
        height: 96px;
    }

    .log-sync-dot {
        bottom: 116px;
    }
}

.voice-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-card-subtitle {
    display: none;
}

.voice-personality-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.voice-personality-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.voice-personality-select {
    flex: 1;
    max-width: 190px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
}

.voice-personality-row.hidden {
    display: none;
}

.provider-picker {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    width: 100%;
    flex-wrap: wrap;
}

.selection-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}

.selection-row .selection-label {
    width: auto;
    min-width: 28px;
    margin: 6px 0 0;
    flex-shrink: 0;
}

.selection-row .provider-picker {
    flex: 1;
    margin-bottom: 6px;
}

.selection-row .provider-btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selection-label {
    width: 100%;
    font-size: 13px;
    color: var(--text-secondary);
    margin: -8px 0 8px;
}

.stt-engine-row {
    margin-bottom: 8px;
}

.provider-btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-btn.active {
    background: var(--text-primary);
    color: var(--btn-text);
    border-color: var(--text-primary);
}

.llm-provider-select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    background-color: #ffffff;
    color: #111111;
    padding: 7px 36px 7px 12px;
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease;
    background-image:
        linear-gradient(45deg, transparent 50%, #111111 50%),
        linear-gradient(135deg, #111111 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.llm-provider-select:hover {
    border-color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.llm-provider-select:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
    background-image:
        linear-gradient(45deg, transparent 50%, #111111 50%),
        linear-gradient(135deg, #111111 50%, transparent 50%);
}

.llm-provider-select option {
    color: #111;
}

.mic-denoise-panel {
    width: 100%;
    display: none;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: -12px 0 16px;
    color: var(--text-secondary);
    font-size: 12px;
}

.mic-denoise-panel.active {
    display: flex;
}

.mic-denoise-panel label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mic-denoise-panel input[type="checkbox"] {
    accent-color: var(--accent);
}

.mic-denoise-panel select {
    max-width: 190px;
}

/* ── Adaptive Rate Panel ──────────────────────────────────── */
.adaptive-rate-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.adaptive-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.adaptive-checkbox-label:hover {
    color: var(--text-primary);
}

.adaptive-checkbox-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

.adaptive-checkbox-label span {
    flex: 1;
}

.tts-speed-btn {
    min-width: 100px;
}

.voice-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
}

.mic-permission-hint {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.45;
    margin: -20px 0 14px;
    min-height: 40px;
    transition: color 0.2s ease;
}

.mic-permission-hint.warn {
    color: #ffb340;
}

.mic-permission-hint.ok {
    color: var(--accent);
}

.ready-loading {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: -6px 0 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

.ready-loading.active {
    display: flex;
}

.ready-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: readyLoadingSpin 0.9s linear infinite;
}

@keyframes readyLoadingSpin {
    to { transform: rotate(360deg); }
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.3s;
}

.dot.active {
    background: var(--text-primary);
}

/* ── Screen 3: Active Chat ────────────────────────────────── */
.chat-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.status-text {
    position: absolute;
    top: 42px;
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    min-height: 24px;
    transition: opacity 0.3s;
}

.chat-meta-grid {
    position: absolute;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    width: min(860px, calc(100% - 24px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.chat-model-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.model-name {
    position: static;
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    min-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.tts-info {
    position: static;
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    min-height: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.noise-cancel-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.noise-cancel-indicator {
    position: static;
    font-size: 11px;
    line-height: 1;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 4px 10px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.04);
    width: auto;
}

.noise-cancel-mode {
    font-size: 11px;
    line-height: 1;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 4px 10px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    width: auto;
}

.noise-cancel-indicator.ok {
    color: #8ff0b7;
    border-color: rgba(80, 220, 140, 0.75);
    background: rgba(46, 164, 79, 0.16);
}

.noise-cancel-indicator.bad {
    color: #ff9a9a;
    border-color: rgba(230, 85, 85, 0.7);
    background: rgba(185, 45, 45, 0.2);
}

.noise-cancel-metrics {
    position: static;
    font-size: 10px;
    color: var(--text-dim);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.noise-cancel-metric-grid {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    max-width: 100%;
    font-size: 10px;
    color: var(--text-dim);
}

.noise-cancel-metric-item {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.session-id {
    position: static;
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
    opacity: 0.85;
    min-height: 14px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.interrupt-mode-indicator {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 126px;
    min-height: 32px;
    font-size: 11px;
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    padding: 4px 10px;
    line-height: 1;
    opacity: 1;
    transform: scale(1);
    cursor: default;
    pointer-events: none;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.interrupt-mode-indicator.listening {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
    opacity: 1;
    transform: scale(1);
}

.interrupt-mode-indicator.active {
    color: var(--accent);
    border-color: rgba(16, 163, 127, 0.45);
    background: rgba(16, 163, 127, 0.14);
    opacity: 1;
    transform: scale(1.04);
}

.timeline-log {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 146px;
    height: 110px;
    min-height: 70px;
    max-height: 45vh;
    overflow-y: auto;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(26, 26, 26, 0.88);
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 1;
}

.log-sync-dot {
    position: absolute;
    right: 16px;
    bottom: 130px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.log-sync-dot.sending {
    background: var(--accent);
    transform: scale(1.15);
}

.timeline-log .log-row {
    display: block;
    white-space: normal;
    word-break: break-word;
}

.timeline-log .log-time {
    color: var(--text-dim);
    margin-right: 8px;
}

.timeline-log .log-elapsed {
    color: var(--accent);
}

.timeline-log .log-count {
    color: var(--text-dim);
}

.timeline-log::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

/* ── Voice Orb (4 circles) ────────────────────────────────── */
.orb-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.voice-orb {
    display: flex;
    gap: 12px;
    align-items: center;
}

.orb-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ── Orb Animation States ─────────────────────────────────── */

/* Idle — static */
.voice-orb.idle .orb-circle {
    animation: none;
    transform: scale(1);
    opacity: 0.6;
}

/* Listening — gentle pulse */
.voice-orb.listening .c1 { animation: listenPulse 1.2s ease-in-out infinite 0s; }
.voice-orb.listening .c2 { animation: listenPulse 1.2s ease-in-out infinite 0.15s; }
.voice-orb.listening .c3 { animation: listenPulse 1.2s ease-in-out infinite 0.3s; }
.voice-orb.listening .c4 { animation: listenPulse 1.2s ease-in-out infinite 0.45s; }

@keyframes listenPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.25); opacity: 1; }
}

/* Thinking — rotating bounce */
.voice-orb.thinking .c1 { animation: thinkBounce 0.8s ease-in-out infinite 0s; }
.voice-orb.thinking .c2 { animation: thinkBounce 0.8s ease-in-out infinite 0.1s; }
.voice-orb.thinking .c3 { animation: thinkBounce 0.8s ease-in-out infinite 0.2s; }
.voice-orb.thinking .c4 { animation: thinkBounce 0.8s ease-in-out infinite 0.3s; }

@keyframes thinkBounce {
    0%, 100% { transform: translateY(0) scale(0.85); opacity: 0.5; }
    50% { transform: translateY(-20px) scale(1.1); opacity: 1; }
}

/* Speaking — expanding wave */
.voice-orb.speaking .c1 { animation: speakWave 0.9s ease-in-out infinite 0s; }
.voice-orb.speaking .c2 { animation: speakWave 0.9s ease-in-out infinite 0.12s; }
.voice-orb.speaking .c3 { animation: speakWave 0.9s ease-in-out infinite 0.24s; }
.voice-orb.speaking .c4 { animation: speakWave 0.9s ease-in-out infinite 0.36s; }

@keyframes speakWave {
    0%, 100% { transform: scaleY(1) scaleX(1); opacity: 0.8; }
    25% { transform: scaleY(1.5) scaleX(0.9); opacity: 1; }
    50% { transform: scaleY(0.7) scaleX(1.15); opacity: 0.9; }
    75% { transform: scaleY(1.3) scaleX(0.95); opacity: 1; }
}

/* ── Thinking Blob Animation ──────────────────────────────── */
.thinking-blob {
    width: 120px;
    height: 120px;
    position: relative;
    animation: blobFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(129,236,255,0.35));
}

.thinking-blob svg {
    width: 100%;
    height: 100%;
}

.thinking-dots {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(129,236,255,0.7);
    animation: dotBounce 1.4s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes blobFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ── Loading Spinner ─────────────────────────────────────── */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(129,236,255,0.15);
    border-top-color: rgba(129,236,255,0.8);
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
}

.loading-status {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.5px;
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

/* ── Demo Timer ───────────────────────────────────────────── */
.demo-timer {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.9;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.demo-timer.warning {
    color: #ff6b6b;
    opacity: 1;
    font-weight: 700;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Transcript ───────────────────────────────────────────── */
.transcript {
    position: absolute;
    top: 244px;
    left: 20px;
    right: 20px;
    text-align: center;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
    max-height: 52px;
    overflow: hidden;
    transition: opacity 0.3s;
}

@media (max-width: 480px) {
    .transcript {
        top: auto;
        bottom: 150px;
        max-height: 130px;
        overflow-y: auto;
        font-size: 12px;
    }
    .orb-container {
        margin-top: -100px;
    }
    .chat-controls {
        bottom: 24px;
    }
}

/* ── TTS Buffer Visualization ─────────────────────────────── */
.tts-buffer-panel {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 300px;
    max-height: 148px;
    min-height: 148px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    z-index: 2;
}

.tts-buffer-panel.active {
    display: flex;
}

.tts-buffer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tts-buffer-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    font-weight: 600;
}

.tts-buffer-stats {
    font-size: 10px;
    color: var(--text-dim);
    font-family: monospace;
}

.tts-buffer-incoming {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
    min-height: 0;
    word-break: break-word;
    line-height: 1.4;
    transition: opacity 0.2s;
}

.tts-buffer-incoming:empty {
    display: none;
}

.tts-buffer-segments {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 88px;
    overflow-y: auto;
    scrollbar-width: none;
}

.tts-buf-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
    transition: background 0.3s, border-color 0.3s, opacity 0.4s;
    border: 1px solid transparent;
}

.tts-buf-item .buf-indicator {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background 0.3s, box-shadow 0.3s;
}

.tts-buf-item .buf-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tts-buf-item .buf-status {
    flex-shrink: 0;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    opacity: 0.7;
}

/* Buffer item states */
.tts-buf-item.waiting {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.tts-buf-item.waiting .buf-indicator {
    background: rgba(255, 255, 255, 0.3);
}

.tts-buf-item.waiting .buf-status {
    color: var(--text-dim);
}

.tts-buf-item.speaking {
    background: rgba(99, 179, 237, 0.12);
    border-color: rgba(99, 179, 237, 0.35);
    color: var(--text-primary);
}

.tts-buf-item.speaking .buf-indicator {
    background: #63b3ed;
    box-shadow: 0 0 6px rgba(99, 179, 237, 0.6);
    animation: bufPulse 1s ease-in-out infinite;
}

.tts-buf-item.speaking .buf-status {
    color: #63b3ed;
}

.tts-buf-item.done {
    background: rgba(72, 187, 120, 0.08);
    border-color: rgba(72, 187, 120, 0.2);
    color: var(--text-dim);
    opacity: 0.6;
}

.tts-buf-item.done .buf-indicator {
    background: #48bb78;
}

.tts-buf-item.done .buf-status {
    color: #48bb78;
}

@keyframes bufPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

/* ── Chat Controls ────────────────────────────────────────── */
.chat-controls {
    position: absolute;
    bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 4;
}

.btn-mic {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: var(--text-primary);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.3s;
}

.btn-mic:hover {
    background: #e0e0e0;
}

.btn-mic:active {
    transform: scale(0.92);
}

.btn-mic.active {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 0 6px rgba(255, 59, 48, 0.25);
}

.btn-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-close:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}

/* ── Mute Mic Button ──────────────────────────────────────── */
.btn-mute {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-mute:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
}

.btn-mute.muted {
    background: rgba(255, 59, 48, 0.2);
    border-color: var(--danger);
    color: var(--danger);
}

/* ── TTS Volume Slider (mobile) ───────────────────────────── */
.tts-volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.07);
    border-radius: 24px;
    margin: 0 auto 12px;
    max-width: 320px;
    width: 90%;
}

.tts-volume-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.tts-volume-row input[type="range"] {
    flex: 1;
    height: 4px;
    accent-color: var(--accent, #64b5f6);
    cursor: pointer;
}

.tts-volume-value {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    width: 38px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Mic Permission Toast ─────────────────────────────────── */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Booking PDF Download Button ──────────────────────────── */
.booking-pdf-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: pdfSlideIn 0.4s ease-out;
}

.booking-pdf-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.booking-pdf-download:active {
    transform: translateY(0);
}

@keyframes pdfSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .welcome-title { font-size: 26px; }
    .orb-circle { width: 40px; height: 40px; }
    .voice-orb { gap: 8px; }
}

@media (min-width: 768px) {
    .orb-circle { width: 56px; height: 56px; }
    .voice-orb { gap: 16px; }
}

/* ══════════════════════════════════════════════════════════════
   Speaker Enrollment & Verification Styles
   ══════════════════════════════════════════════════════════════ */

/* ── Back Button ───────────────────────────────────────────── */
.btn-back {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    color: var(--text-secondary, #8b8b8b);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    z-index: 10;
}
.btn-back:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary, #fff);
}

/* ── Speaker Selection Screen ─────────────────────────────── */
.speaker-select-content {
    gap: 16px;
    padding-top: 40px !important;
    padding-bottom: 24px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.speaker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 8px auto 0;
}

.speaker-card {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}
.speaker-card:hover {
    border-color: var(--accent);
    background: rgba(74, 158, 255, 0.08);
}

.speaker-card-select {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    flex: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
    min-width: 0;
}

.speaker-card-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    margin-right: 8px;
}
.speaker-card-delete:hover {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

.speaker-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6dd5ed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}

.speaker-card-info {
    flex: 1;
    text-align: left;
}
.speaker-card-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}
.speaker-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-register-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 14px;
    border: 2px dashed rgba(255,255,255,0.25);
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}
.btn-register-new:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Enrollment Screen ────────────────────────────────────── */
.enroll-screen-content {
    gap: 12px;
    padding-top: 40px !important;
    padding-bottom: 24px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: auto;
    min-height: 100%;
}

.enroll-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0;
}

.enroll-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
}

/* ── Enrollment Orb ───────────────────────────────────────── */
.enroll-orb-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4px 0;
}

.enroll-orb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enroll-orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(74, 158, 255, 0.3);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.enroll-orb-core {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #4a9eff, #1a5cbf);
    transition: transform 0.15s, background 0.3s;
}

.enroll-volume-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color 0.1s, transform 0.1s;
    pointer-events: none;
}

.enroll-orb.recording .enroll-orb-ring {
    border-color: rgba(255, 59, 48, 0.6);
    box-shadow: 0 0 30px rgba(255, 59, 48, 0.2);
}

.enroll-orb.recording .enroll-orb-core {
    background: radial-gradient(circle at 40% 40%, #ff6b5a, #d32f2f);
    animation: enroll-pulse 1.5s ease-in-out infinite;
}

.enroll-orb.recording .enroll-volume-ring {
    border-color: rgba(255, 59, 48, 0.4);
}

.enroll-orb.success .enroll-orb-ring {
    border-color: rgba(16, 163, 127, 0.6);
    box-shadow: 0 0 30px rgba(16, 163, 127, 0.3);
}

.enroll-orb.success .enroll-orb-core {
    background: radial-gradient(circle at 40% 40%, #34d399, #10a37f);
}

.enroll-orb.error .enroll-orb-ring {
    border-color: rgba(255, 59, 48, 0.6);
}

.enroll-orb.error .enroll-orb-core {
    background: radial-gradient(circle at 40% 40%, #ff6b5a, #d32f2f);
}

@keyframes enroll-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ── Progress Steps ───────────────────────────────────────── */
.enroll-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0;
}

.enroll-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
    transition: color 0.3s;
}

.enroll-step.active {
    color: var(--orb-color-1);
}

.enroll-step.done {
    color: var(--accent);
}

.enroll-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--text-dim);
    transition: border-color 0.3s, background 0.3s;
}

.enroll-step.active .enroll-step-dot {
    border-color: var(--orb-color-1);
    background: var(--orb-color-1);
    box-shadow: 0 0 8px rgba(74, 158, 255, 0.5);
}

.enroll-step.done .enroll-step-dot {
    border-color: var(--accent);
    background: var(--accent);
}

.enroll-step-line {
    width: 40px;
    height: 2px;
    background: var(--text-dim);
    margin-bottom: 18px;
    transition: background 0.3s;
}

.enroll-step-line.done {
    background: var(--accent);
}

/* ── Prompt / Sentence ────────────────────────────────────── */
.enroll-prompt {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px 20px;
    width: 100%;
    text-align: center;
}

.enroll-sentence {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
    min-height: 32px;
}

.enroll-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ── Status ───────────────────────────────────────────────── */
.enroll-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.enroll-status-text {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.enroll-status-text.recording {
    color: var(--danger);
}

.enroll-status-text.success {
    color: var(--accent);
}

.enroll-timer {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--danger);
}

/* ── Record Button ────────────────────────────────────────── */
.btn-enroll-record {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: var(--orb-color-1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(74, 158, 255, 0.3);
    flex-shrink: 0;
}

.btn-enroll-record:hover {
    background: #3a8ee8;
    box-shadow: 0 4px 24px rgba(74, 158, 255, 0.4);
}

.btn-enroll-record:active {
    transform: scale(0.95);
}

.btn-enroll-record.recording {
    background: var(--danger);
    box-shadow: 0 4px 20px rgba(255, 59, 48, 0.4);
    animation: record-btn-pulse 1.5s ease-in-out infinite;
}

.btn-enroll-record:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    animation: none;
}

@keyframes record-btn-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 59, 48, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(255, 59, 48, 0.6); }
}

/* ── STT Transcript ───────────────────────────────────────── */
.enroll-transcript-section {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 14px;
    text-align: center;
    min-height: 40px;
}

.enroll-transcript-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enroll-transcript-text {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 22px;
}

.enroll-transcript-text.listening {
    color: var(--orb-color-2);
}

/* ── Review Section (playback / confirm / re-record) ──────── */
.enroll-review-section {
    width: 100%;
}

.enroll-review-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-enroll-review {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 18px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
    min-width: 80px;
}

.btn-enroll-review:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-enroll-review:active {
    transform: scale(0.96);
}

.btn-enroll-review.confirm {
    border-color: rgba(16, 163, 127, 0.3);
    color: var(--accent);
}

.btn-enroll-review.confirm:hover {
    background: rgba(16, 163, 127, 0.1);
    border-color: var(--accent);
}

.btn-enroll-review.rerecord {
    border-color: rgba(255, 165, 0, 0.3);
    color: #ffa500;
}

.btn-enroll-review.rerecord:hover {
    background: rgba(255, 165, 0, 0.1);
    border-color: #ffa500;
}

.btn-enroll-review.playing {
    border-color: var(--orb-color-1);
    color: var(--orb-color-1);
    background: rgba(74, 158, 255, 0.1);
}

/* ── Name Input ───────────────────────────────────────────── */
.enroll-name-section {
    width: 100%;
    text-align: center;
}

.enroll-name-label {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.enroll-name-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.enroll-name-input:focus {
    border-color: var(--orb-color-1);
}

.enroll-name-input::placeholder {
    color: var(--text-dim);
}

/* ── Gender Toggle ────────────────────────────────────────── */
.enroll-gender-toggle {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 12px 0;
}

.enroll-gender-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.enroll-gender-btn.active {
    border-color: var(--orb-color-1);
    background: rgba(52, 199, 89, 0.12);
    color: var(--text-primary);
    font-weight: 600;
}

.btn-enroll-start {
    margin-top: 8px;
    width: 100%;
}

#enroll-recording-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* ── Action Buttons ───────────────────────────────────────── */
.enroll-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.btn-enroll-skip {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s;
}

.btn-enroll-skip:hover {
    color: var(--text-primary);
}

.btn-enroll-link {
    background: none;
    border: none;
    color: var(--orb-color-1);
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Re-enroll Section ────────────────────────────────────── */
.enroll-reenroll-section {
    text-align: center;
    margin-top: 8px;
}

.enroll-existing-name {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 4px;
}

/* ══════════════════════════════════════════════════════════════
   Verification Screen
   ══════════════════════════════════════════════════════════════ */
.verify-screen-content {
    gap: 20px;
    padding-top: 60px !important;
}

.verify-orb {
    margin: 0 auto;
}

.verify-title {
    font-size: 24px;
    font-weight: 700;
}

.verify-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.verify-result {
    width: 100%;
    text-align: center;
}

.verify-score-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 8px;
}

.verify-score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s;
    width: 0;
}

.verify-score-fill.pass {
    background: linear-gradient(90deg, #10a37f, #34d399);
}

.verify-score-fill.fail {
    background: linear-gradient(90deg, #d32f2f, #ff6b5a);
}

.verify-score-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.verify-score-text.pass {
    color: var(--accent);
}

.verify-score-text.fail {
    color: var(--danger);
}

/* ── Mobile adjustments for enrollment ────────────────────── */
@media (max-width: 480px) {
    .enroll-title { font-size: 24px; }
    .enroll-orb { width: 100px; height: 100px; }
    .enroll-orb-core { width: 64px; height: 64px; }
    .enroll-prompt { padding: 12px 16px; }
    .enroll-sentence { font-size: 16px; }
    .btn-enroll-record { width: 64px; height: 64px; }
}
