/* ============================================
   APP RÉVISION BTS SIO SISR — THÈME PORTFOLIO
   grp-ranson.fr/Portfolio.html
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:            #060a08;
    --bg-card:       #0c1410;
    --bg-elev:       #111a14;
    --border:        #1f3828;
    --border2:       #2e5a3a;
    --text:          #c4dcc8;
    --text-muted:    #4a7a54;
    --white:         #e8f2ea;
    --primary:       #3fcf6e;
    --primary-dark:  #28a050;
    --primary-light: #0a2214;
    --gdim:          #1a6635;
    --glo:           #0a2214;
    --amber:         #d4940a;
    --success:       #3fcf6e;
    --success-light: #0a2214;
    --danger:        #ef4444;
    --danger-light:  rgba(239,68,68,0.1);
    --warning:       #d4940a;
    --warning-light: rgba(212,148,10,0.08);
    --shadow-sm:     0 1px 4px rgba(0,0,0,0.5);
    --shadow:        0 4px 16px rgba(0,0,0,0.6);
    --shadow-lg:     0 8px 32px rgba(0,0,0,0.7);
    --radius:        3px;
    --radius-sm:     2px;
    --radius-lg:     3px;
    --transition:    0.2s ease;
    --ff-head:       'Oswald', sans-serif;
    --ff-mono:       'Source Code Pro', monospace;
    --ff-body:       'Barlow', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--ff-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    overflow-x: hidden;
}

/* Scanlines */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 3px,
        rgba(0,0,0,0.05) 3px, rgba(0,0,0,0.05) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gdim); }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 768px) { .container { padding: 0 1.5rem; } }

/* --- HEADER --- */
.app-header {
    background: rgba(6,10,8,0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: var(--bg);
    font-family: var(--ff-mono);
    font-size: 1rem;
    font-weight: 700;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--ff-mono);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.logo-text strong { color: var(--primary); font-weight: 600; }

@media (max-width: 480px) { .logo-text { display: none; } }

/* Bouton thème masqué — thème unique */
.theme-toggle { display: none; }

.menu-toggle {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.menu-toggle:hover { border-color: var(--border2); background: var(--glo); }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--text); transition: var(--transition); }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (min-width: 768px) { .menu-toggle { display: none; } }

/* --- NAVIGATION --- */
.main-nav {
    background: rgba(6,10,8,0.97);
    border-top: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.main-nav.open { max-height: 500px; }

.nav-inner {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
    gap: 0.1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
    transition: all var(--transition);
}
.nav-link:hover { color: var(--primary); border-color: var(--border2); background: var(--glo); }
.nav-link.active { color: var(--primary); border-color: var(--border2); background: var(--glo); }

@media (min-width: 768px) {
    .main-nav { max-height: none; overflow: visible; border-top: none; }
    .nav-inner { flex-direction: row; padding: 0.4rem 1.5rem; gap: 0.2rem; flex-wrap: wrap; align-items: center; }
    .nav-link { padding: 0.35rem 0.7rem; }
}

/* --- MAIN --- */
.app-main { flex: 1; padding: 1.5rem 0 3rem; }
@media (min-width: 768px) { .app-main { padding: 2.5rem 0 4rem; } }

/* --- FOOTER --- */
.app-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.footer-sub { margin-top: 0.4rem; opacity: 0.55; }

/* --- TYPOGRAPHIE --- */
h1, h2, h3, h4 {
    font-family: var(--ff-head);
    line-height: 1.3;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; margin-bottom: 0.5rem; }
h2 { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 600; margin-bottom: 0.75rem; margin-top: 1.5rem; color: var(--primary); }
h3 { font-size: clamp(0.95rem, 2.5vw, 1.1rem); font-weight: 500; margin-bottom: 0.5rem; margin-top: 1.25rem; }
h4 { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem; margin-top: 1rem; color: var(--primary); }

p { margin-bottom: 0.75rem; }

code {
    font-family: var(--ff-mono);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: 0.15rem 0.45rem;
    font-size: 0.85em;
    color: var(--primary);
}

pre {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.85rem;
}
pre code { background: transparent; border: none; padding: 0; color: var(--text); }

ul, ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
li { margin-bottom: 0.3rem; }
strong { font-weight: 700; color: var(--white); }

blockquote {
    border: 1px solid var(--border);
    border-left: 3px solid var(--border2);
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    color: var(--text-muted);
    background: var(--bg-elev);
    font-style: italic;
}

/* --- PAGE ACCUEIL --- */
.hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: var(--primary);
    text-shadow: 0 0 24px rgba(63,207,110,0.3);
    font-weight: 700;
}

.hero p {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.stat-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.35rem 0.9rem;
    font-family: var(--ff-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.stat-pill strong { color: var(--primary); }

/* Grille matières */
.subjects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}
@media (min-width: 600px) { .subjects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .subjects-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }

.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color var(--transition);
    display: block;
    position: relative;
}
.subject-card:hover { border-color: var(--border2); }
.subject-card:hover .subject-title { color: var(--primary); }

.subject-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 16px;
    height: 2px;
    background: var(--card-accent, var(--primary));
    opacity: 0.7;
}

.subject-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }

.subject-title {
    font-family: var(--ff-head);
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    color: var(--white);
    transition: color var(--transition);
}

.subject-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.55;
}

.subject-meta {
    display: flex;
    gap: 0.75rem;
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.subject-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* --- BREADCRUMB --- */
.breadcrumb {
    display: flex;
    gap: 0.5rem;
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { opacity: 0.4; }

/* --- LISTE DE THÈMES --- */
.topics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 1.5rem;
}
@media (min-width: 600px) { .topics-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .topics-grid { grid-template-columns: repeat(3, 1fr); } }

.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    padding: 1.1rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.topic-card:hover { border-color: var(--primary); }
.topic-card:hover h3 { color: var(--primary); }

.topic-card h3 {
    font-family: var(--ff-head);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color var(--transition);
}

.topic-card-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
    flex: 1;
    line-height: 1.5;
}

.topic-card-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.topic-tag {
    font-family: var(--ff-mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    padding: 0.12rem 0.45rem;
}
.topic-tag.tag-quiz { background: var(--glo); color: var(--primary); border-color: var(--border2); }
.topic-tag.tag-ex { background: rgba(212,148,10,0.06); color: var(--amber); border-color: rgba(212,148,10,0.3); }
.topic-tag.tag-def { background: var(--glo); color: var(--primary); border-color: var(--border2); }

/* --- DÉTAIL THÈME --- */
.topic-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
}
@media (min-width: 768px) { .topic-detail { padding: 2.5rem; } }

.topic-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.topic-header h1 { margin-bottom: 0.5rem; }

.topic-tagline {
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: -1px;
    transition: all var(--transition);
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s; }

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

/* --- DÉFINITIONS --- */
.definitions {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}
.definitions h4 {
    margin-top: 0;
    color: var(--primary);
    font-family: var(--ff-mono);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.def-item { margin-bottom: 0.75rem; }
.def-item:last-child { margin-bottom: 0; }
.def-term { font-family: var(--ff-mono); font-size: 0.88rem; color: var(--primary); }
.def-text { color: var(--text-muted); font-size: 0.88rem; }

/* Key Points */
.key-points {
    background: var(--glo);
    border: 1px solid var(--border2);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}
.key-points h4 { margin-top: 0; color: var(--primary); font-family: var(--ff-mono); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; }
.key-points ul { margin-bottom: 0; }

/* Info boxes */
.info-box {
    background: var(--glo);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}
.warning-box {
    background: rgba(212,148,10,0.06);
    border: 1px solid rgba(212,148,10,0.2);
    border-left: 3px solid var(--amber);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}
.success-box {
    background: var(--glo);
    border: 1px solid var(--border2);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

/* --- QUIZ --- */
.quiz-container { max-width: 700px; margin: 0 auto; }

.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.progress-bar { height: 2px; background: var(--bg-elev); overflow: hidden; margin-bottom: 1.5rem; }
.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(63,207,110,0.5);
}

.quiz-question {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    line-height: 1.55;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.quiz-option {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-family: var(--ff-body);
    font-size: 0.93rem;
    color: var(--text);
    width: 100%;
    line-height: 1.5;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.quiz-option:hover:not(:disabled) { border-color: var(--border2); background: var(--bg-elev); color: var(--white); }
.quiz-option:disabled { cursor: not-allowed; }
.quiz-option.correct { background: var(--glo); border-color: var(--primary); color: var(--primary); }
.quiz-option.incorrect { background: rgba(239,68,68,0.08); border-color: var(--danger); color: var(--danger); }
.quiz-option.correct::after { content: ' ✓'; font-weight: 700; }
.quiz-option.incorrect::after { content: ' ✗'; font-weight: 700; }

.quiz-explanation {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.quiz-explanation strong { color: var(--primary); }

.quiz-actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; }

.quiz-result { text-align: center; padding: 2rem 1rem; }
.quiz-result h3 { margin-top: 0; font-size: 1.5rem; }

.score-display {
    font-family: var(--ff-head);
    font-size: 3.5rem;
    font-weight: 700;
    margin: 1rem 0;
    color: var(--primary);
    text-shadow: 0 0 24px rgba(63,207,110,0.4);
    letter-spacing: 0.05em;
}
.score-message { color: var(--text-muted); margin-bottom: 1.5rem; }

/* --- EXERCICES --- */
.exercise {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exercise-title {
    font-family: var(--ff-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--amber);
}

.exercise-difficulty {
    font-family: var(--ff-mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.12rem 0.5rem;
    border: 1px solid;
}
.diff-easy { color: var(--primary); border-color: var(--border2); background: var(--glo); }
.diff-medium { color: var(--amber); border-color: rgba(212,148,10,0.3); background: rgba(212,148,10,0.06); }
.diff-hard { color: var(--danger); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.06); }

.exercise-question { margin-bottom: 0.75rem; color: var(--text); }

.exercise-toggle {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--primary);
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all var(--transition);
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
.exercise-toggle:hover { background: var(--glo); border-color: var(--primary); }

.exercise-answer {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    margin-top: 0.75rem;
}
.exercise-answer.open { display: block; }
.exercise-answer h5 {
    font-family: var(--ff-mono);
    color: var(--primary);
    margin: 0 0 0.5rem 0;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- BUTTONS --- */
.btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: var(--ff-mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.btn:hover { border-color: var(--border2); background: var(--glo); color: var(--white); }

.btn-primary { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.btn-primary:hover { background: #5ef08a; border-color: #5ef08a; color: var(--bg); }

.btn-success { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--glo); }
.btn-lg { padding: 0.7rem 1.6rem; font-size: 0.68rem; }

/* --- TABLES --- */
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.65rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); }
th {
    background: var(--bg-elev);
    font-family: var(--ff-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 500;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-elev); }

/* --- SEARCH --- */
.search-bar {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.93rem;
    font-family: var(--ff-body);
    border: 1px solid var(--border);
    background: rgba(63,207,110,0.03);
    color: var(--text);
    margin-bottom: 1.5rem;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.search-bar:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(63,207,110,0.06);
    box-shadow: 0 0 12px rgba(63,207,110,0.1);
}
.search-bar::placeholder {
    color: rgba(63,207,110,0.25);
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-results { display: flex; flex-direction: column; gap: 0.6rem; }
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- PROGRESS TRACKING --- */
.progress-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--ff-mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.12rem 0.5rem;
    border: 1px solid var(--border2);
    background: var(--glo);
    color: var(--primary);
    margin-left: 0.5rem;
}

/* --- UTILITIES --- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* --- GLOSSAIRE --- */
.definitions-page { max-width: 900px; }

.def-page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.def-page-header h1 { margin-bottom: 0.25rem; }

.def-controls { margin-bottom: 1.25rem; }

.def-filter-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.def-filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.28rem 0.75rem;
    cursor: pointer;
    font-family: var(--ff-mono);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.def-filter-btn:hover { border-color: var(--border2); color: var(--text); background: var(--bg-elev); }
.def-filter-btn.active { background: var(--glo); color: var(--primary); border-color: var(--border2); }

.def-count { background: rgba(63,207,110,0.12); padding: 0 0.35rem; font-size: 0.65rem; color: var(--primary); }
.def-filter-btn:not(.active) .def-count { background: var(--bg-elev); color: var(--text-muted); }

.alpha-index {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.alpha-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    text-decoration: none;
    font-family: var(--ff-mono);
    font-weight: 700;
    font-size: 0.72rem;
    background: var(--bg-elev);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.alpha-btn:hover { background: var(--glo); color: var(--primary); border-color: var(--border2); }

.def-letter-section { margin-bottom: 2.5rem; scroll-margin-top: 80px; }

.def-letter-header {
    font-family: var(--ff-head);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.4rem 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    background: var(--glo);
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.def-entries { display: flex; flex-direction: column; gap: 0.5rem; }

.def-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    padding: 0.9rem 1.25rem;
    transition: all var(--transition);
}
.def-entry:hover { border-left-color: var(--primary); background: var(--bg-elev); }

.def-entry-term {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.def-entry-word { font-family: var(--ff-mono); font-size: 0.88rem; color: var(--primary); }

.def-entry-source {
    font-family: var(--ff-mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: 0.12rem 0.5rem;
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
}
.def-entry-source:hover { background: var(--glo); color: var(--primary); border-color: var(--border2); }

.def-entry-def { color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; }

/* --- MERMAID --- */
.mermaid-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem 1rem;
    margin: 1.5rem 0;
    text-align: center;
    overflow-x: auto;
}
.mermaid-wrap .mermaid { display: inline-block; max-width: 100%; }
.mermaid-wrap svg { max-width: 100%; height: auto; }

/* --- SEARCH RESULTS --- */
.search-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    display: block;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.search-result-card:hover { border-left-color: var(--primary); background: var(--bg-elev); }

.search-result-meta {
    font-family: var(--ff-mono);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.search-result-title {
    font-family: var(--ff-head);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.25rem;
    color: var(--white);
}
.search-result-tagline { font-size: 0.83rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.search-result-excerpt { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.search-result-excerpt mark { background: rgba(212,148,10,0.15); color: var(--amber); padding: 0 2px; font-weight: 600; }

/* --- QUIZ AMÉLIORÉ --- */
.quiz-start-screen { text-align: center; padding: 2rem 1rem; }
.quiz-start-icon { font-size: 3rem; margin-bottom: 1rem; }
.quiz-start-screen h2 { margin-bottom: 0.5rem; }
.quiz-best-score {
    display: inline-block;
    background: var(--glo);
    border: 1px solid var(--border2);
    color: var(--primary);
    font-family: var(--ff-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.28rem 0.8rem;
    margin-bottom: 1rem;
}
.quiz-score-badge {
    background: var(--glo);
    border: 1px solid var(--border2);
    color: var(--primary);
    font-family: var(--ff-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.12rem 0.5rem;
}

.score-circle-wrap { margin-bottom: 1rem; }
.score-circle { overflow: visible; }

/* --- EXERCICES AMÉLIORÉS --- */
.exercise-hint {
    font-size: 0.83rem;
    color: var(--amber);
    font-style: italic;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(212,148,10,0.06);
    border-left: 3px solid var(--amber);
}

/* --- BADGE BTS --- */
.badge-bts {
    display: inline-flex;
    align-items: center;
    font-family: var(--ff-mono);
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.35);
    padding: 0.08rem 0.38rem;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 0.35rem;
    position: relative;
    top: -1px;
    flex-shrink: 0;
}

/* --- PRINT --- */
@media print {
    .app-header, .app-footer, .tabs, .quiz-actions, .menu-toggle, .theme-toggle { display: none; }
    .app-main { padding: 0; }
    .topic-detail { border: none; padding: 0; }
    .tab-content { display: block !important; }
    body::before { display: none; }
}
