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

:root {
    --primary: #223076;
    --primary-light: #3a4da0;
    --primary-dark: #161f50;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --sidebar-width: 280px;
    --toolbar-height: 48px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.12);
}

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

/* ── Index Page ──────────────────────────────────────── */
.index-page {
    overflow: auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.index-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    text-align: center;
    padding: 48px 24px 40px;
}

.index-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #fff;
    padding: 8px;
}

.index-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.index-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.tour-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.tour-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.tour-card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.tour-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.tour-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Academy Cards (global index) ───────────────────── */
.academy-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.academy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.academy-card-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #fff;
    padding: 4px;
}

.academy-card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.academy-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.academy-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.index-back-link {
    display: inline-block;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.index-back-link:hover {
    color: #fff;
}

.index-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--surface);
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--primary);
    color: #fff;
    min-height: 56px;
}

.sidebar-back {
    color: #fff;
    text-decoration: none;
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0.8;
    flex-shrink: 0;
}

.sidebar-back:hover {
    opacity: 1;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}

.sidebar-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
    flex-shrink: 0;
}

.sidebar-close:hover {
    opacity: 1;
}

.sidebar-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.sidebar-parcours {
    margin-bottom: 4px;
}

.parcours-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    user-select: none;
}

.parcours-header:hover {
    background: #f0f1f5;
}

.parcours-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.parcours-arrow.open {
    transform: rotate(90deg);
}

.parcours-scenes {
    list-style: none;
    display: none;
}

.parcours-scenes.open {
    display: block;
}

.sidebar-scene {
    padding: 8px 16px 8px 36px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

/* Standalone scenes (no parcours) */
.sidebar-list > .sidebar-scene {
    padding-left: 16px;
}

.sidebar-scene:hover {
    background: #f0f1f5;
}

.sidebar-scene.active {
    background: #e8eaf6;
    border-left-color: var(--primary);
    font-weight: 600;
    color: var(--primary);
}

/* ── Viewer ──────────────────────────────────────────── */
#viewer {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    transition: left 0.3s ease;
}

.sidebar-collapsed #viewer,
.sidebar.hidden ~ #viewer {
    left: 0;
}

#aframe-scene {
    width: 100%;
    height: 100%;
}

/* ── Toolbar ─────────────────────────────────────────── */
#toolbar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.65);
    padding: 6px 12px;
    border-radius: 24px;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ── Hotspots (A-Frame entities styled via JS) ──────── */
/* Cursor change on hover is handled by A-Frame raycaster */

/* ── Tooltip ─────────────────────────────────────────── */
.tooltip {
    position: fixed;
    z-index: 200;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    max-width: 250px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.tooltip.hidden {
    display: none;
}

/* ── Modal (<dialog> — uses browser top-layer via showModal()) ── */
dialog.modal {
    /* Reset dialog defaults */
    border: none;
    padding: 0;
    background: transparent;
    max-width: none;
    max-height: none;
}

dialog.modal[open] {
    width: 100vw;
    height: 100vh;
    /* Center content */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

dialog.modal::backdrop {
    background: rgba(0,0,0,0.75);
}

/* Hide backdrop div — we use the native ::backdrop instead */
dialog.modal .modal-backdrop {
    display: none;
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    width: 90vw;
    max-width: 1000px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.8);
}

#modal-body {
    flex: 1;
    overflow: hidden;
    overflow-y: auto;
}

#modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#modal-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#modal-body video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }

    .sidebar {
        width: 85%;
        max-width: 320px;
    }

    #viewer {
        left: 0;
    }

    .modal-content {
        width: 95vw;
        height: 80vh;
        border-radius: 8px;
    }

    .index-header {
        padding: 32px 16px;
    }

    .index-header h1 {
        font-size: 1.5rem;
    }

    .index-grid {
        padding: 16px;
        gap: 16px;
    }
}

/* ── Fullscreen mode (CSS-based, no Fullscreen API) ──── */
body.is-fullscreen .sidebar {
    transform: translateX(-100%) !important;
}

#viewer.is-fullscreen {
    left: 0 !important;
    z-index: 9999;
}

/* ── Loading indicator ───────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    color: #fff;
    font-size: 1.2rem;
    transition: opacity 0.5s;
}

.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ── Quiz styles ───────────────────────────────────── */
.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
    color: #1a1a2e;
}

.quiz-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #1a1a2e;
}

.quiz-question {
    margin-bottom: 2rem;
}

.quiz-question-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-answer {
    background: rgba(0,0,0,0.05);
    border: 2px solid rgba(0,0,0,0.15);
    color: #1a1a2e;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}

.quiz-answer:hover:not(:disabled) {
    background: rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.3);
}

.quiz-answer:disabled {
    cursor: default;
    opacity: 0.7;
}

.quiz-answer.correct {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10B981;
    opacity: 1;
}

.quiz-answer.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #EF4444;
    opacity: 1;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.quiz-feedback.correct {
    background: rgba(16, 185, 129, 0.2);
    border-left: 4px solid #10B981;
}

.quiz-feedback.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-left: 4px solid #EF4444;
}

/* Quiz - Multiple select */
.quiz-answer.selected {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3B82F6;
}

.quiz-validate,
.quiz-reset {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.quiz-validate:hover,
.quiz-reset:hover {
    background: var(--primary-light);
}

.quiz-validate:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Quiz - Ordering */
.quiz-answers.ordering {
    gap: 0.75rem;
}

.quiz-instruction {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.quiz-answer.ordering-item {
    position: relative;
    padding-left: 2.5rem;
}

.quiz-answer.ordering-item .order-number {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: #fff;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
}

.quiz-answer.ordered {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3B82F6;
    cursor: default;
}

.quiz-reset {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
}

.quiz-reset:hover {
    background: rgba(255,255,255,0.1);
}

/* ── Hotspot label on hover ──────────────────────────── */
.hotspot-label {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -120%);
}

/* ── Hotspot Edit Mode ──────────────────────────────── */
.hotspot-edit-active {
    cursor: crosshair !important;
}

.hotspot-edit-active #aframe-scene {
    outline: 3px solid #00e5ff;
    outline-offset: -3px;
}

#hotspot-edit-badge {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #00e5ff;
    color: #000;
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 6px;
    z-index: 99998;
    letter-spacing: 1px;
    pointer-events: none;
    text-transform: uppercase;
}

#hotspot-props-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.9);
    color: #fff;
    font-family: monospace;
    font-size: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    z-index: 99999;
    min-width: 300px;
    max-height: 90vh;
    overflow-y: auto;
    line-height: 1.5;
    user-select: text;
}

#hotspot-props-panel .hp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

#hotspot-props-panel .hp-title {
    color: #00e5ff;
    font-size: 13px;
    font-weight: 700;
}

#hotspot-props-panel .hp-hint {
    color: #888;
    font-size: 10px;
}

#hotspot-props-panel .hp-section {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #333;
}

#hotspot-props-panel .hp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

#hotspot-props-panel .hp-label {
    color: #aaa;
    min-width: 70px;
    flex-shrink: 0;
}

#hotspot-props-panel .hp-value {
    color: #81C784;
}

#hotspot-props-panel .hp-info {
    color: #FFD54F;
    word-break: break-all;
}

#hotspot-props-panel input[type="number"] {
    background: #222;
    border: 1px solid #555;
    color: #81C784;
    font-family: monospace;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    width: 72px;
}

#hotspot-props-panel input[type="number"]:focus {
    border-color: #00e5ff;
    outline: none;
}

#hotspot-props-panel .hp-btn {
    padding: 5px 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: monospace;
    font-size: 11px;
    color: #fff;
    flex: 1;
}

#hotspot-props-panel .hp-btn-blue { background: #1976D2; }
#hotspot-props-panel .hp-btn-green { background: #388E3C; }
#hotspot-props-panel .hp-btn-red { background: #C62828; }
#hotspot-props-panel .hp-btn-orange { background: #E65100; }

#hotspot-props-panel .hp-btn:hover { opacity: 0.85; }

#hotspot-props-panel .hp-copied {
    color: #00e5ff;
    text-align: center;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.3s;
    margin-top: 4px;
}

#hotspot-props-panel .hp-no-sel {
    color: #888;
    text-align: center;
    padding: 12px 0;
    font-style: italic;
}

/* ── Progress Panel ─────────────────────────────────── */
dialog.progress-dialog {
    border: none;
    padding: 0;
    background: transparent;
    max-width: none;
    max-height: none;
}

dialog.progress-dialog[open] {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

dialog.progress-dialog::backdrop {
    background: rgba(0,0,0,0.75);
}

.progress-dialog-content {
    background: var(--surface);
    border-radius: 12px;
    width: 90vw;
    max-width: 800px;
    height: 85vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.progress-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
}

.progress-dialog-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.progress-dialog-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.progress-btn-print {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.progress-btn-print:hover {
    background: rgba(255,255,255,0.3);
}

.progress-dialog-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px 8px;
    line-height: 1;
}

.progress-dialog-close:hover {
    opacity: 1;
}

#progress-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Progress panel content */
.pg-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 1rem;
}

.pg-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.pg-learner {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.pg-tour-title {
    font-size: 1rem;
    color: var(--text);
    margin-top: 4px;
}

.pg-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.pg-summary {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.pg-summary-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.pg-summary-item {
    flex: 1;
    min-width: 120px;
}

.pg-summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.pg-summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.pg-status-done { color: #10B981; }
.pg-status-progress { color: #F59E0B; }
.pg-status-todo { color: var(--text-muted); }

.pg-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}

.pg-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Tree structure */
.pg-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pg-parcours {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.pg-parcours-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f3f4f6;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.pg-parcours-title {
    flex: 1;
}

.pg-scene {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
    overflow: hidden;
}

.pg-parcours .pg-scene {
    border: none;
    border-top: 1px solid #e5e7eb;
    border-radius: 0;
    margin-bottom: 0;
}

.pg-scene-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fafbfc;
}

.pg-scene-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
}

.pg-scene-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pg-components {
    padding: 4px 14px 8px 38px;
}

.pg-component {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 0.85rem;
    color: var(--text);
}

.pg-comp-title {
    flex: 1;
}

.pg-comp-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Icons / badges */
.pg-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.pg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.pg-badge-pass { background: #d1fae5; color: #059669; }
.pg-badge-wip { background: #fef3c7; color: #d97706; }
.pg-badge-fail { background: #fee2e2; color: #dc2626; }
.pg-badge-na { background: #f3f4f6; color: #9ca3af; }

/* Quiz */
.pg-quiz {
    margin: 4px 0;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.pg-quiz-passed { border-color: #a7f3d0; }
.pg-quiz-failed { border-color: #fecaca; }

.pg-quiz-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #fafbfc;
    font-size: 0.85rem;
}

.pg-quiz-score {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    margin-left: auto;
}

.pg-quiz-tries {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pg-questions {
    padding: 6px 10px 10px 36px;
}

.pg-question {
    padding: 4px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid #f3f4f6;
}

.pg-question:last-child { border-bottom: none; }

.pg-q-text {
    color: var(--text);
}

.pg-q-answer {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
    padding-left: 16px;
}

.pg-q-na { font-style: italic; }

.pg-q-correct .pg-q-text::before { content: ""; }
.pg-q-correct { border-left: 3px solid #10B981; padding-left: 8px; }
.pg-q-wrong { border-left: 3px solid #EF4444; padding-left: 8px; }
.pg-q-none { border-left: 3px solid #e5e7eb; padding-left: 8px; }

/* ── Print styles ───────────────────────────────────── */
@media print {
    /* Hide everything except the progress dialog */
    body > *:not(dialog) {
        display: none !important;
    }

    dialog.progress-dialog,
    dialog.progress-dialog[open] {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        background: white !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    dialog.progress-dialog::backdrop {
        display: none !important;
    }

    .progress-dialog-content {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .progress-dialog-header {
        background: white !important;
        color: var(--primary) !important;
        border-bottom: 2px solid var(--primary);
        padding: 12px 0 !important;
    }

    .progress-dialog-actions {
        display: none !important;
    }

    #progress-body {
        overflow: visible !important;
        padding: 16px 0 !important;
    }

    .pg-summary {
        background: #f8f9fb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pg-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pg-bar, .pg-bar-fill {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pg-scene, .pg-parcours, .pg-quiz {
        break-inside: avoid;
    }
}
