/* « Contrôle du jour » (29/11/2026) : feuille légère, même famille que « Liaisons du jour ». Un chiffre, puis une ligne
   par contrôle qui se déplie. Rouge sobre pour « à corriger », ambre pour « à ranger » ; rien d'autre ne bouge. */
.cdj {
  position: fixed; width: min(620px, calc(100% - 32px)); max-height: min(860px, 90dvh); padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 28px; background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 100px rgb(10 20 15 / 22%), 0 2px 8px rgb(10 20 15 / 6%);
  display: none; flex-direction: column;
}
.cdj[open] { display: flex; }
.cdj::backdrop { background: rgb(18 24 20 / 34%); -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); }
:root[data-theme=dark] .cdj { box-shadow: 0 30px 100px rgb(0 0 0 / 55%); }
:root[data-theme=dark] .cdj::backdrop { background: rgb(0 0 0 / 50%); }
.cdj-ouverte { overflow: hidden; }

.cdj-fermer {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; min-height: 44px; padding: 0;
  display: grid; place-items: center; border-radius: 999px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1;
}
.cdj-fermer span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--inset); }
.cdj-fermer:hover { color: var(--ink); }

.cdj-tete { padding: 30px 28px 6px; }
.cdj-h { margin: 0 44px 4px 0; font-size: 26px; line-height: 1.15; font-weight: 750; letter-spacing: -.7px; outline: none; }
.cdj-sous { margin: 0; min-height: 20px; color: var(--muted); font-size: 14px; }
.cdj-chiffre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 16px 0 0; }
.cdj-chiffre[hidden] { display: none; }
.cdj-total { font-size: 46px; line-height: 1; font-weight: 760; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.cdj-total-lib { font-size: 16px; }
.cdj-ecart { padding: 3px 10px; border-radius: 999px; background: var(--inset); color: var(--muted); font-size: 13px; font-weight: 600; }
.cdj-ecart[data-sens=mieux] { background: rgb(46 125 78 / 13%); color: #1f6b41; }
.cdj-ecart[data-sens=pire] { background: rgb(176 60 45 / 12%); color: #a3301f; }
:root[data-theme=dark] .cdj-ecart[data-sens=mieux] { color: #8fd3ab; }
:root[data-theme=dark] .cdj-ecart[data-sens=pire] { color: #f0a497; }

.cdj-defile { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 22px; }
.cdj-etat { margin: 0; color: var(--muted); font-size: 15px; text-align: center; }
.cdj-etat:empty { display: none; }
.cdj-etat.cdj-vide { padding: 26px 0 18px; }
.cdj-liste { list-style: none; margin: 0; padding: 0; border-radius: 16px; background: var(--inset); overflow: hidden; }
.cdj-liste:empty { display: none; }
.cdj-controle + .cdj-controle { border-top: 1px solid var(--line); }
.cdj-controle-tete {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border: 0; border-radius: 0;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.cdj-controle-tete:hover { background: rgb(127 127 127 / 7%); }
.cdj-controle-tete:focus-visible, .cdj-dossier-lien:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cdj-nombre { flex: 0 0 auto; min-width: 34px; text-align: right; font-size: 18px; font-weight: 720; font-variant-numeric: tabular-nums; }
.cdj-controle-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cdj-controle-nom { font-size: 15px; font-weight: 600; line-height: 1.3; }
.cdj-controle-aide { color: var(--muted); font-size: 13px; line-height: 1.3; }
.cdj-niveau { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.cdj-controle[data-niveau=corriger] .cdj-niveau { background: rgb(176 60 45 / 12%); color: #a3301f; }
.cdj-controle[data-niveau=ranger] .cdj-niveau { background: rgb(190 130 20 / 15%); color: #855a06; }
:root[data-theme=dark] .cdj-controle[data-niveau=corriger] .cdj-niveau { color: #f0a497; }
:root[data-theme=dark] .cdj-controle[data-niveau=ranger] .cdj-niveau { color: #e8c37a; }
.cdj-chevron { flex: 0 0 auto; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .15s ease; }
.cdj-ouvert > .cdj-controle-tete .cdj-chevron { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .cdj-chevron { transition: none; } }

.cdj-zone { padding: 0 10px 10px; }
.cdj-zone[hidden] { display: none; }
.cdj-dossiers { list-style: none; margin: 0; padding: 0; border-radius: 12px; background: var(--surface); overflow: hidden; }
.cdj-dossier + .cdj-dossier { border-top: 1px solid var(--line); }
.cdj-dossier-lien {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 0;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.cdj-dossier-lien:hover { background: rgb(127 127 127 / 7%); }
.cdj-dossier > .cdj-dossier-texte { display: flex; min-height: 48px; padding: 8px 12px; justify-content: center; }
.cdj-dossier-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cdj-dossier-nom { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.cdj-dossier-detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.cdj-reste { margin: 8px 4px 0; color: var(--muted); font-size: 13px; }
.cdj-calmes { margin: 14px 4px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cdj-calmes[hidden] { display: none; }
.cdj-aide { margin: 12px 4px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

@media (max-width: 520px) {
  .cdj { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .cdj-tete { padding: 26px 20px 6px; }
  .cdj-defile { padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); }
  .cdj-niveau { display: none; }
  .cdj-total { font-size: 40px; }
}
