    :root {
        --navy: #2E4057;
        --navy-soft: #435872;
        --cream: #FBF8F2;
        --paper: #FFFFFF;
        --green: #4C9A6B;
        --green-soft: #E4F3EA;
        --coral: #F2785C;
        --coral-soft: #FDE7E1;
        --amber: #E7A93C;
        --amber-soft: #FCF1DC;
        --home: #3E6FA8;
        --home-soft: #E1EBF6;
        --ink: #2B2E33;
        --ink-soft: #6B7280;
        --line: #E4E0D6;
        --radius: 18px;
        --radius-sm: 12px;
        --shadow: 0 6px 20px rgba(46, 64, 87, 0.10);
        box-sizing: border-box;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    html {
        scroll-padding-top: env(safe-area-inset-top, 0px);
    }

    * {
        box-sizing: border-box;
    }

    @media (prefers-color-scheme: dark) {
        :root:not([data-theme="light"]) {
            --cream: #1B2027;
            --paper: #232A33;
            --ink: #EDEFF2;
            --ink-soft: #A7AFBB;
            --line: #333B46;
            --navy: #7C93B3;
            --navy-soft: #647A9B;
            --green-soft: #1E362A;
            --coral-soft: #3A2620;
            --amber-soft: #3A2F18;
            --home-soft: #1E2E42;
            --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
        }
    }

    :root[data-theme="dark"] {
        --cream: #1B2027;
        --paper: #232A33;
        --ink: #EDEFF2;
        --ink-soft: #A7AFBB;
        --line: #333B46;
        --navy: #7C93B3;
        --navy-soft: #647A9B;
        --green-soft: #1E362A;
        --coral-soft: #3A2620;
        --amber-soft: #3A2F18;
        --home-soft: #1E2E42;
        --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    }

    body {
        margin: 0;
        background: var(--cream);
        color: var(--ink);
        font-family: 'Nunito', sans-serif;
        min-height: 100%;
    }

    html, body {
        height: 100%;
    }

    h1, h2, h3, .display {
        font-family: 'Baloo 2', sans-serif;
    }

    header.topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
        background: var(--navy);
        color: white;
        display: flex;
        align-items: center;
        gap: 14px;
        flex-wrap: wrap;
    }

    header.topbar .title-block {
        display: flex;
        flex-direction: column;
        margin-right: auto;
    }

    .live-clock {
        font-family: 'Baloo 2', sans-serif;
        font-weight: 800;
        font-size: 20px;
        color: white;
        background: rgba(255, 255, 255, 0.14);
        padding: 8px 16px;
        border-radius: 999px;
        letter-spacing: 0.5px;
        flex-shrink: 0;
    }

    header.topbar h1 {
        margin: 0;
        font-size: 21px;
        font-weight: 700;
        letter-spacing: 0.2px;
    }

    header.topbar .subtitle {
        font-size: 12.5px;
        opacity: 0.75;
        margin-top: 1px;
    }

    select#weekSelect {
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 14px;
        padding: 9px 12px;
        border-radius: 999px;
        border: none;
        background: rgba(255, 255, 255, 0.16);
        color: white;
        max-width: 220px;
    }

    select#weekSelect option {
        color: #111;
    }

    .btn {
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 14px;
        border: none;
        border-radius: 999px;
        padding: 9px 16px;
        cursor: pointer;
        transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
        white-space: nowrap;
    }

    .btn:active {
        transform: scale(0.96);
    }

    .btn-ghost {
        background: rgba(255, 255, 255, 0.14);
        color: white;
    }

    .btn-ghost:hover {
        background: rgba(255, 255, 255, 0.24);
    }

    .btn-coral {
        background: var(--coral);
        color: white;
    }

    .btn-coral:hover {
        opacity: 0.92;
    }

    .btn-green {
        background: var(--green);
        color: white;
    }

    .btn-navy {
        background: var(--navy);
        color: white;
    }

    .btn-outline {
        background: transparent;
        color: var(--navy);
        border: 2px solid var(--line);
    }

    .btn-outline:hover {
        border-color: var(--navy-soft);
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 12.5px;
    }

    .btn[disabled] {
        opacity: 0.5;
        cursor: default;
    }

    .mode-toggle {
        display: flex;
        background: rgba(255, 255, 255, 0.14);
        border-radius: 999px;
        padding: 3px;
    }

    .mode-toggle button {
        border: none;
        background: transparent;
        color: white;
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 13.5px;
        padding: 7px 14px;
        border-radius: 999px;
        cursor: pointer;
        opacity: 0.75;
    }

    .mode-toggle button.active {
        background: white;
        color: var(--navy);
        opacity: 1;
    }

    main {
        max-width: 1180px;
        margin: 0 auto;
        padding: 22px 20px 60px;
    }/* ---------- Élève : grille des avatars ---------- */

    .eleve-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 14px;
    }

    .tile {
        background: var(--paper);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 12px 8px 10px;
        text-align: center;
        cursor: pointer;
        border: 2px solid transparent;
        transition: transform .12s ease, border-color .12s ease;
        position: relative;
    }

    .tile:hover {
        transform: translateY(-2px);
        border-color: var(--green);
    }

    .tile:active {
        transform: scale(0.97);
    }

    .tile img {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        object-fit: cover;
        display: block;
        margin: 0 auto 8px;
        border: 3px solid var(--line);
    }

    .tile-avatar {
        position: relative;
        display: inline-block;
    }

    .tile img.ring-avail {
        border-color: var(--green);
        border-width: 4px;
        box-shadow: 0 0 0 3px var(--green-soft);
    }

    .tile img.ring-busy {
        border-color: var(--ink-soft);
        border-width: 4px;
        box-shadow: 0 0 0 3px var(--line);
    }

    @keyframes help-pulse {
        0%, 100% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.05);
        }
    }

    .tile .tname {
        font-weight: 800;
        font-size: 14px;
        color: var(--ink);
        font-family: 'Baloo 2', sans-serif;
    }

    .help-slot {
        min-height: 30px;
        margin-top: 8px;
    }

    .help-toggle-btn {
        border: 2px solid var(--line);
        border-radius: 999px;
        font-family: 'Nunito', sans-serif;
        font-weight: 800;
        font-size: 12.5px;
        padding: 7px 10px;
        cursor: pointer;
        width: 100%;
        background: var(--paper);
        color: var(--ink-soft);
    }

    .help-toggle-btn.active {
        background: var(--coral);
        border-color: var(--coral);
        color: white;
        animation: help-pulse 1.2s ease-in-out infinite;
    }

    .tutor-slot {
        min-height: 26px;
        margin-top: 6px;
    }

    .tutor-toggle-btn {
        border: none;
        border-radius: 999px;
        font-family: 'Nunito', sans-serif;
        font-weight: 800;
        font-size: 11.5px;
        padding: 5px 10px;
        cursor: pointer;
        width: 100%;
    }

    .tutor-toggle-btn.avail {
        background: var(--green-soft);
        color: var(--green);
    }

    .tutor-toggle-btn.busy {
        background: var(--line);
        color: var(--ink-soft);
    }

    .tutor-subjects {
        font-size: 10.5px;
        color: var(--ink-soft);
        font-weight: 700;
        margin-top: 4px;
        text-align: center;
    }

    .tutor-subjects.muted {
        font-style: italic;
        opacity: 0.7;
    }

    .teacher-tile {
        background: linear-gradient(180deg, var(--paper), var(--cream));
        border: 2px dashed var(--line);
    }

    .teacher-avatar-icon {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        margin: 0 auto 8px;
        border: 3px solid var(--line);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        background: var(--cream);
        overflow: hidden;
    }

    .teacher-avatar-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .teacher-avatar-icon.ring-avail {
        border-color: var(--green);
        border-width: 4px;
        box-shadow: 0 0 0 3px var(--green-soft);
    }

    .teacher-avatar-icon.ring-busy {
        border-color: var(--ink-soft);
        border-width: 4px;
        box-shadow: 0 0 0 3px var(--line);
    }

    .teacher-tile .tname {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    .rename-btn {
        border: none;
        background: none;
        cursor: pointer;
        font-size: 12px;
        opacity: 0.6;
        padding: 0;
    }

    .rename-btn:hover {
        opacity: 1;
    }

    .subject-pick {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .subject-pick-btn {
        border: 2px solid var(--line);
        background: var(--paper);
        border-radius: 999px;
        font-family: 'Nunito', sans-serif;
        font-weight: 800;
        font-size: 11.5px;
        padding: 5px 8px;
        cursor: pointer;
        width: 100%;
        color: var(--ink);
    }

    .subject-pick-btn:hover {
        border-color: var(--coral);
    }

    .subject-pick-cancel {
        border: none;
        background: none;
        color: var(--ink-soft);
        font-size: 10.5px;
        cursor: pointer;
        text-decoration: underline;
        padding: 2px;
    }

    .help-suggest {
        font-size: 10.5px;
        font-weight: 800;
        color: var(--coral);
        margin-top: 4px;
        text-align: center;
        line-height: 1.3;
    }

    .tile .tprogress-ring {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        color: white;
        background: var(--line);
    }

    .tile .tprogress-ring.done {
        background: var(--green);
    }

    .tile .tprogress-ring.mid {
        background: var(--amber);
    }/* ---------- Fiche élève ---------- */

    .sheet {
        background: var(--paper);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 22px;
        max-width: 820px;
        margin: 0 auto;
    }

    .sheet-head {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 18px;
        flex-wrap: wrap;
    }

    .sheet-head img {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--line);
    }

    .sheet-head h2 {
        margin: 0;
        font-size: 22px;
    }

    .sheet-head .weeklabel {
        font-size: 13px;
        color: var(--ink-soft);
        font-weight: 700;
    }

    .back-link {
        background: none;
        border: none;
        color: var(--navy-soft);
        font-weight: 800;
        font-size: 14px;
        cursor: pointer;
        padding: 6px 0;
        font-family: 'Nunito', sans-serif;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .progress-wrap {
        margin: 14px 0 20px;
    }

    .progress-bar-track {
        height: 14px;
        border-radius: 999px;
        background: var(--line);
        overflow: hidden;
    }

    .progress-bar-fill {
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--green), #7FC99A);
        transition: width .35s ease;
    }

    .progress-msg {
        margin-top: 8px;
        font-weight: 800;
        color: var(--navy);
        font-size: 14.5px;
        font-family: 'Baloo 2', sans-serif;
    }

    table.activities {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 22px;
    }

    table.activities th {
        text-align: left;
        font-size: 12px;
        text-transform: none;
        color: var(--ink-soft);
        padding: 6px 8px;
        border-bottom: 2px solid var(--line);
        font-weight: 800;
    }

    table.activities td {
        padding: 10px 8px;
        border-bottom: 1px solid var(--line);
        vertical-align: middle;
    }

    table.activities td.domaine {
        font-weight: 800;
        color: var(--navy);
        font-size: 13.5px;
        white-space: nowrap;
    }

    table.activities td.activite {
        font-size: 14.5px;
    }

    .check-cell {
        text-align: center;
        width: 64px;
    }

    .support-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11.5px;
        font-weight: 700;
        color: var(--ink-soft);
        background: var(--cream);
        border-radius: 999px;
        padding: 3px 9px;
        margin-top: 3px;
        white-space: nowrap;
    }

    .checkbtn {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        border: 2px solid var(--line);
        background: var(--paper);
        cursor: pointer;
        font-size: 17px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all .12s ease;
    }

    .checkbtn.on-fait {
        background: var(--green-soft);
        border-color: var(--green);
        color: var(--green);
    }

    .checkbtn.on-corrige {
        background: var(--amber-soft);
        border-color: var(--amber);
        color: #9C6B12;
    }

    .checkbtn.on-maison {
        background: var(--home-soft);
        border-color: var(--home);
        color: var(--home);
    }

    .row-empty td {
        text-align: center;
        color: var(--ink-soft);
        padding: 20px;
        font-style: italic;
    }

    .bilan-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-bottom: 18px;
    }

    @media (max-width: 620px) {
        .bilan-grid {
            grid-template-columns: 1fr;
        }
    }

    .bilan-card {
        background: var(--green-soft);
        border-radius: var(--radius-sm);
        padding: 14px;
    }

    .bilan-card label {
        display: block;
        font-weight: 800;
        font-size: 13.5px;
        margin-bottom: 8px;
        color: var(--navy);
    }

    .bilan-card textarea {
        width: 100%;
        min-height: 60px;
        border-radius: 10px;
        border: 1px solid var(--line);
        padding: 8px 10px;
        font-family: 'Nunito', sans-serif;
        font-size: 14px;
        resize: vertical;
        background: var(--paper);
        color: var(--ink);
    }

    .choice-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 16px;
    }

    .choice-btn {
        border: 2px solid var(--line);
        background: var(--paper);
        border-radius: 999px;
        padding: 8px 14px;
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 13px;
        cursor: pointer;
        color: var(--ink-soft);
    }

    .choice-btn.selected {
        background: var(--navy);
        border-color: var(--navy);
        color: white;
    }

    .choice-group-label {
        font-weight: 800;
        font-size: 13.5px;
        margin-bottom: 8px;
        color: var(--navy);
        display: block;
    }

    .validation-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: var(--coral-soft);
        border-radius: var(--radius-sm);
        padding: 12px 16px;
        margin-top: 4px;
        flex-wrap: wrap;
    }

    .validation-row .vtxt {
        font-weight: 800;
        color: var(--navy);
        font-size: 14px;
    }

    .validation-row .vsub {
        font-size: 12px;
        color: var(--ink-soft);
        font-weight: 600;
    }/* ---------- Tableau double-entrée (vue Élève) ---------- */

    .class-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 14px;
        flex-wrap: wrap;
    }

    .class-toolbar .hint {
        font-size: 13px;
        color: var(--ink-soft);
        font-weight: 600;
    }

    .table-scroll {
        overflow-x: auto;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        background: var(--paper);
    }

    table.classtable {
        border-collapse: collapse;
        font-size: 12.5px;
        min-width: 100%;
    }

    table.classtable th, table.classtable td {
        border-bottom: 1px solid var(--line);
        padding: 6px 7px;
        text-align: center;
        white-space: nowrap;
    }

    table.classtable thead th {
        background: var(--navy);
        color: white;
        font-weight: 800;
        font-size: 11px;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    table.classtable thead tr.domaine-row th {
        font-size: 10.5px;
        font-weight: 700;
        background: var(--navy-soft);
    }

    table.classtable td.name-cell, table.classtable th.name-head {
        position: sticky;
        left: 0;
        background: var(--paper);
        z-index: 3;
        text-align: left;
        min-width: 148px;
        box-shadow: 2px 0 0 var(--line);
    }

    table.classtable thead th.name-head {
        background: var(--navy);
        z-index: 4;
    }

    table.classtable tbody tr:nth-child(even) td.name-cell {
        background: #FAFAF7;
    }

    .student-mini2 {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .student-mini2 img {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--line);
        flex-shrink: 0;
    }

    .student-mini2 span {
        font-weight: 800;
        font-family: 'Baloo 2', sans-serif;
        font-size: 13px;
        color: var(--ink);
    }

    .tapbox {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        border: 2px solid var(--line);
        background: var(--paper);
        cursor: pointer;
        font-size: 15px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: transparent;
    }

    .tapbox.on-fait {
        background: var(--green-soft);
        border-color: var(--green);
        color: var(--green);
    }

    .tapbox.on-corrige {
        background: var(--amber-soft);
        border-color: var(--amber);
        color: #9C6B12;
    }

    td.pct-cell .pct-badge {
        display: inline-block;
    }

    .row-actions {
        display: flex;
        gap: 4px;
        justify-content: center;
    }

    .row-actions button {
        font-size: 15px;
    }/* ---------- Popup bilan / PDF ---------- */

    .bilan-modal {
        max-width: 460px;
        text-align: left;
    }

    .bilan-modal .bmhead {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .bilan-modal .bmhead img {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--line);
    }

    .bilan-modal .bmhead h3 {
        margin: 0;
        font-size: 19px;
    }

    .bilan-modal .close-x {
        margin-left: auto;
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        color: var(--ink-soft);
    }

    .chip-row {
        display: flex;
        gap: 7px;
        flex-wrap: wrap;
        margin-bottom: 14px;
    }

    .chip {
        border: 2px solid var(--line);
        background: var(--paper);
        border-radius: 999px;
        padding: 6px 12px;
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 12.5px;
        cursor: pointer;
        color: var(--ink-soft);
    }

    .chip.selected-proud {
        background: var(--green-soft);
        border-color: var(--green);
        color: var(--green);
    }

    .chip.selected-help {
        background: var(--coral-soft);
        border-color: var(--coral);
        color: var(--coral);
    }

    .extra-toggle {
        background: none;
        border: none;
        color: var(--navy-soft);
        font-weight: 700;
        font-size: 12.5px;
        cursor: pointer;
        padding: 0 0 10px;
        text-decoration: underline;
    }

    .extra-text {
        width: 100%;
        min-height: 50px;
        border-radius: 10px;
        border: 1px solid var(--line);
        padding: 8px 10px;
        font-family: 'Nunito', sans-serif;
        font-size: 13.5px;
        margin-bottom: 12px;
        background: var(--cream);
        color: var(--ink);
    }/* ---------- Onglets élève + sélecteur de vue ---------- */

    .elv-tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 18px;
        flex-wrap: wrap;
    }

    .elv-tab {
        font-family: 'Baloo 2', sans-serif;
        font-weight: 700;
        font-size: 15px;
        border: none;
        cursor: pointer;
        padding: 10px 18px;
        border-radius: 999px;
        background: var(--paper);
        color: var(--ink-soft);
        box-shadow: var(--shadow);
    }

    .elv-tab.active {
        background: var(--navy);
        color: white;
    }

    .plan-toolbar {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 14px;
    }

    .display-toggle {
        display: flex;
        background: var(--paper);
        border-radius: 999px;
        padding: 3px;
        box-shadow: var(--shadow);
    }

    .dtbtn {
        border: none;
        background: transparent;
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 13px;
        padding: 7px 14px;
        border-radius: 999px;
        cursor: pointer;
        color: var(--ink-soft);
    }

    .dtbtn.active {
        background: var(--green);
        color: white;
    }/* ---------- Météo du jour ---------- */

    .mood-and-challenge {
        display: grid;
        grid-template-columns: 2.2fr 1fr;
        gap: 22px;
        align-items: start;
    }

    @media (max-width: 820px) {
        .mood-and-challenge {
            grid-template-columns: 1fr;
        }
    }

    .mood-head {
        text-align: center;
        margin-bottom: 20px;
    }

    .mood-head h2 {
        margin: 0 0 4px;
        font-size: 22px;
        color: var(--navy);
    }

    .mood-date {
        color: var(--ink-soft);
        font-weight: 700;
        font-size: 13.5px;
        text-transform: capitalize;
    }

    .mood-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .mood-tile {
        background: var(--paper);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 14px 10px;
        text-align: center;
    }

    .mood-tile img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--line);
        margin-bottom: 6px;
    }

    .mtname {
        font-weight: 800;
        font-family: 'Baloo 2', sans-serif;
        font-size: 13.5px;
        margin-bottom: 10px;
    }

    .mood-options {
        display: flex;
        justify-content: center;
        gap: 5px;
        flex-wrap: wrap;
    }

    .mood-emoji {
        border: 2px solid transparent;
        background: var(--cream);
        border-radius: 10px;
        font-size: 19px;
        cursor: pointer;
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform .1s ease;
    }

    .mood-emoji:hover {
        transform: scale(1.12);
    }

    .mood-emoji.selected {
        background: var(--green-soft);
        border-color: var(--green);
    }

    .mood-pills {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 8px;
    }

    .mood-pill {
        display: flex;
        align-items: center;
        gap: 6px;
        background: var(--cream);
        border-radius: 999px;
        padding: 6px 12px;
    }

    .mood-pill .me {
        font-size: 17px;
    }

    .mood-pill .mn {
        font-weight: 800;
        color: var(--navy);
        font-size: 13.5px;
    }

    .mood-sub {
        font-size: 12.5px;
        color: var(--ink-soft);
        font-weight: 700;
        margin-bottom: 6px;
    }

    .mood-alert {
        background: var(--coral-soft);
        color: #8A3F2C;
        font-weight: 700;
        font-size: 13px;
        padding: 8px 12px;
        border-radius: var(--radius-sm);
    }

    .help-row {
        padding: 2px 0;
    }/* ---------- Défi du jour ---------- */

    .challenge-card {
        text-align: center;
        position: sticky;
        top: 90px;
    }

    .challenge-sub {
        font-size: 12px;
        color: var(--ink-soft);
        font-weight: 700;
        margin: -6px 0 12px;
    }

    .challenge-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .challenge-row {
        display: flex;
        align-items: center;
        gap: 10px;
        background: var(--amber-soft);
        border-radius: var(--radius-sm);
        padding: 10px 14px;
        text-align: left;
    }

    .challenge-num {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: var(--amber);
        color: white;
        font-weight: 800;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .challenge-q {
        font-family: 'Baloo 2', sans-serif;
        font-weight: 700;
        font-size: 17px;
        color: var(--ink);
    }

    .challenge-q strong {
        color: var(--green);
    }

    .grammar-row {
        background: var(--green-soft) !important;
        align-items: flex-start;
    }

    .grammar-rappel {
        font-size: 11.5px;
        color: var(--ink-soft);
        font-style: italic;
        margin-top: 4px;
        line-height: 1.3;
    }

    .challenge-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .challenge-actions .btn {
        width: 100%;
    }/* ---------- Petit test individuel ---------- */

    .mini-quiz-card {
        background: var(--green-soft);
        margin-bottom: 20px;
        text-align: left;
    }

    .mini-quiz-head {
        font-family: 'Baloo 2', sans-serif;
        font-weight: 800;
        font-size: 16px;
        color: var(--navy);
        margin-bottom: 12px;
    }

    .mini-quiz-q {
        margin-bottom: 14px;
    }

    .mq-question {
        font-weight: 700;
        font-size: 14.5px;
        color: var(--ink);
        margin-bottom: 8px;
    }

    .mq-options {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
    }

    .mq-opt-btn {
        border: 2px solid var(--line);
        background: var(--paper);
        border-radius: 999px;
        padding: 7px 14px;
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 13px;
        cursor: pointer;
        color: var(--ink);
    }

    .mq-opt-btn.selected {
        background: var(--navy);
        border-color: var(--navy);
        color: white;
    }

    .mq-opt-btn.correct {
        background: var(--green);
        border-color: var(--green);
        color: white;
    }

    .mq-opt-btn.wrong {
        background: var(--coral-soft);
        border-color: var(--coral);
        color: var(--coral);
        text-decoration: line-through;
    }

    .mq-opt-btn:disabled {
        cursor: default;
    }

    .mq-rappel {
        font-size: 12px;
        color: var(--ink-soft);
        font-style: italic;
        margin-top: 6px;
    }

    .mini-quiz-actions {
        display: flex;
        gap: 10px;
        margin-top: 6px;
    }

    .quiz-trace {
        background: var(--green-soft);
        border-radius: var(--radius-sm);
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 700;
        color: var(--navy);
        margin-bottom: 18px;
    }

    .quiz-trace.muted {
        background: var(--cream);
        color: var(--ink-soft);
        font-weight: 600;
        font-size: 13px;
    }

    .stars {
        font-size: 15px;
        letter-spacing: 1px;
    }

    .quiz-detail-list {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .quiz-detail-row {
        display: flex;
        gap: 8px;
        background: var(--paper);
        border-radius: var(--radius-sm);
        padding: 8px 10px;
        font-weight: 500;
    }

    .quiz-detail-row.ok {
        border-left: 3px solid var(--green);
    }

    .quiz-detail-row.ko {
        border-left: 3px solid var(--coral);
    }

    .qd-icon {
        font-size: 14px;
        flex-shrink: 0;
    }

    .qd-question {
        font-size: 13px;
        color: var(--ink);
        font-weight: 700;
    }

    .qd-answer {
        font-size: 12px;
        color: var(--ink-soft);
        margin-top: 2px;
    }

    .qd-answer strong {
        color: var(--ink);
    }/* ---------- Enseignant·e ---------- */

    .dash-grid {
        display: grid;
        grid-template-columns: 1.1fr 1.6fr;
        gap: 18px;
        align-items: start;
    }

    @media (max-width: 900px) {
        .dash-grid {
            grid-template-columns: 1fr;
        }
    }

    .card {
        background: var(--paper);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 18px;
    }

    .card h3 {
        margin: 0 0 12px;
        font-size: 17px;
        color: var(--navy);
    }

    .stat-row {
        display: flex;
        gap: 12px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }

    .stat-pill {
        flex: 1;
        min-width: 120px;
        background: var(--green-soft);
        border-radius: var(--radius-sm);
        padding: 12px 14px;
    }

    .stat-pill .num {
        font-family: 'Baloo 2', sans-serif;
        font-size: 24px;
        font-weight: 800;
        color: var(--navy);
    }

    .stat-pill .lbl {
        font-size: 12px;
        color: var(--ink-soft);
        font-weight: 700;
    }

    .stat-pill.warn {
        background: var(--coral-soft);
    }

    .act-row {
        display: flex;
        gap: 8px;
        margin-bottom: 8px;
        align-items: center;
    }

    .act-row input {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 8px 10px;
        font-family: 'Nunito', sans-serif;
        font-size: 13.5px;
        background: var(--cream);
        color: var(--ink);
    }

    .act-row input.domaine-in {
        width: 110px;
        font-weight: 700;
    }

    .act-row input.activite-in {
        flex: 1;
    }

    .act-row select.support-in {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 8px 6px;
        font-family: 'Nunito', sans-serif;
        font-size: 12.5px;
        background: var(--cream);
        color: var(--ink);
        width: 168px;
        flex-shrink: 0;
    }

    .icon-btn {
        border: none;
        background: transparent;
        color: var(--ink-soft);
        cursor: pointer;
        font-size: 17px;
        width: 30px;
        height: 30px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .icon-btn:hover {
        background: var(--coral-soft);
        color: var(--coral);
    }

    table.overview {
        width: 100%;
        border-collapse: collapse;
        font-size: 12.5px;
    }

    table.overview th, table.overview td {
        padding: 7px 6px;
        border-bottom: 1px solid var(--line);
        text-align: center;
    }

    table.overview th {
        color: var(--ink-soft);
        font-weight: 800;
        font-size: 11px;
    }

    table.overview td.student-cell {
        text-align: left;
        cursor: pointer;
    }

    table.overview td.student-cell:hover .student-name {
        text-decoration: underline;
    }

    .student-mini {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .student-mini img {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--line);
    }

    .student-name {
        font-weight: 800;
        color: var(--ink);
        font-size: 13px;
    }

    .dot-pair {
        display: inline-flex;
        gap: 3px;
    }

    .dot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--line);
        display: inline-block;
    }

    .dot.fait {
        background: var(--green);
    }

    .dot.corrige {
        background: var(--amber);
    }

    .dot.maison {
        background: var(--home);
    }

    .pct-badge {
        font-weight: 800;
        padding: 3px 8px;
        border-radius: 999px;
        background: var(--line);
        color: var(--ink-soft);
        font-size: 11.5px;
    }

    .pct-badge.full {
        background: var(--green-soft);
        color: var(--green);
    }

    .newweek-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .newweek-form label {
        font-size: 13px;
        font-weight: 800;
        color: var(--navy);
    }

    .newweek-form input[type=date] {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 8px 10px;
        font-family: 'Nunito', sans-serif;
        background: var(--cream);
        color: var(--ink);
    }

    .checkbox-line {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13.5px;
        color: var(--ink-soft);
        font-weight: 600;
    }

    .group-title {
        margin: 0 0 10px;
        font-size: 16px;
        color: var(--navy);
    }

    .niveau-block {
        border: 1px dashed var(--line);
        border-radius: var(--radius-sm);
        padding: 12px;
    }

    .niveau-block-head {
        font-weight: 800;
        color: var(--navy);
        font-family: 'Baloo 2', sans-serif;
        font-size: 14.5px;
        margin-bottom: 8px;
    }

    .niveau-hint {
        font-size: 12.5px;
        color: var(--ink-soft);
        font-weight: 600;
        margin-bottom: 12px;
    }

    .niveau-grid {
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-width: 480px;
    }

    .niveau-item {
        display: flex;
        align-items: center;
        gap: 12px;
        background: var(--cream);
        border-radius: var(--radius-sm);
        padding: 9px 14px;
        flex-wrap: wrap;
    }

    .subject-chip-row {
        flex-basis: 100%;
        display: flex;
        gap: 6px;
        padding-left: 50px;
        flex-wrap: wrap;
    }

    .subj-chip {
        border: 2px solid var(--line);
        background: var(--paper);
        border-radius: 999px;
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 11.5px;
        padding: 4px 10px;
        cursor: pointer;
        color: var(--ink-soft);
    }

    .subj-chip.sel {
        background: #F0B429;
        border-color: #F0B429;
        color: white;
    }

    .niveau-item img {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--line);
        flex-shrink: 0;
    }

    .niveau-name {
        font-size: 15px;
        font-weight: 800;
        color: var(--ink);
        flex: 1;
        font-family: 'Baloo 2', sans-serif;
    }

    .niveau-toggle {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
    }

    .niv-btn {
        border: 1px solid var(--line);
        background: var(--paper);
        border-radius: 8px;
        font-size: 13px;
        font-weight: 800;
        padding: 7px 14px;
        cursor: pointer;
        color: var(--ink-soft);
    }

    .niv-btn.sel {
        background: var(--navy);
        border-color: var(--navy);
        color: white;
    }

    .niv-btn.tutor-btn.sel-tutor {
        background: #F0B429;
        border-color: #F0B429;
        color: white;
    }/* ---------- Récap mensuel ---------- */

    .recap-week {
        margin-bottom: 20px;
    }

    .recap-week-title {
        font-weight: 800;
        color: var(--navy);
        font-family: 'Baloo 2', sans-serif;
        font-size: 15px;
        margin-bottom: 8px;
        border-bottom: 2px solid var(--line);
        padding-bottom: 5px;
    }

    table.recap-table {
        width: 100%;
        border-collapse: collapse;
    }

    table.recap-table td {
        padding: 7px 8px;
        border-bottom: 1px solid var(--line);
        font-size: 13.5px;
        vertical-align: top;
    }

    table.recap-table td.recap-domaine {
        font-weight: 800;
        color: var(--navy);
        white-space: nowrap;
        width: 130px;
    }

    .recap-empty {
        color: var(--ink-soft);
        font-style: italic;
        font-size: 13px;
        padding: 6px 0 14px;
    }

    .recap-group-title {
        color: var(--navy);
        font-size: 17px;
        margin: 4px 0 14px;
    }

    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(20, 24, 30, 0.45);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 50;
        padding: 20px;
    }

    .modal {
        background: var(--paper);
        border-radius: var(--radius);
        padding: 22px;
        max-width: 380px;
        width: 100%;
        box-shadow: var(--shadow);
    }

    .modal h3 {
        margin-top: 0;
    }

    .modal-actions {
        display: flex;
        gap: 10px;
        margin-top: 16px;
        justify-content: flex-end;
    }

    .empty-state {
        text-align: center;
        padding: 50px 20px;
        color: var(--ink-soft);
    }

    .empty-state .em {
        font-size: 34px;
        margin-bottom: 10px;
    }

    .toast {
        position: fixed;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: var(--navy);
        color: white;
        padding: 10px 18px;
        border-radius: 999px;
        font-weight: 700;
        font-size: 13.5px;
        box-shadow: var(--shadow);
        opacity: 0;
        transition: all .25s ease;
        z-index: 60;
        pointer-events: none;
    }

    .toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .offline-banner {
        background: var(--amber-soft);
        color: #7A5410;
        padding: 10px 16px;
        text-align: center;
        font-weight: 700;
        font-size: 13px;
    }

    .hidden {
        display: none !important;
    }/* ---------- Célébration (confettis) ---------- */

    .confetti-piece {
        position: fixed;
        top: -20px;
        pointer-events: none;
        z-index: 90;
        animation-name: confetti-fall;
        animation-timing-function: cubic-bezier(.25, .46, .45, .94);
        animation-fill-mode: forwards;
    }

    @keyframes confetti-fall {
        0% {
            transform: translateY(0) rotate(0deg);
            opacity: 1;
        }

        100% {
            transform: translateY(110vh) rotate(680deg);
            opacity: 0.85;
        }
    }

    .celebrate-banner {
        position: fixed;
        top: 20%;
        left: 50%;
        transform: translate(-50%, -14px);
        background: var(--paper);
        color: var(--navy);
        padding: 18px 26px;
        border-radius: 20px;
        box-shadow: var(--shadow);
        font-family: 'Baloo 2', sans-serif;
        font-weight: 800;
        font-size: 17px;
        z-index: 95;
        opacity: 0;
        transition: opacity .25s ease, transform .25s ease;
        text-align: center;
        max-width: 340px;
        pointer-events: none;
        line-height: 1.35;
    }

    .celebrate-banner.show {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--line);
        border-radius: 999px;
    }
