/**
 * OSCE Feature — Page Styles
 * Mobile-first OSCE simulation flow
 * Uses Academia Design System tokens
 */

/* ========================================
   OSCE SHELL & LAYOUT
   ======================================== */

.osce-shell {
    position: relative;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    height: 100vh;
    overflow: hidden;
    z-index: 2;
}

/* Screen management */
/*
 * CRITICAL: Using visibility instead of display to prevent scrollbar flicker.
 * display:none prevents ::-webkit-scrollbar from being computed,
 * causing a flash of default scrollbar on display:block.
 * visibility:hidden keeps the element rendered (scrollbar pre-computed)
 * but invisible. All screens are position:absolute so they stack cleanly.
 */
.osce-screen {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    inset: 0;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 80px;
    opacity: 0;
    /* Always use custom thin scrollbar — no flicker ever */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.osce-screen::-webkit-scrollbar {
    width: 4px;
}

.osce-screen::-webkit-scrollbar-track {
    background: transparent;
}

.osce-screen::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

[data-theme="light"] .osce-screen {
    scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}

[data-theme="light"] .osce-screen::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
}

.osce-screen.active {
    visibility: visible;
    pointer-events: auto;
    position: relative;
    opacity: 1;
    animation: osceFadeIn 0.35s ease;
}

/* Voice mode should never scroll */
#screenVoice.active {
    overflow: hidden;
    padding-bottom: 0;
}

@keyframes osceFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   HEADER BAR (inner screens)
   ======================================== */

.osce-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-md) var(--space-sm);
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-glass-border);
}

.osce-header-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.osce-header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.osce-header-btn:hover {
    background: var(--color-glass-hover);
    border-color: var(--color-primary);
}

/* Dashboard Top Bar */
.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
}

.dash-topbar-controls {
    display: flex;
    gap: var(--space-xs);
}

/* ========================================
   MOBILE DASHBOARD (Screen 0)
   ======================================== */

.dash-greeting {
    padding: 0 var(--space-md) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.dash-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dash-greeting-text h2 {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.dash-greeting-text p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
}

.dash-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-end: auto;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass);
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dash-premium-badge:active {
    transform: scale(0.95);
}

.dash-premium-badge.is-premium {
    background: linear-gradient(135deg, var(--color-accent-gold), var(--color-orange));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(255, 170, 0, 0.3);
}

/* Feature Grid */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
}

.dash-tile {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    position: relative;
}

.dash-tile:hover {
    background: var(--color-glass-hover);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.dash-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(45, 184, 76, 0.15), rgba(45, 184, 76, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.dash-tile-icon.osce-icon {
    background: linear-gradient(135deg, rgba(45, 184, 76, 0.25), rgba(45, 184, 76, 0.1));
}

.dash-tile-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Bottom Nav */
.dash-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    justify-content: space-around;
    padding: var(--space-sm) 0;
    padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-top: 1px solid var(--color-glass-border);
    z-index: 30;
}

.dash-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    transition: color var(--transition-base);
    border: none;
    background: none;
    font-family: inherit;
}

.dash-nav-item.active {
    color: var(--color-primary);
}

.dash-nav-item i {
    font-size: 1.3rem;
}

/* ========================================
   OSCE LANDING (Screen 1)
   ======================================== */

/* OSCE Hero Banner */
.osce-hero-banner {
    margin: var(--space-md);
    border-radius: var(--radius-xl);
    background-image: url('../assets/osce-banner.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(45, 184, 76, 0.15);
    height: 120px;
    overflow: hidden;
}

.osce-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-muted);
    padding: 0 var(--space-md);
    margin-bottom: var(--space-md);
}

/* System Grid */
.system-grid {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-xs) var(--space-md) var(--space-xl);
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.system-grid::-webkit-scrollbar {
    display: none;
}

.system-card {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    position: relative;
    width: 160px;
    min-width: 160px;
    min-height: 180px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.system-card:hover {
    background: var(--color-glass-hover);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.system-card.disabled {
    opacity: 0.5;
    cursor: default;
}

.system-card.disabled:hover {
    transform: none;
    border-color: var(--color-glass-border);
    background: var(--color-glass);
}

.system-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-base);
}

/* Green glass shape — smaller, centered behind the icon */
.system-card-icon::after {
    content: '';
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3cc45e, #28a347);
    box-shadow:
        0 6px 20px rgba(40, 163, 71, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    z-index: 0;
}

/* Glass sheen on the green shape */
.system-card-icon::before {
    content: '';
    position: absolute;
    width: 42px;
    height: 21px;
    top: calc(50% - 21px);
    border-radius: 12px 12px 0 0;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.0) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Icon sits on top */
.system-card-icon i {
    position: relative;
    z-index: 2;
    font-size: 1.3rem;
    color: #fff;
}

.system-card:hover .system-card-icon {
    transform: translateY(-2px);
}

.system-card:hover .system-card-icon::after {
    box-shadow:
        0 10px 28px rgba(40, 163, 71, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

/* Light mode */
[data-theme="light"] .system-card-icon::after {
    box-shadow:
        0 6px 20px rgba(40, 163, 71, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .system-card-icon::before {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.0) 100%);
}

/* Per-system glass colors */
[data-system="respiratory"] .system-card-icon::after {
    background: linear-gradient(145deg, #4db8b0, #2d9e96);
    box-shadow: 0 6px 20px rgba(45, 158, 150, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-system="cardiovascular"] .system-card-icon::after {
    background: linear-gradient(145deg, #e06070, #c44858);
    box-shadow: 0 6px 20px rgba(196, 72, 88, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-system="gastrointestinal"] .system-card-icon::after {
    background: linear-gradient(145deg, #e8944c, #d07830);
    box-shadow: 0 6px 20px rgba(208, 120, 48, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-system="neurological"] .system-card-icon::after {
    background: linear-gradient(145deg, #9b6dc8, #7c52a8);
    box-shadow: 0 6px 20px rgba(124, 82, 168, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-system="musculoskeletal"] .system-card-icon::after {
    background: linear-gradient(145deg, #3cc45e, #28a347);
    box-shadow: 0 6px 20px rgba(40, 163, 71, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-system="endocrine"] .system-card-icon::after {
    background: linear-gradient(145deg, #e0a040, #c88828);
    box-shadow: 0 6px 20px rgba(200, 136, 40, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .smart-stat-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .stat-icon-wrap {
    background: rgba(45, 184, 76, 0.15);
    border-color: rgba(45, 184, 76, 0.2);
}

[data-theme="light"] .smart-stat-value {
    color: #1a1a1a;
}

[data-theme="light"] .smart-stat-label {
    color: #555;
}

.system-card-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.system-card-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.system-card .pro-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-accent-gold), var(--color-orange));
    color: white;
    font-weight: 700;
}

[dir="ltr"] .system-card .pro-badge {
    right: auto;
    left: 8px;
}

[data-theme="light"] .system-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .system-card-name {
    color: #1a1a1a;
}

[data-theme="light"] .system-card-count {
    color: #555;
}

[data-theme="light"] .system-card-attempts {
    color: #444;
}

/* ========================================
   CASES BROWSER (Screen 2)
   ======================================== */

/* Filter Chips */
.filter-bar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    overflow: visible;
    flex-wrap: nowrap;
    position: sticky;
    top: 57px;
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-glass-border);
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    position: relative;
    z-index: 101;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass);
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    position: relative;
}

.filter-chip:hover {
    border-color: var(--color-primary);
}

.filter-chip.active {
    background: rgba(45, 184, 76, 0.15);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-chip .chip-dismiss {
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.7;
}

.filter-chip .chip-dismiss:hover {
    opacity: 1;
}

/* Filter Dropdown */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease;
}

[dir="ltr"] .filter-dropdown {
    left: 0;
    right: auto;
}

[dir="rtl"] .filter-dropdown {
    right: 0;
    left: auto;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: inherit;
    color: var(--color-text);
    font-family: inherit;
}

.filter-option:hover {
    background: var(--color-glass-hover);
}

.filter-option .difficulty-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.difficulty-dot.easy {
    background: var(--color-success);
}

.difficulty-dot.medium {
    background: var(--color-warning);
}

.difficulty-dot.hard {
    background: var(--color-error);
}

/* Case Cards */
.cases-list {
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.case-card {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.case-card:hover {
    background: var(--color-glass-hover);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.case-card.locked {
    filter: blur(2px);
    pointer-events: none;
    user-select: none;
}

.case-card.locked::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: none;
}

.case-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.case-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-sm);
}

.tag {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.tag-system {
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.tag-easy {
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-success);
}

.tag-medium {
    background: rgba(245, 166, 35, 0.15);
    color: var(--color-warning);
}

.tag-hard {
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-error);
}

.tag-lang {
    background: rgba(74, 144, 217, 0.15);
    color: var(--color-accent-blue);
}

.case-card-patient {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.case-card-patient i {
    color: var(--color-primary);
}

.case-card-complaint {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    font-style: italic;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.case-card-stats {
    display: flex;
    gap: var(--space-md);
}

.case-card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.case-card-chevron {
    font-size: 1rem;
    color: var(--color-text-dim);
}

/* Locked overlay for premium cards */
.case-locked-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    z-index: 2;
}

.case-locked-overlay i {
    font-size: 1.5rem;
    color: var(--color-accent-gold);
}

.case-locked-overlay span {
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
}

/* Empty State */
.cases-empty {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--color-text-muted);
}

.cases-empty i {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

/* ========================================
   CASE DETAIL (Screen 3)
   ======================================== */

.case-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: var(--space-md) var(--space-md) 0;
    margin-bottom: var(--space-lg);
}

/* Patient Preview */
.patient-preview {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: 0 var(--space-md) var(--space-lg);
}

.patient-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.patient-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(45, 184, 76, 0.2), rgba(45, 184, 76, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.3rem;
}

.patient-name {
    font-weight: 700;
    font-size: 1rem;
}

.patient-details {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.patient-divider {
    height: 1px;
    background: var(--color-glass-border);
    margin-bottom: var(--space-md);
}

.patient-complaint-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

.patient-complaint-text {
    font-style: italic;
    color: var(--color-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Patient Persona Profile (Case Detail) */
.patient-avatar-emoji {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.patient-trait {
    font-size: 0.78rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 2px;
}

.persona-detail-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.persona-detail-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.persona-detail-row > i {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.persona-detail-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.persona-detail-value {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.5;
}

.persona-emotion-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.persona-emotion-badge.neutral {
    background: rgba(45, 184, 76, 0.12);
    color: var(--color-primary);
}

.persona-emotion-badge.anxious {
    background: rgba(245, 166, 35, 0.12);
    color: var(--color-warning);
}

.persona-emotion-badge.angry {
    background: rgba(255, 68, 68, 0.12);
    color: var(--color-error);
}

.persona-emotion-badge.crying {
    background: rgba(74, 144, 217, 0.12);
    color: var(--color-accent-blue);
}

.persona-emotion-badge.confused {
    background: rgba(124, 82, 168, 0.12);
    color: #9b6dc8;
}

.persona-quirks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.persona-quirks-list li {
    font-size: 0.82rem;
    color: var(--color-text);
    padding-inline-start: var(--space-sm);
    position: relative;
    line-height: 1.5;
}

.persona-quirks-list li::before {
    content: '•';
    position: absolute;
    inset-inline-start: 0;
    color: var(--color-primary);
    font-weight: 700;
}

.station-instructions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(45, 184, 76, 0.05);
    border: 1px solid rgba(45, 184, 76, 0.1);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-text);
}

.instruction-item i {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

[data-theme="light"] .instruction-item {
    background: rgba(45, 184, 76, 0.06);
    border-color: rgba(45, 184, 76, 0.15);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-item {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.stat-item i {
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.stat-item-value {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
}

.stat-item-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* CTA Button */
.osce-cta {
    position: sticky;
    bottom: 0;
    padding: var(--space-md);
    background: linear-gradient(to top, var(--color-bg) 60%, transparent);
    z-index: 10;
}

.osce-cta-btn {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-glow-primary);
    transition: all var(--transition-base);
}

.osce-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--color-primary-glow);
}

.osce-cta-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   PRE-SIM CHECKLIST (Screen 3.5)
   ======================================== */

.presim-content {
    padding: var(--space-md);
}

.presim-content.presim-compact {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Collapsible Advanced Details */
.presim-advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--space-sm);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color var(--transition-base);
}

.presim-advanced-toggle:hover {
    color: var(--color-primary);
}

.presim-advanced-toggle i {
    transition: transform var(--transition-base);
}

.presim-content.show-advanced .presim-advanced-toggle i {
    transform: rotate(180deg);
}

.presim-advanced-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.presim-content.show-advanced .presim-advanced-content {
    max-height: 2000px;
}

.presim-intro {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    padding: 0 var(--space-sm);
}

.presim-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
}

.presim-item.unlocked i {
    color: var(--color-primary);
}

.presim-item.locked {
    opacity: 0.5;
    position: relative;
}

.presim-item.locked i {
    color: var(--color-text-dim);
}

.presim-item-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.presim-item-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* SOCRATES Card */
.socrates-card {
    background: linear-gradient(135deg, rgba(45, 184, 76, 0.08), rgba(45, 184, 76, 0.02));
    border: 1px solid rgba(45, 184, 76, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
}

.socrates-card h4 {
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.socrates-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.socrates-list li {
    font-size: 0.82rem;
    display: flex;
    gap: var(--space-sm);
}

.socrates-list li strong {
    color: var(--color-primary);
    min-width: 18px;
}

/* ========================================
   CHAT SIMULATION (Screen 4)
   ======================================== */

.chat-sim-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-glass-border);
}

.chat-sim-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Patient Emotion Badge */
.patient-emotion-badge {
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    animation: emotionPulse 2s ease infinite;
}

@keyframes emotionPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Voice Live Indicator */
.voice-live-indicator {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 14px;
    border-radius: var(--radius-full);
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    font-size: 0.82rem;
    color: var(--color-error);
    animation: listenPulse 1.5s ease infinite;
}

@keyframes listenPulse {

    0%,
    100% {
        border-color: rgba(255, 68, 68, 0.3);
    }

    50% {
        border-color: rgba(255, 68, 68, 0.7);
    }
}

.voice-live-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

/* Chat Mode Toggle Button */
.chat-mode-btn {
    background: var(--color-glass);
    color: var(--color-accent-blue);
    border: 1px solid var(--color-glass-border);
}

.chat-mode-btn.voice-active {
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Patient Emotion in Chat Bubble */
.chat-bubble-emotion {
    font-size: 0.7rem;
    color: var(--color-text-dim);
    font-style: italic;
    margin-top: 2px;
}

/* Emotion Narration */
.chat-narration {
    text-align: center;
    font-size: 0.7rem;
    font-style: italic;
    color: var(--color-text-dim);
    padding: var(--space-xs) var(--space-md);
    opacity: 0.8;
}

/* System Instruction Message (student-first prompt) */
.chat-system-msg {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(45, 184, 76, 0.06);
    border: 1px solid rgba(45, 184, 76, 0.15);
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    animation: osceFadeIn 0.5s ease;
}

.chat-system-msg i {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.chat-system-msg strong {
    color: var(--color-primary);
    font-weight: 600;
}

[data-theme="light"] .chat-system-msg {
    background: rgba(45, 184, 76, 0.08);
    border-color: rgba(45, 184, 76, 0.2);
}

/* Physical Exam Findings */
.chat-bubble.exam-findings .chat-bubble-body {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.06));
    border-inline-start: 3px solid var(--color-primary);
    padding-inline-start: 10px;
    font-style: italic;
}

.chat-sim-timer {
    font-family: var(--font-family-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.chat-sim-timer.warning {
    color: var(--color-warning);
}

.chat-sim-timer.danger {
    color: var(--color-error);
    animation: timerPulse 1s ease infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-msg-count {
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: var(--space-xs) 0 var(--space-sm);
}

/* Chat Messages */
.chat-messages {
    padding: var(--space-sm) var(--space-md);
    padding-bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-height: calc(100vh - 200px);
}

.study-mode-active .chat-messages {
    padding-top: 10px;
}

.chat-bubble {
    max-width: 82%;
    display: flex;
    gap: var(--space-sm);
}

.chat-bubble.patient {
    align-self: flex-start;
}

.chat-bubble.student {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 4px;
}

.chat-bubble-body {
    background: var(--color-surface-elevated);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.chat-bubble.student .chat-bubble-body {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
}

.chat-bubble-time {
    font-size: 0.65rem;
    color: var(--color-text-dim);
    margin-top: 4px;
    text-align: right;
}

.chat-bubble.student .chat-bubble-time {
    text-align: left;
}

/* Voice message bubble */
.chat-voice-bubble {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 0;
}

.voice-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 24px;
}

.voice-waveform-bar {
    width: 3px;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.6;
}

.chat-bubble.student .voice-waveform-bar {
    background: white;
}

/* Typing indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-text-muted);
    animation: typingBounce 1.4s ease infinite;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }
}

/* Study Mode Toggle */
.presim-mode-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-glass-border);
    margin: var(--space-md) auto;
    width: fit-content;
}

.mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-toggle-btn.active {
    background: var(--color-primary);
    color: white;
}

.mode-toggle-btn:not(.active):hover {
    background: var(--color-glass);
}

/* Study Mode Checklist Panel */
.study-checklist-panel {
    position: sticky;
    top: 84px;
    width: 100%;
    box-sizing: border-box;
    background: var(--color-surface);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-glass-border);
    z-index: 17;
    max-height: 36px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.study-checklist-panel.expanded {
    max-height: 320px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.study-checklist-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.study-checklist-toggle .toggle-arrow {
    margin-inline-start: auto;
    transition: transform var(--transition-base);
}

.study-checklist-panel.expanded .toggle-arrow {
    transform: rotate(180deg);
}

.study-checklist-items {
    padding: 0 var(--space-md) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.study-check-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    background: var(--color-background);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    transition: all var(--transition-base);
}

.study-check-item.covered {
    color: var(--color-accent-green);
    font-weight: 600;
}

.study-check-item .check-icon {
    font-size: 1rem;
}

/* Study Mode Hint Banner */
.study-hint-banner {
    position: sticky;
    top: 120px;
    width: calc(100% - var(--space-xl));
    margin: var(--space-sm) auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.12), rgba(255, 120, 0, 0.08));
    border: 1px solid rgba(255, 170, 0, 0.2);
    color: var(--color-accent-gold);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 15;
    animation: hintSlideIn 0.4s ease;
}

@keyframes hintSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Suggestion Chips */
.chat-suggestion-chips {
    position: fixed;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    box-sizing: border-box;
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 10;
}

.chat-suggestion-chips::-webkit-scrollbar {
    display: none;
}

.chat-suggestion-chips:empty {
    display: none;
}

.suggestion-chip {
    flex-shrink: 0;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: var(--color-primary);
    color: white;
    border-color: transparent;
}

.suggestion-chip:active {
    transform: scale(0.95);
}

/* Chat Input */
.chat-input-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    padding: var(--space-sm) var(--space-md);
    padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-top: 1px solid var(--color-glass-border);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    z-index: 25;
}

.chat-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-full);
    background: var(--color-glass);
    color: var(--color-text);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-base);
}

.chat-input-field:focus {
    border-color: var(--color-primary);
}

.chat-input-field::placeholder {
    color: var(--color-text-dim);
}

.chat-input-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.chat-mic-btn {
    background: var(--color-glass);
    color: var(--color-primary);
    border: 1px solid var(--color-glass-border);
}

.chat-mic-btn.recording {
    background: var(--color-error);
    color: white;
    border-color: var(--color-error);
    animation: recordPulse 1.5s ease infinite;
}

@keyframes recordPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

/* ========================================
   EVALUATION LOADING (Screen 5)
   ======================================== */

.eval-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
    text-align: center;
}

.eval-spinner {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    border: 3px solid var(--color-glass-border);
    border-top-color: var(--color-primary);
    animation: evalSpin 1s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
    position: relative;
}

.eval-spinner i {
    font-size: 2rem;
    color: var(--color-primary);
    animation: evalSpin 1s linear infinite reverse;
}

@keyframes evalSpin {
    to {
        transform: rotate(360deg);
    }
}

.eval-loading h3 {
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
}

.eval-loading p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ========================================
   EXAMINER REPORT (Screen 6)
   ======================================== */

.report-content {
    padding: var(--space-md);
}

/* Score Ring */
.report-score-section {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.score-ring {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    background: conic-gradient(var(--ring-color, var(--color-error)) var(--ring-progress, 0%), var(--color-glass-border) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    position: relative;
}

.score-ring::before {
    content: '';
    position: absolute;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: var(--radius-full);
    background: var(--color-bg);
}

.score-ring-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.score-ring-value {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.score-ring-label {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-top: 4px;
}

.score-ring-label.failed {
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-error);
}

.score-ring-label.passed {
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-primary);
}

.report-session-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.report-session-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Report Sections */
.report-section {
    margin-bottom: var(--space-xl);
}

/* Transcript Review */
.transcript-section .transcript-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.transcript-section.expanded .transcript-list {
    max-height: 600px;
    overflow-y: auto;
}

.transcript-section.expanded .transcript-toggle i:last-child {
    transform: rotate(180deg);
}

.transcript-toggle {
    cursor: pointer;
}

.transcript-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    border-inline-start: 3px solid var(--color-glass-border);
}

.transcript-item.student {
    border-inline-start-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.06);
}

.transcript-item.patient {
    border-inline-start-color: var(--color-accent-gold);
    background: rgba(255, 170, 0, 0.06);
}

.transcript-role {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.transcript-body {
    flex: 1;
    min-width: 0;
}

.transcript-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-text-primary);
    display: block;
}

.transcript-time {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    margin-top: 2px;
    display: block;
}

.report-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Category Bars */
.category-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.category-name {
    font-size: 0.78rem;
    min-width: 120px;
    flex-shrink: 0;
}

.category-bar {
    flex: 1;
    height: 8px;
    background: var(--color-glass-border);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.category-score {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    color: var(--color-text-muted);
}

/* Missed Questions */
.missed-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-glass-border);
}

.missed-penalty {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-error);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.missed-text {
    font-size: 0.82rem;
    line-height: 1.4;
}

/* Communication Skills */
.comm-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.comm-narrative {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* Strengths & Improvements */
.feedback-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.feedback-item i {
    margin-top: 3px;
    flex-shrink: 0;
}

.feedback-item.strength i {
    color: var(--color-success);
}

.feedback-item.improvement i {
    color: var(--color-accent-gold);
}

/* Red Flags */
.red-flag-card {
    background: rgba(255, 68, 68, 0.06);
    border: 1px solid rgba(255, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

[data-theme="light"] .red-flag-card {
    background: rgba(255, 68, 68, 0.05);
    border-color: rgba(255, 68, 68, 0.15);
}

.red-flag-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-error);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

.red-flag-text {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Locked Section Overlay */
.report-locked {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.report-locked::after {
    content: '⭐ Unlock with Pro';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-accent-gold);
    border-radius: var(--radius-md);
}

/* ========================================
   SESSION HISTORY (Screen 7)
   ======================================== */

.history-list {
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.history-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.history-card:hover {
    background: var(--color-glass-hover);
    border-color: var(--color-primary);
}

.history-score {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 3px solid;
}

.history-score.low {
    border-color: var(--color-error);
    color: var(--color-error);
}

.history-score.mid {
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.history-score.high {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    flex-wrap: wrap;
}

.history-badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
}

.history-badge.evaluated {
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-primary);
}

.history-chevron {
    color: var(--color-text-dim);
    flex-shrink: 0;
}

/* Progress Banner (Premium) */
.progress-banner {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-sm) var(--space-md) var(--space-md);
}

.progress-banner.locked {
    position: relative;
    overflow: hidden;
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

.progress-banner h4 {
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.progress-stats {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.weak-area {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    margin-bottom: var(--space-xs);
}

/* ========================================
   PAYWALL MODAL
   ======================================== */

.paywall-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: backdropFade 0.3s ease;
}

.paywall-backdrop.active {
    display: flex;
}

@keyframes backdropFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.paywall-sheet {
    width: 100%;
    max-width: 430px;
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-xl) var(--space-lg);
    padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    animation: sheetSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes sheetSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.paywall-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.paywall-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.paywall-features {
    list-style: none;
    margin-bottom: var(--space-xl);
}

.paywall-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    font-size: 0.88rem;
}

.paywall-features li i {
    color: var(--color-primary);
}

.paywall-plan {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-bottom: var(--space-sm);
    font-family: inherit;
    color: var(--color-text);
}

.paywall-plan:hover {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.05);
}

.paywall-plan.recommended {
    border-color: var(--color-primary);
    background: rgba(45, 184, 76, 0.08);
}

.paywall-plan-price {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
}

.paywall-plan-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.paywall-plan-save {
    font-size: 0.72rem;
    color: var(--color-primary);
    font-weight: 600;
}

.paywall-dismiss {
    display: block;
    width: 100%;
    text-align: center;
    padding: var(--space-md);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: color var(--transition-base);
}

.paywall-dismiss:hover {
    color: var(--color-text);
}

/* ========================================
   DIALOG MODALS
   ======================================== */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.dialog-backdrop.active {
    display: flex;
}

.dialog-box {
    width: 100%;
    max-width: 340px;
    background: var(--color-surface-elevated);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    animation: dialogPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialogPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dialog-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.dialog-body {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: var(--space-lg);
}

.dialog-actions {
    display: flex;
    gap: var(--space-sm);
}

.dialog-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-base);
}

.dialog-btn-cancel {
    background: var(--color-glass);
    color: var(--color-text);
    border: 1px solid var(--color-glass-border);
}

.dialog-btn-danger {
    background: var(--color-error);
    color: white;
}

.dialog-btn-confirm {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
}

/* ========================================
   MEDICAL DOODLE BACKGROUND
   ======================================== */

.osce-shell .grid-overlay {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Ctext x='10' y='30' font-size='18' opacity='0.08' fill='%232DB84C'%3E🩺%3C/text%3E%3Ctext x='120' y='25' font-size='14' opacity='0.06' fill='%23F5A623'%3E💊%3C/text%3E%3Ctext x='60' y='80' font-size='16' opacity='0.07' fill='%234A90D9'%3E🫀%3C/text%3E%3Ctext x='160' y='90' font-size='12' opacity='0.08' fill='%232DB84C'%3E🔬%3C/text%3E%3Ctext x='30' y='140' font-size='14' opacity='0.06' fill='%23F5A623'%3E💉%3C/text%3E%3Ctext x='140' y='160' font-size='16' opacity='0.07' fill='%234A90D9'%3E🫁%3C/text%3E%3Ctext x='90' y='180' font-size='12' opacity='0.06' fill='%232DB84C'%3E🧬%3C/text%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0.8;
}

/* ========================================
   BILINGUAL SUPPORT
   ======================================== */

[data-lang="ar"] .text-en,
[data-lang="en"] .text-ar {
    display: none !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 374px) {

    .system-grid,
    .stats-grid {
        gap: var(--space-sm);
    }

    .dash-grid {
        gap: var(--space-sm);
    }

    .osce-header-title {
        font-size: 0.95rem;
    }
}

@media (min-width: 431px) {
    .osce-shell {
        border-left: 1px solid var(--color-glass-border);
        border-right: 1px solid var(--color-glass-border);
    }
}

/* ========================================
   LTR DIRECTION FIXES
   ======================================== */

/* Back arrow flips for LTR (arrow-right becomes arrow-left visually) */
[dir="ltr"] .osce-back-arrow {
    transform: scaleX(-1);
}

/* Chevrons flip for LTR */
[dir="ltr"] .case-card-chevron,
[dir="ltr"] .history-chevron {
    transform: scaleX(-1);
}

/* ========================================
   LIGHT THEME REFINEMENTS
   ======================================== */

/* Better contrast for disabled system cards */
[data-theme="light"] .system-card.disabled {
    opacity: 0.6;
}

[data-theme="light"] .system-card.disabled .system-card-count {
    color: var(--color-text-muted);
}

/* Stronger text on glass in light mode */
[data-theme="light"] .case-card-complaint {
    color: var(--color-text-secondary);
}

[data-theme="light"] .report-locked::after {
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-text);
}

/* ========================================
   PATIENT PERSONA PREVIEW
   ======================================== */

.persona-preview-card {
    background: var(--color-glass);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin: var(--space-md);
    animation: osceFadeIn 0.3s ease;
}

.persona-preview-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.persona-shuffle-btn {
    margin-inline-start: auto;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.persona-shuffle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: rotate(180deg);
}

.persona-preview-avatar {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--space-sm);
}

.persona-preview-name {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2px;
}

.persona-preview-trait {
    font-size: 0.78rem;
    color: var(--color-primary);
    text-align: center;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.persona-preview-details {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--space-sm);
}

.persona-preview-divider {
    height: 1px;
    background: var(--color-glass-border);
    margin: var(--space-sm) 0 var(--space-md);
}

.persona-preview-quirks {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.persona-preview-quirks li {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(45, 184, 76, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(45, 184, 76, 0.2);
}

/* ========================================
   LIVE VOICE MODE
   ======================================== */

.voice-mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    padding: var(--space-md);
    background: radial-gradient(ellipse at center, rgba(15, 25, 35, 0.95), var(--color-bg));
    position: relative;
    overflow: hidden;
}

/* Top Bar */
.voice-mode-top {
    display: flex;
    align-items: center;
    width: 100%;
    gap: var(--space-sm);
    padding-bottom: var(--space-md);
}

.voice-mode-patient {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.voice-mode-timer {
    font-family: var(--font-family-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Emotion Badge */
.voice-mode-emotion {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    font-size: 0.78rem;
    margin-bottom: var(--space-lg);
    transition: all 0.3s ease;
}

.voice-emotion-emoji {
    font-size: 1.1rem;
}

/* ── The Sphere ── */
.voice-sphere-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
}

.voice-sphere {
    width: 180px;
    height: 180px;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.voice-sphere:active {
    transform: scale(0.95);
}

.sphere-core {
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 184, 76, 0.6), rgba(45, 184, 76, 0.2));
    box-shadow: 0 0 30px rgba(45, 184, 76, 0.3), inset 0 0 20px rgba(45, 184, 76, 0.2);
    transition: all 0.5s ease;
}

.sphere-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.5s ease;
}

.ring-1 {
    inset: 5%;
    border-color: rgba(45, 184, 76, 0.3);
    animation: sphereRotate1 8s linear infinite;
}

.ring-2 {
    inset: 15%;
    border-color: rgba(45, 184, 76, 0.2);
    animation: sphereRotate2 6s linear infinite reverse;
}

.ring-3 {
    inset: 25%;
    border-color: rgba(45, 184, 76, 0.15);
    animation: sphereRotate3 4s linear infinite;
}

@keyframes sphereRotate1 {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes sphereRotate2 {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes sphereRotate3 {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Idle State */
.voice-sphere.idle .sphere-core {
    background: radial-gradient(circle, rgba(100, 100, 100, 0.4), rgba(100, 100, 100, 0.1));
    box-shadow: 0 0 20px rgba(100, 100, 100, 0.2);
}

.voice-sphere.idle .sphere-ring {
    border-color: rgba(100, 100, 100, 0.15);
}

/* Listening State — green pulsing */
.voice-sphere.listening .sphere-core {
    background: radial-gradient(circle, rgba(45, 184, 76, 0.7), rgba(45, 184, 76, 0.3));
    box-shadow: 0 0 40px rgba(45, 184, 76, 0.5), 0 0 80px rgba(45, 184, 76, 0.2);
    animation: spherePulse 1.5s ease infinite;
}

.voice-sphere.listening .ring-1 {
    border-color: rgba(45, 184, 76, 0.5);
    animation-duration: 3s;
}

.voice-sphere.listening .ring-2 {
    border-color: rgba(45, 184, 76, 0.35);
    animation-duration: 2.5s;
}

.voice-sphere.listening .ring-3 {
    border-color: rgba(45, 184, 76, 0.25);
    animation-duration: 2s;
}

@keyframes spherePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Thinking State — amber rotating */
.voice-sphere.thinking .sphere-core {
    background: radial-gradient(circle, rgba(245, 166, 35, 0.6), rgba(245, 166, 35, 0.2));
    box-shadow: 0 0 40px rgba(245, 166, 35, 0.4);
    animation: sphereThink 1s ease infinite;
}

.voice-sphere.thinking .ring-1 {
    border-color: rgba(245, 166, 35, 0.4);
    animation-duration: 1.5s;
}

.voice-sphere.thinking .ring-2 {
    border-color: rgba(245, 166, 35, 0.3);
    animation-duration: 1s;
}

.voice-sphere.thinking .ring-3 {
    border-color: rgba(245, 166, 35, 0.2);
    animation-duration: 0.8s;
}

@keyframes sphereThink {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Speaking State — blue ripple */
.voice-sphere.speaking .sphere-core {
    background: radial-gradient(circle, rgba(74, 144, 217, 0.7), rgba(74, 144, 217, 0.3));
    box-shadow: 0 0 50px rgba(74, 144, 217, 0.5), 0 0 100px rgba(74, 144, 217, 0.2);
    animation: sphereSpeak 0.8s ease infinite;
}

.voice-sphere.speaking .ring-1 {
    border-color: rgba(74, 144, 217, 0.5);
    animation: sphereRipple1 1.5s ease infinite;
}

.voice-sphere.speaking .ring-2 {
    border-color: rgba(74, 144, 217, 0.35);
    animation: sphereRipple2 1.5s ease 0.3s infinite;
}

.voice-sphere.speaking .ring-3 {
    border-color: rgba(74, 144, 217, 0.2);
    animation: sphereRipple3 1.5s ease 0.6s infinite;
}

@keyframes sphereSpeak {

    0%,
    100% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.08);
    }

    60% {
        transform: scale(0.96);
    }
}

@keyframes sphereRipple1 {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes sphereRipple2 {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes sphereRipple3 {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Status label under sphere */
.voice-sphere-status {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-align: center;
    transition: all 0.3s ease;
}

/* Voice Mode — Light Theme Fix */
[data-theme="light"] .voice-mode-container {
    background: radial-gradient(ellipse at center, rgba(240, 245, 240, 0.98), var(--color-bg));
}

[data-theme="light"] .sphere-core {
    background: radial-gradient(circle, rgba(45, 184, 76, 0.7), rgba(45, 184, 76, 0.3));
    box-shadow: 0 0 40px rgba(45, 184, 76, 0.35), inset 0 0 20px rgba(45, 184, 76, 0.25);
}

[data-theme="light"] .sphere-ring {
    border-color: rgba(45, 184, 76, 0.15);
}

[data-theme="light"] .ring-1 {
    border-color: rgba(45, 184, 76, 0.2) !important;
}

[data-theme="light"] .ring-2 {
    border-color: rgba(45, 184, 76, 0.15) !important;
}

[data-theme="light"] .ring-3 {
    border-color: rgba(45, 184, 76, 0.1) !important;
}

/* Live Transcript Area */
.voice-transcript-area {
    width: 100%;
    min-height: 80px;
    padding: var(--space-md);
    text-align: center;
}

.voice-transcript-student {
    font-size: 0.9rem;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    min-height: 1.2em;
    opacity: 0.9;
}

.voice-transcript-patient {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
    min-height: 1.2em;
}

/* End Session Button */
.voice-mode-controls {
    padding: var(--space-md) 0;
}

.voice-end-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-error);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
}

.voice-end-btn:hover {
    background: rgba(255, 68, 68, 0.25);
}

.voice-end-btn i {
    font-size: 1.2rem;
}

/* ========================================
   SPHERE EMOTION STATES
   Visual feedback for patient feelings
   ======================================== */

/* Pain — deep red throb */
.voice-sphere[data-emotion="pain"] .sphere-core {
    background: radial-gradient(circle, rgba(255, 68, 68, 0.7), rgba(200, 30, 30, 0.3)) !important;
    box-shadow: 0 0 50px rgba(255, 68, 68, 0.5), 0 0 100px rgba(255, 68, 68, 0.2) !important;
    animation: spherePainThrob 0.7s ease infinite !important;
}

.voice-sphere[data-emotion="pain"] .sphere-ring {
    border-color: rgba(255, 68, 68, 0.35) !important;
}

@keyframes spherePainThrob {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.12);
    }

    50% {
        transform: scale(0.94);
    }

    75% {
        transform: scale(1.06);
    }
}

/* Scared — orange rapid flicker */
.voice-sphere[data-emotion="scared"] .sphere-core {
    background: radial-gradient(circle, rgba(231, 76, 60, 0.7), rgba(245, 166, 35, 0.3)) !important;
    box-shadow: 0 0 40px rgba(231, 76, 60, 0.5) !important;
    animation: sphereScaredFlicker 0.4s ease infinite !important;
}

.voice-sphere[data-emotion="scared"] .sphere-ring {
    border-color: rgba(231, 76, 60, 0.3) !important;
}

.voice-sphere[data-emotion="scared"] .ring-1 {
    animation-duration: 1.5s !important;
}

.voice-sphere[data-emotion="scared"] .ring-2 {
    animation-duration: 1s !important;
}

@keyframes sphereScaredFlicker {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    25% {
        opacity: 0.6;
        transform: scale(1.03);
    }

    50% {
        opacity: 1;
        transform: scale(0.97);
    }

    75% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* Anxious — amber jittery */
.voice-sphere[data-emotion="anxious"] .sphere-core {
    background: radial-gradient(circle, rgba(245, 166, 35, 0.65), rgba(230, 140, 20, 0.25)) !important;
    box-shadow: 0 0 35px rgba(245, 166, 35, 0.4) !important;
    animation: sphereAnxiousJitter 0.3s ease infinite !important;
}

.voice-sphere[data-emotion="anxious"] .sphere-ring {
    border-color: rgba(245, 166, 35, 0.3) !important;
}

@keyframes sphereAnxiousJitter {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(-1px, 1px) scale(1.02);
    }

    50% {
        transform: translate(1px, -1px) scale(0.98);
    }

    75% {
        transform: translate(-1px, -1px) scale(1.01);
    }
}

/* Relieved — calm teal glow */
.voice-sphere[data-emotion="relieved"] .sphere-core {
    background: radial-gradient(circle, rgba(45, 184, 76, 0.6), rgba(38, 166, 154, 0.3)) !important;
    box-shadow: 0 0 40px rgba(38, 166, 154, 0.4), 0 0 80px rgba(45, 184, 76, 0.15) !important;
    animation: sphereRelievedBreath 3s ease infinite !important;
}

.voice-sphere[data-emotion="relieved"] .sphere-ring {
    border-color: rgba(38, 166, 154, 0.3) !important;
}

.voice-sphere[data-emotion="relieved"] .ring-1 {
    animation-duration: 10s !important;
}

.voice-sphere[data-emotion="relieved"] .ring-2 {
    animation-duration: 8s !important;
}

@keyframes sphereRelievedBreath {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.04);
        opacity: 1;
    }
}

/* Crying — blue with drip effect */
.voice-sphere[data-emotion="crying"] .sphere-core {
    background: radial-gradient(circle, rgba(74, 144, 217, 0.7), rgba(52, 100, 180, 0.3)) !important;
    box-shadow: 0 0 45px rgba(74, 144, 217, 0.5), 0 0 90px rgba(52, 100, 180, 0.2) !important;
    animation: sphereCryPulse 2s ease infinite !important;
}

.voice-sphere[data-emotion="crying"] .sphere-ring {
    border-color: rgba(74, 144, 217, 0.35) !important;
}

.voice-sphere[data-emotion="crying"] .ring-1 {
    animation: sphereCryDrip 2s ease infinite !important;
}

.voice-sphere[data-emotion="crying"] .ring-2 {
    animation: sphereCryDrip 2s ease 0.5s infinite !important;
}

@keyframes sphereCryPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03) translateY(2px);
    }
}

@keyframes sphereCryDrip {
    0% {
        transform: scale(1) translateY(0);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.1) translateY(8px);
        opacity: 0;
    }
}

/* Angry — aggressive red with shake */
.voice-sphere[data-emotion="angry"] .sphere-core {
    background: radial-gradient(circle, rgba(211, 84, 0, 0.75), rgba(192, 57, 43, 0.35)) !important;
    box-shadow: 0 0 50px rgba(211, 84, 0, 0.6), 0 0 100px rgba(192, 57, 43, 0.3) !important;
    animation: sphereAngryShake 0.15s ease infinite !important;
}

.voice-sphere[data-emotion="angry"] .sphere-ring {
    border-color: rgba(211, 84, 0, 0.4) !important;
}

.voice-sphere[data-emotion="angry"] .ring-1 {
    animation-duration: 1s !important;
}

.voice-sphere[data-emotion="angry"] .ring-2 {
    animation-duration: 0.8s !important;
}

.voice-sphere[data-emotion="angry"] .ring-3 {
    animation-duration: 0.6s !important;
}

@keyframes sphereAngryShake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 1px);
    }

    50% {
        transform: translate(2px, -1px);
    }

    75% {
        transform: translate(-1px, -2px);
    }
}

/* Confused — purple swirl */
.voice-sphere[data-emotion="confused"] .sphere-core {
    background: radial-gradient(circle, rgba(155, 89, 182, 0.6), rgba(142, 68, 173, 0.3)) !important;
    box-shadow: 0 0 40px rgba(155, 89, 182, 0.45) !important;
    animation: sphereConfusedWobble 2s ease infinite !important;
}

.voice-sphere[data-emotion="confused"] .sphere-ring {
    border-color: rgba(155, 89, 182, 0.3) !important;
}

.voice-sphere[data-emotion="confused"] .ring-1 {
    animation-direction: reverse !important;
    animation-duration: 3s !important;
}

.voice-sphere[data-emotion="confused"] .ring-2 {
    animation-direction: normal !important;
    animation-duration: 2s !important;
}

.voice-sphere[data-emotion="confused"] .ring-3 {
    animation-direction: reverse !important;
    animation-duration: 1.5s !important;
}

@keyframes sphereConfusedWobble {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    25% {
        transform: rotate(3deg) scale(1.02);
    }

    50% {
        transform: rotate(-2deg) scale(0.98);
    }

    75% {
        transform: rotate(1deg) scale(1.01);
    }
}

/* ========================================
   REPORT ACTION BUTTONS
   ======================================== */

.report-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding: var(--space-md) 0;
}

.report-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
}

.report-action-btn.retry {
    background: var(--color-glass);
    color: var(--color-text);
    border: 1px solid var(--color-glass-border);
}

.report-action-btn.retry:hover {
    background: rgba(255, 255, 255, 0.1);
}

.report-action-btn.dashboard {
    background: var(--color-primary);
    color: white;
}

.report-action-btn.dashboard:hover {
    filter: brightness(1.1);
}

.report-action-btn i {
    font-size: 1.1rem;
}

/* ========================================
   SYSTEM CARD ATTEMPT BADGE
   ======================================== */

.system-card-attempts {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--color-primary);
    margin-top: 2px;
}

.system-card-attempts i {
    font-size: 0.75rem;
}

/* ========================================
   PHASE LABEL INDICATOR
   ======================================== */

.phase-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(45, 184, 76, 0.08);
    padding: 6px 14px;
    margin: 0 var(--space-md);
    margin-top: var(--space-xs);
    border-radius: var(--radius-full);
    border: 1px solid rgba(45, 184, 76, 0.15);
    position: sticky;
    top: 52px;
    z-index: 18;
}

.phase-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: phaseDotPulse 2s ease infinite;
}

@keyframes phaseDotPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ========================================
   READY FOR EXAMINER CTA
   ======================================== */

.phase-ready-cta {
    position: fixed;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    box-sizing: border-box;
    padding: 8px 16px;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.phase-ready-cta.visible {
    opacity: 1;
    pointer-events: auto;
}

.phase-ready-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--color-primary), #1a9a3e);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    animation: phaseReadyPulse 2.5s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(45, 184, 76, 0.3);
}

.phase-ready-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(45, 184, 76, 0.4);
}

.phase-ready-btn:active {
    transform: translateY(0);
}

.phase-ready-btn i {
    font-size: 1.1rem;
}

@keyframes phaseReadyPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(45, 184, 76, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(45, 184, 76, 0.5);
    }
}

/* ========================================
   PHASE TRANSITION SCREEN
   ======================================== */

.transition-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
    gap: var(--space-lg);
    text-align: center;
    animation: osceFadeIn 0.5s ease;
}

.transition-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(45, 184, 76, 0.2), rgba(45, 184, 76, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: transitionCheckBounce 0.6s ease;
}

.transition-check i {
    font-size: 2rem;
    color: var(--color-primary);
}

@keyframes transitionCheckBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.transition-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.transition-stats-card {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    backdrop-filter: blur(16px);
    animation: osceFadeIn 0.6s ease 0.2s both;
}

.transition-stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.transition-stat i {
    color: var(--color-primary);
    font-size: 1rem;
}

.transition-stat strong {
    margin-inline-start: auto;
    color: var(--color-text);
    font-size: 0.95rem;
}

/* Transition Sphere — morphs from warm to cool */
.transition-sphere-wrap {
    margin: var(--space-lg) 0;
    animation: osceFadeIn 0.6s ease 0.4s both;
}

.transition-sphere {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 0 auto;
}

.transition-sphere .sphere-core {
    position: absolute;
    inset: 25%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 144, 217, 0.6), rgba(45, 184, 76, 0.3));
    box-shadow: 0 0 40px rgba(74, 144, 217, 0.4), 0 0 80px rgba(45, 184, 76, 0.15);
    animation: transitionSphereMorph 4s ease infinite;
}

.transition-sphere .sphere-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.transition-sphere .ring-1 {
    inset: 5%;
    border-color: rgba(74, 144, 217, 0.3);
    animation: sphereRotate1 4s linear infinite;
}

.transition-sphere .ring-2 {
    inset: 15%;
    border-color: rgba(45, 184, 76, 0.2);
    animation: sphereRotate2 3s linear infinite reverse;
}

@keyframes transitionSphereMorph {
    0% {
        background: radial-gradient(circle, rgba(45, 184, 76, 0.6), rgba(45, 184, 76, 0.2));
    }

    50% {
        background: radial-gradient(circle, rgba(74, 144, 217, 0.7), rgba(74, 144, 217, 0.3));
    }

    100% {
        background: radial-gradient(circle, rgba(74, 144, 217, 0.6), rgba(45, 184, 76, 0.2));
    }
}

.transition-next {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
    animation: osceFadeIn 0.6s ease 0.6s both;
}

.transition-countdown {
    font-size: 1.1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: osceFadeIn 0.6s ease 0.8s both;
}

.transition-countdown strong {
    font-size: 2rem;
    color: var(--color-primary);
    font-weight: 800;
    min-width: 2ch;
    text-align: center;
}

/* ========================================
   EXAMINER CHAT BUBBLE
   ======================================== */

.chat-bubble.examiner {
    flex-direction: row;
}

.chat-bubble.examiner .chat-bubble-avatar,
.examiner-avatar {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.2), rgba(74, 144, 217, 0.05));
    border-color: rgba(74, 144, 217, 0.3);
}

.examiner-avatar i {
    color: rgba(74, 144, 217, 0.9) !important;
}

.chat-bubble.examiner .chat-bubble-body {
    background: rgba(74, 144, 217, 0.08);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
}

[dir="rtl"] .chat-bubble.examiner .chat-bubble-body {
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}

/* ========================================
   PHASE SCORE BREAKDOWN (Report)
   ======================================== */

.phase-breakdown-section {
    border-color: rgba(45, 184, 76, 0.2) !important;
}

.phase-score-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.phase-score-card {
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.phase-score-card.phase1 {
    border-color: rgba(45, 184, 76, 0.2);
}

.phase-score-card.phase2 {
    border-color: rgba(74, 144, 217, 0.2);
}

.phase-score-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.phase-score-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.phase1 .phase-score-icon {
    background: rgba(45, 184, 76, 0.15);
    color: var(--color-primary);
}

.phase2 .phase-score-icon {
    background: rgba(74, 144, 217, 0.15);
    color: rgba(74, 144, 217, 0.9);
}

.phase-score-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.phase-score-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text);
}

.phase-score-max {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.phase-score-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    margin-top: var(--space-sm);
    overflow: hidden;
}

.phase-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.phase-comm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-glass);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.phase-comm-row strong {
    color: var(--color-text);
}

.phase-comm-row i {
    margin-inline-end: 4px;
}

/* ========================================
   RE-DO PHASE BUTTONS
   ======================================== */

.report-action-btn.redo-phase1 {
    background: rgba(45, 184, 76, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(45, 184, 76, 0.2);
}

.report-action-btn.redo-phase1:hover {
    background: rgba(45, 184, 76, 0.2);
}

.report-action-btn.redo-phase2 {
    background: rgba(74, 144, 217, 0.1);
    color: rgba(74, 144, 217, 0.9);
    border: 1px solid rgba(74, 144, 217, 0.2);
}

.report-action-btn.redo-phase2:hover {
    background: rgba(74, 144, 217, 0.2);
}

/* ========================================
   AUDIO REPLAY
   ======================================== */

.audio-replay-section .audio-player {
    width: 100%;
    margin-top: var(--space-sm);
    border-radius: var(--radius-md);
    background: var(--color-glass);
}

/* ========================================
   SMART DASHBOARD (OSCE Landing)
   ======================================== */

.smart-dash {
    padding: 0 var(--space-md);
    margin-bottom: var(--space-md);
}

/* Row 1: Phase Performance */
.dash-phase-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}

.dash-phase-ring {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.dash-phase-scores {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.dash-phase-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dash-phase-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 52px;
    flex-shrink: 0;
}

.dash-phase-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

[data-theme="light"] .dash-phase-bar {
    background: rgba(0, 0, 0, 0.06);
}

.dash-phase-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--color-primary);
    transition: width 0.8s ease;
}

.dash-phase-fill.phase2 {
    background: var(--color-accent-gold, #f5a623);
}

.dash-phase-val {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-text);
    min-width: 30px;
    text-align: right;
}

/* Row 2: General Stats */
.dash-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}

.dash-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dash-stat-item i {
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 2px;
}

.dash-stat-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1;
}

.dash-stat-lbl {
    font-size: 0.6rem;
    color: var(--color-text-muted);
}

.dash-stat-divider {
    width: 1px;
    height: 28px;
    background: var(--color-glass-border);
}

[data-theme="light"] .dash-stat-val {
    color: #1a1a1a;
}

.smart-dash-msg {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    margin: var(--space-xs) 0 0;
    font-weight: 500;
}

/* Progress Ring */
.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
}

[data-theme="light"] .progress-bg {
    stroke: rgba(0, 0, 0, 0.06);
}

.progress-fill {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s ease;
}

.progress-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--color-primary);
}

/* Recommendations — Card Style */
.smart-dash-recs {
    margin-top: var(--space-sm);
}

.recs-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    overflow-y: visible;
    padding: var(--space-xs) 0 var(--space-md);
    scrollbar-width: none;
}

.recs-scroll::-webkit-scrollbar {
    display: none;
}

.rec-chip {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    width: 150px;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    border: 1px solid var(--color-glass-border);
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.rec-chip:hover {
    border-color: var(--color-primary);
    background: var(--color-glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.rec-chip i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--color-primary);
    background: rgba(45, 184, 76, 0.1);
}

.rec-chip-title {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-chip-score {
    color: var(--color-error);
    font-weight: 700;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 59, 48, 0.08);
    align-self: flex-start;
}

.rec-chip-new {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(45, 184, 76, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}