/* ========================================================
   PHILOSOPHIE GENERALE — STYLES
   Thème light par défaut, dark optionnel via .philo-dark
   ======================================================== */

/* ===== 1. VARIABLES ===== */
:root {
    --header-row-dynamic-height: 40px;
    --header-column-dynamic-width: 30px;
    --container-line2-side-width: 30px;

    /* Thème light (défaut) — utilise les variables globales gbl_styles */
    --philo-bg: var(--global-white-2);
    --philo-surface: var(--global-white-1);
    --philo-border: rgba(0, 0, 0, 0.1);
    --philo-text-primary: var(--txt-color-blackop-90);
    --philo-text-secondary: var(--txt-color-blackop-60);
    --philo-text-tertiary: var(--txt-color-blackop-50);
    --philo-accent: var(--button-global-color);
    --philo-accent-hover: var(--button-global-hovercolor);
    --philo-popover-bg: white;
    --philo-popover-shadow: rgba(0, 0, 0, 0.12);
    --philo-accent-subtle: rgba(10, 75, 180, 0.07);

    /* CLD — lightness/chroma constants (light) */
    --cld-lightness: 0.72;
    --cld-chroma: .11;
    --cld-hover-lightness: 0.58;
    --cld-hover-chroma: 0.098;
}


/* Thème dark */
.philo-dark {
    --philo-bg: hsl(216, 5%, 12%);
    --philo-surface: hsl(220, 5%, 15%);
    --philo-border: hsl(220, 5%, 20%);
    --philo-text-primary: var(--txt-color-whiteop-90);
    --philo-text-secondary: var(--txt-color-whiteop-60);
    --philo-text-tertiary: var(--txt-color-whiteop-50);
    --philo-accent: rgb(70, 130, 220);
    --philo-accent-hover: rgb(100, 155, 240);
    --philo-accent-subtle: rgba(70, 130, 220, 0.12);
    --philo-popover-bg: hsl(220, 5%, 15%);
    --philo-popover-shadow: rgba(0, 0, 0, 0.2);

    /* CLD — lightness/chroma constants (dark) */
    --cld-lightness: 0.75;
    --cld-chroma: 0.08;
    --cld-hover-lightness: 0.70;
    --cld-hover-chroma: 0.11;
}

/* ===== 2. CLD COULEURS (champs lexicaux — dynamiques via ancrage_ordre) ===== */
/* La teinte H (--cld-hue) est définie en JS par mélange pondéré des 4 ordres racinaires.
   La couleur finale est composée en CSS via oklch(L C H). */
.lexique-column {
    --cld-hue: 0;
    --champ-lexical-dynamic-color: oklch(var(--cld-lightness) var(--cld-chroma) var(--cld-hue));
    --champ-lexical-dynamic-hovercolor: oklch(var(--cld-hover-lightness) var(--cld-hover-chroma) var(--cld-hue));
    --champ-lexical-dynamic-transparent-color: color-mix(in oklch, var(--champ-lexical-dynamic-color) 2%, transparent);
}

/* ===== 3. SECTIONS & CONTAINERS ===== */
.header-completion {
    position: absolute;
    opacity: .8;
    top: 0;
    width: 100%;
    height: 200px;
    background-color: var(--philo-bg);
    z-index: -1;
}
.philo-header-section,
.philo-main-section {
    position: relative;
    background: var(--philo-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: background 0.3s ease;
}
.philo-header-section {
    z-index: 10;
    padding: 30px 0 0 0;
}
.philo-main-section {
    z-index: 1;
    min-height: 60vh;
    padding: 30px 0 60px 0;
}

.philo-header-container {
    z-index: 20;
    max-width: 1200px;
    width: 80vw;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
.philo-main-container {
    max-width: 900px;
    width: 80vw;
    background-color: var(--philo-surface);
    border: 1px solid var(--philo-border);
    border-radius: 8px;
    padding: 40px 50px;
    line-height: 1.7;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ===== 4. SELECT & THEME TOGGLE ===== */
.header-container-select {
    width: 100%;
    height: 44px;
    background-color: var(--philo-surface);
    border: 1px solid var(--philo-border);
    border-bottom-color: var(--philo-text-secondary);
    border-radius: 7px 7px 0 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    transition: background-color 0.3s ease, border-color 0.3s ease, border-radius 0.35s ease;
}
.custom-select {
    flex: 1;
    position: relative;
    min-width: 100px;
}
.custom-select select {
    display: none;
}

/* Élément sélectionné visible */
.select-selected {
    background-color: var(--philo-surface);
    border-radius: 7px;
    border: 1px solid var(--philo-border);
    cursor: pointer;
    transition: all 0.2s ease;
}
.select-selected:hover {
    font-weight: 600;
}

/* Flèche du select */
.select-selected::after {
    position: absolute;
    content: "";
    top: 50%;
    right: 10px;
    transform: translateY(-70%) rotate(135deg);
    width: 5px;
    height: 5px;
    border: 3px solid transparent;
    border-color: var(--philo-text-secondary) var(--philo-text-secondary) transparent transparent;
    border-radius: 50%;
    transition: transform 0.2s ease;
}
@media (max-width: 800px) {
    .select-selected::after {
        width: 4px;
        height: 4px;
        border-width: 2px;
    }
}
@media (max-width: 600px) {
    .select-selected::after {
        width: 3px;
        height: 3px;
        border-width: 2px;
    }
}

/* Flèche orientée vers le haut quand ouvert */
.select-selected.select-arrow-active::after {
    transform: translateY(-110%) rotate(-45deg);
}

/* Items du select et élément sélectionné — padding / texte */
.select-items div, .select-selected {
    color: var(--philo-text-primary);
    padding: 4px 10px;
    border: 1px solid transparent;
    border-color: transparent transparent transparent transparent;
    cursor: pointer;
}

/* Container des options (dropdown) */
.select-items {
    position: absolute;
    background-color: var(--philo-popover-bg);
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 8px 0;
    border: 1px solid var(--philo-border);
    border-radius: 7px;
    box-shadow: 0 8px 24px var(--philo-popover-shadow);
    max-height: 250px;
    overflow-y: auto;
}

.select-hide {
    display: none;
}

/* Survol des options */
.select-items div:hover {
    background-color: var(--philo-accent-subtle);
}

/* Option sélectionnée */
.select-items div.same-as-selected {
    background-color: var(--philo-accent);
    color: white;
    font-weight: 500;
}
.select-items div.same-as-selected:hover {
    background-color: var(--philo-accent-hover);
}

/* Options désactivées */
.select-items div.option-disabled {
    color: var(--philo-text-tertiary);
    background-color: var(--philo-bg);
    pointer-events: none;
    cursor: default;
}

/* Scrollbar personnalisée */
.select-items::-webkit-scrollbar {
    width: 12px;
}
.select-items::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px;
}
.select-items::-webkit-scrollbar-thumb {
    background-color: var(--philo-text-tertiary);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
.select-items::-webkit-scrollbar-thumb:hover {
    background-color: var(--philo-text-secondary);
}
.select-items::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}
#philo-select {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
}
#philo-select option {
    background: var(--philo-surface);
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--philo-border);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s, background-color 0.2s;
}
.theme-toggle-btn:hover {
    border-color: var(--philo-accent);
    background-color: var(--philo-border);
}

/* ===== 5. FORMAT SWITCH ===== */
.header-container-formatswitch {
    width: var(--container-line2-side-width);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 10px;
}
.format-switch-btn {
    background: transparent;
    border: 1px solid var(--philo-border);
    width: 26px;
    height: 26px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, background-color 0.3s;
}
.format-switch-btn:hover {
    border-color: var(--philo-accent);
}

/* ===== 6. HEADER CONTAINER (main column) ===== */
.header-container {
    width: calc(100% - var(--container-line2-side-width));
    display: flex;
    flex-direction: column;
}

/* ===== 7. LINE 2 : Titre / cycle / indices ===== */
.header-container-line2 {
    width: 100%;
    display: flex;
    align-items: stretch;
}
.header-container-line2-side {
    width: var(--header-column-dynamic-width);
    background-color: var(--philo-popover-bg);
    border-top: 2px solid var(--philo-text-secondary);
    border-bottom: 2px solid var(--philo-text-secondary);
    flex-shrink: 0;
    display: flex;
    flex-direction:row;
    align-items: center;
    justify-content:space-around;
    padding : 8px 3px;
}
.line2-side-deco-column {
    width: 2px;
    height: 100%;
    border-radius: 10px;
    background-color: var(--philo-text-secondary);
}
.header-container-line2-main {
    background-color: var(--philo-popover-bg);
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 0;
    gap: 6px;
}

.line2-row1,
.line2-row2,
.line2-row3,
.line2-row4 {
    padding-left: 10px;
    padding-right: 10px;
}
/* Row 1 : Cycle */
.line2-row1 {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    text-transform: uppercase;
}

/* Row 2 : Titre principal + date */
.line2-row2 {
    display: flex;
    align-items: baseline;
    gap: 16px;
}
.line2-date {
    white-space: nowrap;
}

/* Row 3 : Titre formel */
.line2-row3 {
    font-style: italic;
}

/* Row 4 : Indices */
.line2-row4 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}
.indice-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}
.indice-label {
    white-space: nowrap;
}
.indice-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 8px;
    border-radius: 4px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.indice-badge:hover {
    filter: brightness(1.15) saturate(1.1);
}
/* Couleurs d'indices (niveaux fondamentalité 0-5) */
.indice-badge.indice-level-0 { background: #e58800; }
.indice-badge.indice-level-1 { background: #e58800; }
.indice-badge.indice-level-2 { background: #ed731c; }
.indice-badge.indice-level-3 { background: #f15d3c; }
.indice-badge.indice-level-4 { background: #ef4759; }
.indice-badge.indice-level-5 { background: #e83377; }

/* Couleurs d'indices (niveaux abstraction 6-10, complémentaires) */
.indice-badge.indice-level-6 { background: #da2395; }
.indice-badge.indice-level-7 { background: #c717b3; }
.indice-badge.indice-level-8 { background: #af0ed0; }
.indice-badge.indice-level-9 { background: #9205e9; }
.indice-badge.indice-level-10 { background: #7000fc; }

/* Popover indices */
.indice-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--philo-popover-bg);
    border: 1px solid var(--philo-border);
    border-radius: 6px;
    padding: 14px 18px;
    min-width: 240px;
    max-width: 320px;
    z-index: 100;
    box-shadow: 0 8px 24px var(--philo-popover-shadow);
    transition: background 0.3s ease, border-color 0.3s ease;
}
.indice-container:hover .indice-popover {
    display: block;
}

/* ===== 8. LINES 3 & 4 : Mécanisme / Tensions (label fixe + zone scrollable) ===== */
.header-container-line3,
.header-container-line4 {
    width: 100%;
    height: var(--header-row-dynamic-height);
    overflow: hidden;
    position: relative;
    border-top: 1px solid var(--philo-border);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 14px;
}
.scrollable-gradient {
    z-index: -1000;
    width: 100%;
    height: 100%;
}
.header-container-line3 {
    border-color: var(--philo-text-secondary);
}
/* Label fixe (hors scroll) */
.line3-label, .line4-label {
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Zone scrollable avec clic-glissé + inertie */
.header-container-line3-scrollable,
.header-container-line4-scrollable {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    cursor: grab;
    white-space: nowrap;
    user-select: none;
    padding-right: 14px;
}
.header-container-line4-scrollable {
    text-align: center;
}
.header-container-line3-scrollable::-webkit-scrollbar,
.header-container-line4-scrollable::-webkit-scrollbar {
    display: none;
}
.header-container-line3-scrollable:active,
.header-container-line4-scrollable:active {
    cursor: grabbing;
}

.line3-content, .line4-content {
    display: inline-flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}

/* Mécanisme : éléments et flèches */
.meca-item {
    white-space: nowrap;
}
.meca-arrow {
    margin: 0 6px;
    flex-shrink: 0;
}
.meca-arrow-large {
    margin: 0 10px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Tensions internes */
.tension-group {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.tension-item {
    white-space: nowrap;
}
.tension-separator {
    margin: 0 6px;
}
.tension-group-separator {
    margin: 0 14px;
}

/* ===== 9. LINE 5 : Accordion (Phase 2) ===== */
.header-container-line5 {
    width: 100%;
    border-top: 1px solid var(--philo-border);
    overflow: hidden;
}
.header-container-line5-accordion-title {
    height: var(--header-row-dynamic-height);
    display: flex;
    align-items: center;
    padding: 0 14px;
    cursor: pointer;
    gap: 0;
}
.accordion-toggle {
    user-select: none;
    transition: color 0.2s;
}
.accordion-toggle:hover {
    color: var(--philo-text-primary);
}

/* Chevron animé accordion (style accueil) */
.philo-arrow {
    position: relative;
    width: 12px;
    height: 12px;
    margin-right: 10px;
    flex-shrink: 0;
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}
.philo-arrow::before,
.philo-arrow::after {
    content: '';
    position: absolute;
    background-color: var(--philo-text-secondary);
    border-radius: 2px;
    transition: transform 0.3s ease;
}
.philo-arrow::before {
    width: 8px;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%) rotate(45deg);
    transform-origin: left center;
}
.philo-arrow::after {
    width: 8px;
    height: 2px;
    bottom: 50%;
    left: 0;
    transform: translateY(50%) rotate(-45deg);
    transform-origin: left center;
}

/* État ouvert accordion */
.header-container-line5-accordion-title.active .philo-arrow {
    transform: rotate(-90deg);
}

/* Format switch arrow */
.format-switch-btn .philo-arrow {
    margin-right: 0;
}
.format-switch-btn.collapsed .philo-arrow {
    transform: rotate(0deg);
}
.header-container-line5-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.header-container-line5-accordion-content.open {
    max-height: 2000px;
}

/* --- Lexique : contrôles (tri + slider) --- */
.lexique-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 8px 14px;
    border-bottom: 1px solid var(--philo-border);
    gap: 8px 12px;
}
.lexique-sort-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.lexique-sort-btn {
    padding: 3px 12px;
    border: 1px solid var(--philo-border);
    border-radius: 99px;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.lexique-sort-btn:hover {
    border-color: var(--philo-accent);
}
.lexique-sort-btn.active {
    background-color: var(--philo-accent);
    border-color: var(--philo-accent);
    color: white;
}
.lexique-slider-container {
    display: flex;
    align-items: center;
    flex: 1 1 140px;
    min-width: 100px;
}
.lexique-slider {
    width: 100%;
    height: 4px;
    accent-color: var(--philo-accent);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

/* --- Lexique : colonnes --- */
.lexique-columns-viewport {
    overflow: hidden;
    position: relative;
}
.lexique-columns-wrapper {
    display: flex;
    gap: 0;
    cursor: grab;
    user-select: none;
}
.lexique-columns-wrapper:active {
    cursor: grabbing;
}
.lexique-column {
    flex: 0 0 auto;
    min-width: 0;
    border-right: 1px solid var(--philo-border);
    display: flex;
    flex-direction: column;
}
.lexique-column:last-child {
    border-right: none;
}

/* Animation type 1 : blur sur le CONTENU TEXTE uniquement (spans internes, pas le div entier) */
@keyframes lexiqueBlurEnter {
    from {
        opacity: 0;
        filter: blur(6px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}
.lexique-column-enter .lexique-column-header-text,
.lexique-column-enter .lexique-column-subheader-text {
    animation: lexiqueBlurEnter 0.35s ease forwards;
}

/* Animation type 2 : border-color de transparent → --champ-lexical-dynamic-color */
/* S'applique à .lexique-column-header (border-bottom) et .lexique-word-btn (border) */
@keyframes lexiqueBorderColorEnter {
    from { border-color: transparent; }
    to   { border-color: var(--champ-lexical-dynamic-color); }
}
.lexique-column-enter .lexique-column-header,
.lexique-column-enter .lexique-word-btn {
    animation: lexiqueBorderColorEnter 0.4s ease forwards;
}

/* Animation type 3 : instantané — .lexique-column-words et son contenu n'ont aucune animation */
.lexique-column-header {
    padding: 8px 12px;
    border-bottom: 2px solid var(--champ-lexical-dynamic-color);
    text-transform: capitalize;
    cursor: default;
}
.lexique-column-subheader {
    padding: 4px 12px 6px;
    line-height: 1.35;
}
.lexique-column-words {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* --- Lexique : en-tête niveau (groupement par nom_niveau) --- */
.lexique-niveau-header {
    padding: 0px 2px 0px;
    text-transform: uppercase;
}
.lexique-niveau-header:first-child {
    margin-top: 0;
}

/* --- Lexique : mots (boutons) --- */
.lexique-word-wrapper {
    position: relative;
}
.lexique-word-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 4px 10px;
    border: 1px solid var(--champ-lexical-dynamic-color);
    border-radius: 4px;
    background: var(--champ-lexical-dynamic-transparent-color);
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
}
.lexique-word-btn:hover {
    background-color: var(--champ-lexical-dynamic-hovercolor);
    border-color: var(--champ-lexical-dynamic-hovercolor);
    color: white;
    transform: translateX(2px);
}

/* --- Lexique : popover mot (floating, position:fixed pour échapper aux overflow:hidden) --- */
/* La position est calculée en JS via getBoundingClientRect() au hover */
.lexique-word-popover-floating {
    display: none;
    position: fixed;
    background: var(--philo-popover-bg);
    border: 1px solid var(--philo-border);
    border-radius: 6px;
    padding: 12px 16px;
    min-width: 240px;
    max-width: 340px;
    z-index: 9999;
    box-shadow: 0 8px 24px var(--philo-popover-shadow);
    pointer-events: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}
/* Thème dark : synchronisé par JS (floatingWordPopover.classList.toggle('philo-dark')) */
.lexique-word-popover-floating.philo-dark {
    --philo-popover-bg: hsl(220, 5%, 15%);
    --philo-border: hsl(220, 5%, 20%);
    --philo-popover-shadow: rgba(0, 0, 0, 0.2);
    --philo-accent: rgb(70, 130, 220);
    --philo-text-primary: var(--txt-color-whiteop-90);
    --philo-text-secondary: var(--txt-color-whiteop-60);
    background: hsl(220, 5%, 15%);
    border-color: hsl(220, 5%, 20%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.lexique-popover-name {
    margin-bottom: 4px;
}
.lexique-popover-fonction {
    margin-bottom: 6px;
    line-height: 1.4;
}
.lexique-popover-mecanisme {
    padding: 5px 0;
    border-top: 1px solid var(--philo-border);
    margin-top: 4px;
}
.lexique-popover-coords {
    display: flex;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--philo-border);
    margin-top: 4px;
}
.lexique-popover-coords span {
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--philo-border);
}

/* ===== 10. COLLAPSIBLE ANIMATION (format switch) ===== */
.header-container-line3,
.header-container-line4,
.header-container-line5 {
    transition: height 0.35s ease, max-height 0.35s ease, opacity 0.25s ease, filter 0.25s ease;
    overflow: hidden;
}
.line2-row4 {
    transition: max-height 0.35s ease, opacity 0.25s ease, filter 0.25s ease, padding 0.35s ease;
}
.header-container-line2-main {
    transition: background-color 0.35s ease;
}
.header-container-line2-side {
    transition: width 0.35s ease, background-color 0.35s ease, padding 0.35s ease, border-color 0.35s ease;
}
.format-switch-btn .philo-arrow::before,
.format-switch-btn .philo-arrow::after {
    transition: transform 0.3s ease, background-color 0.35s ease;
}

/* --- État replié --- */
.header-collapsed .header-container-line3,
.header-collapsed .header-container-line4,
.header-collapsed .header-container-line5 {
    height: 0;
    opacity: 0;
    filter: blur(4px);
    border-top: none;
}
.header-collapsed .line2-row4 {
    max-height: 0 !important;
    opacity: 0;
    filter: blur(4px);
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* Changement 1 : fond line2-main → philo-bg */
.header-collapsed .header-container-line2-main {
    background-color: var(--philo-bg);
}

/* Changement 2 : colonnes latérales réduites à 0 */
.header-collapsed .header-container-line2-side {
    width: 0;
    padding: 0;
    border-color: transparent;
    overflow: hidden;
}

/* Changement 3 : format-switch-btn fond + icône */
.header-collapsed .format-switch-btn {
    background-color: var(--philo-text-secondary);
}
.header-collapsed .format-switch-btn .philo-arrow::before,
.header-collapsed .format-switch-btn .philo-arrow::after {
    background-color: var(--philo-popover-bg);
}

/* Changement 4 : header-container-select arrondi complet + border-bottom neutre */
.header-collapsed .header-container-select {
    border-radius: 7px;
    border-bottom-color: var(--philo-border);
}

/* ===== 11. TYPOGRAPHIE (section centralisée) ===== */

/* --- Niveaux de texte primaire --- */
.line2-titre-principal,
.philo-main-container h2,
.indice-popover-title {
    font-family: 'Intertight', sans-serif;
    font-weight: 700;
    color: var(--philo-text-primary);
}

/* --- Niveaux de texte secondaire --- */
.line2-row1,
.line2-date,
.indice-container,
.accordion-toggle,
.line3-label,
.line4-label,
.format-switch-btn,
.theme-toggle-icon,
.indice-popover-desc,
.indice-popover-ref,
.lexique-sort-label,
.lexique-column-subheader,
.lexique-niveau-header,
.lexique-popover-fonction,
.lexique-popover-coords {
    color: var(--philo-text-secondary);
}

/* --- Niveaux de texte contenu --- */
.meca-item,
.tension-item,
.indice-popover-level,
.indice-popover-ref em,
#philo-select,
.lexique-word-btn,
.lexique-popover-name,
.lexique-column-header,
.lexique-sort-btn,
.line2-row3 {
    color: var(--philo-text-primary);
}

/* --- Accents --- */
.meca-arrow-large,
.tension-group-separator {
    color: var(--philo-accent);
}
.meca-arrow,
.tension-separator {
    font-weight: 800;
    color: var(--philo-accent);
}

/* --- Corps de texte chargé --- */
.philo-main-container {
    color: var(--philo-text-primary);
    font-size: var(--txt-size-10);
}
.philo-main-container p {
    margin: 0 0 14px 0;
    color: var(--philo-text-primary);
}
.philo-main-container h3 {
    font-family: 'Intertight', sans-serif;
    font-weight: 600;
    color: var(--philo-text-primary);
}

/* --- Tailles de texte --- */
.line2-titre-principal {
    font-size: var(--txt-size-16);
    line-height: var(--txt-lh-tight);
}
.line2-row1 {
    font-size: var(--txt-size-07);
    letter-spacing: var(--txt-spacing-extraloose);
}
.line2-row3 {
    font-size: var(--txt-size-09-uv);
    line-height: var(--txt-lh-compact);
}

.indice-container,
.indice-badge,
.meca-item,
.tension-item,
.tension-separator,
.accordion-toggle,
.indice-popover-desc,
.indice-popover-level,
.line2-date {
    font-size: var(--txt-size-08);
}
.indice-popover-title {
    font-size: var(--txt-size-09);
    margin-bottom: 6px;
}
.indice-popover-level {
    font-size: var(--txt-size-09);
    margin-top: 6px;
}
.indice-popover-ref {
    font-size: var(--txt-size-07);
}
.line3-label, .line4-label {
    font-size: var(--txt-size-07);
    font-weight: 700;
    letter-spacing: var(--txt-spacing-extraloose);
}
.meca-arrow {
    font-size: var(--txt-size-07);
}
.meca-arrow-large {
    font-size: var(--txt-size-09);
}
.tension-group-separator {
    font-size: var(--txt-size-07);
}
.accordion-toggle {
    font-weight: 600;
    letter-spacing: var(--txt-spacing-loose);
}
.lexique-sort-label {
    font-size: var(--txt-size-07);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--txt-spacing-extraloose);
}
.lexique-sort-btn {
    font-family: 'Inter', sans-serif;
    font-size: var(--txt-size-07);
}
.lexique-column-header {
    font-family: 'Intertight', sans-serif;
    font-size: var(--txt-size-08);
    font-weight: 700;
}
.lexique-column-subheader {
    font-size: var(--txt-size-07);
    font-style: italic;
}
.lexique-niveau-header {
    font-size: var(--txt-size-07);
    font-weight: 600;
    letter-spacing: var(--txt-spacing-loose);
}
.lexique-word-btn {
    font-family: 'Inter', sans-serif;
    font-size: var(--txt-size-08);
}
.lexique-popover-name {
    font-family: 'Intertight', sans-serif;
    font-size: var(--txt-size-08);
    font-weight: 700;
}
.lexique-popover-fonction {
    font-size: var(--txt-size-08);
    font-style: italic;
}
.lexique-popover-mecanisme {
    font-size: var(--txt-size-08);
    color: var(--philo-accent);
}
.lexique-popover-coords {
    font-size: var(--txt-size-07);
    font-weight: 600;
}
#philo-select {
    font-family: 'Inter', sans-serif;
    font-size: var(--txt-size-09);
    letter-spacing: var(--txt-spacing-loose);
}
.select-selected,
.select-items div {
    font-family: 'Inter', sans-serif;
    font-size: var(--txt-size-09);
    font-weight: 500;
}
.theme-toggle-icon {
    font-size: var(--txt-size-10);
}
.philo-main-container h2 {
    font-size: var(--txt-size-13);
    margin: 32px 0 12px 0;
}
.philo-main-container h3 {
    font-size: var(--txt-size-11);
    margin: 24px 0 8px 0;
}

/* ===== 12. RESPONSIVE ===== */
@media (max-width: 800px) {
    :root {
        --header-column-dynamic-width: 25px;
    }
    .line2-row1 {
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
    }
    .display800 {
        display: none;
    }
    .philo-header-container,
    .philo-main-container {
        width: 95vw;
    }
    .philo-main-container {
        padding: 28px 24px;
    }
}
@media (max-width: 600px) {
    :root {
        --header-column-dynamic-width: 20px;
    }
    .display600 {
        display: none;
    }
    .line2-row2 {
        flex-direction: column;
        gap: 4px;
    }
    .line2-row4 {
        gap: 10px;
    }
    .indice-container {
        flex-direction: column;
    }
}