/* style.css — frisechrono.fr — v1.0 */

/* ===== CSS Custom Properties ===== */
:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #DBEAFE;
    --secondary: #F59E0B;
    --secondary-hover: #D97706;
    --bg: #FFFFFF;
    --surface: #F8FAFC;
    --surface-hover: #F1F5F9;
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --toolbar-h: 56px;
    --sidebar-w: 300px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea {
    font-family: inherit;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
ul { list-style: none; }

/* ===== Utilities ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-cta { background: var(--secondary); color: #fff; font-weight: 600; }
.btn-cta:hover { background: var(--secondary-hover); color: #fff; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; border-radius: var(--radius); }
.btn-icon:hover { background: var(--surface-hover); }

/* ===== Navigation ===== */
.main-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 2rem;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
    flex-shrink: 0;
}
.nav-logo:hover { color: var(--text); }
.nav-links { display: flex; gap: 1.5rem; flex: 1; }
.nav-link { color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; transition: color 0.15s; }
.nav-link:hover { color: var(--text); }
.nav-cta { margin-left: auto; }
.mobile-nav-cta { display: none; }
/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-menu { top: calc(100% + 8px); left: -1rem; }
.nav-dropdown .nav-link { display: inline-flex; align-items: center; gap: 0.25rem; }
.nav-mobile-toggle { display: none; }

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0.75rem;
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links .nav-link { display: block; width: 100%; padding: .55rem 0; font-size: .95rem; }
    .nav-links .nav-dropdown { width: 100%; }
    .nav-links .dropdown-menu { position: static; width: 100%; max-height: 48vh; overflow-y: auto; margin-top: .35rem; box-shadow: none; }
    .nav-cta { display: none; }
    .mobile-nav-cta { display: inline-flex; justify-content: center; width: 100%; margin-top: .35rem; }
    .nav-mobile-toggle { display: flex; align-items: center; margin-left: auto; color: var(--text); }
}

/* ===== Homepage Hero ===== */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}
.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}
.hero .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}
.hero .btn-cta { font-size: 1.125rem; padding: 0.875rem 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.hero-proof { margin: .9rem 0 0; color: var(--text-muted); font-size: .82rem; font-weight: 600; }
.intent-section { padding: 1.5rem 0 0; }
.intent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.intent-card { display: grid; gap: .2rem; padding: 1rem; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.intent-card:hover { color: var(--primary); border-color: #93C5FD; transform: translateY(-1px); }
.intent-card strong { font-size: .9rem; }
.intent-card span { color: var(--text-muted); font-size: .76rem; line-height: 1.35; }

/* Mini timeline animation */
.hero-timeline {
    margin: 3rem auto 0;
    max-width: 600px;
    height: 60px;
    position: relative;
}
.hero-timeline-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transform: translateY(-50%);
}
.hero-timeline-dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 3px solid var(--bg);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow-sm);
    animation: dotPulse 2s ease-in-out infinite;
}
.hero-timeline-dot:nth-child(2) { left: 25%; animation-delay: 0s; }
.hero-timeline-dot:nth-child(3) { left: 45%; animation-delay: 0.3s; }
.hero-timeline-dot:nth-child(4) { left: 65%; animation-delay: 0.6s; }
.hero-timeline-dot:nth-child(5) { left: 85%; animation-delay: 0.9s; background: var(--secondary); }
@keyframes dotPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* ===== Sections ===== */
.section { padding: 4rem 0; }
.section-alt { background: var(--surface); }
.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
}
.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* ===== Style Cards ===== */
.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
.style-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}
.style-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.style-card-preview {
    height: 120px;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.style-card h3 { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.style-card p { font-size: 0.8125rem; color: var(--text-secondary); }

/* Style card inline SVG previews */
.style-preview-svg { width: 90%; height: 80%; }

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.step { text-align: center; }
.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}
.step h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.step p { font-size: 0.875rem; color: var(--text-secondary); }

@media (max-width: 640px) {
    .steps { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ===== Features Grid ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-item h4 { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.feature-item p { font-size: 0.8125rem; color: var(--text-secondary); }

/* ===== Audience / Ideal For ===== */
.audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.audience-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.9375rem;
}

/* ===== Templates Grid ===== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.template-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
}
.template-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.template-card-preview {
    height: 140px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.template-card-body { padding: 1rem 1.25rem; }
.template-card h3 { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.template-card p { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 0.75rem; }

/* ===== FAQ ===== */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    border-bottom: 1px solid var(--border);
}
.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.faq-question svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.2s;
}
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
    display: none;
    padding: 0 0 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* ===== Footer ===== */
.site-footer {
    background: var(--text);
    color: #CBD5E1;
    padding: 3rem 0 0;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}
.footer-logo:hover { color: #fff; }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; }
.footer-links h4 { color: #fff; font-size: 0.875rem; margin-bottom: 0.75rem; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: #94A3B8; font-size: 0.8125rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8125rem;
}
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ===== Editor Layout ===== */
.editor-page { overflow: hidden; height: 100vh; }
.editor-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--toolbar-h) 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Editor toolbar */
.editor-toolbar {
    grid-column: 1 / -1;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.25rem;
    z-index: 50;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.editor-toolbar::-webkit-scrollbar { display: none; }
.editor-toolbar > *, .toolbar-group, .toolbar-btn { flex-shrink: 0; }
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}
.toolbar-separator {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 0.5rem;
}
.toolbar-spacer { flex: 1; }
.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
    position: relative;
}
.toolbar-btn:hover { background: var(--surface-hover); color: var(--text); }
.toolbar-btn.active { background: var(--primary-light); color: var(--primary); }
.toolbar-btn svg { width: 18px; height: 18px; }

/* Dropdown menus */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    z-index: 200;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text);
    text-align: left;
    transition: background 0.1s;
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--text-secondary); }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.375rem 0; }

/* Editor sidebar */
.editor-sidebar {
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--bg);
    padding: 1rem;
}
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.sidebar-field { margin-bottom: 0.75rem; }
.sidebar-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.sidebar-field input,
.sidebar-field select,
.sidebar-field textarea {
    width: 100%;
}
.sidebar-field textarea { resize: vertical; min-height: 60px; }
.sidebar-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.sidebar-field input[type="color"] {
    width: 100%;
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

/* Editor canvas */
.editor-canvas {
    overflow: auto;
    background: #E5E7EB;
    position: relative;
    cursor: grab;
}
.editor-canvas:active { cursor: grabbing; }
.editor-canvas-inner {
    position: relative;
    min-width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.timeline-container {
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    position: relative;
}

.editor-empty-state {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    width: min(720px, calc(100% - 2rem));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.97);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: default;
}
.editor-empty-state[hidden] { display: none; }
.editor-empty-state-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
}
.editor-empty-state strong { display: block; font-size: 0.875rem; }
.editor-empty-state p { margin: 0.15rem 0 0; color: var(--text-secondary); font-size: 0.75rem; line-height: 1.4; }
.editor-empty-state-actions { display: flex; gap: 0.5rem; white-space: nowrap; }

/* Zoom controls */
.zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem;
    box-shadow: var(--shadow-md);
    z-index: 30;
}
.zoom-controls button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}
.zoom-controls button:hover { background: var(--surface-hover); color: var(--text); }
.zoom-controls span { font-size: 0.75rem; font-weight: 500; min-width: 40px; text-align: center; }

/* Selected element styles */
.element-selected { outline: 2px dashed var(--primary); outline-offset: 2px; cursor: move; }
.resize-handle {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border: 1px solid var(--bg);
    border-radius: 2px;
    position: absolute;
    z-index: 20;
}

/* ===== Mobile editor ===== */
@media (max-width: 768px) {
    .editor-layout {
        grid-template-columns: 1fr;
        grid-template-rows: var(--toolbar-h) 1fr;
    }
    .editor-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        border-top: 1px solid var(--border);
        border-right: none;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 80;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    }
    .editor-sidebar.open { transform: translateY(0); }
    .editor-sidebar-handle {
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border-strong);
        border-radius: 2px;
        margin: 0.5rem auto 0.75rem;
    }
    .toolbar-btn span { display: none; }
    .editor-toolbar { padding: .25rem .4rem; gap: .1rem; }
    .editor-toolbar .toolbar-separator { display: none; }
    .editor-toolbar .toolbar-spacer { min-width: .25rem; }
    .toolbar-btn { min-width: 38px; min-height: 40px; justify-content: center; padding: .4rem; }
    .editor-canvas { overscroll-behavior: contain; }
    .editor-empty-state {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }
    .editor-empty-state-actions { grid-column: 1 / -1; width: 100%; }
    .editor-empty-state-actions .btn { flex: 1; }
}
@media (min-width: 769px) {
    .editor-sidebar-handle { display: none; }
}

/* ===== Gallery ===== */
.gallery-header { padding: 2rem 0; }
.gallery-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 0.375rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.gallery-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}
.gallery-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gallery-card-preview {
    height: 160px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.gallery-card-body { padding: 1rem 1.25rem; }
.gallery-card h3 { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.gallery-card p { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.gallery-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.pagination button {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    background: var(--bg);
    color: var(--text);
    transition: all 0.15s;
}
.pagination button:hover, .pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== FAQ Page ===== */
.faq-page-hero {
    padding: 3rem 0 2rem;
    text-align: center;
    background: var(--surface);
}
.faq-page-hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.faq-content { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }
.faq-content h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; color: var(--text); }
.faq-content p { margin-bottom: 1rem; color: var(--text-secondary); line-height: 1.7; }

/* ===== Guide Sections ===== */
.guide-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.guide-section h2 { font-size: 1.375rem; margin-bottom: 1rem; }
.guide-section p { margin-bottom: 0.75rem; font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7; }

/* ===== Modals ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 1.0625rem; font-weight: 600; }
.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ===== Library Panel ===== */
.library-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 35;
    display: none;
    flex-direction: column;
}
.library-panel.open { display: flex; }
.library-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.library-header h3 { font-size: 0.9375rem; font-weight: 600; }
.library-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.library-search input { width: 100%; }
.library-body { flex: 1; overflow-y: auto; padding: 0.5rem; }
.library-category { margin-bottom: 0.5rem; }
.library-category-title {
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}
.library-event {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.1s;
}
.library-event:hover { background: var(--surface-hover); }
.library-event input[type="checkbox"] { flex-shrink: 0; }
.library-event-date { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }
.library-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

/* ===== Notifications / Toast ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    z-index: 600;
    transition: transform 0.3s ease;
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== Ad slots ===== */
.ad-slot {
    text-align: center;
    padding: 0.5rem;
    min-height: 90px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.ad-slot-editor {
    grid-column: 1 / -1;
    height: 60px;
    min-height: 60px;
}

/* ===== Responsive typography ===== */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.875rem; }
    .hero .subtitle { font-size: 1rem; }
    .section-title { font-size: 1.5rem; }
    .hero { padding: 2.5rem 0 1.75rem; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .hero-timeline { margin-top: 1.75rem; }
    .intent-grid { grid-template-columns: 1fr 1fr; }
    .intent-card { padding: .85rem; }
    .section { padding: 2.5rem 0; }
}

/* Editorial period pages and crawlable model gallery */
.period-detail-hero { padding: 3.5rem 0 2.75rem; color: #fff; background: linear-gradient(125deg, #172554, var(--period-color) 70%, #0EA5E9); }
.period-detail-hero h1 { max-width: 900px; margin: .25rem 0 .8rem; color: #fff; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.08; }
.period-detail-hero p { max-width: 780px; margin: 0 0 1.25rem; color: #DBEAFE; line-height: 1.6; }
.period-timeline { display: grid; grid-template-columns: repeat(var(--event-count), minmax(120px, 1fr)); min-width: 820px; gap: .65rem; padding: 1.35rem; background: #F8FAFC; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.period-event { position: relative; padding: .8rem .7rem; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--period-color); border-radius: var(--radius); }
.period-event time { display: block; margin-bottom: .3rem; color: var(--period-color); font-size: .74rem; font-weight: 800; }
.period-event strong { font-size: .78rem; line-height: 1.3; }
.period-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: 1.25rem 0 2rem; }
.period-links a { padding: .75rem; color: var(--text-secondary); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; font-size: .78rem; font-weight: 700; }
.period-links a:hover, .period-links a[aria-current="page"] { color: #fff; background: var(--primary); border-color: var(--primary); }
.featured-gallery { margin-bottom: 3rem; }
.gallery-card-model { display: flex; flex-direction: column; }
.gallery-card-model .gallery-card-preview { height: 118px; background: linear-gradient(145deg, #EFF6FF, #F8FAFC); }
.gallery-card-model .gallery-card-preview svg { width: 82%; height: 70px; }
.gallery-card-model .gallery-card-body { flex: 1; }
.community-heading { margin: 0 0 .35rem; }
@media (max-width: 760px) {
    .intent-grid, .period-links { grid-template-columns: 1fr 1fr; }
    .period-detail-hero { padding: 2.5rem 0 2rem; }
}
@media (max-width: 430px) {
    .intent-grid, .period-links { grid-template-columns: 1fr; }
}

/* ===== Print ===== */
@media print {
    .editor-toolbar, .editor-sidebar, .zoom-controls, .no-print, .main-nav, .site-footer, .ad-slot { display: none !important; }
    .editor-canvas { overflow: visible !important; background: white !important; }
    .editor-layout { display: block !important; height: auto !important; }
    .timeline-container { box-shadow: none !important; }
    .timeline-svg { width: 100% !important; height: auto !important; }
    body.printing-timeline * { visibility: hidden !important; }
    body.printing-timeline .print-target,
    body.printing-timeline .print-target * { visibility: visible !important; }
    body.printing-timeline .print-target {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 10mm !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }
    body.printing-timeline .print-target svg {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
    }
}

/* Shared actions for printable timelines and SEO tools */
.timeline-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
    margin: 1rem 0 0;
}
.tool-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.tool-field label {
    display: block;
    margin-bottom: .4rem;
    color: var(--text-secondary);
    font-size: .8125rem;
    font-weight: 700;
}
.tool-field input, .tool-field select, .tool-field textarea {
    width: 100%;
    padding: .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font: inherit;
}
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus {
    outline: 2px solid var(--primary-light);
    border-color: var(--primary);
}
.tool-help { color: var(--text-muted); font-size: .8125rem; line-height: 1.5; }
@media (max-width: 640px) {
    .tool-panel { padding: 1rem; }
    .timeline-actions .btn { width: 100%; text-align: center; }
}

/* ===== Import list / CSV ===== */
.modal-wide { width: min(760px, calc(100vw - 2rem)); max-width: 760px; }
.modal-help { margin: 0 0 1rem; color: var(--text-secondary); line-height: 1.55; }
.modal-help code { padding: .15rem .35rem; color: #1E3A8A; background: #EFF6FF; border-radius: 4px; }
.import-textarea { min-height: 180px; resize: vertical; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.import-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.import-file-row { display: flex; align-items: center; gap: .75rem; margin: .75rem 0; color: var(--text-muted); font-size: .8125rem; }
.import-preview { min-height: 58px; padding: .85rem 1rem; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); line-height: 1.45; }
.import-preview.is-valid { color: #065F46; background: #ECFDF5; border-color: #A7F3D0; }
.import-preview.has-errors { border-color: #FBBF24; }
.import-preview ul { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 1rem; margin: .55rem 0 0 1.1rem; color: var(--text-secondary); font-size: .8rem; }
.import-preview small { display: block; margin-top: .45rem; }
.import-errors { color: #92400E; }
.share-field { margin-bottom: 1.15rem; }
.share-field label { display: block; margin-bottom: .4rem; font-size: .875rem; font-weight: 700; }
.share-field > div { display: flex; align-items: stretch; gap: .5rem; }
.share-field input, .share-field textarea { flex: 1; min-width: 0; padding: .65rem .75rem; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font: .82rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.share-privacy { margin: .5rem 0 0; color: var(--text-muted); font-size: .8125rem; }

.content-narrow { max-width: 900px; }
.section-muted { background: var(--surface); }
.eyebrow { display: inline-block; margin-bottom: .65rem; color: var(--primary); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.import-hero { padding-top: 3.5rem; background: linear-gradient(180deg, #EFF6FF 0, #fff 56%); }
.import-heading { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 2rem; align-items: end; margin-bottom: 2rem; }
.import-heading h1 { max-width: 800px; margin: 0 0 .75rem; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.04em; }
.import-heading p { max-width: 760px; margin: 0; color: var(--text-secondary); font-size: 1.08rem; line-height: 1.7; }
.import-format-card { display: grid; gap: .45rem; padding: 1rem 1.1rem; background: #0F172A; color: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.import-format-card strong { font-size: .8rem; color: #93C5FD; text-transform: uppercase; letter-spacing: .06em; }
.import-format-card code { font-size: .76rem; color: #E2E8F0; white-space: nowrap; }
.public-import-tool { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); overflow: hidden; background: #fff; border: 1px solid #CBD5E1; border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .12); }
.public-import-inputs { padding: 1.5rem; }
.public-import-visual { padding: 1.5rem; background: #0F172A; color: #fff; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; margin-bottom: .4rem; font-size: .84rem; font-weight: 700; }
.form-field input, .form-field textarea, .form-field select { width: 100%; padding: .75rem .85rem; color: var(--text); background: #fff; border: 1px solid #CBD5E1; border-radius: var(--radius); font: inherit; }
.form-field textarea { min-height: 250px; font: .85rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: 3px solid #DBEAFE; border-color: var(--primary); }
.form-field.compact { min-width: 230px; margin: 0; }
.public-import-actions-row { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.public-import-actions-row > label { margin: 0; cursor: pointer; }
.public-import-result { display: flex; flex-wrap: wrap; gap: .25rem .75rem; min-height: 50px; margin-bottom: 1rem; padding: .75rem .9rem; color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.public-import-result.is-valid { color: #065F46; background: #ECFDF5; border-color: #A7F3D0; }
.public-import-result.has-errors { color: #92400E; background: #FFFBEB; border-color: #FDE68A; }
.public-import-result span, .public-import-result small { display: block; width: 100%; }
.public-import-inputs > .btn-primary { width: 100%; }
.public-import-visual-title { margin-bottom: 1rem; color: #93C5FD; font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.public-import-preview { position: relative; display: grid; gap: .65rem; padding-left: .25rem; }
.public-import-preview::before { content: ''; position: absolute; top: 14px; bottom: 14px; left: 92px; width: 2px; background: #334155; }
.public-import-event { position: relative; display: grid; grid-template-columns: 76px 12px minmax(0, 1fr); gap: .65rem; align-items: center; min-height: 34px; }
.public-import-event span { color: #CBD5E1; font-size: .76rem; text-align: right; }
.public-import-event i { position: relative; z-index: 1; width: 12px; height: 12px; background: var(--event-color); border: 3px solid #0F172A; border-radius: 50%; box-shadow: 0 0 0 2px var(--event-color); }
.public-import-event strong { color: #F8FAFC; font-size: .84rem; line-height: 1.25; }
.public-import-preview > p { margin: .25rem 0 0 6.4rem; color: #94A3B8; font-size: .8rem; }
.public-import-local-note { margin: 1.5rem 0 0; padding-top: 1rem; color: #94A3B8; border-top: 1px solid #334155; font-size: .78rem; line-height: 1.5; }
.csv-example { overflow-x: auto; margin: 1rem 0 2rem; padding: 1rem; color: #E2E8F0; background: #0F172A; border-radius: var(--radius); font-size: .82rem; line-height: 1.65; }
.accepted-formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin: 1rem 0 2rem; }
.accepted-formats span { padding: .75rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-secondary); font-size: .85rem; }
.accepted-formats strong { display: block; color: var(--text); }

/* ===== Read-only presentation / embed ===== */
.viewer-page { background: #F1F5F9; }
.viewer-shell { width: min(1500px, calc(100% - 2rem)); min-height: 620px; margin: 1rem auto; overflow: hidden; background: #fff; border: 1px solid #CBD5E1; border-radius: 18px; box-shadow: 0 18px 55px rgba(15, 23, 42, .12); }
.viewer-embed { overflow: hidden; background: #fff; }
.viewer-embed .viewer-shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.viewer-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; color: #fff; background: #0F172A; }
.viewer-toolbar-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.viewer-toolbar-brand a { flex: 0 0 auto; }
.viewer-toolbar-brand div { display: grid; min-width: 0; }
.viewer-toolbar-brand strong { overflow: hidden; color: #F8FAFC; font-size: .95rem; white-space: nowrap; text-overflow: ellipsis; }
.viewer-toolbar-brand span { color: #94A3B8; font-size: .72rem; }
.viewer-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.viewer-toolbar .btn-secondary { color: #E2E8F0; background: #1E293B; border-color: #475569; }
.viewer-stage { min-height: 500px; padding: 1.25rem; }
.viewer-loading { display: grid; min-height: 430px; place-items: center; color: var(--text-muted); }
.viewer-loading.has-error { color: #B91C1C; }
.viewer-periods { display: flex; gap: .6rem; overflow-x: auto; padding: .25rem 0 1rem; }
.viewer-periods > span { flex: 0 0 auto; display: grid; gap: .08rem; min-width: 150px; padding: .55rem .7rem .55rem .85rem; background: color-mix(in srgb, var(--period-color) 9%, white); border-left: 4px solid var(--period-color); border-radius: 6px; }
.viewer-periods strong { font-size: .78rem; }
.viewer-periods small { color: var(--text-muted); font-size: .68rem; }
.viewer-track-wrap { overflow-x: auto; padding: 1rem 0 1.4rem; scrollbar-color: #94A3B8 #E2E8F0; }
.viewer-track { position: relative; display: flex; align-items: stretch; gap: 1rem; min-width: max-content; padding: 1.2rem 2rem; }
.viewer-track::before { content: ''; position: absolute; top: 49px; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, #CBD5E1, #2563EB 50%, #CBD5E1); }
.viewer-event { position: relative; display: grid; grid-template-rows: 24px 26px 1fr; justify-items: center; width: 165px; padding: 0; color: var(--text); text-align: center; background: transparent; border: 0; cursor: pointer; }
.viewer-event-date { color: var(--text-muted); font-size: .72rem; font-weight: 700; }
.viewer-event i { position: relative; z-index: 1; width: 18px; height: 18px; margin-top: 1px; background: var(--event-color); border: 4px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--event-color); transition: transform .15s ease; }
.viewer-event strong { align-self: start; margin-top: .65rem; padding: .55rem .6rem; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; box-shadow: 0 5px 15px rgba(15,23,42,.06); font-size: .78rem; line-height: 1.3; }
.viewer-event:hover i, .viewer-event.active i { transform: scale(1.25); }
.viewer-event.active strong { color: #1D4ED8; background: #EFF6FF; border-color: #93C5FD; }
.viewer-navigation { display: grid; grid-template-columns: 44px minmax(0, 720px) 44px; justify-content: center; align-items: stretch; gap: .8rem; margin: 0 auto; }
.viewer-nav-button { align-self: center; width: 42px; height: 42px; color: #1E3A8A; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 50%; font-size: 1.25rem; cursor: pointer; }
.viewer-detail { position: relative; min-height: 175px; padding: 1.35rem 1.5rem; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; }
.viewer-detail time { display: block; color: var(--primary); font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.viewer-detail h2 { margin: .3rem 0 .55rem; font-size: 1.45rem; }
.viewer-detail p { margin: 0; color: var(--text-secondary); line-height: 1.65; }
.viewer-detail-counter { position: absolute; top: 1rem; right: 1rem; color: var(--text-muted); font-size: .72rem; }
.viewer-detail-category { display: inline-block; margin-top: .8rem; padding: .2rem .5rem; color: #334155; background: #E2E8F0; border-radius: 999px; font-size: .7rem; }
.viewer-attribution { padding: .55rem 1rem; text-align: center; background: #F8FAFC; border-top: 1px solid #E2E8F0; font-size: .72rem; }
.viewer-attribution a { color: #64748B; }
.viewer-not-found { padding: 7rem 0; text-align: center; }

/* ===== Educational printable packs ===== */
.school-page { background: #fff; }
.school-hero { padding: 3.8rem 0 2.8rem; color: #fff; background: linear-gradient(125deg, #172554, #1D4ED8 62%, #0EA5E9); }
.school-hero h1 { max-width: 900px; margin: 0 0 .8rem; color: #fff; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.08; letter-spacing: -.035em; }
.school-hero p { max-width: 850px; margin: 0; color: #DBEAFE; font-size: 1.05rem; line-height: 1.65; }
.school-hero .eyebrow { color: #BAE6FD; }
.brevet-hero { background: linear-gradient(125deg, #450A0A, #B91C1C 60%, #F97316); }
.brevet-hero .eyebrow { color: #FED7AA; }
.exercise-hero { background: linear-gradient(125deg, #052E16, #047857 60%, #14B8A6); }
.exercise-hero .eyebrow { color: #A7F3D0; }
.school-workspace-section { background: #F1F5F9; }
.school-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: .7rem; background: #fff; border: 1px solid #CBD5E1; border-radius: 12px; box-shadow: var(--shadow-sm); }
.school-mode-buttons, .school-print-buttons { display: flex; flex-wrap: wrap; gap: .45rem; }
.school-mode-buttons button { padding: .55rem .8rem; color: #475569; background: transparent; border: 1px solid transparent; border-radius: 7px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.school-mode-buttons button:hover { background: #F1F5F9; }
.school-mode-buttons button.active { color: #1D4ED8; background: #EFF6FF; border-color: #BFDBFE; }
.school-pack { overflow: hidden; padding: 1.25rem; background: #fff; border: 1px solid #CBD5E1; border-radius: 14px; box-shadow: 0 14px 40px rgba(15,23,42,.08); }
.school-pack-header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: 1rem; }
.school-pack-header span { color: #64748B; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.school-pack-header h2 { margin: .15rem 0 0; font-size: 1.45rem; }
.school-pack-header > strong { padding: .3rem .6rem; color: #1D4ED8; background: #EFF6FF; border-radius: 999px; font-size: .72rem; white-space: nowrap; }
.period-band { display: grid; grid-template-columns: 1fr 1.25fr 1.25fr 1.15fr 1.65fr; overflow: hidden; margin-bottom: 1.4rem; border-radius: 8px; }
.period-band > div { position: relative; display: grid; gap: .12rem; padding: .65rem .5rem; color: #fff; text-align: center; background: var(--period); }
.period-band > div:not(:last-child)::after { content: ''; position: absolute; z-index: 1; top: 0; right: -10px; border-top: 30px solid transparent; border-bottom: 30px solid transparent; border-left: 10px solid var(--period); }
.period-band strong { font-size: .78rem; }
.period-band span { font-size: .64rem; opacity: .9; }
.school-event-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; padding: 0; list-style: none; counter-reset: none; }
.school-event-grid li, .brevet-event-grid li { position: relative; min-height: 105px; padding: .75rem .65rem .65rem; border: 1px solid #E2E8F0; border-top: 4px solid var(--event-color); border-radius: 8px; background: #fff; }
.school-event-number { position: absolute; top: .45rem; right: .45rem; display: grid; width: 20px; height: 20px; place-items: center; color: #64748B; background: #F1F5F9; border-radius: 50%; font-size: .62rem; font-weight: 800; }
.school-event-grid time, .brevet-event-grid time { display: block; margin-bottom: .35rem; color: var(--event-color); font-size: .72rem; font-weight: 800; }
.school-event-grid li > strong, .brevet-event-grid li > strong { display: block; padding-right: 1.2rem; font-size: .75rem; line-height: 1.35; }
.school-blank-line { display: none; height: 55px; margin-top: 1rem; border-top: 1px solid #94A3B8; border-bottom: 1px solid #94A3B8; }
.school-pack[data-mode="blank"] .school-answer { visibility: hidden; }
.school-pack[data-mode="blank"] .school-blank-line { display: block; }
.school-student-only, .school-correction-key { display: none; margin-top: 1rem; padding: .65rem .8rem; border-radius: 7px; font-size: .78rem; }
.school-pack[data-mode="blank"] .school-student-only { display: block; color: #1E3A8A; background: #EFF6FF; }
.school-pack[data-mode="correction"] .school-correction-key { display: block; color: #065F46; background: #ECFDF5; }
.school-pack-footer { margin-top: 1rem; padding-top: .65rem; color: #94A3B8; border-top: 1px solid #E2E8F0; text-align: right; font-size: .62rem; }
.school-download-note { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1rem; background: #fff; border: 1px solid #CBD5E1; border-radius: 10px; }
.school-download-note p { margin: 0; color: var(--text-secondary); font-size: .84rem; line-height: 1.5; }
.brevet-legend { display: flex; gap: .75rem; margin-bottom: .85rem; }
.brevet-legend span { display: inline-flex; align-items: center; gap: .35rem; color: #475569; font-size: .68rem; font-weight: 700; }
.brevet-legend span::before { content: ''; width: 9px; height: 9px; background: var(--legend); border-radius: 50%; }
.brevet-event-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem; padding: 0; list-style: none; }
.brevet-event-grid li { min-height: 92px; }
.brevet-event-grid li > strong { font-size: .68rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }

.chronology-quiz { display: grid; gap: 1.25rem; }
.quiz-block { padding: 1.25rem; background: #fff; border: 1px solid #CBD5E1; border-radius: 12px; box-shadow: var(--shadow-sm); }
.quiz-block > header { display: flex; gap: .85rem; align-items: start; margin-bottom: 1rem; }
.quiz-block > header > span { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; color: #fff; background: #047857; border-radius: 9px; font-weight: 800; }
.quiz-block h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.quiz-block header p { margin: 0; color: var(--text-muted); font-size: .82rem; }
.quiz-order-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .65rem; }
.quiz-order-grid label { display: grid; grid-template-columns: 1fr 48px; gap: .45rem; align-items: center; padding: .65rem; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px; }
.quiz-order-grid strong { font-size: .75rem; line-height: 1.3; }
.quiz-order-grid input, .quiz-date-grid input, .quiz-period-line input { width: 100%; padding: .48rem; background: #fff; border: 1px solid #CBD5E1; border-radius: 6px; text-align: center; font: inherit; }
.quiz-date-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .65rem; }
.quiz-date-grid label { display: grid; gap: .5rem; color: #334155; font-size: .75rem; font-weight: 700; }
.quiz-period-line { display: grid; grid-template-columns: repeat(9, minmax(70px, 1fr)); align-items: stretch; overflow-x: auto; }
.quiz-period-line span, .quiz-period-line label { display: grid; min-height: 72px; place-items: center; padding: .45rem; color: #fff; background: #047857; font-size: .72rem; font-weight: 700; text-align: center; }
.quiz-period-line label { background: #ECFDF5; }
.quiz-period-line b { display: grid; width: 0; place-items: center; color: #064E3B; font-size: .65rem; transform: translateX(-50%); z-index: 2; }
.chronology-quiz input.is-correct { color: #065F46; background: #ECFDF5; border-color: #34D399; }
.chronology-quiz input.is-wrong { color: #991B1B; background: #FEF2F2; border-color: #F87171; }
.quiz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.quiz-result { margin-left: auto; padding: .55rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 800; }
.quiz-result.perfect { color: #065F46; background: #D1FAE5; }
.quiz-result.partial { color: #92400E; background: #FEF3C7; }

/* ===== Kings chronology search table ===== */
.royal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1.25rem 0; }
.royal-stats span { display: grid; padding: .85rem 1rem; color: #475569; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 9px; font-size: .78rem; }
.royal-stats strong { color: #1E3A8A; font-size: 1.15rem; }
.royal-table-controls { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: .75rem; align-items: end; margin: 1.5rem 0 .75rem; padding: 1rem; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 10px; }
.royal-table-controls label { display: grid; gap: .35rem; color: #334155; font-size: .75rem; font-weight: 700; }
.royal-table-controls input, .royal-table-controls select { width: 100%; padding: .62rem .7rem; color: #0F172A; background: #fff; border: 1px solid #CBD5E1; border-radius: 7px; font: inherit; font-size: .84rem; }
.royal-table-controls > span { padding: .62rem .75rem; color: #1D4ED8; background: #fff; border: 1px solid #BFDBFE; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.royal-table-wrap { max-height: 720px; overflow: auto; margin-bottom: .5rem; border: 1px solid #CBD5E1; border-radius: 10px; }
.royal-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.royal-table thead { position: sticky; z-index: 1; top: 0; color: #fff; background: #1E3A8A; text-align: left; }
.royal-table th, .royal-table td { padding: .7rem .75rem; border-bottom: 1px solid #E2E8F0; vertical-align: top; }
.royal-table tbody th { min-width: 150px; color: #0F172A; text-align: left; }
.royal-table tbody td:nth-child(2) { min-width: 130px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.royal-table tbody tr:nth-child(even) { background: #F8FAFC; }
.royal-table tbody tr:hover { background: #EFF6FF; }
.dynasty-pill { display: inline-block; padding: .18rem .45rem; color: #334155; background: #E2E8F0; border-radius: 999px; font-size: .68rem; white-space: nowrap; }
.royal-source-note { margin: .65rem 0 2rem; color: #64748B; font-size: .75rem; line-height: 1.5; }

@media (max-width: 900px) {
    .import-heading, .public-import-tool { grid-template-columns: 1fr; }
    .import-format-card { display: none; }
    .public-import-visual { min-height: 320px; }
    .school-toolbar, .school-download-note { align-items: stretch; flex-direction: column; }
    .school-event-grid { grid-template-columns: repeat(2, 1fr); }
    .brevet-event-grid { grid-template-columns: repeat(3, 1fr); }
    .quiz-order-grid, .quiz-date-grid { grid-template-columns: repeat(2, 1fr); }
    .viewer-toolbar { align-items: flex-start; }
    .viewer-toolbar-actions .btn:not(.btn-primary) { display: none; }
    .royal-table-controls { grid-template-columns: 1fr 1fr; }
    .royal-table-controls > span { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 560px) {
    .import-options, .accepted-formats { grid-template-columns: 1fr; }
    .import-preview ul { grid-template-columns: 1fr; }
    .public-import-actions-row { align-items: stretch; flex-direction: column; }
    .form-field.compact { min-width: 0; }
    .public-import-inputs, .public-import-visual { padding: 1rem; }
    .period-band { grid-template-columns: 1fr; }
    .period-band > div:not(:last-child)::after { display: none; }
    .school-event-grid, .brevet-event-grid, .quiz-order-grid, .quiz-date-grid { grid-template-columns: 1fr; }
    .school-pack { padding: .8rem; }
    .school-pack-header { flex-direction: column; }
    .viewer-shell { width: 100%; margin: 0; border-radius: 0; }
    .viewer-stage { padding: .7rem; }
    .viewer-navigation { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: .35rem; }
    .viewer-nav-button { width: 32px; height: 32px; }
    .viewer-detail { padding: 1rem; }
    .viewer-detail h2 { font-size: 1.1rem; }
    .royal-stats, .royal-table-controls { grid-template-columns: 1fr; }
    .royal-table-controls > span { grid-column: auto; }
}

@media print {
    body.school-printing * { visibility: hidden !important; }
    body.school-printing .school-print-target,
    body.school-printing .school-print-target * { visibility: visible !important; }
    body.school-printing .school-print-target { position: absolute !important; inset: 0 auto auto 0 !important; width: 100% !important; max-width: none !important; margin: 0 !important; padding: 7mm !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
    body.school-printing.school-print-a3 .school-print-target { width: 400mm !important; }
    body.school-printing.school-print-poster .school-print-target { width: 540mm !important; }
    body.school-printing .school-pack-header h2 { font-size: 18pt; }
    body.school-printing .school-event-grid li,
    body.school-printing .brevet-event-grid li { break-inside: avoid; }
    body.school-printing .quiz-actions { display: none !important; }
    body.school-printing .chronology-quiz input { color: transparent !important; background: #fff !important; border-color: #64748B !important; }
    body.school-printing.school-print-a4 .school-print-target { page: school-a4; }
    body.school-printing.school-print-a3 .school-print-target { page: school-a3; }
    body.school-printing.school-print-poster .school-print-target { page: school-poster; }
}

@page { size: A4 landscape; margin: 7mm; }
@page school-a4 { size: A4 landscape; margin: 7mm; }
@page school-a3 { size: A3 landscape; margin: 7mm; }
@page school-poster { size: A4 landscape; margin: 7mm; }
