/* ============================================================
   BacHO — Éditeur de fiche
   Le chrome autour du document. Le document lui-même (la page A4)
   n'est jamais touché : il est réglementaire, il reste tel quel.

   Deux règles portent cet écran :

   1. L'ÉTABLI. La page est blanche, donc le plan de travail ne peut
      pas l'être. Il passe en papier appuyé et la feuille reçoit une
      ombre franche : elle se met à flotter, et on comprend d'un coup
      d'œil que c'est un objet posé, pas un fond d'écran.

   2. LE BARÈME EST TOUJOURS VISIBLE. Ce que l'élève surveille en
      permanence, c'est son total de points. Il ne se cache pas dans
      un onglet : il vit en haut du panneau, avec sa jauge.

   Dépend de bacho-tokens.css.
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--bh-sans);
    font-size: 15px;
    color: var(--bh-ink);
    background: var(--app-bench, #e2e8f0);
    overflow-x: hidden;
    touch-action: pan-x pan-y;
    overscroll-behavior: contain;
    padding-top: var(--ed-banner);
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

:root {
    --app-bench: #e2e8f0;
    --app-bench-deep: #cbd5e1;
    --ed-topbar: 64px;
    /* Bandeau défilant : une ligne de texte, pas un bloc — il ne doit pas
       peser plus que la barre du nom de la fiche juste dessous. */
    --ed-banner: 42px;
    --ed-rail: 380px;
    --ed-r: 10px;
    --ed-lift: 0 1px 0 rgba(15, 23, 42, 0.04), 0 10px 24px -14px rgba(15, 23, 42, 0.35);
    --ed-page: 0 1px 2px rgba(15, 23, 42, 0.14), 0 18px 40px -12px rgba(15, 23, 42, 0.3);
}

:focus-visible {
    outline: 2px solid var(--bh-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   BANDEAU — le compte à rebours, à voix basse
   Un aplat bleu roi n'appartenait à aucune palette du produit et
   volait l'attention à l'éditeur. Ici : papier, filet, chasse fixe.
   ============================================================ */

.announcement-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ed-banner);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: 1rem;
    background: var(--bh-ink);
    color: var(--bh-paper);
    overflow: hidden;
    z-index: 10000;
}

.announcement-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--bh-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.86);
    white-space: nowrap;
}

.announcement-text::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bh-gold-bright);
    flex: none;
    animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
    50% {
        opacity: 0.35;
    }
}

/* Défilement continu : le texte entre à droite, sort à gauche, sans fin.
   Le point doré reste fixe en tête ; les bords s'estompent. */
.announcement-banner {
    justify-content: flex-start;
    gap: 0.75rem;
}

/* Le point passe du texte au bandeau : il ne doit pas défiler */
.announcement-text::before {
    display: none;
}

.announcement-banner::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bh-gold-bright);
    flex: none;
    animation: pulseDot 2.4s ease-in-out infinite;
}

.announcement-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.announcement-track {
    display: flex;
    width: max-content;
    animation: bandeauDefile 120s linear infinite;
    will-change: transform;
}

.announcement-group {
    display: flex;
    flex: none;
}

.announcement-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Séparateur entre deux annonces */
.announcement-item::after {
    content: '';
    width: 4px;
    height: 4px;
    margin: 0 1.6rem;
    border-radius: 50%;
    background: var(--bh-gold-bright);
    opacity: 0.6;
}

.announcement-item.is-urgent {
    color: var(--bh-gold-bright);
    font-weight: 700;
}

.announcement-banner:hover .announcement-track {
    animation-play-state: paused;
}

@keyframes bandeauDefile {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Grand écran / télévision : texte plus grand, lisible de loin */
@media (min-width: 1600px) {
    .announcement-text {
        font-size: 15px;
    }
}

/* ============================================================
   NOTIFICATION
   ============================================================ */

.app-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 12000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: min(92vw, 420px);
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: var(--bh-ink);
    color: var(--bh-paper);
    font-size: 14px;
    box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.8);
    transform: translate(-50%, 16px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s var(--bh-ease-out), visibility 0.22s;
}

.app-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.app-toast i {
    color: var(--bh-gold-bright);
}

/* ============================================================
   BARRE D'OUTILS (desktop)
   ============================================================ */

.desktop-topbar {
    position: fixed;
    top: var(--ed-banner);
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--ed-topbar);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    background: var(--bh-paper);
    border-bottom: 1px solid var(--bh-ink-line);
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--bh-ink-line);
    border-radius: var(--ed-r);
    background: var(--bh-white);
    color: var(--bh-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s var(--bh-ease-out);
}

.topbar-btn:hover:not(:disabled) {
    border-color: var(--bh-ink-3);
}

.topbar-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.topbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.topbar-btn.primary {
    background: var(--bh-primary);
    border-color: var(--bh-primary);
    color: #ffffff;
}

.topbar-btn.primary:hover {
    box-shadow: var(--ed-lift);
}

/* Le nom de la fiche est un titre, pas un champ de formulaire.
   Il ne se déguise en champ qu'au moment où on peut l'éditer. */
.fiche-name-input {
    min-width: 220px;
    max-width: 420px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--ed-r);
    background: transparent;
    color: var(--bh-ink);
    font-family: inherit;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.015em;
    text-align: center;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.fiche-name-input:not([readonly]):hover {
    background: var(--bh-white);
    border-color: var(--bh-ink-line);
}

.fiche-name-input:focus {
    outline: none;
    background: var(--bh-white);
    border-color: var(--bh-gold);
    box-shadow: 0 0 0 3px var(--bh-gold-wash);
}

.topbar-spacer {
    flex: 1;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--bh-ink-line);
    border-radius: var(--ed-r);
    background: var(--bh-white);
}

.zoom-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--bh-ink-2);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.zoom-btn:hover {
    background: var(--bh-ink);
    color: var(--bh-paper);
}

.zoom-level {
    min-width: 46px;
    text-align: center;
    font-family: var(--bh-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--bh-ink-3);
}

/* ============================================================
   COQUILLE
   ============================================================ */

.app-container {
    display: flex;
    /* Le body réserve déjà la hauteur du bandeau : sans cette soustraction,
       le bas de l'éditeur sortait de l'écran de la hauteur du bandeau. */
    height: calc(100vh - var(--ed-banner));
    padding-top: var(--ed-topbar);
}

/* ============================================================
   PANNEAU LATÉRAL
   ============================================================ */

.desktop-sidebar {
    width: var(--ed-rail);
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--bh-paper);
    border-right: 1px solid var(--bh-ink-line);
    overflow: hidden;
}

.sidebar-tabs {
    display: flex;
    gap: 3px;
    flex: none;
    margin: 12px 12px 0;
    padding: 3px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 12px;
    background: var(--bh-white);
}

.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--bh-ink-3);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s var(--bh-ease), color 0.2s var(--bh-ease);
}

.sidebar-tab i {
    font-size: 14px;
}

.sidebar-tab.active {
    background: var(--bh-primary);
    color: #ffffff;
}

.sidebar-tab.active i {
    color: var(--bh-gold-bright);
}

.sidebar-content {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-content.active {
    display: flex;
}

/* ============================================================
   INFOS CANDIDAT
   Un bordereau : libellé à gauche, valeur à droite, filets fins.
   La même langue que le document qu'on est en train de remplir.
   ============================================================ */

.info-section,
.info-section-compact {
    border: 1px solid var(--bh-ink-line);
    border-radius: 14px;
    background: var(--bh-white);
    overflow: hidden;
}

.info-header,
.info-header-compact {
    padding: 12px 14px;
    background: var(--bh-paper);
    border-bottom: 1px solid var(--bh-ink-line);
}

.info-header h2,
.info-header-compact h2 {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: var(--bh-ink);
}

.info-header p,
.info-header-compact p {
    margin-top: 2px;
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bh-ink-4);
}

.info-header-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--bh-ink);
    color: var(--bh-gold-bright);
    flex: none;
}

.info-row,
.info-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bh-ink-line-soft);
}

.info-row:last-child,
.info-item-row:last-child {
    border-bottom: 0;
}

.info-label,
.info-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    font-size: 13px;
    color: var(--bh-ink-3);
}

.info-label-row i {
    width: 14px;
    text-align: center;
    color: var(--bh-ink-4);
    font-size: 12px;
}

.info-value,
.info-value-row {
    min-width: 0;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--bh-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-details {
    display: grid;
    gap: 2px;
}

.info-centre-highlight {
    padding: 10px 14px;
    background: var(--bh-gold-wash);
    border-bottom: 1px solid var(--bh-gold-line);
}

.info-centre-label {
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #92400e;
}

.info-centre-value {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 650;
    color: var(--bh-ink);
}

.info-edit-input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 8px;
    background: var(--bh-white);
    font-family: inherit;
    font-size: 13px;
    color: var(--bh-ink);
}

.info-edit-input:focus {
    outline: none;
    border-color: var(--bh-gold);
    box-shadow: 0 0 0 3px var(--bh-gold-wash);
}

/* ============================================================
   BARÈME — la signature de l'éditeur
   Le total ne se consulte pas, il se surveille : il reste affiché,
   avec une jauge qui se remplit jusqu'à la limite conseillée.
   ============================================================ */

.elements-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: none;
    padding: 12px 14px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 14px 14px 0 0;
    background: var(--bh-ink);
    color: var(--bh-paper);
}

.elements-header-row h3 {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.015em;
}

.points-inline-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.pts-label {
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.55);
}

.pts-value {
    font-family: var(--bh-mono);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--bh-gold-bright);
}

.elements-sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: none;
    padding: 8px 14px;
    border-inline: 1px solid var(--bh-ink-line);
    border-bottom: 1px solid var(--bh-ink-line);
    background: var(--bh-paper);
    font-size: 12px;
    color: var(--bh-ink-3);
}

.count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 5px;
    background: var(--bh-white);
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--bh-ink);
}

.limit-note {
    font-family: var(--bh-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bh-ink-4);
}

/* Version longue, conservée pour le script mais masquée. */
.points-counter {
    display: none !important;
}

.points-counter-label,
.points-counter-limit,
.points-counter-value {
    font-family: var(--bh-mono);
}

/* ============================================================
   NOTICE LIAISON
   ============================================================ */

.liaison-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: none;
    padding: 10px 14px;
    border-inline: 1px solid var(--bh-ink-line);
    border-bottom: 1px solid var(--bh-ink-line);
    background: var(--bh-gold-wash);
    font-size: 12px;
    line-height: 1.45;
    color: #92400e;
}

.liaison-info-banner i {
    margin-top: 2px;
    color: #92400e;
    flex: none;
}

.liaison-info-banner strong {
    font-weight: 700;
}

/* ============================================================
   LISTE DES ÉLÉMENTS
   Numérotée comme le tableau officiel, catégorie en pastille.
   ============================================================ */

.elements-list-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-inline: 1px solid var(--bh-ink-line);
    background: var(--bh-white);
}

.elements-list {
    list-style: none;
    counter-reset: element;
}

.element-item {
    counter-increment: element;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 8px;
    border-bottom: 1px solid var(--bh-ink-line-soft);
    background: var(--bh-white);
    cursor: grab;
    transition: background 0.16s ease;
}

.element-item::before {
    content: counter(element);
    display: grid;
    place-items: center;
    width: 22px;
    flex: none;
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--bh-ink-4);
}

.element-item:hover {
    background: var(--bh-paper);
}

.element-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.element-item.drag-over {
    background: var(--bh-gold-wash);
    box-shadow: inset 0 2px 0 var(--bh-gold);
}

.drag-handle {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: none;
    color: var(--bh-ink-4);
    cursor: grab;
}

.element-name-compact {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--bh-ink);
    line-height: 1.3;
}

/* La pastille de catégorie est celle du document. */
.element-cat-compact {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 22px;
    flex: none;
    padding: 0 6px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 5px;
    background: var(--bh-paper-2);
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--bh-ink-2);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--bh-ink-4);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
    background: var(--bh-paper);
    border-color: var(--bh-ink-line);
    color: var(--bh-ink);
}

.icon-btn.danger:hover {
    background: var(--bh-red-wash);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--bh-red-dark);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 32px 20px;
    border-inline: 1px solid var(--bh-ink-line);
    background: var(--bh-white);
    text-align: center;
    color: var(--bh-ink-3);
}

.empty-state i {
    font-size: 22px;
    color: var(--bh-ink-4);
}

.empty-state p {
    font-size: 13px;
}

.add-element-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    flex: none;
    border: 1px solid var(--bh-primary);
    border-radius: 0 0 14px 14px;
    background: var(--bh-primary);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.18s var(--bh-ease-out), transform 0.14s var(--bh-ease-out);
}

.add-element-btn:hover {
    box-shadow: var(--ed-lift);
}

.add-element-btn:active {
    transform: scale(0.99);
}

/* ============================================================
   DÉCORATION — filigranes
   ============================================================ */

.wm-gender-section {
    margin-top: 14px;
}

.wm-gender-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

.wm-gender-label.boy i {
    color: var(--bh-blue, #2563eb);
}

.wm-gender-label.girl i {
    color: var(--bh-red-dark);
}

.watermark-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wm-item {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 6px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 10px;
    background: var(--bh-white);
    color: var(--bh-ink-4);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s var(--bh-ease-out);
}

.wm-item:hover {
    border-color: var(--bh-ink-3);
    transform: translateY(-1px);
}

.wm-item.selected {
    border-color: var(--bh-ink);
    background: var(--bh-paper);
    box-shadow: inset 0 0 0 1px var(--bh-ink);
}

.wm-item.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 3px;
    right: 3px;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--bh-ink);
    color: var(--bh-gold-bright);
    font-size: 7px;
}

.wm-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.85;
}

.wm-divider {
    height: 1px;
    margin: 14px 0;
    background: var(--bh-ink-line);
}

.wm-range-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bh-ink-2);
}

.wm-range-label span:last-child {
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--bh-ink-3);
}

.wm-range {
    width: 100%;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 2px;
    background: var(--bh-paper-3);
    cursor: pointer;
}

.wm-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--bh-white);
    border-radius: 50%;
    background: var(--bh-ink);
    box-shadow: var(--ed-lift);
    cursor: grab;
}

.wm-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid var(--bh-white);
    border-radius: 50%;
    background: var(--bh-ink);
    cursor: grab;
}

/* ============================================================
   MODÈLES
   ============================================================ */

.models-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.model-card {
    padding: 10px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 12px;
    background: var(--bh-white);
    cursor: pointer;
    transition: border-color 0.16s ease, transform 0.16s var(--bh-ease-out);
}

.model-card:hover {
    border-color: var(--bh-ink-3);
    transform: translateY(-2px);
}

.model-card.selected {
    border-color: var(--bh-ink);
    box-shadow: inset 0 0 0 1px var(--bh-ink);
}

.model-preview {
    display: grid;
    place-items: center;
    aspect-ratio: 794 / 1123;
    margin-bottom: 8px;
    border-radius: 6px;
    background: var(--bh-paper);
    color: var(--bh-ink-4);
    font-size: 20px;
}

.model-title {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--bh-ink-2);
}

/* ============================================================
   L'ÉTABLI
   La page A4 est blanche : le plan de travail ne peut pas l'être.
   ============================================================ */

.canvas-area {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 28px 20px;
    background: var(--app-bench);
    /* Grain régulier + une lueur diffuse, centrée là où la feuille flotte :
       l'espace de travail respire sans jamais empiéter sur la page. */
    background-image:
        radial-gradient(ellipse 60% 42% at 50% 32%, rgba(255, 255, 255, 0.55), transparent 70%),
        radial-gradient(rgba(15, 23, 42, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px;
    overflow: auto;
}

.canvas-wrapper {
    position: relative;
    flex-shrink: 0;
    /* La feuille flotte au-dessus du plan de travail : ombre franche
       proche, halo bleu très doux plus loin. Rien à l'intérieur. */
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.16),
        0 22px 48px -16px rgba(15, 23, 42, 0.38),
        0 0 90px -24px rgba(37, 99, 235, 0.16);
}

/* ============================================================
   MOBILE — barre haute, navigation basse, feuille
   ============================================================ */

.mobile-top-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bh-paper);
    border-bottom: 1px solid var(--bh-ink-line);
}

.mobile-top-bar button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 9px;
    background: var(--bh-white);
    color: var(--bh-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.mobile-top-bar button.primary {
    background: var(--bh-primary);
    border-color: var(--bh-primary);
    color: #ffffff;
}

.mobile-top-bar input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
    text-align: center;
    color: var(--bh-ink);
}

.mobile-bottom-nav {
    display: none;
    flex-direction: column;
    background: var(--bh-paper);
    border-top: 1px solid var(--bh-ink-line);
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 200;
}

.bottom-nav-items {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    border: 0;
    background: none;
    color: var(--bh-ink-4);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.16s ease;
}

.nav-item i {
    font-size: 15px;
}

.nav-item.active {
    color: var(--bh-ink);
}

.nav-item.active i {
    color: #92400e;
}

.mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    max-height: 82dvh;
    background: var(--bh-paper);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 50px -18px rgba(15, 23, 42, 0.55);
    transform: translateY(100%);
    transition: transform 0.3s var(--bh-ease-out);
}

.mobile-sheet.open {
    transform: translateY(0);
}

.sheet-handle {
    width: 42px;
    height: 4px;
    margin: 10px auto 6px;
    flex: none;
    border-radius: 2px;
    background: var(--bh-paper-3);
    cursor: grab;
}

.sheet-handle:active {
    cursor: grabbing;
}

.mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s;
}

.mobile-sheet-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.sheet-content {
    flex: 1;
    min-height: 0;
    padding: 0 14px 18px;
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ============================================================
   MODALES
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal.active,
.modal.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 18px;
    background: var(--bh-paper);
    box-shadow: 0 36px 70px -28px rgba(15, 23, 42, 0.7);
    overflow-y: auto;
    animation: modalIn 0.26s var(--bh-ease-out);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-header h3 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--bh-ink);
}

.modal-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border: 1px solid var(--bh-ink-line);
    border-radius: 50%;
    background: var(--bh-white);
    color: var(--bh-ink-2);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.modal-close:hover {
    background: var(--bh-ink);
    color: var(--bh-paper);
}

.modal-body {
    flex: 1;
    min-height: 0;
}

.modal-info-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--bh-ink-2);
}

.modal-footer,
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--bh-primary);
    border-radius: var(--ed-r);
    background: var(--bh-primary);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.16s var(--bh-ease-out), transform 0.14s var(--bh-ease-out);
}

.modal-btn:hover {
    box-shadow: var(--ed-lift);
}

.modal-btn:active {
    transform: scale(0.98);
}

.modal-btn.cancel {
    background: var(--bh-white);
    border-color: var(--bh-ink-line);
    color: var(--bh-ink-2);
}

.modal-btn.cancel:hover {
    border-color: var(--bh-ink-3);
    box-shadow: none;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */

.form-field {
    margin-bottom: 14px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--bh-ink-line);
    border-radius: var(--ed-r);
    background: var(--bh-white);
    font-family: inherit;
    font-size: 16px;
    color: var(--bh-ink);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-field input::placeholder {
    color: var(--bh-ink-4);
}

.form-field input:read-only {
    background: var(--bh-paper-2);
    color: var(--bh-ink-3);
    cursor: default;
}

.form-field input:focus:not(:read-only),
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--bh-gold);
    box-shadow: 0 0 0 3px var(--bh-gold-wash);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-col {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   RECHERCHE ET SUGGESTIONS
   ============================================================ */

.search-field {
    position: relative;
    margin-bottom: 12px;
}

/* L'icone se glisse DANS le champ : posee au-dessus, elle flottait
   toute seule et ne designait plus rien. */
.search-field i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--bh-ink-4);
    font-size: 13px;
    pointer-events: none;
}

.search-field input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px 10px 34px;
    border: 1px solid var(--bh-ink-line);
    border-radius: var(--ed-r);
    background: var(--bh-white);
    font-family: inherit;
    font-size: 16px;
}

.search-field input:focus {
    outline: none;
    border-color: var(--bh-gold);
    box-shadow: 0 0 0 3px var(--bh-gold-wash);
}

.suggestions-list {
    max-height: 260px;
    margin-top: 6px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 12px;
    background: var(--bh-white);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bh-ink-line-soft);
    cursor: pointer;
    transition: background 0.14s ease;
}

.suggestion-item:last-child {
    border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--bh-paper);
}

.suggestion-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--bh-ink);
}

.suggestion-cat {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 22px;
    flex: none;
    padding: 0 6px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 5px;
    background: var(--bh-paper-2);
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--bh-ink-2);
}

/* ============================================================
   APERÇU DANS LA MODALE D'AJOUT
   ============================================================ */

.preview-zone {
    margin-top: 12px;
    padding: 12px;
    border: 1px dashed var(--bh-ink-line);
    border-radius: 12px;
    background: var(--bh-white);
}

.preview-title {
    margin-bottom: 8px;
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

.preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--bh-ink-line-soft);
    border-radius: 8px;
    background: var(--bh-paper);
}

.preview-item + .preview-item {
    margin-top: 6px;
}

.preview-item-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--bh-ink);
}

.preview-item-cat {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 22px;
    flex: none;
    padding: 0 6px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 5px;
    background: var(--bh-white);
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--bh-ink-2);
}

.scrolling-info {
    font-family: var(--bh-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bh-ink-4);
}

/* ============================================================
   MOUVEMENT RÉDUIT
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   NOTICE DE L'ÉTABLI
   Elle était un frère de la page dans un conteneur centré : elle se
   retrouvait écrasée à 68 px sur le côté. Elle quitte le flux et
   vient se poser sur le plan de travail, sous la feuille.
   ============================================================ */

.canvas-notice {
    position: absolute;
    left: 20px;
    bottom: 20px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(340px, calc(100% - 40px));
    padding: 8px 12px;
    border: 1px solid var(--bh-gold-line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bh-gold-wash) 92%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 11px;
    line-height: 1.4;
    color: #92400e;
    box-shadow: var(--ed-lift);
}

.canvas-notice i {
    flex: none;
    font-size: 11px;
    color: #92400e;
}

.canvas-notice strong {
    font-weight: 700;
}

@media (max-width: 768px) {
    .canvas-notice {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
        font-size: 10px;
    }
}

/* ============================================================
   PALIERS MOBILES DU CHROME
   ============================================================ */

@media (max-width: 768px) {
    .mobile-top-bar {
        display: flex;
    }

    .mobile-bottom-nav {
        display: flex;
    }
}

/* Indice au-dessus de la navigation basse : une phrase, pas un bandeau. */
.nav-hint {
    padding: 7px 12px;
    border-bottom: 1px solid var(--bh-ink-line);
    background: var(--bh-paper);
    font-family: var(--bh-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--bh-ink-3);
}

.nav-hint strong {
    color: var(--bh-ink);
    font-weight: 700;
}

/* ============================================================
   JAUGE DE BARÈME — la signature de l'éditeur
   Le total de points est la seule chose que l'élève surveille en
   continu. Il ne se cache pas dans un onglet : il se remplit sous
   ses yeux, avec le repère des 12 points au trois quarts du rail.
   ============================================================ */

.bareme-gauge {
    position: relative;
    height: 5px;
    flex: none;
    border-inline: 1px solid var(--bh-ink-line);
    background: var(--bh-ink);
    overflow: hidden;
}

.bareme-gauge__fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--bh-gold-bright);
    transition: width 0.35s var(--bh-ease-out), background 0.25s ease;
}

.bareme-gauge.is-good .bareme-gauge__fill {
    background: #10b981;
}

.bareme-gauge.is-over .bareme-gauge__fill {
    background: #f59e0b;
}

/* Repère des 12 points : la zone conseillée commence là. */
.bareme-gauge__mark {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(248, 250, 252, 0.4);
}

/* ============================================================
   LIGNE D'ÉLÉMENT — retravaillée
   Elle affichait le nom et la catégorie, mais pas la pondération :
   c'était pourtant le chiffre qui explique le total. Chaque ligne
   dit maintenant la même chose que le tableau officiel : quel
   élément, quelle catégorie, combien de points.
   ============================================================ */

.element-item {
    display: grid;
    grid-template-columns: 22px 14px 1fr auto 30px;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 8px 12px 8px 6px;
}

/* Poignée : trois filets, pas un caractère « ☰ » qui change de
   dessin selon la police installée. */
.drag-handle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 14px;
    height: 100%;
    color: var(--bh-ink-4);
    cursor: grab;
    font-size: 0;
}

.drag-handle i {
    display: block;
    width: 12px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
}

.element-item:active .drag-handle {
    cursor: grabbing;
    color: var(--bh-ink-2);
}

.element-name-compact {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.element-label {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--bh-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* L'élément de liaison se lit comme une seconde ligne rattachée,
   pas comme une rallonge du nom. */
.element-link {
    font-family: var(--bh-mono);
    font-size: 10.5px;
    letter-spacing: 0.02em;
    color: var(--bh-ink-3);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.element-scores {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.element-pts {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 22px;
    padding: 0 6px;
    border-radius: 5px;
    background: var(--bh-paper);
    border: 1px solid var(--bh-ink-line);
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--bh-ink);
}

.element-pts::after {
    content: '';
}

/* Les pastilles reprennent les couleurs de catégorie du document :
   l'élève retrouve le même code d'un écran à l'autre. */
.element-cat-compact[data-cat='A'] {
    background: var(--bh-gold-wash);
    border-color: var(--bh-gold-line);
    color: #92400e;
}

.element-cat-compact[data-cat='B'] {
    background: var(--bh-blue-wash, #dbeafe);
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--bh-blue, #2563eb);
}

.element-cat-compact[data-cat='C'] {
    background: var(--bh-green-wash);
    border-color: rgba(16, 185, 129, 0.28);
    color: var(--bh-green-dark);
}

.element-cat-compact[data-cat='D'] {
    background: #ede9fe;
    border-color: rgba(124, 58, 237, 0.26);
    color: #7c3aed;
}

.element-cat-compact[data-cat='E'] {
    background: var(--bh-red-wash);
    border-color: rgba(239, 68, 68, 0.26);
    color: var(--bh-red-dark);
}

/* Le numéro d'ordre est un repère de tableau : chasse fixe, encadré. */
.element-item::before {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--bh-paper);
    border: 1px solid var(--bh-ink-line);
    color: var(--bh-ink-3);
    font-size: 10.5px;
}

/* Au doigt, la poignée et le bouton méritent leur place. */
@media (max-width: 768px) {
    .element-item {
        grid-template-columns: 24px 16px 1fr auto 34px;
        min-height: 58px;
        gap: 9px;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
    }
}

/* ============================================================
   ÉCRAN DE CHARGEMENT
   Un anneau qui tourne ne dit rien de ce qu'on attend. Ici la page
   A4 se dessine : ses lignes se remplissent une à une, la gymnaste
   apparaît en filigrane. On voit arriver ce qu'on est venu chercher.
   ============================================================ */

.fiche-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--app-bench, #e2e8f0);
    background-image: radial-gradient(rgba(15, 23, 42, 0.07) 1px, transparent 1px);
    background-size: 20px 20px;
}

.fiche-loader__page {
    position: relative;
    width: 132px;
    aspect-ratio: 794 / 1123;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: #fff;
    border: 1px solid var(--bh-ink-line);
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .18), 0 18px 40px -12px rgba(15, 23, 42, .42);
    overflow: hidden;
    animation: loaderPose .5s var(--bh-ease-out);
}

@keyframes loaderPose {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* La tranche dorée, comme sur les cartes de fiches. */
.fiche-loader__page::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--bh-gold-bright);
}

/* La gymnaste des filigranes, peinte à l'encre de la marque. */
.fiche-loader__silhouette {
    position: absolute;
    right: -14%;
    bottom: -4%;
    width: 66%;
    aspect-ratio: 442 / 565;
    background: var(--bh-ink);
    opacity: .07;
    -webkit-mask: url('/images/filigranes/filigranes_girls/filigrane2.png') no-repeat center bottom / contain;
    mask: url('/images/filigranes/filigranes_girls/filigrane2.png') no-repeat center bottom / contain;
}

.fiche-loader__entete {
    height: 22px;
    flex: none;
    border: 1.5px solid var(--bh-green);
    border-radius: 3px;
    opacity: 0;
    animation: loaderRemplir .45s var(--bh-ease-out) .25s forwards;
}

.fiche-loader__ligne {
    height: 7px;
    flex: none;
    border-radius: 2px;
    background: var(--bh-paper-2);
    transform-origin: left;
    transform: scaleX(0);
    opacity: 0;
    animation: loaderTracer .5s var(--bh-ease-out) forwards;
}

/* Les lignes se remplissent l'une après l'autre, puis ça recommence :
   la boucle dure 3,2 s, assez lente pour être lisible. */
.fiche-loader__ligne:nth-of-type(2) { animation-delay: .45s; }
.fiche-loader__ligne:nth-of-type(3) { animation-delay: .70s; }
.fiche-loader__ligne:nth-of-type(4) { animation-delay: .95s; width: 78%; }
.fiche-loader__ligne:nth-of-type(5) { animation-delay: 1.2s; }
.fiche-loader__ligne:nth-of-type(6) { animation-delay: 1.45s; width: 60%; }
.fiche-loader__ligne:nth-of-type(7) { animation-delay: 1.7s; }

@keyframes loaderTracer {
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes loaderRemplir {
    to {
        opacity: 1;
    }
}

.fiche-loader__texte {
    margin: 0;
    font-family: var(--bh-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

.fiche-loader__marque {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-weight: 800;
    font-stretch: 90%;
    font-size: 15px;
    letter-spacing: -.04em;
    color: var(--bh-ink);
    opacity: .5;
}

.fiche-loader__marque i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--bh-gold-bright);
}

@media (prefers-reduced-motion: reduce) {

    .fiche-loader__ligne,
    .fiche-loader__entete {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   SÉLECTEUR DE SÉRIE
   Le `datalist` natif ouvrait une liste plein écran, hors charte,
   sans montrer où l'on en était. Les séries forment un ensemble
   fermé et court : on les affiche toutes et on en touche une.
   Le champ texte reste dessous pour les cas non prévus.
   ============================================================ */

.serie-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.serie-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--bh-ink-line);
    border-radius: 9px;
    background: var(--bh-white);
    color: var(--bh-ink-2);
    font-family: var(--bh-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.serie-chip:hover {
    border-color: var(--bh-ink-3);
}

.serie-chip.is-active {
    background: var(--bh-primary);
    border-color: var(--bh-primary);
    color: var(--bh-gold-bright);
}

/* Le champ libre s'efface visuellement : c'est la sortie de secours,
   pas le chemin principal. */
.serie-libre {
    font-size: 14px !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    background: transparent !important;
    border-style: dashed !important;
}

/* ============================================================
   APLATISSEMENT DES PANNEAUX « INFOS » ET « ÉLÉMENTS »

   Ces deux panneaux étaient des cartes blanches posées dans la
   feuille, elle-même une carte : deux cadres emboîtés pour un
   contenu qui n'en demandait aucun. L'onglet « Décoration » n'a
   jamais eu ce problème parce que son contenu vit directement sur
   le fond — c'est ce qu'on applique ici.

   Ce qui remplace les cadres : des filets fins, des libellés en
   chasse fixe, et de l'espace. La seule surface qui reste pleine
   est le total de points, parce que c'est le chiffre que l'élève
   surveille.
   ============================================================ */

/* --- INFOS CANDIDAT ------------------------------------------------- */

.info-section,
.info-section-compact {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.info-header,
.info-header-compact {
    padding: 0 2px 10px;
    background: transparent;
    border-bottom: 1px solid var(--bh-ink-line);
}

.info-header h2,
.info-header-compact h2 {
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

.info-header p,
.info-header-compact p {
    display: none;
}

.info-row,
.info-item-row {
    padding: 12px 2px;
    border-bottom: 1px solid var(--bh-ink-line-soft);
    background: transparent;
}

.info-label,
.info-label-row {
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

.info-value,
.info-value-row {
    font-size: 14px;
}

.info-centre-highlight {
    padding: 12px 2px;
    background: transparent;
    border-bottom: 1px solid var(--bh-ink-line-soft);
    border-top: 0;
}

/* --- ÉLÉMENTS -------------------------------------------------------- */

.elements-header-row {
    padding: 0 2px 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--bh-ink);
}

.elements-header-row h3 {
    font-family: var(--bh-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

/* Le total reste une surface pleine : c'est le seul chiffre que
   l'élève surveille en continu, il a le droit de se détacher. */
.points-inline-badge {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--bh-ink);
}

.pts-label {
    color: rgba(248, 250, 252, 0.5);
}

.pts-value {
    font-size: 17px;
}

/* La jauge devient un filet posé sous l'en-tête. */
.bareme-gauge {
    height: 3px;
    border: 0;
    border-radius: 2px;
    background: var(--bh-paper-3);
}

.bareme-gauge__mark {
    background: rgba(15, 23, 42, 0.25);
}

.elements-sub-row {
    padding: 10px 2px;
    border: 0;
    border-bottom: 1px solid var(--bh-ink-line);
    background: transparent;
}

.liaison-info-banner {
    margin: 12px 0 0 !important;
    padding: 10px 12px !important;
    border: 0 !important;
    border-left: 2px solid var(--bh-gold) !important;
    border-radius: 0 6px 6px 0 !important;
    background: var(--bh-gold-wash) !important;
}

.elements-list-container {
    border: 0;
    background: transparent;
}

.element-item {
    padding-inline: 2px 0;
    background: transparent;
    border-bottom: 1px solid var(--bh-ink-line-soft);
}

.element-item:hover {
    background: rgba(15, 23, 42, 0.03);
}

.empty-state {
    border: 0;
    background: transparent;
    padding: 36px 12px;
}

.add-element-btn {
    margin-top: 14px !important;
    border-radius: 10px !important;
}

/* --- DÉCORATION : on aligne les marges sur les deux autres ---------- */

#content-watermark .wm-divider:first-of-type {
    margin-top: 10px;
}

/* Sur grand écran le panneau garde sa respiration latérale. */
.desktop-sidebar .sidebar-content {
    padding-inline: 18px;
}
