/* ==========================================================================
   AI MOCK INTERVIEW SIMULATOR - TIẾNG HÀN THEO CHỦ ĐỀ
   Dual-Theme System (Light Mode & Dark Mode High Contrast)
   Không lỗi nền xám bẩn - Phối màu sắc nét, chuyên nghiệp, tương thích 100%
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. HERO LAUNCHER BANNER & TAB BUTTON IN DECKS VIEW
   -------------------------------------------------------------------------- */
.hw-deck-book-banner-slot {
    width: 100%;
    margin-bottom: 22px;
}

.hw-deck-book-banner-slot.hw-hidden {
    display: none !important;
}

/* Banner container */
.hw-interview-launcher-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    grid-column: 1 / -1;
    border-radius: 20px;
    padding: 22px 26px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Banner: Light Mode (Default) */
html:not(.dark) .hw-interview-launcher-banner {
    background: linear-gradient(135deg, #3730a3 0%, #4f46e5 50%, #4338ca 100%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 30px -5px rgba(67, 56, 202, 0.35), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Banner: Dark Mode */
html.dark .hw-interview-launcher-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #1e1b4b 100%);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(79, 70, 229, 0.2);
}

.hw-interview-launcher-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.hw-launcher-content {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.hw-launcher-icon {
    font-size: 34px;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hw-launcher-text {
    min-width: 0;
}

.hw-launcher-text h3 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    letter-spacing: -0.2px;
}

.hw-launcher-badge {
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    background: #fef08a;
    color: #854d0e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.hw-launcher-text p {
    margin: 0;
    font-size: 13.5px;
    color: #e0e7ff !important;
    line-height: 1.45;
}

.hw-launcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 14px;
    border: none;
    background: #ffffff;
    color: #3730a3;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.hw-launcher-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.26);
    background: #f8fafc;
    color: #312e81;
}

/* Header Tab Button styling */
#view-decks .hw-deck-module-tabs button.hw-interview-sim-tab-btn {
    color: #4f46e5;
    font-weight: 700;
}

#view-decks .hw-deck-module-tabs button.hw-interview-sim-tab-btn:hover {
    color: #3730a3;
    background: rgba(79, 70, 229, 0.08);
}

html.dark #view-decks .hw-deck-module-tabs button.hw-interview-sim-tab-btn {
    color: #818cf8 !important;
}

html.dark #view-decks .hw-deck-module-tabs button.hw-interview-sim-tab-btn:hover {
    color: #a5b4fc !important;
    background: rgba(99, 102, 241, 0.15) !important;
}

/* --------------------------------------------------------------------------
   1. MODAL OVERLAY & CORE CONTAINER
   -------------------------------------------------------------------------- */
.hw-interview-sim-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
}

html:not(.dark) .hw-interview-sim-overlay {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html.dark .hw-interview-sim-overlay {
    background: rgba(2, 6, 23, 0.84);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.hw-interview-sim-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.hw-interview-sim-container {
    width: 100%;
    max-width: 880px;
    height: min(840px, calc(100dvh - 24px));
    max-height: 90vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.hw-interview-sim-overlay.is-active .hw-interview-sim-container {
    transform: translateY(0) scale(1);
}

/* Light Theme Container */
html:not(.dark) .hw-interview-sim-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.18), 0 0 35px rgba(99, 102, 241, 0.12);
    color: #0f172a;
}

/* Dark Theme Container */
html.dark .hw-interview-sim-container {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 40px rgba(79, 70, 229, 0.25);
    color: #f8fafc;
}

/* --------------------------------------------------------------------------
   2. MODAL HEADER
   -------------------------------------------------------------------------- */
.hw-sim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    min-height: 48px;
    box-sizing: border-box;
    gap: 12px;
    flex-shrink: 0;
}

html:not(.dark) .hw-sim-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

html.dark .hw-sim-header {
    background: rgba(30, 41, 59, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hw-sim-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.hw-sim-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.hw-sim-title {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

html:not(.dark) .hw-sim-title {
    color: #0f172a;
}

html.dark .hw-sim-title {
    color: #f1f5f9;
}

.hw-sim-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

html:not(.dark) .hw-sim-close-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

html:not(.dark) .hw-sim-close-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: rotate(90deg);
}

html.dark .hw-sim-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

html.dark .hw-sim-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #f87171;
    transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   3. TOPIC PICKER & SUB-HEADER NAV
   -------------------------------------------------------------------------- */
.hw-sim-topic-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
}

html:not(.dark) .hw-sim-topic-nav {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

html.dark .hw-sim-topic-nav {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hw-sim-topic-tabs {
    display: flex;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
}

html:not(.dark) .hw-sim-topic-tabs {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

html.dark .hw-sim-topic-tabs {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hw-sim-topic-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

html:not(.dark) .hw-sim-topic-btn {
    color: #64748b;
}

html:not(.dark) .hw-sim-topic-btn:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

html:not(.dark) .hw-sim-topic-btn.is-active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}

html.dark .hw-sim-topic-btn {
    color: #94a3b8;
}

html.dark .hw-sim-topic-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

html.dark .hw-sim-topic-btn.is-active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.4);
}

.hw-sim-counter {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

html:not(.dark) .hw-sim-counter {
    color: #64748b;
}

html:not(.dark) .hw-sim-counter strong {
    color: #4338ca;
    font-weight: 800;
}

html.dark .hw-sim-counter {
    color: #94a3b8;
}

html.dark .hw-sim-counter strong {
    color: #38bdf8;
    font-weight: 800;
}

.hw-sim-level-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.35;
    white-space: nowrap;
}

html:not(.dark) .hw-sim-level-badge.is-basic {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

html.dark .hw-sim-level-badge.is-basic {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

html:not(.dark) .hw-sim-level-badge.is-intermediate {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

html.dark .hw-sim-level-badge.is-intermediate {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

html:not(.dark) .hw-sim-level-badge.is-advanced {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

html.dark .hw-sim-level-badge.is-advanced {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.hw-sim-topic-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hw-sim-toggle-autoplay {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    user-select: none;
    -webkit-user-select: none;
}

html:not(.dark) .hw-sim-toggle-autoplay {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}

html:not(.dark) .hw-sim-toggle-autoplay:hover {
    background: #e2e8f0;
    color: #0f172a;
}

html:not(.dark) .hw-sim-toggle-autoplay.is-active {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.16);
}

html:not(.dark) .hw-sim-toggle-autoplay.is-active strong {
    color: #0369a1;
}

html.dark .hw-sim-toggle-autoplay {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

html.dark .hw-sim-toggle-autoplay:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

html.dark .hw-sim-toggle-autoplay.is-active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

html.dark .hw-sim-toggle-autoplay.is-active strong {
    color: #7dd3fc;
}

/* --------------------------------------------------------------------------
   4. BODY CONTAINER
   -------------------------------------------------------------------------- */
.hw-sim-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.hw-sim-body::-webkit-scrollbar {
    width: 5px;
}

.hw-sim-body::-webkit-scrollbar-track {
    background: transparent;
}

.hw-sim-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

html:not(.dark) .hw-sim-body {
    background: #f8fafc;
}

html.dark .hw-sim-body {
    background: #0f172a;
}

/* --------------------------------------------------------------------------
   5. PERSONA PROFILE CARD
   -------------------------------------------------------------------------- */
.hw-sim-persona-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

html:not(.dark) .hw-sim-persona-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

html.dark .hw-sim-persona-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hw-sim-persona-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #f59e0b, #ec4899);
}

.hw-sim-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

html:not(.dark) .hw-sim-avatar-wrap {
    background: #eef2ff;
    border: 2px solid #c7d2fe;
}

html.dark .hw-sim-avatar-wrap {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hw-sim-avatar-wrap.is-speaking {
    animation: simAvatarPulse 1.4s infinite;
    border-color: #38bdf8;
}

@keyframes simAvatarPulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6); }
    70% { box-shadow: 0 0 0 14px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.hw-sim-persona-info {
    min-width: 0;
    flex: 1;
}

.hw-sim-persona-info h4 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html:not(.dark) .hw-sim-persona-info h4 {
    color: #0f172a;
}

html.dark .hw-sim-persona-info h4 {
    color: #f8fafc;
}

.hw-sim-persona-info p {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

html:not(.dark) .hw-sim-persona-info p {
    color: #64748b;
}

html.dark .hw-sim-persona-info p {
    color: #94a3b8;
}

/* --------------------------------------------------------------------------
   6. QUESTION BOX
   -------------------------------------------------------------------------- */
.hw-sim-question-box {
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

html:not(.dark) .hw-sim-question-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #c7d2fe;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.07);
}

html.dark .hw-sim-question-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.hw-sim-question-kr {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.45;
    word-break: keep-all;
    overflow-wrap: break-word;
}

html:not(.dark) .hw-sim-question-kr {
    color: #0f172a !important;
}

html.dark .hw-sim-question-kr {
    color: #f1f5f9;
}

.hw-sim-question-phonetic {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
    font-weight: 600;
    word-break: break-word;
}

html:not(.dark) .hw-sim-question-phonetic {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

html.dark .hw-sim-question-phonetic {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.hw-sim-question-vi {
    font-size: 13.5px;
    line-height: 1.4;
    padding-left: 10px;
    font-weight: 500;
    word-break: break-word;
}

html:not(.dark) .hw-sim-question-vi {
    color: #334155 !important;
    border-left: 3px solid #4f46e5;
}

html.dark .hw-sim-question-vi {
    color: #cbd5e1;
    border-left: 3px solid #6366f1;
}

/* Question Action Bar */
.hw-sim-question-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    box-sizing: border-box;
}

.hw-sim-actions-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hw-sim-btn-sound {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

html:not(.dark) .hw-sim-btn-sound {
    border: 1px solid #7dd3fc;
    background: #e0f2fe;
    color: #0284c7;
}

html:not(.dark) .hw-sim-btn-sound:hover {
    background: #bae6fd;
    color: #0369a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

html.dark .hw-sim-btn-sound {
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

html.dark .hw-sim-btn-sound:hover {
    background: rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.hw-sim-btn-sound-sm {
    margin-left: auto;
    padding: 3px 8px !important;
    font-size: 10.5px !important;
    border-radius: 8px !important;
}

.hw-sim-speed-selector {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

html:not(.dark) .hw-sim-speed-selector {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

html.dark .hw-sim-speed-selector {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hw-sim-speed-selector span {
    font-size: 11px;
    margin-right: 2px;
}

html:not(.dark) .hw-sim-speed-selector span {
    color: #64748b;
}

html.dark .hw-sim-speed-selector span {
    color: #94a3b8;
}

.hw-sim-speed-btn {
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

html:not(.dark) .hw-sim-speed-btn {
    color: #64748b;
}

html.dark .hw-sim-speed-btn {
    color: #94a3b8;
}

.hw-sim-speed-btn.is-active {
    background: #4f46e5 !important;
    color: #ffffff !important;
}

.hw-sim-btn-toggle-answer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    margin-left: auto;
}

html:not(.dark) .hw-sim-btn-toggle-answer {
    border: 1px solid #fde68a;
    background: #fef3c7;
    color: #b45309;
}

html:not(.dark) .hw-sim-btn-toggle-answer:hover {
    background: #fde68a;
    color: #92400e;
}

html.dark .hw-sim-btn-toggle-answer {
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

html.dark .hw-sim-btn-toggle-answer:hover {
    background: rgba(245, 158, 11, 0.25);
}

/* --------------------------------------------------------------------------
   7. MODEL PRO ANSWER SECTION
   --------------------------------------------------/* --------------------------------------------------------------------------
   7. MODEL PRO ANSWER SECTION
   -------------------------------------------------------------------------- */
.hw-sim-model-answer {
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    animation: simFadeIn 0.25s ease;
}

@keyframes simFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.hw-sim-model-answer.hw-hidden {
    display: none;
}

html:not(.dark) .hw-sim-model-answer {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.08);
}

html.dark .hw-sim-model-answer {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.hw-sim-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-wrap: wrap;
}

html:not(.dark) .hw-sim-section-label {
    color: #b45309;
}

html.dark .hw-sim-section-label {
    color: #fbbf24;
}

.hw-sim-answer-kr {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 10px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

html:not(.dark) .hw-sim-answer-kr {
    color: #78350f !important;
    background: #ffffff;
    border: 1.5px dashed #f59e0b;
}

html.dark .hw-sim-answer-kr {
    color: #fef08a !important;
    background: rgba(254, 240, 138, 0.05);
    border: 1px dashed rgba(253, 224, 71, 0.3);
}

.hw-sim-answer-vi {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    word-break: break-word;
}

html:not(.dark) .hw-sim-answer-vi {
    color: #334155 !important;
}

html.dark .hw-sim-answer-vi {
    color: #cbd5e1 !important;
}

.hw-sim-keywords-title {
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 2px;
}

html:not(.dark) .hw-sim-keywords-title {
    color: #475569;
}

html.dark .hw-sim-keywords-title {
    color: #94a3b8;
}

.hw-sim-keywords-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.hw-sim-keyword-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    transition: all 0.2s ease;
    word-break: break-word;
}

html:not(.dark) .hw-sim-keyword-chip {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

html:not(.dark) .hw-sim-keyword-chip.is-matched {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #15803d;
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.4);
}

html.dark .hw-sim-keyword-chip {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

html.dark .hw-sim-keyword-chip.is-matched {
    background: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.hw-sim-tip-box {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
    word-break: break-word;
}

html:not(.dark) .hw-sim-tip-box {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

html.dark .hw-sim-tip-box {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.08);
}

/* --------------------------------------------------------------------------
   8. CANDIDATE LIVE MIC & EVALUATION SECTION
   -------------------------------------------------------------------------- */
.hw-sim-candidate-section {
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-sizing: border-box;
}

html:not(.dark) .hw-sim-candidate-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

html.dark .hw-sim-candidate-section {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hw-sim-mic-btn-wrap {
    position: relative;
}

.hw-sim-mic-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hw-sim-mic-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.55);
}

.hw-sim-mic-btn.is-recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: simMicRecordingPulse 1.2s infinite;
}

@keyframes simMicRecordingPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.hw-sim-mic-label {
    font-size: 12px;
    font-weight: 600;
}

html:not(.dark) .hw-sim-mic-label {
    color: #475569;
}

html.dark .hw-sim-mic-label {
    color: #94a3b8;
}

.hw-sim-mic-label.is-recording {
    color: #dc2626 !important;
    font-weight: 700;
}

/* Spoken Transcript */
.hw-sim-transcript-box {
    width: 100%;
    min-height: 38px;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    text-align: left;
    box-sizing: border-box;
    word-break: break-word;
    font-weight: 500;
    line-height: 1.4;
}

html:not(.dark) .hw-sim-transcript-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #0f172a !important;
}

html:not(.dark) .hw-sim-transcript-box:empty::before {
    content: 'Lời bạn nói bằng tiếng Hàn sẽ hiển thị tại đây khi bật mic...';
    color: #94a3b8;
    font-style: italic;
    font-size: 12px;
}

html.dark .hw-sim-transcript-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc !important;
}

html.dark .hw-sim-transcript-box:empty::before {
    content: 'Lời bạn nói bằng tiếng Hàn sẽ hiển thị tại đây khi bật mic...';
    color: #64748b;
    font-style: italic;
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   9. EVALUATION SCORE CARD & DIFF FEEDBACK
   -------------------------------------------------------------------------- */
.hw-sim-eval-card {
    width: 100%;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    box-sizing: border-box;
    animation: simFadeIn 0.25s ease;
}

.hw-sim-eval-card.hw-hidden {
    display: none;
}

html:not(.dark) .hw-sim-eval-card {
    background: #ffffff;
    border: 1.5px solid #86efac;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.1);
}

html.dark .hw-sim-eval-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.hw-sim-eval-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hw-sim-eval-title {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

html:not(.dark) .hw-sim-eval-title {
    color: #15803d;
}

html.dark .hw-sim-eval-title {
    color: #94a3b8;
}

.hw-sim-score-badge {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.hw-sim-score-badge.is-pass {
    color: #16a34a !important;
    text-shadow: 0 0 12px rgba(22, 163, 74, 0.35);
}

.hw-sim-score-badge.is-mid {
    color: #d97706 !important;
    text-shadow: 0 0 12px rgba(217, 119, 6, 0.35);
}

.hw-sim-score-badge.is-fail {
    color: #dc2626 !important;
    text-shadow: 0 0 12px rgba(220, 38, 38, 0.35);
}

.hw-sim-diff-view {
    font-size: 13.5px;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 10px;
    word-break: break-word;
}

html:not(.dark) .hw-sim-diff-view {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

html.dark .hw-sim-diff-view {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.hw-sim-transcript-note {
    font-size: 11.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

html:not(.dark) .hw-sim-transcript-note {
    color: #64748b;
}

html.dark .hw-sim-transcript-note {
    color: #94a3b8;
}

.hw-sim-spoken-preview {
    font-size: 13.5px;
    font-weight: 700;
    word-break: break-word;
}

html:not(.dark) .hw-sim-spoken-preview {
    color: #0f172a;
}

html.dark .hw-sim-spoken-preview {
    color: #f1f5f9;
}

.hw-token-correct {
    color: #16a34a;
    font-weight: 800;
}

html.dark .hw-token-correct {
    color: #34d399;
    font-weight: 800;
}

.hw-token-missing {
    color: #dc2626;
    text-decoration: underline wavy #ef4444;
    font-weight: 700;
}

html.dark .hw-token-missing {
    color: #f87171;
    text-decoration: underline wavy #ef4444;
    opacity: 0.85;
}

.hw-sim-eval-feedback {
    font-size: 12.5px;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 8px;
    word-break: break-word;
}

html:not(.dark) .hw-sim-eval-feedback {
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

html.dark .hw-sim-eval-feedback {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
}

/* --------------------------------------------------------------------------
   10. FOOTER NAVIGATION
   -------------------------------------------------------------------------- */
.hw-sim-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    min-height: 50px;
    box-sizing: border-box;
    flex-shrink: 0;
}

html:not(.dark) .hw-sim-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

html.dark .hw-sim-footer {
    background: rgba(30, 41, 59, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hw-sim-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

html:not(.dark) .hw-sim-nav-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

html:not(.dark) .hw-sim-nav-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateY(-1px);
}

html.dark .hw-sim-nav-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

html.dark .hw-sim-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.hw-sim-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hw-sim-nav-btn.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.35);
}

.hw-sim-nav-btn.btn-primary:hover:not(:disabled) {
    box-shadow: 0 5px 16px rgba(79, 70, 229, 0.5);
}

/* --------------------------------------------------------------------------
   11. RESPONSIVE BREAKPOINTS (ALL SCREENS & HALF-SCREEN DEVTOOLS)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hw-interview-sim-overlay {
        padding: 8px;
    }
    .hw-interview-sim-container {
        width: 100%;
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 18px;
    }
    .hw-interview-launcher-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding: 16px 18px;
        gap: 14px;
    }
    .hw-launcher-content {
        flex-direction: row;
        align-items: flex-start;
    }
    .hw-launcher-icon {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }
    .hw-launcher-btn {
        width: 100%;
        justify-content: center;
    }
    .hw-sim-header {
        padding: 10px 14px;
        min-height: 46px;
    }
    .hw-sim-title {
        font-size: 14px;
    }
    .hw-sim-badge {
        font-size: 10px;
        padding: 2.5px 7px;
    }
    .hw-sim-topic-nav {
        padding: 6px 12px;
        gap: 6px;
    }
    .hw-sim-topic-nav-right {
        width: 100%;
        justify-content: space-between;
    }
    .hw-sim-topic-tabs {
        width: 100%;
        justify-content: stretch;
    }
    .hw-sim-topic-btn {
        flex: 1;
        justify-content: center;
        padding: 6px 8px;
        font-size: 12px;
    }
    .hw-sim-body {
        padding: 12px 14px;
        gap: 10px;
    }
    .hw-sim-actions-left {
        width: 100%;
        justify-content: space-between;
    }
    .hw-sim-btn-sound {
        flex: 1;
        justify-content: center;
    }
    .hw-sim-btn-toggle-answer {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    .hw-sim-footer {
        padding: 8px 14px;
        min-height: 48px;
    }
    .hw-sim-nav-btn {
        padding: 7px 14px;
        font-size: 12.5px;
    }
}

@media (max-width: 480px) {
    .hw-interview-sim-overlay {
        padding: 4px;
    }
    .hw-interview-sim-container {
        border-radius: 14px;
        height: calc(100dvh - 8px);
        max-height: calc(100dvh - 8px);
    }
    .hw-sim-header {
        padding: 8px 12px;
    }
    .hw-sim-title {
        font-size: 13.5px;
    }
    .hw-sim-avatar-wrap {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .hw-sim-persona-info h4 {
        font-size: 13px;
    }
    .hw-sim-persona-info p {
        font-size: 11.5px;
    }
    .hw-sim-question-kr {
        font-size: 15.5px;
    }
}
