/* ===========================
   AI Kaiwa Coach Styles
   Rose/pink accent (#10b981)
   =========================== */

/* --- Setup Page --- */
.kaiwa-setup-container {
    max-width: 720px;
    margin: 50px auto 30px;
    padding: 0 16px;
}

.kaiwa-setup-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 28px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(36, 48, 68, 0.10);
}

.kaiwa-setup-header {
    text-align: center;
    margin-bottom: 32px;
}

.kaiwa-setup-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.kaiwa-section {
    margin-bottom: 28px;
}

.kaiwa-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

/* Mode Cards */
.kaiwa-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.kaiwa-mode-card {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 18px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kaiwa-mode-card:hover {
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
}

.kaiwa-mode-card.active {
    border-color: #10b981;
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.kaiwa-mode-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.kaiwa-mode-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 11px;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 4px;
}

.kaiwa-mode-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.kaiwa-mode-desc {
    font-size: 12px;
    color: var(--muted);
}

/* Level Pills */
.kaiwa-level-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kaiwa-level-pill {
    padding: 8px 20px;
    border-radius: 50px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.kaiwa-level-pill:hover {
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.kaiwa-level-pill.active {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
}

/* Topic Input */
.kaiwa-topic-input {
    border-radius: 14px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.7);
}

.kaiwa-topic-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Correction Style */
.kaiwa-style-options {
    display: flex;
    gap: 10px;
}

.kaiwa-style-option {
    flex: 1;
    cursor: pointer;
}

.kaiwa-style-option input[type="radio"] {
    display: none;
}

.kaiwa-style-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    border-radius: 14px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    text-align: center;
}

.kaiwa-style-option:hover .kaiwa-style-content {
    border-color: rgba(16, 185, 129, 0.3);
}

.kaiwa-style-option.active .kaiwa-style-content {
    border-color: #10b981;
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
}

.kaiwa-style-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.kaiwa-style-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.kaiwa-style-desc {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* Start Button */
.kaiwa-start-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.kaiwa-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
    color: #fff;
}

.kaiwa-outline-btn {
    background: transparent;
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.kaiwa-outline-btn:hover {
    background: rgba(16, 185, 129, 0.06);
    border-color: #10b981;
    color: #10b981;
}

/* ===========================
   Chat Session Page
   =========================== */
.kaiwa-chat-container {
    max-width: 800px;
    margin: 80px auto 20px;
    height: calc(100vh - 100px);
    padding: 0 16px;
}

.kaiwa-chat-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(16, 185, 129, 0.10);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(36, 48, 68, 0.10);
}

/* Chat Header */
.kaiwa-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.6);
}

.kaiwa-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kaiwa-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kaiwa-chat-badges {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.kaiwa-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    text-transform: uppercase;
}

.kaiwa-badge-mode {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kaiwa-badge-level {
    background: rgba(109, 190, 69, 0.1);
    color: #5aa83a;
}

.kaiwa-badge-topic {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.kaiwa-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kaiwa-header-btn {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.6);
    color: var(--text);
    transition: all 0.2s ease;
}

.kaiwa-header-btn:hover {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.kaiwa-finish-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.kaiwa-msg-counter {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

/* Messages Area */
.kaiwa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Wrappers */
.kaiwa-msg-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: kaiwaMsgIn 0.3s ease;
}

@keyframes kaiwaMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.kaiwa-msg-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
}

.kaiwa-msg-wrapper.ai {
    align-self: flex-start;
    align-items: flex-start;
}

.kaiwa-msg-wrapper.system {
    align-self: center;
    align-items: center;
    max-width: 90%;
}

/* Bubbles */
.kaiwa-msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.kaiwa-msg-wrapper.user .kaiwa-msg-bubble {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.kaiwa-msg-wrapper.ai .kaiwa-msg-bubble {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-soft, rgba(0, 0, 0, 0.06));
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.04));
}

.kaiwa-msg-wrapper.system .kaiwa-msg-bubble {
    background: rgba(99, 102, 241, 0.06);
    color: #6366f1;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    border-radius: 12px;
}

/* Japanese text */
.kaiwa-msg-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 4px;
}

/* Vietnamese translation */
.kaiwa-msg-vi {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    line-height: 1.4;
    margin-top: 4px;
}

/* Message time */
.kaiwa-msg-time {
    font-size: 11px;
    color: var(--text-disabled, #d1d5db);
    margin-top: 4px;
}

/* Correction card */
.kaiwa-correction {
    margin-top: 8px;
    background: var(--warning-bg, #fffbeb);
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.kaiwa-correction-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--warning-text, #92400e);
    user-select: none;
}

.kaiwa-correction-toggle:hover {
    background: rgba(251, 146, 60, 0.1);
}

.kaiwa-correction-body {
    padding: 0 12px 10px;
    display: none;
    font-size: 13px;
    line-height: 1.5;
}

.kaiwa-correction-body.show {
    display: block;
}

.kaiwa-correction-original {
    color: var(--danger-text, #dc2626);
    text-decoration: line-through;
    margin-bottom: 4px;
}

.kaiwa-correction-corrected {
    color: var(--success-text, #16a34a);
    font-weight: 600;
    margin-bottom: 4px;
}

.kaiwa-correction-explain {
    color: var(--text-muted, #78716c);
    font-size: 12px;
}

/* Suggestion chips */
.kaiwa-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kaiwa-suggestion-chip {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 12px;
    color: #10b981;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kaiwa-suggestion-chip:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Encouragement */
.kaiwa-encouragement {
    font-size: 12px;
    color: #f472b6;
    font-style: italic;
    margin-top: 6px;
}

/* TTS Button */
.kaiwa-tts-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.kaiwa-tts-btn:hover {
    opacity: 1;
}

/* Typing Indicator */
.kaiwa-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 10px;
}

.kaiwa-typing-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.kaiwa-typing-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-soft, rgba(0, 0, 0, 0.06));
    border-radius: 14px;
    padding: 8px 14px;
}

.kaiwa-typing-dots {
    display: flex;
    gap: 3px;
}

.kaiwa-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: kaiwaDot 1.2s infinite;
}

.kaiwa-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.kaiwa-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes kaiwaDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Hint Panel */
.kaiwa-hint-panel {
    border-top: 1px solid var(--border-soft, rgba(0, 0, 0, 0.06));
    background: var(--bg-card, rgba(255, 255, 255, 0.95));
    padding: 14px 20px;
    animation: kaiwaSlideUp 0.3s ease;
}

@keyframes kaiwaSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.kaiwa-hint-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.kaiwa-hint-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.kaiwa-hint-tier {
    background: var(--bg-card, rgba(255, 255, 255, 0.8));
    border: 1px solid var(--border-soft, rgba(0, 0, 0, 0.06));
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kaiwa-hint-tier:hover {
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.06));
}

.kaiwa-hint-tier-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.kaiwa-hint-tier-label.easy { color: #16a34a; }
.kaiwa-hint-tier-label.natural { color: #2563eb; }
.kaiwa-hint-tier-label.expanded { color: #9333ea; }

.kaiwa-hint-tier-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

.kaiwa-hint-footer {
    margin-top: 8px;
    text-align: center;
}

/* Input Area */
.kaiwa-chat-input-area {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border-soft, rgba(0, 0, 0, 0.06));
    background: var(--bg-card, rgba(255, 255, 255, 0.6));
}

.kaiwa-chat-input-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.kaiwa-chat-input {
    flex: 1;
    border: 2px solid var(--input-border, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    background: var(--input-bg, #fff);
    color: var(--input-text);
    transition: border-color 0.2s;
    font-family: 'Noto Sans JP', 'Nunito', sans-serif;
}

.kaiwa-chat-input::placeholder {
    color: var(--input-placeholder);
}

.kaiwa-chat-input:focus {
    outline: none;
    border-color: var(--accent-sakura, #10b981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.kaiwa-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.kaiwa-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.kaiwa-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.kaiwa-chat-footer-text {
    text-align: center;
    margin-top: 6px;
}

/* Completed session */
.kaiwa-chat-completed {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--border-soft, rgba(0, 0, 0, 0.06));
    background: var(--bg-card, rgba(255, 255, 255, 0.6));
}

/* ===========================
   Report Page
   =========================== */
.kaiwa-report-container {
    max-width: 700px;
    margin: 50px auto 30px;
    padding: 0 16px;
}

.kaiwa-report-card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.88));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-soft, rgba(16, 185, 129, 0.12));
    border-radius: 28px;
    padding: 40px 36px;
    box-shadow: var(--shadow-card, 0 20px 60px rgba(36, 48, 68, 0.10));
}

.kaiwa-report-header {
    text-align: center;
    margin-bottom: 32px;
}

.kaiwa-report-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* Score Circles */
.kaiwa-report-scores {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.kaiwa-score-card {
    text-align: center;
}

.kaiwa-score-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 6px;
}

.kaiwa-score-circle-large {
    width: 100px;
    height: 100px;
}

.kaiwa-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.kaiwa-score-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 3;
}

.kaiwa-score-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.kaiwa-score-grammar { stroke: #10b981; }
.kaiwa-score-fluency { stroke: #6366f1; }
.kaiwa-score-vocab { stroke: #f59e0b; }
.kaiwa-score-overall-fill { stroke: #10b981; }

.kaiwa-score-text {
    fill: var(--text);
    font-size: 10px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
    transform: rotate(90deg);
    transform-origin: center;
}

.kaiwa-score-circle-large .kaiwa-score-text {
    font-size: 12px;
}

.kaiwa-score-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

/* Report Sections */
.kaiwa-report-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-card-hover, rgba(255, 255, 255, 0.6));
    border-radius: 16px;
    border: 1px solid var(--border-soft, rgba(0, 0, 0, 0.04));
}

.kaiwa-report-section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.kaiwa-report-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

/* Mistake items */
.kaiwa-mistake-item {
    padding: 10px 14px;
    background: var(--bg-card, #fff);
    border-radius: 10px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent-sakura, #10b981);
}

.kaiwa-mistake-original {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    color: #dc2626;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.kaiwa-mistake-corrected {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    color: #16a34a;
    font-weight: 600;
    margin-bottom: 2px;
}

.kaiwa-mistake-explain {
    font-size: 12px;
    color: var(--muted);
}

/* Report Loading */
.kaiwa-report-loading {
    text-align: center;
    padding: 40px 0;
}

/* Report Actions */
.kaiwa-report-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 991px) {
    .kaiwa-setup-container,
    .kaiwa-report-container {
        margin-top: 80px;
    }

    .kaiwa-chat-container {
        margin-top: 70px;
        height: calc(100vh - 90px);
    }
}

@media (max-width: 767.98px) {
    .kaiwa-setup-card,
    .kaiwa-report-card {
        padding: 28px 20px;
        border-radius: 22px;
    }

    .kaiwa-mode-grid {
        grid-template-columns: 1fr;
    }

    .kaiwa-style-options {
        flex-direction: column;
    }

    .kaiwa-hint-body {
        grid-template-columns: 1fr;
    }

    .kaiwa-msg-wrapper {
        max-width: 90%;
    }

    .kaiwa-report-scores {
        gap: 16px;
    }

    .kaiwa-report-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .kaiwa-report-actions .btn {
        text-align: center;
    }
}

@media (max-width: 430px) {
    .kaiwa-chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .kaiwa-chat-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===========================
   Scenario Styles
   =========================== */

/* Scenario Grid */
.kaiwa-scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.kaiwa-scenario-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.7));
    border: 1px solid var(--border-soft, rgba(0, 0, 0, 0.06));
    border-radius: 16px;
    padding: 18px;
    transition: all 0.2s ease;
}

.kaiwa-scenario-card:hover {
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.06));
}

.kaiwa-scenario-header {
    margin-bottom: 10px;
}

.kaiwa-scenario-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.kaiwa-scenario-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.kaiwa-badge-ai {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kaiwa-badge-public {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.kaiwa-scenario-desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.kaiwa-scenario-roles,
.kaiwa-scenario-topic {
    margin-bottom: 6px;
}

.kaiwa-scenario-actions {
    margin-top: 10px;
}

/* Empty State */
.kaiwa-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.kaiwa-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Topic Suggestions */
.kaiwa-topic-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Preview Card */
.kaiwa-preview-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.6));
    border: 1px solid var(--border-soft, rgba(0, 0, 0, 0.04));
    border-radius: 16px;
    padding: 24px;
}

.kaiwa-preview-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.kaiwa-preview-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.kaiwa-preview-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.kaiwa-preview-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.kaiwa-preview-roles {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.kaiwa-preview-role {
    display: flex;
    flex-direction: column;
}

.kaiwa-preview-role-label {
    font-size: 11px;
    color: var(--muted);
}

.kaiwa-preview-role-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* Opening Prompt Card */
.kaiwa-opening-prompt {
    background: var(--accent-sakura-bg, linear-gradient(135deg, #fff1f2, #ffe4e6));
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    padding: 14px 18px;
}

.kaiwa-opening-prompt .kaiwa-msg-jp {
    font-size: 16px;
    color: var(--text);
}

/* Goals List */
.kaiwa-goals-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kaiwa-goals-list li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.kaiwa-goals-list li:last-child {
    border-bottom: none;
}

.kaiwa-goals-list li::before {
    content: "✓ ";
    color: #10b981;
    font-weight: 700;
}

/* Preview Tags */
.kaiwa-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kaiwa-preview-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
}

.kaiwa-preview-tag.grammar {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
}

.kaiwa-preview-tag.vocab {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}

/* Starter Replies */
.kaiwa-starter-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kaiwa-starter-reply {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
}

.kaiwa-starter-reply .kaiwa-msg-jp {
    font-size: 14px;
}

/* Scenario Info Panel (in chat) */
.kaiwa-scenario-info-panel {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.kaiwa-scenario-info-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6366f1;
}

.kaiwa-scenario-info-icon {
    font-size: 14px;
}

.kaiwa-scenario-info-text {
    flex: 1;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 767.98px) {
    .kaiwa-scenario-grid {
        grid-template-columns: 1fr;
    }

    .kaiwa-preview-roles {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===========================
   Voice Interaction Styles
   =========================== */
.kaiwa-voice-settings-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: rgba(16, 185, 129, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.kaiwa-rate-select {
    width: auto;
    display: inline-block;
    padding: 2px 24px 2px 8px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.kaiwa-mic-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.2);
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 16px;
}

.kaiwa-mic-btn:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    transform: scale(1.05);
}

.kaiwa-mic-btn.is-listening {
    border-color: #ef4444;
    background: #ffe4e6;
    animation: kaiwaMicPulse 1.5s infinite;
}

@keyframes kaiwaMicPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.kaiwa-interim-text {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid #cbd5e1;
    border-radius: 4px;
    animation: fadeIn 0.2s ease;
}

.kaiwa-voice-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.06);
    padding-top: 8px;
}

.kaiwa-voice-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    background: rgba(255, 255, 255, 0.8);
    color: #059669;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kaiwa-voice-btn:hover {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

/* ===========================
   Immersive AI Voice Call Styles
   =========================== */
.voice-call-canvas {
    position: fixed;
    top: 72px; /* height of navbar */
    left: 0;
    width: 100vw;
    height: calc(100vh - 72px);
    background: var(--gradient-body, linear-gradient(135deg, #ffeef4 0%, #eef7ff 100%));
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    z-index: 10;
}

.voice-call-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 30px 20px 40px;
}

.voice-call-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted, #4b5563);
    background: var(--bg-card, rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(8px);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.4));
    box-shadow: var(--shadow-sm, 0 4px 15px rgba(0, 0, 0, 0.03));
    margin-top: 10px;
}

.voice-call-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    max-width: 800px;
}

/* Blossom circular glow */
.blossom-glow-container {
    margin-bottom: 24px;
    position: relative;
}

.blossom-glow-circle {
    width: 100px;
    height: 100px;
    background: var(--bg-card, rgba(255, 255, 255, 0.8));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.25), inset 0 0 20px rgba(16, 185, 129, 0.1);
    border: 2px solid var(--border-soft, rgba(255, 255, 255, 0.6));
    animation: blossomPulse 3s infinite ease-in-out;
}

.blossom-glow-icon {
    font-size: 42px;
    filter: drop-shadow(0 4px 6px rgba(16, 185, 129, 0.15));
}

@keyframes blossomPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.25), inset 0 0 20px rgba(16, 185, 129, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 60px rgba(16, 185, 129, 0.45), inset 0 0 30px rgba(16, 185, 129, 0.2);
    }
}

/* Waveform container */
.waveform-container-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.waveform-canvas-box {
    width: 100%;
    height: 100%;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Volume Slider */
.volume-slider-container {
    position: absolute;
    top: -20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card, rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.4));
    box-shadow: var(--shadow-sm, 0 4px 12px rgba(0, 0, 0, 0.02));
    z-index: 15;
    transition: all 0.2s ease;
}

.volume-slider-container:hover {
    background: var(--bg-card-hover, rgba(255, 255, 255, 0.85));
}

.volume-icon {
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-card-hover, #cbd5e1);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Subtitles styling */
.subtitles-container {
    text-align: center;
    padding: 20px;
    max-width: 650px;
    background: var(--bg-card, rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.3));
    box-shadow: var(--shadow-md, 0 8px 32px rgba(16, 185, 129, 0.03));
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.subtitle-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main, #1f2937);
    line-height: 1.6;
    margin-bottom: 10px;
}

.subtitle-vi {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    line-height: 1.5;
}

/* Floating bars */
.float-bar-left, .float-bar-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 20;
}

.float-bar-left {
    left: 40px;
}

.float-bar-right {
    right: 40px;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.5));
    background: var(--bg-card, rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    color: var(--text-muted, #4b5563);
}

.float-btn:hover {
    transform: scale(1.08) translateY(-2px);
    background: var(--bg-card-hover, #ffffff);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.12);
    color: var(--accent-sakura, #10b981);
}

.float-btn.active {
    background: var(--accent-sakura-bg, linear-gradient(135deg, #fff1f2, #ffe4e6));
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-sakura, #10b981);
}

.float-btn.hangup {
    background: var(--danger-bg, linear-gradient(135deg, #fef2f2, #fee2e2));
    color: var(--danger-text, #ef4444);
    border-color: rgba(239, 68, 68, 0.2);
}

.float-btn.hangup:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.3);
}

/* Instructions */
.voice-call-instruction {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    background: var(--bg-card, rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(6px);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.2));
    letter-spacing: 0.5px;
    animation: breathe 2s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* End call button bottom right */
.voice-call-footer-right {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 20;
}

.end-call-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.end-call-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.5);
}

.end-call-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
}

/* Smart Hints Popover */
.smart-hints-overlay {
    position: absolute;
    right: 110px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    background: var(--bg-card, rgba(30, 41, 59, 0.92));
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.15));
    border-radius: 18px;
    box-shadow: var(--shadow-card, 0 20px 50px rgba(0, 0, 0, 0.3));
    padding: 16px;
    color: var(--text-main, #ffffff);
    z-index: 100;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateY(-50%) translateX(20px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.smart-hints-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
    padding-bottom: 8px;
}

.smart-hints-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 13px;
    color: #f472b6;
}

.smart-hints-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smart-hint-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.smart-hint-item:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateX(3px);
}

.smart-hint-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.4;
}

.smart-hint-vi {
    font-size: 11px;
    color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .float-bar-left {
        left: 15px;
    }
    .float-bar-right {
        right: 15px;
    }
    .subtitles-container {
        max-width: 80%;
    }
    .waveform-container-wrapper {
        max-width: 85%;
    }
    .voice-call-footer-right {
        right: 15px;
        bottom: 15px;
    }
    .smart-hints-overlay {
        right: 80px;
        width: 240px;
    }
}

/* Karaoke & Subtitle Visibility styles */
.karaoke-word {
    display: inline-block;
    transition: color 0.2s ease, transform 0.2s ease;
    color: #1f2937;
    position: relative;
    cursor: default;
}

.karaoke-word.active-word {
    color: #10b981 !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    transform: scale(1.06);
    font-weight: 700;
}

.subtitle-jp.hidden, .subtitle-vi.hidden {
    display: none !important;
    opacity: 0;
}

/* --- Scenario Card Active Selection --- */
.kaiwa-scenario-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kaiwa-scenario-card.active {
    border-color: #10b981 !important;
    box-shadow: 0 0 15px rgba(46, 91, 255, 0.3);
    transform: translateY(-2px);
}

/* --- Dark Mode Setup Page Overrides --- */
[data-theme="dark"] body {
    background: #0f131c !important;
}

[data-theme="dark"] .kaiwa-setup-card {
    background: #151b26;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .kaiwa-mode-card {
    background: #1e2530;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .kaiwa-mode-card:hover {
    border-color: rgba(46, 91, 255, 0.4);
    box-shadow: 0 8px 24px rgba(46, 91, 255, 0.15);
}

[data-theme="dark"] .kaiwa-mode-card.active {
    border-color: #10b981;
    background: linear-gradient(135deg, #1f2a3f, #25334d);
    box-shadow: 0 4px 16px rgba(46, 91, 255, 0.25);
}

[data-theme="dark"] .kaiwa-mode-jp {
    color: #4f73ff;
}

[data-theme="dark"] .kaiwa-level-pill {
    background: #1e2530;
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

[data-theme="dark"] .kaiwa-level-pill:hover {
    border-color: rgba(46, 91, 255, 0.4);
    color: #4f73ff;
}

[data-theme="dark"] .kaiwa-level-pill.active {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

[data-theme="dark"] .kaiwa-topic-input {
    background: #1e2530;
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

[data-theme="dark"] .kaiwa-topic-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(46, 91, 255, 0.15);
}

[data-theme="dark"] .kaiwa-style-content {
    background: #1e2530;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .kaiwa-style-option:hover .kaiwa-style-content {
    border-color: rgba(46, 91, 255, 0.4);
}

[data-theme="dark"] .kaiwa-style-option.active .kaiwa-style-content {
    border-color: #10b981;
    background: linear-gradient(135deg, #1f2a3f, #25334d);
}

[data-theme="dark"] .kaiwa-start-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 8px 25px rgba(46, 91, 255, 0.25);
}

[data-theme="dark"] .kaiwa-start-btn:hover {
    box-shadow: 0 12px 30px rgba(46, 91, 255, 0.4);
}

[data-theme="dark"] .kaiwa-outline-btn {
    border-color: rgba(255, 255, 255, 0.15);
    color: #94a3b8;
}

[data-theme="dark"] .kaiwa-outline-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

[data-theme="dark"] .kaiwa-scenario-card {
    background: #1e2530;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .kaiwa-scenario-card:hover {
    border-color: rgba(46, 91, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .kaiwa-scenario-card.active {
    border-color: #10b981 !important;
    box-shadow: 0 0 15px rgba(46, 91, 255, 0.3);
}

[data-theme="dark"] .kaiwa-badge-ai {
    background: rgba(46, 91, 255, 0.1);
    color: #4f73ff;
}

[data-theme="dark"] .kaiwa-badge-level {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

[data-theme="dark"] .kaiwa-badge-mode {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

/* ══════════════════════════════════════════════════════════════════════════
   EXPLICIT LIGHT & DARK MODE OVERRIDES (KAIWA PAGE)
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Light Mode ─── */
[data-theme="light"] .kaiwa-setup-card,
:root:not([data-theme="dark"]) .kaiwa-setup-card,
[data-theme="light"] .kaiwa-card,
:root:not([data-theme="dark"]) .kaiwa-card,
[data-theme="light"] .kaiwa-scenario-card,
:root:not([data-theme="dark"]) .kaiwa-scenario-card {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.09) !important;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05) !important;
}

[data-theme="light"] .kaiwa-section-title,
:root:not([data-theme="dark"]) .kaiwa-section-title,
[data-theme="light"] .kaiwa-mode-name,
:root:not([data-theme="dark"]) .kaiwa-mode-name,
[data-theme="light"] .kaiwa-card-title,
:root:not([data-theme="dark"]) .kaiwa-card-title {
    color: #0f172a !important;
}

[data-theme="light"] .kaiwa-mode-desc,
:root:not([data-theme="dark"]) .kaiwa-mode-desc,
[data-theme="light"] .kaiwa-card-desc,
:root:not([data-theme="dark"]) .kaiwa-card-desc {
    color: #475569 !important;
}

[data-theme="light"] .kaiwa-mode-card,
:root:not([data-theme="dark"]) .kaiwa-mode-card,
[data-theme="light"] .kaiwa-level-pill,
:root:not([data-theme="dark"]) .kaiwa-level-pill,
[data-theme="light"] .kaiwa-voice-card,
:root:not([data-theme="dark"]) .kaiwa-voice-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

[data-theme="light"] .kaiwa-mode-card.active,
:root:not([data-theme="dark"]) .kaiwa-mode-card.active,
[data-theme="light"] .kaiwa-level-pill.active,
:root:not([data-theme="dark"]) .kaiwa-level-pill.active,
[data-theme="light"] .kaiwa-voice-card.active,
:root:not([data-theme="dark"]) .kaiwa-voice-card.active {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #059669 !important;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] .kaiwa-setup-card,
html.dark .kaiwa-setup-card,
[data-theme="dark"] .kaiwa-card,
html.dark .kaiwa-card,
[data-theme="dark"] .kaiwa-scenario-card,
html.dark .kaiwa-scenario-card {
    background: #161d2b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .kaiwa-section-title,
html.dark .kaiwa-section-title,
[data-theme="dark"] .kaiwa-mode-name,
html.dark .kaiwa-mode-name,
[data-theme="dark"] .kaiwa-card-title,
html.dark .kaiwa-card-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .kaiwa-mode-desc,
html.dark .kaiwa-mode-desc,
[data-theme="dark"] .kaiwa-card-desc,
html.dark .kaiwa-card-desc {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .kaiwa-mode-card,
html.dark .kaiwa-mode-card,
[data-theme="dark"] .kaiwa-level-pill,
html.dark .kaiwa-level-pill,
[data-theme="dark"] .kaiwa-voice-card,
html.dark .kaiwa-voice-card {
    background: #0f1624 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .kaiwa-mode-card.active,
html.dark .kaiwa-mode-card.active,
[data-theme="dark"] .kaiwa-level-pill.active,
html.dark .kaiwa-level-pill.active,
[data-theme="dark"] .kaiwa-voice-card.active,
html.dark .kaiwa-voice-card.active {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   KAIWA VOICE SESSION — Modern Interactive Layout (Screenshot Match)
   ══════════════════════════════════════════════════════════════════════════ */
.kaiwa-voice-session-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 32px 24px 48px;
    background: #0f172a;
    color: #f8fafc;
    overflow: hidden;
}

[data-theme="light"] .kaiwa-voice-session-container,
:root:not([data-theme="dark"]) .kaiwa-voice-session-container {
    background: #f8fafc !important;
    color: #0f172a !important;
}

/* Top Pill Badge */
.kaiwa-top-pill-badge {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    padding: 8px 24px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .kaiwa-top-pill-badge,
:root:not([data-theme="dark"]) .kaiwa-top-pill-badge {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: #334155 !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

/* Main Layout with Side Toolbars */
.kaiwa-voice-main-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
    max-width: 1080px;
    margin: auto 0;
}

/* Stage */
.kaiwa-voice-center-stage {
    flex: 1;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* Floating Controls Left & Right */
.kaiwa-floating-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    z-index: 10;
}

.kaiwa-ctrl-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
}
.kaiwa-ctrl-btn:hover {
    transform: scale(1.12);
    border-color: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}
.kaiwa-ctrl-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.45);
}
.kaiwa-ctrl-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="light"] .kaiwa-ctrl-btn,
:root:not([data-theme="dark"]) .kaiwa-ctrl-btn {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

/* Center Avatar Glow */
.kaiwa-avatar-pulse-circle {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(244, 114, 182, 0.15);
    border: 2px solid rgba(244, 114, 182, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 32px rgba(244, 114, 182, 0.3);
    animation: avatarGlowPulse 3s infinite ease-in-out;
    margin-bottom: 4px;
}
@keyframes avatarGlowPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(244, 114, 182, 0.25); }
    50% { transform: scale(1.08); box-shadow: 0 0 42px rgba(244, 114, 182, 0.45); }
}
.kaiwa-avatar-inner {
    font-size: 2.2rem;
}

/* Waveform Card */
.kaiwa-waveform-card {
    position: relative;
    width: 100%;
    height: 115px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    backdrop-filter: blur(12px);
}
[data-theme="light"] .kaiwa-waveform-card,
:root:not([data-theme="dark"]) .kaiwa-waveform-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.09) !important;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.04) !important;
}
.kaiwa-waveform-svg {
    width: 100%;
    height: 52px;
}
.kaiwa-volume-widget {
    position: absolute;
    top: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.kaiwa-volume-slider {
    width: 75px;
    height: 4px;
    accent-color: #ec4899;
    cursor: pointer;
}

/* Main Speech Card */
.kaiwa-main-speech-card {
    width: 100%;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px 36px;
    text-align: center;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
}
[data-theme="light"] .kaiwa-main-speech-card,
:root:not([data-theme="dark"]) .kaiwa-main-speech-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.09) !important;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06) !important;
}
.kaiwa-speech-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.6;
    color: #f8fafc;
    margin: 0 0 12px;
}
[data-theme="light"] .kaiwa-speech-jp,
:root:not([data-theme="dark"]) .kaiwa-speech-jp {
    color: #0f172a !important;
}
.kaiwa-speech-vi {
    font-size: 0.96rem;
    color: #cbd5e1;
    margin: 0;
}
[data-theme="light"] .kaiwa-speech-vi,
:root:not([data-theme="dark"]) .kaiwa-speech-vi {
    color: #64748b !important;
}

/* Bottom Controls Bar */
.kaiwa-bottom-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
}
.kaiwa-hint-pill {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #cbd5e1;
}
[data-theme="light"] .kaiwa-hint-pill,
:root:not([data-theme="dark"]) .kaiwa-hint-pill {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: #475569 !important;
}
.kaiwa-finish-report-btn {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 12px 26px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.35);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.kaiwa-finish-report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(236, 72, 153, 0.5);
}

/* Text Input Drawer in Kaiwa Session */
.kaiwa-text-input-field {
    background: rgba(30, 41, 59, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.kaiwa-text-input-field::placeholder {
    color: #94a3b8;
}
.kaiwa-text-input-field:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.35);
}

.kaiwa-text-send-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.kaiwa-text-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* Light Mode Overrides for Kaiwa Text Input */
[data-theme="light"] .kaiwa-text-input-field,
:root:not([data-theme="dark"]) .kaiwa-text-input-field {
    background: #ffffff !important;
    border: 1.5px solid rgba(15, 23, 42, 0.18) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}
[data-theme="light"] .kaiwa-text-input-field::placeholder,
:root:not([data-theme="dark"]) .kaiwa-text-input-field::placeholder {
    color: #64748b !important;
}
