/* =====================================================================
   Dashboard : thème sombre, une couleur par rubrique.
   --c (et --c2, sa couleur d'accompagnement) colore le fond lumineux,
   la navigation et les boutons de la page ; --primary en découle.
   ===================================================================== */
:root {
    --bg: #08090e;
    --surface: rgba(255, 255, 255, .045);
    --surface-2: rgba(255, 255, 255, .075);
    --surface-3: rgba(255, 255, 255, .11);
    --solide: #12141c;
    --solide-2: #191c26;
    --border: rgba(255, 255, 255, .08);
    --border-2: rgba(255, 255, 255, .13);
    --sep: rgba(255, 255, 255, .06);
    --text: #f2f4f9;
    --text-2: #c6cbd7;
    --muted: #8d94a6;
    --faint: #626a7d;
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, .14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .14);
    --radius: 22px;
    --radius-sm: 14px;
    --ombre: 0 24px 48px -30px rgba(0, 0, 0, .8);
    --rail: 92px;

    /* Couleurs des rubriques */
    --c-accueil: #8b9cff;
    --c-cours: #38bdf8;
    --c-matieres: #facc15;
    --c-notes: #a78bfa;
    --c-devoirs: #fb923c;
    --c-rdv: #f472b6;
    --c-status: #2dd4bf;
    --c-resultats: #a3e635;
    --c-assistant: #e879f9;
    --c-gris: #a3aec2;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-titre: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

    --c: var(--c-accueil);
    --c2: #22d3ee;
    --primary: var(--c);
    --primary-soft: color-mix(in srgb, var(--c) 15%, transparent);
    color-scheme: dark;
}

/* ----- Une couleur par rubrique : page (section-), lien (nav-), carte (tint-) ----- */
.section-accueil, .nav-accueil, .tint-accueil { --c: var(--c-accueil); --c2: #22d3ee; }
.section-cours, .nav-cours, .tint-cours { --c: var(--c-cours); --c2: #818cf8; }
.section-matieres, .nav-matieres, .tint-matieres { --c: var(--c-matieres); --c2: #fb7185; }
.section-notes, .nav-notes, .tint-notes { --c: var(--c-notes); --c2: #f472b6; }
.section-devoirs, .nav-devoirs, .tint-devoirs { --c: var(--c-devoirs); --c2: #f43f5e; }
.section-rdv, .nav-rdv, .tint-rdv { --c: var(--c-rdv); --c2: #a78bfa; }
.section-status, .nav-status, .tint-status { --c: var(--c-status); --c2: #60a5fa; }
.section-resultats, .nav-resultats, .tint-resultats { --c: var(--c-resultats); --c2: #2dd4bf; }
.section-assistant, .nav-assistant, .tint-assistant { --c: var(--c-assistant); --c2: #818cf8; }
.section-securite, .nav-securite { --c: var(--c-gris); --c2: #818cf8; }
.section-donnees, .nav-donnees { --c: var(--c-gris); --c2: #2dd4bf; }

[class*="section-"], [class*="tint-"], [class*="nav-"] {
    --primary: var(--c);
    --primary-soft: color-mix(in srgb, var(--c) 15%, transparent);
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
body {
    margin: 0;
    min-height: 100vh;
    font: 15px/1.55 var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 {
    font-family: var(--font-titre);
    font-size: clamp(2.05rem, 1.35rem + 2.6vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.02;
}
h2 { font-family: var(--font-titre); font-size: 1.15rem; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: .95rem; font-weight: 650; }
code {
    padding: 2px 6px; border-radius: 6px;
    background: var(--surface-2); font-family: var(--font-mono); font-size: .86em;
}
kbd {
    display: inline-block; padding: 1px 6px; border-radius: 6px;
    font-family: var(--font-mono); font-size: .7rem; line-height: 1.5;
    border: 1px solid var(--border-2); border-bottom-width: 2px; background: var(--surface); color: var(--muted);
}
::selection { background: color-mix(in srgb, var(--primary) 65%, transparent); color: #fff; }
::placeholder { color: var(--faint); opacity: 1; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: .84rem; }
.empty { margin: 6px 0; color: var(--muted); }
.texte-ok { color: var(--ok); }
.texte-danger { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
    width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.logo { width: 32px; height: 32px; flex-shrink: 0; }
@media (pointer: coarse) { .seulement-clavier { display: none; } }

/* ----- Fond lumineux aux couleurs de la page, légèrement animé ----- */
.fond {
    position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    background: radial-gradient(120% 70% at 50% -10%, #12141e 0%, var(--bg) 62%);
}
.fond::before {
    content: ""; position: absolute; inset: -20%;
    background:
        radial-gradient(36% 30% at 82% 12%, color-mix(in srgb, var(--c) 30%, transparent), transparent 72%),
        radial-gradient(32% 28% at 16% 4%, color-mix(in srgb, var(--c2) 19%, transparent), transparent 72%),
        radial-gradient(40% 32% at 34% 100%, color-mix(in srgb, var(--c) 11%, transparent), transparent 72%);
    animation: aurore 28s ease-in-out infinite alternate;
}
.fond::after {
    content: ""; position: absolute; inset: 0; opacity: .06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes aurore {
    0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    50% { transform: translate3d(-4%, 3%, 0) rotate(5deg) scale(1.06); }
    100% { transform: translate3d(3%, -2%, 0) rotate(-4deg) scale(1.03); }
}
@keyframes monte { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 65%, transparent); }
    70% { box-shadow: 0 0 0 9px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes apparait { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Mise en page : rail (ordinateur), barre d'onglets (téléphone)
   ===================================================================== */
.content { margin-left: var(--rail); padding: calc(34px + env(safe-area-inset-top)) clamp(20px, 4vw, 56px) 90px; }
.contenu { max-width: 1240px; margin: 0 auto; }
/* « backwards » et non « both » : une fois finie, l'animation ne garde aucun transform
   (sinon le bloc deviendrait la référence des éléments position: fixed, comme le menu « ⋯ » sur téléphone). */
.contenu > * { animation: monte .5s cubic-bezier(.2, .7, .2, 1) backwards; }
.contenu > :nth-child(2) { animation-delay: .03s; }
.contenu > :nth-child(3) { animation-delay: .07s; }
.contenu > :nth-child(4) { animation-delay: .11s; }
.contenu > :nth-child(5) { animation-delay: .15s; }
.contenu > :nth-child(n+6) { animation-delay: .19s; }

.rail {
    position: fixed; z-index: 50; inset: 0 auto 0 0; width: var(--rail);
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    padding: calc(18px + env(safe-area-inset-top)) 0 calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(15, 17, 26, .82), rgba(10, 11, 17, .72));
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    border-right: 1px solid var(--border);
}
.rail-logo { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; transition: transform .25s; }
.rail-logo:hover { transform: rotate(-8deg) scale(1.06); }
.rail-logo .logo { width: 36px; height: 36px; filter: drop-shadow(0 6px 16px rgba(139, 156, 255, .4)); }
.espaces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.espace { position: relative; }
.espace-lien {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
    width: 74px; padding: 11px 4px 9px; border-radius: 18px;
    color: var(--muted); font-size: .68rem; font-weight: 600; letter-spacing: .01em; text-align: center;
    transition: color .15s, background .15s;
}
.espace-lien .ico { width: 22px; height: 22px; transition: transform .2s; }
.espace-lien:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.espace-lien:hover .ico { transform: translateY(-2px); }
.espace.actif .espace-lien { color: var(--text); background: color-mix(in srgb, var(--c) 16%, transparent); }
.espace.actif .espace-lien .ico { color: var(--c); }
.espace.actif .espace-lien::before {
    content: ""; position: absolute; left: -9px; top: 50%; width: 4px; height: 26px; translate: 0 -50%;
    border-radius: 0 4px 4px 0; background: var(--c); box-shadow: 0 0 16px var(--c);
}

/* Menu d'un espace, au survol du rail */
.espace-menu {
    position: absolute; left: calc(100% + 12px); top: -8px; z-index: 60; min-width: 236px;
    display: flex; flex-direction: column; gap: 2px; padding: 10px;
    background: #141722;
    border: 1px solid var(--border-2); border-radius: 20px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .85);
    opacity: 0; visibility: hidden; translate: -6px 0;
    transition: opacity .15s, translate .15s, visibility .15s;
}
.espace-menu::before { content: ""; position: absolute; right: 100%; top: 0; bottom: 0; width: 16px; }
.espace-menu-titre { margin: 4px 10px 6px; font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.espace-menu a {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
    color: var(--text-2); font-size: .9rem; font-weight: 500;
}
.espace-menu a .ico { width: 18px; height: 18px; color: var(--c); }
.espace-menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.espace-menu a.actif { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text); }
@media (hover: hover) and (pointer: fine) {
    .espace:hover .espace-menu, .espace:focus-within .espace-menu {
        opacity: 1; visibility: visible; translate: 0 0; transition-delay: .06s;
    }
}

.rail-bas { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.rail-btn {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.rail-btn .ico { width: 19px; height: 19px; }
.rail-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-2); text-decoration: none; }
.rail-sortie:hover { color: var(--danger); }

/* Pages de l'espace courant */
.sous-nav {
    display: flex; gap: 4px; width: max-content; max-width: 100%; margin: 0 0 30px; padding: 5px;
    overflow-x: auto; scrollbar-width: none;
    border-radius: 999px; background: rgba(255, 255, 255, .035); border: 1px solid var(--border);
}
.sous-nav::-webkit-scrollbar { display: none; }
.sous-nav a {
    flex-shrink: 0; padding: 8px 16px; border-radius: 999px;
    color: var(--muted); font-size: .86rem; font-weight: 600; white-space: nowrap;
    transition: color .15s, background .15s;
}
.sous-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.sous-nav a.actif { color: #0b0c12; background: var(--c); box-shadow: 0 8px 22px -10px var(--c); }

.barre-haut, .barre-mobile { display: none; }

/* ----- En-tête de page ----- */
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
    gap: 18px 24px; margin-bottom: 30px;
}
.page-header > div:first-child { min-width: 0; }
.page-header h1 {
    background: linear-gradient(105deg, #fff 25%, color-mix(in srgb, var(--primary) 50%, #fff) 70%, var(--primary));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    padding-bottom: .06em;
}
.eyebrow {
    margin: 0 0 10px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--primary);
}
.eyebrow a { color: inherit; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.header-actions form { margin: 0; }

/* Actions secondaires regroupées derrière « ⋯ » */
.menu-plus { position: relative; }
.menu-plus > summary { list-style: none; }
.menu-plus > summary::-webkit-details-marker { display: none; }
.menu-plus[open] > summary { background: var(--surface-2); border-color: var(--border-2); }
.menu-plus-liste {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px;
    display: flex; flex-direction: column; gap: 2px; padding: 8px;
    background: rgba(18, 20, 30, .97);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border-2); border-radius: 18px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .85);
    animation: apparait .14s ease-out;
}
.menu-plus-liste form { margin: 0; }
.menu-plus-liste a, .menu-plus-liste button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
    border: 0; border-radius: 12px; background: none; color: var(--text-2);
    font: inherit; font-size: .9rem; font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer;
}
.menu-plus-liste a:hover, .menu-plus-liste button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-plus-liste .ico { width: 17px; height: 17px; color: var(--primary); }

/* Profil, amis, partage */
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; font-family: var(--font-titre); font-weight: 800; font-size: .95rem; letter-spacing: -.02em; color: #0b0d12; background: linear-gradient(135deg, var(--c-cours), var(--c-notes)); }
.profil-identite { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profil-identite .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.profil-identite strong { display: block; font-family: var(--font-titre); font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.profil-identite p { margin: 2px 0 0; }
.profil-identite > div { min-width: 0; overflow-wrap: anywhere; }
.page-header .eyebrow { overflow-wrap: anywhere; }
.profil-chip { margin: 6px 0 0; color: var(--text-2); font-size: .95rem; }
.profil-chip a { color: var(--text); font-weight: 600; }
.ami-ligne, .partage-ligne { align-items: center; }
.ami-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; flex-shrink: 0; }
.ami-actions form { margin: 0; }
.partage-message { color: var(--text-2) !important; font-style: italic; }
.choix-amis { margin: 0 0 16px; padding: 0; border: 0; }
.choix-amis legend { margin-bottom: 8px; font-weight: 600; font-size: .9rem; }
.choix-amis .field-checkbox { margin: 0 0 6px; }
.champ-fichier { width: 100%; padding: 10px; border: 1px dashed var(--border-2); border-radius: 14px; background: rgba(255, 255, 255, .03); color: var(--text-2); font: inherit; }
.champ-fichier::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--surface-3); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.form-passer { margin-top: 10px; }
.jauge-espace { height: 8px; margin: 0 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.jauge-espace span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c-cours), var(--c-notes)); }
.jauge-espace span.plein { background: var(--danger); }
.menu-fichier { width: min(290px, calc(100vw - 32px)); white-space: normal; }
.partage-choix { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 10px; margin-bottom: 4px !important; border-bottom: 1px solid var(--sep); }
.partage-choix p { margin: 0 0 2px; color: var(--muted); }
.partage-choix .field-checkbox { margin: 0; }
.menu-plus-liste .partage-choix .btn { justify-content: center; border: 1px solid var(--border-2); }
.menu-plus-liste button.texte-danger { color: var(--danger); }
.bouclier-simple { color: var(--warn); background: var(--warn-soft); box-shadow: 0 0 0 8px rgba(251, 191, 36, .05), 0 20px 40px -20px var(--warn); }
@media (max-width: 520px) {
    .partage-ligne, .ami-ligne { flex-wrap: wrap; }
    .partage-ligne .ami-actions { width: 100%; justify-content: flex-start; }
}
/* PRONOTE : scan du QR code à la caméra */
.scan { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; max-height: 360px; width: 100%; margin: 4px 0 10px; overflow: hidden; border-radius: 20px; border: 1px dashed var(--border-2); background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .05), rgba(0, 0, 0, .35)); }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.scan.actif { border-style: solid; }
.scan.actif video { opacity: 1; }
.scan-cadre { position: absolute; width: min(62%, 240px); aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); outline: 3px solid rgba(255, 255, 255, .85); opacity: 0; transition: opacity .2s; pointer-events: none; }
.scan.actif .scan-cadre { opacity: 1; animation: scan-pulse 1.6s ease-in-out infinite; }
@keyframes scan-pulse { 50% { outline-color: var(--primary); } }
.scan-bouton { position: relative; z-index: 1; min-height: 50px; padding: 0 22px; border-radius: 16px; }
.scan.actif .scan-bouton { display: none; }
.scan-ok { position: absolute; z-index: 1; display: none; place-items: center; width: 72px; height: 72px; border-radius: 50%; font-size: 2rem; font-weight: 800; color: #0b0d12; background: var(--ok); }
.scan.reconnu { border-style: solid; border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.scan.reconnu .scan-ok { display: grid; }
.scan.reconnu .scan-bouton { position: absolute; bottom: 14px; min-height: 40px; font-size: .88rem; }
.scan-pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-bottom: 8px; }
.scan-secours { margin: 0 0 16px; }
.scan-secours summary { cursor: pointer; }
.scan-secours .champ-fichier { margin-top: 8px; }
/* Accueil public (visiteurs) */
.page-auth:has(.bienvenue) { display: block; }
.bienvenue { width: min(1080px, calc(100vw - 32px)); margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 0 calc(48px + env(safe-area-inset-bottom)); animation: monte .6s cubic-bezier(.2, .7, .2, 1) backwards; }
.bienvenue-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bienvenue-haut .auth-marque { margin: 0; font-size: 1.3rem; }
.bienvenue-haut .auth-marque .logo { width: 34px; height: 34px; }
.bienvenue-hero { max-width: 760px; margin: clamp(40px, 9vw, 96px) auto clamp(36px, 7vw, 72px); text-align: center; }
.bienvenue-hero h1 { margin: 10px 0 18px; font-family: var(--font-titre); font-size: clamp(2.3rem, 1.2rem + 5vw, 4.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -.045em; }
.bienvenue-hero h1 span { background: linear-gradient(90deg, var(--c-cours), var(--c-notes), var(--c-devoirs)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bienvenue-intro { margin: 0 auto 28px; max-width: 560px; font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: var(--text-2); }
.bienvenue-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 14px; }
.bienvenue-actions .btn { min-height: 50px; padding: 0 26px; border-radius: 16px; font-size: 1rem; }
.bienvenue-atouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.bienvenue-atouts .card { margin: 0; }
.bienvenue-atouts h2, .bienvenue-securite h2 { margin: 14px 0 6px; font-size: 1.12rem; }
.bienvenue-atouts p, .bienvenue-securite p { margin: 0; font-size: .92rem; color: var(--text-2); }
.atout-icone { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 15px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.atout-icone .ico { width: 22px; height: 22px; }
.bienvenue-securite { display: flex; align-items: center; gap: 18px; --c: var(--ok); }
.bienvenue-securite h2 { margin-top: 0; }
@media (max-width: 900px) { .bienvenue-atouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
    .bienvenue-atouts { grid-template-columns: minmax(0, 1fr); }
    .bienvenue-actions .btn { flex: 1 1 100%; }
    .bienvenue-securite { flex-direction: column; align-items: flex-start; }
}
/* Inscription : champ piège à robots, hors de l'écran */
.champ-piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Page Utilisateurs */
.compte-ligne strong .badge { margin-left: 6px; vertical-align: 2px; }
.menu-plus-liste.supprimer-compte { width: min(320px, calc(100vw - 32px)); gap: 8px; padding: 14px; white-space: normal; }
.supprimer-compte p { margin: 0; color: var(--text-2); white-space: normal; }
.supprimer-compte input { width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: rgba(255, 255, 255, .04); border: 1px solid var(--border-2); border-radius: 12px; }
.menu-plus-liste.supprimer-compte button.btn-danger { justify-content: center; border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }

/* =====================================================================
   Cartes et listes
   ===================================================================== */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; margin-bottom: 20px; }
.grid > *, .matieres-resultats > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.grid > details.card { align-self: start; }
.card-wide { grid-column: 1 / -1; }

.card {
    position: relative; min-width: 0;
    padding: 22px 24px; margin-bottom: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .058), rgba(255, 255, 255, .022));
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), var(--ombre);
    overflow-wrap: break-word;
}
.card[class*="tint-"] {
    background:
        radial-gradient(90% 70% at 0% 0%, color-mix(in srgb, var(--c) 11%, transparent), transparent 65%),
        linear-gradient(180deg, rgba(255, 255, 255, .058), rgba(255, 255, 255, .022));
}
.card pre { max-width: 100%; overflow-x: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.card[class*="tint-"] > .card-head h2::before, .card[class*="tint-"] > summary h2::before {
    content: ""; width: 10px; height: 10px; flex-shrink: 0; border-radius: 4px;
    background: var(--c); box-shadow: 0 0 14px var(--c);
}
.card-head > a { font-size: .86rem; font-weight: 600; }

.lien-fleche { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--primary); }
.lien-fleche::after { content: "→"; transition: translate .15s; }
.lien-fleche:hover { text-decoration: none; }
.lien-fleche:hover::after { translate: 3px 0; }

/* Section repliable : <details class="card"><summary class="card-head"><h2>…</h2></summary> */
details.card > summary { list-style: none; cursor: pointer; margin-bottom: 0; user-select: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2::after {
    content: ""; width: 8px; height: 8px; margin-left: 2px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    rotate: -45deg; transition: rotate .2s;
}
details.card[open] > summary h2::after { rotate: 45deg; }
details.card[open] > summary { margin-bottom: 14px; }
details.card > summary:hover h2::after { border-color: var(--text); }

/* Suite d'une liste, repliée : <details class="repli"><summary>Voir les 12 autres</summary>… */
.repli { margin-top: 10px; }
.repli > summary {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; list-style: none; cursor: pointer;
    font-size: .84rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
}
.repli > summary::-webkit-details-marker { display: none; }
.repli > summary:hover { color: var(--text); border-color: var(--border-2); }
.repli[open] > summary { margin-bottom: 8px; }

.row {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 11px 12px; margin: 0 -12px; border-radius: 16px; color: var(--text);
}
.row + .row::before, .check-row + .check-row::before {
    content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: var(--sep);
}
.row-link { transition: background .15s; }
.row-link:hover { background: rgba(255, 255, 255, .05); text-decoration: none; }
.row-link:hover::before, .row-link:hover + .row::before { opacity: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; color: var(--text); }
.row-main:hover { text-decoration: none; }
.row-main strong { font-weight: 600; }
.row-main small { color: var(--muted); font-size: .82rem; }
.row .time { min-width: 86px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.done .row-main strong { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .35); color: var(--muted); }

.date-chip {
    display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
    width: 48px; height: 50px; border-radius: 15px; line-height: 1;
    background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 24%, transparent);
}
.date-chip b { font-family: var(--font-titre); font-size: 1.2rem; font-weight: 800; }
.date-chip small { margin-top: 3px; font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }

/* ----- Badges, pastilles, étiquettes ----- */
.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
    font-size: .72rem; font-weight: 650; line-height: 1.35; white-space: nowrap;
    background: var(--surface-2); color: var(--text-2);
}
a.badge:hover { text-decoration: none; filter: brightness(1.15); }
button.badge { cursor: pointer; border: 0; font-family: inherit; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warning { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-file { background: color-mix(in srgb, var(--c-notes) 16%, transparent); color: var(--c-notes); }
.badge-pronote { background: rgba(34, 197, 94, .14); color: #4ade80; font-size: .62rem; vertical-align: middle; }
.badge-btn {
    cursor: pointer; font: inherit; font-size: .72rem; font-weight: 650;
    border: 1px solid var(--border-2); background: transparent; color: var(--muted);
}
.badge-btn:hover { color: var(--danger); border-color: var(--danger); }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.chips .help { margin: 0 4px 0 0; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px;
    border: 1px solid var(--border-2); background: rgba(255, 255, 255, .035); color: var(--text-2);
    font: inherit; font-size: .82rem; font-weight: 550; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
a.chip { text-decoration: none; }
.chip:hover { border-color: color-mix(in srgb, var(--primary) 60%, transparent); color: var(--text); text-decoration: none; }
.chip.active { background: color-mix(in srgb, var(--primary) 18%, transparent); border-color: color-mix(in srgb, var(--primary) 65%, transparent); color: var(--text); }
.chip input { accent-color: var(--primary); margin: 0 2px 0 0; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 10px; border-radius: 999px; font-size: .78rem; background: rgba(255, 255, 255, .05); color: var(--muted); }
.tag:hover, .tag.active { background: var(--primary-soft); color: var(--primary); text-decoration: none; }

.pastille { display: inline-block; width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--mc); box-shadow: 0 0 12px var(--mc); }
.dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--faint); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), 0 0 12px rgba(74, 222, 128, .6); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.dot.ko { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft), 0 0 12px rgba(248, 113, 113, .6); }

/* ----- Case « fait » ----- */
.toggle-form { display: flex; margin: 0; }
.check {
    display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; padding: 0;
    border: 2px solid rgba(255, 255, 255, .22); border-radius: 9px; background: transparent;
    color: #07130b; font-size: 14px; font-weight: 800; cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.check:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); }
.check.checked { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }

/* ----- Chiffres clés ----- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stats > div { min-width: 0; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.stats b {
    display: block; font-family: var(--font-titre); font-size: 1.8rem; font-weight: 800;
    letter-spacing: -.03em; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums;
}
.stats small { color: var(--muted); font-size: .8rem; }

/* =====================================================================
   Boutons
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 9px 18px; border-radius: 14px; border: 1px solid transparent;
    font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
    cursor: pointer; text-decoration: none;
    transition: transform .15s, box-shadow .2s, background .15s, border-color .15s, filter .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn .ico { width: 17px; height: 17px; }
.btn-primary {
    color: #0a0b10;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 72%, #fff), var(--primary) 62%);
    box-shadow: 0 12px 28px -14px var(--primary), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 16px 34px -14px var(--primary), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, .2); }
.btn-danger { color: var(--danger); background: transparent; border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-petit { min-height: 32px; padding: 5px 12px; border-radius: 11px; font-size: .8rem; gap: 6px; }
.btn-petit .ico { width: 15px; height: 15px; }
.btn-large { width: 100%; min-height: 50px; border-radius: 16px; font-size: 1rem; }
.btn-icone { width: 42px; padding: 0; }
.btn-icone.btn-petit { width: 32px; }
.btn-link { padding: 0 0 0 8px; border: 0; background: none; font: inherit; color: var(--danger); cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link-neutre { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.btn-link-neutre:hover { color: var(--text); }
.is-fav, .star { color: var(--warn); }

/* Groupe de boutons collés (semaine précédente / suivante…) */
.groupe-boutons { display: inline-flex; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface); overflow: hidden; }
.groupe-boutons .btn { border: 0; border-radius: 0; background: transparent; min-height: 40px; }
.groupe-boutons .btn + .btn { border-left: 1px solid var(--border-2); }
.groupe-boutons .btn:hover { background: var(--surface-2); }

/* =====================================================================
   Formulaires
   ===================================================================== */
.form-card { max-width: 680px; }
.form-card-wide { max-width: 920px; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-cols-4 { grid-template-columns: repeat(4, 1fr); }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=time],
.field input[type=datetime-local], .field input[type=email], .field input[type=password], .field input[type=url],
.field input[type=search], .field input:not([type]), .field select, .field textarea,
.search input, .saisie-rapide input,
.assistant-fiche input, .assistant-saisie select, .onglet-reglages input[type=text] {
    width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
    background: rgba(255, 255, 255, .04); border: 1px solid var(--border-2); border-radius: 14px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus, .saisie-rapide input:focus,
.assistant-fiche input:focus,
.assistant-saisie select:focus, .onglet-reglages input[type=text]:focus {
    outline: none; background: rgba(255, 255, 255, .06);
    border-color: color-mix(in srgb, var(--primary) 80%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}
.field select, .assistant-saisie select {
    appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d94a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
}
select option { background: var(--solide); color: var(--text); }
.field textarea { resize: vertical; line-height: 1.55; }
.field textarea.editor { font-family: var(--font-mono); font-size: .88rem; line-height: 1.65; }
.field input[type=file] { font: inherit; color: var(--text-2); }
.field input[type=file]::file-selector-button {
    margin-right: 12px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border-2);
    background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.field input::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
input, select, textarea { max-width: 100%; }
/* iPhone : le champ date a une largeur propre qui déborde du cadre, et son texte se centre. */
.field input[type=date], .field input[type=time], .field input[type=datetime-local] {
    -webkit-appearance: none; appearance: none; display: block; min-width: 0; min-height: 48px; text-align: left;
}
.field input::-webkit-date-and-time-value { text-align: left; }
/* Sous 16 px, Safari zoome sur le champ touché et la page reste agrandie, décadrée. */
@media (max-width: 760px) {
    input, select, textarea { font-size: 16px !important; }
}
.field-checkbox { display: flex; align-items: center; gap: 10px; }
.field-checkbox label { margin: 0; font-weight: 500; color: var(--text); }
.field-checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }
.field > div > div { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }
.field input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); }
.field input[type=radio] + label { display: inline; margin: 0; font-weight: 500; color: var(--text); }
.field input[type=range] { width: 100%; accent-color: var(--primary); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger) !important; }
.error { margin: 6px 0 0; color: var(--danger); font-size: .84rem; }
.help { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.delete-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--sep); }
.current-file { margin: 0 0 16px; padding: 10px 14px; border-radius: 14px; background: var(--surface); }

.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 30px 18px 26px; margin-bottom: 16px; text-align: center; cursor: pointer;
    border: 2px dashed rgba(255, 255, 255, .15); border-radius: 20px;
    background: radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%), rgba(255, 255, 255, .02);
    transition: border-color .2s, background .2s;
}
.dropzone::before {
    content: "↑"; display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 6px;
    border-radius: 50%; font-size: 1.3rem; font-weight: 700; color: var(--primary);
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 7%, transparent);
    transition: transform .2s;
}
.dropzone:hover, .dropzone.over {
    border-color: color-mix(in srgb, var(--primary) 70%, transparent);
    background: radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%), rgba(255, 255, 255, .03);
}
.dropzone:hover::before, .dropzone.over::before { transform: translateY(-3px); }
.dropzone strong { font-family: var(--font-titre); font-size: 1.05rem; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tree { padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); font-size: .84rem; overflow-x: auto; }

/* ----- Messages ----- */
.flash {
    display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 13px 16px;
    border-radius: 16px; border: 1px solid transparent; font-weight: 500;
}
.flash-success { background: var(--ok-soft); border-color: rgba(74, 222, 128, .25); color: #c9f7d8; }
.flash-success::before { content: "✓"; font-weight: 800; color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: rgba(248, 113, 113, .3); color: #fed2d2; }
.flash-error::before { content: "!"; display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #1a0606; font-weight: 800; font-size: .8rem; }

.progress { height: 6px; margin: 8px 0 4px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width 1s linear; }

/* =====================================================================
   Accueil
   ===================================================================== */
.accueil-hero { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px 28px; margin: 4px 0 26px; }
.accueil-intro { min-width: 0; }
.accueil-titre { font-size: clamp(2.6rem, 1.4rem + 4.6vw, 5.2rem); line-height: .96; letter-spacing: -.05em; }
.accueil-titre span { background: linear-gradient(100deg, var(--c), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vacances-chip {
    display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 7px 15px; border-radius: 999px;
    font-size: .88rem; color: var(--text);
    background: color-mix(in srgb, var(--c-cours) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c-cours) 26%, transparent);
}
.vacances-chip b { color: var(--c-cours); }
.accueil-meteo {
    display: flex; align-items: center; gap: 14px; padding: 14px 22px 14px 16px; border-radius: 24px;
    background: rgba(255, 255, 255, .04); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.meteo-icon { font-size: 2.4rem; line-height: 1; }
.meteo-temp { font-family: var(--font-titre); font-size: 2.7rem; font-weight: 700; line-height: 1; letter-spacing: -.05em; }
.meteo-texte { display: flex; flex-direction: column; min-width: 0; }
.meteo-texte b { font-weight: 600; }
.meteo-texte small { color: var(--muted); font-size: .8rem; }

/* Maintenant / ensuite */
.focus-zone { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.focus-zone > :only-child { grid-column: 1 / -1; }
.focus {
    --fc: var(--c);
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-width: 0;
    padding: 26px 28px; border-radius: 28px;
    background:
        radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--fc) 26%, transparent), transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    border: 1px solid color-mix(in srgb, var(--fc) 30%, rgba(255, 255, 255, .08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 60px -34px color-mix(in srgb, var(--fc) 55%, transparent);
}
.focus p { margin: 0; }
.focus-label { display: flex; align-items: center; gap: 9px; font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--fc); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--fc); color: var(--fc); animation: pulse 2s infinite; }
.focus-titre {
    font-family: var(--font-titre); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); font-weight: 800;
    letter-spacing: -.035em; line-height: 1.04; color: var(--text);
}
a.focus-titre:hover { text-decoration: none; color: color-mix(in srgb, var(--fc) 40%, #fff); }
.focus-sub { color: var(--text-2); }
.focus-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.focus .progress { height: 10px; margin: 14px 0 4px; }
.focus .progress span { background: linear-gradient(90deg, color-mix(in srgb, var(--fc) 55%, #fff), var(--fc)); box-shadow: 0 0 18px var(--fc); }
.focus .hero-actions { margin-top: 14px; }
.focus-compte { font-family: var(--font-titre); font-size: 1.5rem; font-weight: 700; color: var(--fc); letter-spacing: -.02em; }
.focus-ensuite .focus-titre { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.focus-seul .focus-compte { font-size: clamp(2.6rem, 1.6rem + 3.4vw, 4.4rem); line-height: 1; letter-spacing: -.045em; margin: 4px 0 6px; }
.focus-libre { --fc: var(--ok); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hero-label { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hero-title { font-family: var(--font-titre); font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }

.accueil-grille { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.accueil-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.accueil-col > .card { margin-bottom: 0; }

/* Programme du jour */
.timeline { display: flex; flex-direction: column; }
.tl-item {
    --tc: var(--c-cours);
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 9px 12px 9px 0; margin-right: -12px; border-radius: 16px; color: var(--text);
    transition: background .15s;
}
.tl-item:hover { text-decoration: none; background: rgba(255, 255, 255, .04); }
.tl-cours { --tc: hsl(var(--h, 199) 75% 66%); }
.tl-rdv { --tc: var(--c-rdv); }
.tl-time {
    display: flex; flex-direction: column; min-width: 50px; text-align: right; line-height: 1.15;
    font-family: var(--font-titre); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tl-time small { font-family: var(--font); font-size: .74rem; font-weight: 500; color: var(--faint); }
.tl-dot { position: relative; align-self: stretch; width: 14px; flex-shrink: 0; }
.tl-dot::before { content: ""; position: absolute; left: 6px; top: -9px; bottom: -9px; width: 2px; background: rgba(255, 255, 255, .08); }
.tl-dot::after {
    content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 14px; translate: 0 -50%;
    border-radius: 50%; background: var(--bg); border: 3px solid var(--tc);
}
.tl-item:first-child .tl-dot::before { top: 50%; }
.tl-item:last-child .tl-dot::before { bottom: 50%; }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tl-body strong { font-weight: 600; }
.tl-body small { color: var(--muted); font-size: .82rem; }
.tl-passe, .tl-annule { opacity: .45; }
.tl-annule strong { text-decoration: line-through; }
.tl-en-cours { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 16%, transparent), transparent 80%); }
.tl-en-cours .tl-dot::after { background: var(--tc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--tc) 25%, transparent), 0 0 18px var(--tc); }
.demain { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-2); font-size: .88rem; color: var(--muted); }
.demain p { margin: 0 0 6px; }
.demain b { color: var(--text); }
.demain-devoir { display: block; padding: 3px 0; color: var(--c-devoirs); }
.demain-devoir b { color: inherit; }

/* Aperçu : tuiles-onglets et panneau */
.apercu { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tuile {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0;
    padding: 16px 16px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
    color: var(--text); font: inherit; text-align: left; cursor: pointer;
    transition: transform .18s, border-color .18s, background .18s, box-shadow .18s;
}
.tuile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 35%, transparent); }
.tuile[aria-selected="true"] {
    border-color: color-mix(in srgb, var(--c) 55%, transparent);
    background:
        radial-gradient(120% 110% at 0% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
    box-shadow: 0 18px 40px -22px var(--c);
}
.tuile-label { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.tuile-label .ico { width: 16px; height: 16px; color: var(--c); }
.tuile[aria-selected="true"] .tuile-label { color: var(--text-2); }
.tuile-chiffre {
    font-family: var(--font-titre); font-size: 2.3rem; font-weight: 800; line-height: 1.05;
    letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.tuile-chiffre small { margin-left: 2px; font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.tuile-sub { max-width: 100%; overflow: hidden; font-size: .78rem; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.panneau { margin-bottom: 0; }
.panneau-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sep); }
.panneau-pied .btn { margin-left: auto; }
.panneau-titre { margin: 2px 0 6px; font-size: .68rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); }
.panneau-titre ~ .panneau-titre { margin-top: 18px; }
.panneau-resume { margin: 0 0 8px; font-weight: 600; color: var(--text-2); }

.saisie-rapide { display: flex; gap: 8px; margin-bottom: 10px; }
.saisie-rapide input { flex: 1; min-width: 0; padding: 10px 13px; font-size: .9rem; }
.saisie-rapide input[name=matiere] { flex: 0 0 34%; }
.saisie-rapide .btn { min-height: 44px; width: 46px; padding: 0; }
.saisie-rapide .ico { width: 20px; height: 20px; }
.pronote-auto { margin: -4px 0 10px; }
.pronote-erreur { color: var(--danger); }

/* Minuteur */
.pomo-corps { display: flex; align-items: center; gap: 22px; }
.pomo-anneau {
    position: relative; flex-shrink: 0; display: grid; place-items: center; width: 146px; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 12%, transparent), transparent);
}
.pomo-anneau::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--primary) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .08) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
}
.pomo-temps { font-family: var(--font-titre); font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pomo-actif .pomo-temps { color: var(--primary); text-shadow: 0 0 24px color-mix(in srgb, var(--primary) 55%, transparent); }
.pomo-actif .pomo-anneau::before { filter: drop-shadow(0 0 8px var(--primary)); }
.pomo-cote { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pomo-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.pomo-actions { margin: 0; }

/* =====================================================================
   Emploi du temps
   ===================================================================== */
.edt {
    display: grid;
    grid-template-columns: 44px repeat(var(--colonnes), minmax(0, 1fr));
    grid-template-rows: auto repeat(var(--lignes), 4.5px);
    column-gap: 8px;
    margin-bottom: 14px;
}
.edt-coin { grid-column: 1; grid-row: 1; }
.edt-jour { grid-row: 1; padding: 0 6px 12px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.edt-jour b { margin-left: 3px; font-family: var(--font-titre); font-size: 1.15rem; font-weight: 800; color: var(--text); }
.edt-jour.today, .edt-jour.today b { color: var(--primary); }
.edt-fond { grid-row: 2 / -1; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.edt-fond.today { border-color: color-mix(in srgb, var(--primary) 55%, transparent); background: color-mix(in srgb, var(--primary) 6%, transparent); box-shadow: 0 0 30px -12px var(--primary); }
.edt-trait { grid-column: 2 / -1; z-index: 1; align-self: start; border-top: 1px dashed rgba(255, 255, 255, .06); pointer-events: none; }
.edt-heure { grid-column: 1; font-size: .7rem; color: var(--faint); text-align: right; translate: 0 -.6em; font-variant-numeric: tabular-nums; }
.course {
    display: flex; flex-direction: column; padding: 8px 10px; margin-bottom: 8px; color: var(--text);
    border-left: 3px solid var(--c-cours); border-radius: 10px;
    background: color-mix(in srgb, var(--c-cours) 14%, var(--solide));
    transition: filter .15s, transform .15s;
}
.course:hover { text-decoration: none; filter: brightness(1.18); }
.course .time { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.course small { color: var(--muted); }
.course-matiere { --mc: hsl(var(--h) 75% 66%); background: color-mix(in srgb, var(--mc) 15%, var(--solide)); border-left-color: var(--mc); }
.course-rdv { background: color-mix(in srgb, var(--c-rdv) 15%, var(--solide)); border-left-color: var(--c-rdv); }
.course-annule { opacity: .55; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 6px, transparent 6px 12px), var(--solide); }
.course-annule strong { text-decoration: line-through; }
.annule-tag { color: var(--danger); font-weight: 600; }
.statut-tag { color: var(--warn); font-weight: 600; }
.edt-bloc {
    position: relative; z-index: 2; gap: 1px; min-height: 0; margin: 1px 0; padding: 5px 8px; overflow: hidden;
    width: calc((100% - 4px) / var(--voies));
    margin-left: calc(var(--voie) * (100% / var(--voies)) + 2px);
}
.edt-bloc strong { font-size: .85rem; line-height: 1.2; }
.edt-bloc small { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edt-bloc .time { font-size: .7rem; }
.edt-court { padding-block: 2px; }
.edt-court small { display: none; }
.edt-maintenant { position: relative; z-index: 3; align-self: start; border-top: 2px solid var(--danger); pointer-events: none; box-shadow: 0 0 10px var(--danger); }
.edt-maintenant::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.week { display: none; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.day { min-height: 120px; padding: 14px; border-radius: 20px; background: rgba(255, 255, 255, .035); border: 1px solid var(--border); }
.day.today { border-color: color-mix(in srgb, var(--primary) 55%, transparent); box-shadow: 0 0 30px -14px var(--primary); }
.day h3 { margin-bottom: 10px; font-family: var(--font-titre); font-size: 1rem; font-weight: 700; color: var(--text-2); }
.day.today h3 { color: var(--primary); }
.legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.leg { display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 3px; }
.leg-rdv { background: var(--c-rdv); }
@media (max-width: 900px) {
    .edt { display: none; }
    .week { display: grid; }
}

/* =====================================================================
   Matières
   ===================================================================== */
.matieres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; }
.matiere-card, .matiere-titre, .tl-cours, .matiere-tag, .note-pastille { --mc: hsl(var(--h) 75% 66%); }
.matiere-card {
    position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 170px; padding: 20px 22px; overflow: hidden;
    border-radius: 24px; color: var(--text);
    background:
        radial-gradient(110% 90% at 100% 0%, color-mix(in srgb, var(--mc) 24%, transparent), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
    border: 1px solid color-mix(in srgb, var(--mc) 20%, var(--border));
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.matiere-card:hover { transform: translateY(-3px); text-decoration: none; border-color: color-mix(in srgb, var(--mc) 60%, transparent); box-shadow: 0 26px 50px -28px var(--mc); }
.matiere-card-head { display: flex; align-items: center; gap: 10px; }
.matiere-card-head strong { font-family: var(--font-titre); font-size: 1.3rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.matiere-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; font-size: .84rem; color: var(--muted); }
.matiere-stats b { color: var(--text); }
.matiere-stats .a-faire b { color: var(--c-devoirs); }
.matiere-card .prochain { font-size: .8rem; font-weight: 600; color: var(--mc); }
.theme-matiere { --primary: hsl(var(--h) 75% 66%); --primary-soft: hsl(var(--h) 75% 66% / .14); --mc: var(--primary); }
.matiere-titre { display: flex; align-items: center; gap: 14px; }
.matiere-titre .pastille { width: 16px; height: 16px; }
.matiere-infos { margin: 10px 0 0; }
.matiere-tag {
    padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 650; white-space: nowrap;
    color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, transparent);
}
.matiere-tag:hover { text-decoration: none; filter: brightness(1.15); }

/* =====================================================================
   Notes de cours
   ===================================================================== */
.notes-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.notes-layout > * { min-width: 0; }
.notes-filters { position: sticky; top: 24px; }
.notes-filters h3 { margin: 22px 0 8px; font-size: .68rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; border-radius: 12px; color: var(--text-2); }
.filter-list a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.filter-list a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.filter-list span { color: var(--faint); font-size: .84rem; }
.note-tags { margin: -14px 0 18px; }
.filter-summary { margin: 0 0 14px; }
.matiere-link { color: var(--text); }
.chapitre {
    margin: 16px 0 4px; padding-top: 12px; border-top: 1px dashed var(--border-2);
    font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary);
}
.card-head + .chapitre { margin-top: 0; padding-top: 0; border-top: 0; }
.note-row small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.markdown { padding: 32px 40px; line-height: 1.75; font-size: 1rem; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1 { font-size: 1.7rem; margin: 1.4em 0 .5em; }
.markdown h2 { font-size: 1.35rem; margin: 1.5em 0 .6em; padding-bottom: 6px; border-bottom: 1px solid var(--sep); }
.markdown h3 { font-size: 1.08rem; margin: 1.3em 0 .4em; }
.markdown a { text-decoration: underline; text-underline-offset: 3px; }
.markdown blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 3px solid var(--primary); border-radius: 0 14px 14px 0; background: var(--primary-soft); }
.markdown blockquote p { margin: 0; }
.markdown pre { padding: 14px 16px; border-radius: 14px; background: rgba(0, 0, 0, .35); overflow-x: auto; }
.markdown pre code { padding: 0; background: none; }
.markdown table { margin: 1em 0; border-collapse: collapse; display: block; overflow-x: auto; }
.markdown th, .markdown td { padding: 8px 12px; border: 1px solid var(--border-2); text-align: left; }
.markdown th { background: var(--surface); }
.markdown img { max-width: 100%; border-radius: 12px; }
.markdown hr { margin: 2em 0; border: 0; border-top: 1px solid var(--border-2); }
.markdown li::marker { color: var(--primary); }
.file-preview { width: 100%; height: 80vh; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.file-preview-img { display: block; max-width: 100%; border-radius: 14px; }
.note-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.note-nav .btn { display: inline-block; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 24px; }

/* ----- Révision par fiches ----- */
.revision-filtres { margin: 0 0 20px; }
.flashcards { max-width: 780px; }
.fc-entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.fc-boites { display: flex; gap: 4px; }
.fc-b { min-width: 28px; padding: 3px 7px; border-radius: 8px; text-align: center; font-size: .72rem; font-weight: 700; background: var(--surface-2); }
.fc-b1 { color: var(--danger); } .fc-b2 { color: var(--c-devoirs); } .fc-b3 { color: var(--warn); } .fc-b4 { color: var(--c-cours); } .fc-b5 { color: var(--ok); }
.fc-carte {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px;
    min-height: 260px; padding: 34px 28px; text-align: center; cursor: pointer; border-radius: 26px;
    background:
        radial-gradient(90% 80% at 50% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%),
        linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    box-shadow: 0 30px 60px -34px color-mix(in srgb, var(--primary) 60%, transparent);
}
.fc-carte:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.fc-matiere { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.fc-question { font-family: var(--font-titre); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.fc-reponse { width: 100%; padding-top: 16px; border-top: 1px dashed var(--border-2); font-size: 1.1rem; line-height: 1.55; color: var(--ok); }
.fc-actions { justify-content: center; margin-top: 18px; }
.fc-non { border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
.fc-oui { --primary: var(--ok); }
.fc-fin { padding: 28px 0 8px; text-align: center; }
.fc-fin .actions { justify-content: center; }

/* =====================================================================
   Devoirs
   ===================================================================== */
.devoirs-groupe { padding-top: 18px; }
.devoirs-danger { border-color: rgba(248, 113, 113, .3); background: radial-gradient(90% 70% at 0% 0%, rgba(248, 113, 113, .12), transparent 65%), linear-gradient(180deg, rgba(255, 255, 255, .058), rgba(255, 255, 255, .022)); }
.devoirs-danger > .card-head h2 { color: #fecaca; }
.devoirs-warning { border-color: rgba(251, 191, 36, .25); background: radial-gradient(90% 70% at 0% 0%, rgba(251, 191, 36, .1), transparent 65%), linear-gradient(180deg, rgba(255, 255, 255, .058), rgba(255, 255, 255, .022)); }

/* =====================================================================
   PRONOTE et résultats
   ===================================================================== */
.liste-aide { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.liste-aide li::marker { color: var(--primary); font-weight: 700; }
#pin { max-width: 150px; font-family: var(--font-mono); font-size: 1.3rem; letter-spacing: .4em; text-align: center; }

.resultats-haut { display: grid; grid-template-columns: minmax(230px, 1fr) 3fr; gap: 20px; margin-bottom: 20px; }
.resultats-haut > .card { margin-bottom: 0; }
.moyenne-generale { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.moyenne-chiffre {
    margin: 0; font-family: var(--font-titre); font-size: clamp(3rem, 2.2rem + 2.6vw, 4.4rem); font-weight: 800;
    line-height: .95; letter-spacing: -.05em; font-variant-numeric: tabular-nums;
    background: linear-gradient(120deg, #fff, var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.moyenne-chiffre small { margin-left: 4px; font-size: 1.1rem; font-weight: 600; letter-spacing: 0; -webkit-text-fill-color: var(--muted); }
.moyenne-ecart { margin: 0; font-size: .88rem; font-weight: 600; }
.moyenne-ecart.positif { color: var(--ok); }
.moyenne-ecart.negatif { color: var(--danger); }

/* Graphiques (couleurs validées sur fond sombre) */
.serie-moi { --serie: #3a8fd9; }
.serie-classe { --serie: #b87a28; }
.legende-graph { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.legende-graph span, .g-bulle span { display: inline-flex; align-items: center; gap: 6px; }
i.serie { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--serie); }
i.serie.serie-classe { background: repeating-linear-gradient(90deg, var(--serie) 0 4px, transparent 4px 7px); }
.graph { position: relative; height: 220px; }
.graph svg { display: block; overflow: visible; }
.g-grille { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.g-dix { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.g-axe { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.g-ligne { fill: none; stroke: var(--serie); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.g-ligne.serie-classe { stroke-dasharray: 6 4; }
.g-point { fill: var(--serie); stroke: var(--bg); stroke-width: 2; }
.g-reticule { stroke: var(--muted); stroke-width: 1; }
.g-bulle {
    position: absolute; top: 4px; z-index: 5; pointer-events: none;
    display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 9px 12px;
    background: var(--solide-2); border: 1px solid var(--border-2); border-radius: 12px; font-size: .8rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.tableau-donnees { margin-top: 10px; overflow-x: auto; }
.tableau-donnees summary { cursor: pointer; }
.tableau-donnees table { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: .84rem; }
.tableau-donnees th, .tableau-donnees td { padding: 5px 8px; border-bottom: 1px solid var(--sep); text-align: left; }

.matieres-resultats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }
.matieres-resultats > .card {
    margin-bottom: 0;
    background:
        radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--mc) 14%, transparent), transparent 65%),
        linear-gradient(180deg, rgba(255, 255, 255, .058), rgba(255, 255, 255, .022));
}
.matiere-resultat { --mc: hsl(var(--h) 75% 66%); }
.matiere-titre-petit { display: flex; align-items: center; gap: 10px; }
.matiere-titre-petit a { color: var(--text); }
.moyenne-matiere { font-family: var(--font-titre); font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--mc); }
.moyenne-matiere small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.echelle { position: relative; height: 10px; margin: 6px 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); }
.echelle-plage { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--mc) 28%, transparent); }
.echelle-classe { position: absolute; top: -3px; width: 2px; height: 16px; margin-left: -1px; background: #b87a28; }
.echelle-moi { position: absolute; top: -3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #3a8fd9; border: 3px solid var(--solide); box-shadow: 0 0 12px rgba(58, 143, 217, .7); }
.echelle-legende { margin: 0 0 6px; }
.notes-matiere { margin-top: 8px; }
.notes-matiere > summary { cursor: pointer; color: var(--muted); font-size: .84rem; font-weight: 600; list-style: none; }
.notes-matiere > summary::-webkit-details-marker { display: none; }
.notes-matiere > summary::before { content: "▸ "; }
.notes-matiere[open] > summary::before { content: "▾ "; }
.notes-matiere[open] > summary { margin-bottom: 6px; }
.note-ligne strong { font-variant-numeric: tabular-nums; }
.note-ligne .badge { margin-left: 4px; vertical-align: middle; }
.note-pastille {
    display: flex; align-items: baseline; justify-content: center; min-width: 60px; padding: 7px 9px; border-radius: 14px;
    font-family: var(--font-titre); font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--mc) 14%, transparent); color: var(--mc);
}
.note-pastille small { font-family: var(--font); font-size: .68rem; font-weight: 500; opacity: .8; }

.check-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.btn-petit.btn-primary { box-shadow: 0 8px 18px -10px var(--primary), inset 0 1px 0 rgba(255, 255, 255, .35); }
/* =====================================================================
   Sécurité et pages de connexion
   ===================================================================== */
.page-auth { min-height: 100vh; display: grid; place-items: center; }
.auth { width: min(440px, calc(100vw - 32px)); padding: calc(40px + env(safe-area-inset-top)) 0 40px; animation: monte .6s cubic-bezier(.2, .7, .2, 1) backwards; }
.auth-marque { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; font-family: var(--font-titre); font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.auth-marque .logo { width: 42px; height: 42px; filter: drop-shadow(0 8px 20px rgba(139, 156, 255, .45)); }
.auth-carte { padding: 32px; border-radius: 28px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.auth-titre { margin-bottom: 16px; font-size: 1.7rem; }
.auth-pied { margin-top: 16px; text-align: center; }
.auth-liens { margin: 18px 0 0; text-align: center; }
.champ-mdp { display: flex; gap: 6px; }
.champ-mdp input { flex: 1; min-width: 0; }
.btn-oeil { flex-shrink: 0; width: 46px; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; }
.btn-oeil:hover { border-color: var(--primary); background: var(--surface-2); }
.champ-code { font-family: var(--font-mono) !important; font-size: 1.5rem !important; letter-spacing: .35em; text-align: center; }
.jauge { height: 6px; margin-top: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.jauge span { display: block; width: 0; height: 100%; transition: width .2s, background .2s; }
.regles { display: flex; flex-direction: column; gap: 3px; margin: 0 0 16px; padding-left: 18px; color: var(--muted); }
.qr-totp { width: 220px; margin: 16px auto; padding: 10px; border-radius: 16px; background: #fff; }
.qr-totp svg { display: block; width: 100%; height: auto; }
.cle-totp { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.codes-secours { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.codes-secours code { padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .3); font-size: 1.05rem; text-align: center; letter-spacing: .08em; }
.carte-alerte { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: radial-gradient(90% 90% at 0% 0%, rgba(251, 191, 36, .12), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, .058), rgba(255, 255, 255, .022)); }
.protections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.protections li { display: flex; gap: 10px; }
.protections li::before { content: "✓"; flex-shrink: 0; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: .72rem; font-weight: 800; }
.securite-hero { display: flex; align-items: center; gap: 22px; }
.securite-bouclier {
    display: grid; place-items: center; flex-shrink: 0; width: 76px; height: 76px; border-radius: 24px;
    color: var(--ok); background: var(--ok-soft); box-shadow: 0 0 0 8px rgba(74, 222, 128, .05), 0 20px 40px -20px var(--ok);
}
.securite-bouclier .ico { width: 38px; height: 38px; }
.securite-hero strong { display: block; font-family: var(--font-titre); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.form-confirmation .form-cols { gap: 0 12px; }

/* ----- Fenêtres ----- */
.modale {
    width: min(560px, calc(100vw - 32px)); padding: 24px 26px; color: var(--text);
    background: var(--solide); border: 1px solid var(--border-2); border-radius: 24px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .85);
}
.modale[open] { animation: apparait .18s ease-out; }
.modale::backdrop { background: rgba(4, 5, 9, .65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modale h2 { margin-bottom: 16px; font-size: 1.3rem; }

.progression { margin-top: 12px; }
/* =====================================================================
   Classeurs à intercalaires
   ===================================================================== */
.etagere { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 24px; }
.classeur-couverture {
    --mc: hsl(var(--h) 60% 55%);
    position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 260px; padding: 18px 16px 16px 40px;
    border-radius: 8px 18px 18px 8px; color: #fff; text-decoration: none;
    background: linear-gradient(90deg, color-mix(in srgb, var(--mc) 62%, #000) 0 22px, var(--mc) 22px);
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6), 0 0 40px -18px var(--mc), inset -6px 0 0 rgba(0, 0, 0, .12);
    transition: transform .2s, box-shadow .2s;
}
.classeur-couverture:hover { text-decoration: none; transform: translateY(-5px) rotate(-.8deg); box-shadow: 0 22px 40px -12px rgba(0, 0, 0, .65), 0 0 60px -16px var(--mc); }
.classeur-anneaux { position: absolute; left: 6px; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: space-evenly; }
.classeur-anneaux i { width: 12px; height: 12px; border-radius: 50%; background: #d1d5db; box-shadow: inset 0 -2px 0 #9ca3af, 0 1px 2px rgba(0, 0, 0, .4); }
.classeur-etiquette { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: #fffef7; color: #1f2937; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.classeur-etiquette strong { font-family: var(--font-titre); font-size: 1.08rem; line-height: 1.2; }
.classeur-etiquette small { color: #6b7280; }
.classeur-contenu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; }
.classeur-contenu .badge { background: rgba(0, 0, 0, .25); color: #fff; }
.classeur-contenu small { color: rgba(255, 255, 255, .85); }

.classeur-corps { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: start; }
.classeur-feuilles { min-height: 420px; padding: 20px; border-radius: var(--radius) 0 var(--radius) var(--radius); background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)); border: 1px solid var(--border); }
.classeur-feuilles-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.feuilles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.feuille {
    position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 6px; color: #1f2937; text-decoration: none;
    background: #fffef9; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); cursor: grab; transition: transform .15s, box-shadow .15s;
}
.feuille:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 22px rgba(0, 0, 0, .5); }
.feuille.glissee { opacity: .4; }
.feuille-trous { position: absolute; left: 6px; top: 0; bottom: 34%; z-index: 1; display: flex; flex-direction: column; justify-content: space-around; }
.feuille-trous i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.feuille-apercu { display: grid; place-items: center; aspect-ratio: 1 / 1.3; overflow: hidden; background: #fffef9; border-bottom: 1px solid #e5e7eb; }
.feuille-apercu img, .feuille-apercu canvas { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.feuille-texte {
    align-self: start; width: 100%; height: 100%; padding: 14px 10px 10px 22px; overflow: hidden;
    font-size: .72rem; line-height: 18px; color: #334155;
    background: repeating-linear-gradient(transparent 0 17px, #c7d2e5 17px 18px), linear-gradient(90deg, transparent 18px, #f2b8bf 18px 19px, transparent 19px);
    display: -webkit-box; -webkit-line-clamp: 14; -webkit-box-orient: vertical;
}
.feuille-vide { color: #9ca3af; font-size: .85rem; }
.feuille-legende { display: flex; flex-direction: column; padding: 8px 10px; background: #fff; }
.feuille-legende strong { overflow: hidden; font-size: .82rem; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.feuille-legende small { color: #6b7280; font-size: .72rem; }
.feuille-ajout { align-items: center; justify-content: center; gap: 6px; min-height: 240px; cursor: pointer; background: transparent; color: var(--muted); border: 2px dashed var(--border-2); box-shadow: none; }
.feuille-ajout span { font-size: 2rem; }
.feuille-ajout:hover { color: var(--primary); border-color: var(--primary); box-shadow: none; }
.onglets { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.onglet {
    display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-left: -1px; padding: 10px 12px 10px 14px;
    border-radius: 0 12px 12px 0; color: #111827; font-size: .85rem; font-weight: 600; text-decoration: none;
    background: color-mix(in srgb, var(--oc) 75%, #fff); box-shadow: 2px 2px 6px rgba(0, 0, 0, .35); transition: transform .12s, padding .12s;
}
.onglet span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.onglet small { padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .55); font-size: .72rem; font-weight: 500; }
.onglet:hover { text-decoration: none; transform: translateX(3px); }
.onglet.ouvert { padding-left: 20px; background: var(--oc); box-shadow: 3px 3px 8px rgba(0, 0, 0, .45); }
.onglet.cible { outline: 3px dashed var(--text); outline-offset: 2px; }
.onglet.recu { animation: recu .8s; }
@keyframes recu { 50% { transform: translateX(8px) scale(1.04); } }
.onglet-nouveau input { width: 100%; padding: 9px 11px; border: 1px dashed var(--border-2); border-radius: 0 12px 12px 0; background: transparent; color: var(--text); font: inherit; font-size: .85rem; }
.onglet-nouveau input:focus { outline: 2px solid var(--primary); border-style: solid; }
.onglet-reglages { margin-top: 10px; font-size: .85rem; }
.onglet-reglages summary { cursor: pointer; }
.onglet-reglages input[type=text] { margin: 8px 0; padding: 8px 10px; border-radius: 10px; }
.onglet-couleurs { display: flex; flex-wrap: wrap; gap: 5px; }
.onglet-couleurs label { width: 22px; height: 22px; border-radius: 50%; background: var(--oc); cursor: pointer; }
.onglet-couleurs input { opacity: 0; }
.onglet-couleurs label:has(input:checked) { outline: 2px solid var(--text); outline-offset: 2px; }

/* =====================================================================
   Éditeur de dessin et annotation des PDF
   ===================================================================== */
.editeur-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.editeur-titre { flex: 1; min-width: 200px; padding: 6px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-family: var(--font-titre); font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.editeur-titre:hover, .editeur-titre:focus { border-color: var(--border-2); background: var(--surface); outline: none; }
.editeur-titre-fixe { flex: 1; font-family: var(--font-titre); font-size: 1.2rem; font-weight: 800; }
.editeur-aide { margin: 8px 0 0; }
.barre-dessin {
    position: sticky; top: 10px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 8px 10px; border-radius: 18px; background: rgba(18, 20, 30, .9); border: 1px solid var(--border-2);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6);
}
.barre-groupe { display: flex; align-items: center; gap: 3px; padding-right: 10px; border-right: 1px solid var(--border); }
.barre-groupe:last-of-type { border-right: 0; }
.barre-dessin button, .barre-dessin select {
    min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 10px;
    background: transparent; color: var(--text); font: inherit; font-size: .95rem; cursor: pointer;
}
.barre-dessin button:hover { background: var(--surface-2); }
.barre-dessin .outil.actif, .barre-dessin .epaisseur.actif { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.barre-dessin select { border-color: var(--border-2); background: var(--surface); font-size: .82rem; }
.pastille-couleur { min-width: 24px !important; width: 24px; height: 24px !important; padding: 0 !important; border-radius: 50% !important; background: var(--pc) !important; border: 2px solid var(--solide) !important; box-shadow: 0 0 0 1px var(--border-2); }
.pastille-couleur.actif { box-shadow: 0 0 0 2px var(--text); }
.barre-dessin input[type=color] { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.epaisseur span { display: block; width: 18px; height: var(--w); border-radius: 999px; background: currentColor; }
.barre-etat { margin-left: auto; }
.feuilles-editeur { display: flex; flex-direction: column; align-items: center; gap: 24px; max-width: 900px; margin: 18px auto 40px; }
.page-feuille { position: relative; width: 100%; line-height: 0; border-radius: 3px; background: #fffef9; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.page-feuille canvas { display: block; }
.page-feuille canvas[data-outil="gomme"] { cursor: cell; }
.page-feuille canvas[data-outil="deplacer"] { cursor: move; }
.page-feuille canvas[data-outil="texte"] { cursor: text; }
.page-feuille canvas:not([data-outil="gomme"]):not([data-outil="deplacer"]):not([data-outil="texte"]) { cursor: crosshair; }
.page-pdf { background: #fff; }
.pdf-fond { display: block; width: 100%; height: auto; }
.pdf-calque { position: absolute; inset: 0; }
.page-numero { position: absolute; right: 8px; bottom: -22px; line-height: 1; font-size: .75rem; color: var(--muted); }
.page-lecture { max-width: 820px; margin: 0 auto; }
.saisie-texte {
    position: absolute; z-index: 5; min-width: 160px; min-height: 1.6em; padding: 2px 4px; line-height: 1.25;
    border: 1px dashed #6366f1; border-radius: 4px; background: rgba(255, 255, 255, .9); font-family: Inter, "Segoe UI", sans-serif; resize: both; outline: none;
}
.graphe-apercu { margin: 6px 0 12px; overflow: hidden; line-height: 0; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.graphe-apercu canvas { width: 100%; }

/* =====================================================================
   Assistant
   ===================================================================== */
.assistant-etat { margin-bottom: 16px; }
.assistant-etat p { margin: 4px 0 0; }
.assistant { display: flex; flex-direction: column; gap: 12px; }
.assistant-fil { display: flex; flex-direction: column; gap: 14px; min-height: 300px; max-height: calc(100vh - 360px); padding: 4px 2px; overflow-y: auto; }
.assistant-accueil { max-width: 600px; margin: auto; text-align: center; color: var(--muted); }
.assistant-accueil > p { margin-bottom: 16px; font-family: var(--font-titre); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; color: var(--text); }
.assistant-accueil .chips { justify-content: center; }
.assistant-bulle { max-width: min(760px, 92%); padding: 12px 16px; border-radius: 20px; overflow-wrap: anywhere; animation: monte .3s ease-out both; }
.assistant-moi { align-self: flex-end; border-bottom-right-radius: 6px; white-space: pre-wrap; color: #0b0c12; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 70%, #fff), var(--primary)); }
.assistant-lui { align-self: flex-start; border-bottom-left-radius: 6px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03)); border: 1px solid var(--border); }
.assistant-texte p { margin: 0 0 8px; line-height: 1.6; }
.assistant-texte p:last-child { margin-bottom: 0; }
.assistant-texte ul { margin: 0 0 8px; padding-left: 20px; }
.assistant-attente { margin: 0; }
.assistant-renvoi { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 6px; background: var(--primary-soft); font-size: .76rem; text-align: center; text-decoration: none; }
.assistant-sources { margin-top: 10px; font-size: .9rem; }
.assistant-sources summary { cursor: pointer; color: var(--muted); }
.assistant-source { margin-top: 8px; }
.assistant-source p { margin: 2px 0 0; white-space: pre-line; }
.assistant-agenda { list-style: none; margin: 8px 0 0; padding: 0; }
.assistant-agenda li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 3px 0; }
.assistant-jour { margin-top: 8px; font-size: .84rem; color: var(--muted); }
.assistant-heure { font-family: var(--font-mono); font-size: .84rem; }
.assistant-fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; min-width: min(520px, 100%); }
.assistant-fiche > strong, .assistant-fiche > p, .assistant-fiche > .assistant-actions, .assistant-fiche > .field:first-of-type { grid-column: 1 / -1; }
.assistant-fiche .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.assistant-fiche p { margin: 0; }
.assistant-fiche input { padding: 10px 12px; color-scheme: dark; }
.assistant-alerte { color: var(--warn); }
.assistant-ok { margin: 0; color: var(--ok); }
.assistant-saisie {
    display: flex; flex-direction: column; gap: 8px; padding: 12px;
    border-radius: 24px; border: 1px solid var(--border-2);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
    box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .9);
    transition: border-color .15s, box-shadow .15s;
}
.assistant-saisie:focus-within { border-color: color-mix(in srgb, var(--primary) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent), 0 24px 50px -30px rgba(0, 0, 0, .9); }
.assistant-saisie textarea { width: 100%; padding: 4px 6px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1rem; resize: vertical; }
.assistant-saisie textarea:focus { outline: none; }
.assistant-saisie select { width: auto; max-width: 240px; padding: 7px 34px 7px 11px; border-radius: 12px; background-position: right 10px center; font-size: .86rem; }
.assistant-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.assistant-actions select { margin-right: auto; }
.assistant-note { margin: 0; text-align: center; }

/* =====================================================================
   Recherche (Ctrl+K)
   ===================================================================== */
.palette {
    width: min(660px, calc(100vw - 24px)); margin: 12vh auto auto; padding: 0; color: var(--text);
    background: rgba(18, 20, 30, .96); border: 1px solid var(--border-2); border-radius: 24px;
    box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .9);
}
.palette[open] { animation: apparait .16s ease-out; }
.palette::backdrop { background: rgba(4, 5, 9, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.palette-champ { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.palette-champ .ico { width: 20px; height: 20px; color: var(--primary); }
.palette input { flex: 1; min-width: 0; padding: 18px 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 1.08rem; }
.palette-results { list-style: none; margin: 0; padding: 8px; max-height: 54vh; overflow-y: auto; }
.palette-groupe { padding: 12px 12px 4px; font-size: .66rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--faint); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; cursor: pointer; }
.palette-item.actif, .palette-item:hover { background: var(--primary-soft); }
.palette-icone { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 10px; background: var(--surface); color: var(--primary); }
.palette-texte { display: flex; flex-direction: column; min-width: 0; }
.palette-texte small { overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.palette-vide { padding: 18px; color: var(--muted); text-align: center; }
.palette-help { margin: 0; padding: 10px 16px; border-top: 1px solid var(--border); font-size: .74rem; color: var(--muted); }
.palette-help kbd { margin-right: 2px; }

/* =====================================================================
   Écrans moyens et téléphones
   ===================================================================== */
@media (max-width: 1100px) {
}
@media (max-width: 1000px) {
    .accueil-grille { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
    .accueil-col { display: contents; }
    .accueil-programme { order: 1; }
    .apercu { order: 2; }
    .pomodoro { order: 3; }
}
@media (max-width: 900px) {
    .resultats-haut { grid-template-columns: 1fr; }
    .classeur-corps { grid-template-columns: 1fr; }
    .onglets { flex-direction: row; flex-wrap: wrap; order: -1; padding: 0 0 8px; }
    .onglet { margin: 0; border-radius: 12px 12px 0 0; }
    .classeur-feuilles { border-radius: var(--radius); }
    .form-cols-4 { grid-template-columns: 1fr 1fr; }
    .focus-zone { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    body { font-size: 15px; }
    .rail { display: none; }
    .content {
        margin-left: 0;
        padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }
    .barre-haut { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
    .barre-haut-marque { display: flex; align-items: center; gap: 10px; font-family: var(--font-titre); font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
    .barre-haut-marque:hover { text-decoration: none; }
    .barre-haut-marque .logo { width: 28px; height: 28px; }
    .barre-haut .rail-btn { width: 42px; height: 42px; border-radius: 14px; }
    .barre-mobile {
        position: fixed; z-index: 70; bottom: calc(10px + env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right));
        display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px;
        border-radius: 26px; border: 1px solid var(--border-2);
        background: rgba(16, 18, 27, .84);
        -webkit-backdrop-filter: blur(22px) saturate(1.5);
        backdrop-filter: blur(22px) saturate(1.5);
        box-shadow: 0 24px 48px -14px rgba(0, 0, 0, .9);
    }
    .barre-mobile a {
        display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 20px;
        color: var(--muted); font-size: .64rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
        transition: background .15s, color .15s;
    }
    .barre-mobile a .ico { width: 22px; height: 22px; }
    .barre-mobile a:hover { text-decoration: none; }
    .barre-mobile a.actif { color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); }
    .barre-mobile a.actif .ico { color: var(--c); }
    .sous-nav { margin-bottom: 22px; width: auto; }
    .page-header { margin-bottom: 22px; }
    .card { padding: 18px; border-radius: 20px; }
    .row { margin: 0 -10px; padding: 10px; }
    .row + .row::before { left: 10px; right: 10px; }
    .grid { grid-template-columns: 1fr; gap: 16px; }
    .notes-layout, .form-cols, .form-cols-3 { grid-template-columns: 1fr; }
    /* Filtres des notes : une bande de pastilles qui défile au lieu d'une colonne. */
    .notes-filters { position: static; }
    .notes-filters h3 { display: none; }
    .filter-list, .notes-filters .tags {
        display: flex; flex-wrap: nowrap; gap: 6px; margin: 12px -16px 0; padding: 0 16px;
        overflow-x: auto; scrollbar-width: none;
    }
    .filter-list::-webkit-scrollbar, .notes-filters .tags::-webkit-scrollbar { display: none; }
    .filter-list li, .notes-filters .tag { flex-shrink: 0; }
    .filter-list a { gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-2); white-space: nowrap; }
    .markdown { padding: 20px 18px; }
    .accueil-hero { margin-bottom: 20px; }
    .accueil-meteo { width: 100%; }
    .focus { padding: 22px; border-radius: 24px; }
    .focus .hero-actions .btn { flex: 1 1 auto; }
    .tuile { padding: 14px; border-radius: 18px; }
    .tuile-chiffre { font-size: 2rem; }
    .pomo-corps { flex-direction: column; text-align: center; }
    .pomo-modes, .pomo-actions { justify-content: center; }
    .row .matiere-tag { display: none; }
    .menu-plus-liste {
        position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(92px + env(safe-area-inset-bottom));
        padding: 10px; border-radius: 24px;
    }
    .menu-plus-liste a, .menu-plus-liste button { padding: 13px 14px; font-size: .95rem; }
    .palette { margin-top: calc(10px + env(safe-area-inset-top)); border-radius: 22px; }
    .securite-hero { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
    .tuiles { gap: 8px; }
    .tuile { padding: 12px; }
    .tuile-chiffre { font-size: 1.75rem; }
    .barre-mobile a { font-size: .6rem; }
}

/* ----- Animations désactivées si le système le demande ----- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   Impression
   ===================================================================== */
@media print {
    .fond, .rail, .barre-haut, .barre-mobile, .sous-nav, .page-header .header-actions, .note-nav, .flash,
    .editeur-tete, .barre-dessin, .editeur-aide, .page-numero { display: none !important; }
    body { background: #fff; color: #000; }
    .content { margin: 0; padding: 0; }
    .contenu > * { animation: none; }
    .page-header h1 { color: #000; background: none; -webkit-text-fill-color: #000; }
    .card { padding: 0; border: 0; background: none; box-shadow: none; }
    .feuilles-editeur { max-width: none; margin: 0; gap: 0; }
    .page-feuille { box-shadow: none; page-break-after: always; }
}
