/*
 * Design system Onlineformapro (projet « Refonte » : designSystem.html / tableaux.html),
 * avec une navigation simple en haut, sans menu latéral.
 */
:root {
    --a: #E2006E;          /* accent rose = couleur principale */
    --a-hover: #C80062;
    --a1: #FFF0F6;         /* teinte : survol de ligne, avatar, focus */
    --a2: #FDDAED;         /* teinte 2 : bordures de puces roses */
    --t1: #111827;         /* texte principal */
    --t2: #4B5563;         /* texte secondaire */
    --t3: #9CA3AF;         /* texte discret */
    --bd: #E5E7EB;         /* bordures */
    --bg: #F3F4F6;         /* fond de l'application */
    --ps: #F7F8FA;         /* surface pâle : en-têtes de tableau, survol */
    --sb-dark: #13041c;    /* bloc sombre du logo */

    --ok-bg: #ECFDF5; --ok: #059669; --ok-bd: #A7F3D0;
    --err-bg: #FEE2E2; --err: #DC2626;
    --warn-bg: #FEF3C7; --warn: #D97706;
    --info-bg: #EFF6FF; --info: #3B82F6;

    --ch: 36px;
    --r: 8px;
    --rl: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .04);
    --trans: all .2s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
/* Un élément masqué reste masqué, même si sa classe lui donne un display (voile du lecteur de modules…). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--t1);
    background: var(--bg);
}
a { color: var(--a); text-decoration: none; }
a:hover { color: var(--a-hover); }
code { font-size: 12px; background: var(--bg); color: var(--t2); padding: 1px 6px; border-radius: 5px; }
.ico { flex-shrink: 0; vertical-align: -0.15em; }

.muted { color: var(--t3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.link-muted { color: var(--t2); font-size: 13px; }
.link-muted:hover { color: var(--a); }

/* ---------- Barre du haut ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    height: 56px; display: flex; align-items: stretch;
    background: rgba(255, 255, 255, .85); backdrop-filter: blur(7px);
}
.tb-slot {
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px 0 16px; background: var(--sb-dark); color: #fff;
}
.tb-slot:hover { color: #fff; }
.tb-logo {
    width: 30px; height: 30px; border-radius: 8px; background: var(--a); color: #fff;
    display: inline-grid; place-items: center; flex-shrink: 0;
}
.tb-appn { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }
.tb-body {
    flex: 1; display: flex; align-items: stretch; gap: 10px;
    padding: 0 24px 0 20px; border-bottom: 1px solid var(--bd); min-width: 0;
}
.tb-nav { display: flex; align-items: stretch; gap: 4px; }
.tb-nav a {
    display: flex; align-items: center; gap: 8px; padding: 0 14px;
    font-size: 13.5px; font-weight: 500; color: var(--t2);
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .1s;
}
.tb-nav a:hover { color: var(--t1); }
.tb-nav a[aria-current] { color: var(--a); font-weight: 600; border-bottom-color: var(--a); }
.tb-ics { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--t2); }
.tb-av {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: inline-grid; place-items: center;
    background: var(--a1); color: var(--a); border: 2px solid var(--a2);
    font-size: 11px; font-weight: 600;
}
button.tb-user {
    height: 38px; padding: 0 8px 0 4px; border: 0; border-radius: 19px; background: none;
    font: inherit; font-size: 13px; color: var(--t2); cursor: pointer; transition: background .1s;
}
button.tb-user:hover, button.tb-user[aria-expanded=true] { background: var(--ps); color: var(--t1); }
button.tb-user:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--a2); }
.tb-caret { display: inline-flex; color: var(--t3); transition: transform .15s; }
.tb-user[aria-expanded=true] .tb-caret { transform: rotate(180deg); }

/* Menu déroulant du compte */
.tb-menu { position: relative; display: flex; align-items: center; }
.tb-dd {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
    min-width: 248px; max-width: calc(100vw - 16px); padding: 6px;
    background: #fff; border: 1px solid var(--bd); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
}
.tb-dd[hidden] { display: none; }
.tb-dd-hd { padding: 8px 10px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--bg); }
.tb-dd-name { font-size: 13.5px; font-weight: 600; color: var(--t1); }
.tb-dd-mail { font-size: 12px; color: var(--t3); overflow-wrap: anywhere; }
.tb-dd a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px;
    font-size: 13.5px; font-weight: 500; color: var(--t2); transition: background .1s;
}
.tb-dd a .ico { color: var(--t3); }
.tb-dd a:hover, .tb-dd a:focus-visible { background: var(--ps); color: var(--t1); outline: none; }
.tb-dd a[aria-current] { color: var(--a); }
.tb-dd a[aria-current] .ico { color: var(--a); }
.tb-dd a.red, .tb-dd a.red .ico { color: #DC2626; }
.tb-dd a.red:hover, .tb-dd a.red:focus-visible { background: #FEF2F2; color: #DC2626; }
.tb-dd-sep { height: 1px; margin: 6px 0; background: var(--bg); }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tbi {
    width: 36px; height: 36px; border-radius: 8px; display: inline-grid; place-items: center;
    color: var(--t2); transition: background .1s;
}
/* En <button> (croix des fenêtres modales) : sans la bordure ni le fond du navigateur. */
button.tbi { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
button.tbi:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--a1); }
.tbi:hover { background: var(--ps); color: var(--t1); }
.tbi.red { color: var(--err); }
.tbi.red:hover { background: #FEF2F2; color: var(--err); }
.npill {
    display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px;
    background: var(--a1); color: var(--a); font-size: 11px; font-weight: 600; vertical-align: 1px;
}

/* ---------- Mise en page ---------- */
.content { padding: 24px 32px 48px; max-width: 1440px; margin: 0 auto; }

.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ph-l { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ph-title { font-family: 'Geist', 'Inter', sans-serif; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.ph-ct { font-size: 13.5px; color: var(--t3); }
.ph-sub { font-size: 12.5px; color: var(--t3); margin: 2px 0 0; }
.ph-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ph-actions { display: flex; align-items: center; gap: 12px; }

.bc-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.bc-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--t2); }
.bc-item .ico { color: var(--t3); }
.bc-item:hover { color: var(--t1); }
.bc-sep { color: var(--t3); display: inline-flex; }
.bc-cur { font-size: 13.5px; font-weight: 600; color: var(--t1); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.lead { font-size: 15px; color: var(--t2); margin: 0 0 16px; }

/* ---------- Cartes ---------- */
.card, .tcard, .scard {
    background: #fff; border: 1px solid var(--bd); border-radius: var(--rl); box-shadow: var(--shadow);
}
.card { padding: 24px; }
.scard { padding: 20px 24px; margin-bottom: 16px; }
.tcard { overflow: hidden; }
.scard-hd {
    display: flex; align-items: center; gap: 12px; margin: 0 0 16px;
    font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .08em;
}
.scard-hd::after { content: ''; flex: 1; height: 1px; background: var(--bg); }
.scard-hd-note { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 12px; }

.empty { text-align: center; padding: 48px 24px; }
.empty-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--a1); color: var(--a); }
.empty-title { font-weight: 600; margin: 12px 0 4px; }
.empty p { margin-top: 0; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: var(--ch); padding: 0 16px; font: inherit; font-size: 13px; font-weight: 500;
    border-radius: var(--r); border: 1px solid var(--bd); background: #fff; color: var(--t2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04); cursor: pointer; transition: background .1s; white-space: nowrap;
}
.btn:hover { background: var(--ps); color: var(--t1); }
.btn.primary { background: var(--a); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--a-hover); color: #fff; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.danger { color: var(--err); border-color: #FECACA; }
.btn.danger:hover { background: #FEF2F2; color: var(--err); }
.btn-block { width: 100%; height: 40px; margin-top: 20px; }
.btn-link { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; padding: 6px 4px; color: var(--t2); }
.btn-link.danger { color: var(--err); }
.btn-link:hover { text-decoration: underline; }

/* ---------- Formulaires ---------- */
.form-field { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.form-field label { font-size: 12.5px; font-weight: 700; color: #64748B; }
.form-input, .form-select {
    height: 38px; width: 100%; padding: 0 12px; font: inherit; font-size: 13.5px;
    border: 1px solid #E2E8F0; border-radius: 8px; background: #fff; color: #0F172A; transition: all .15s;
}
textarea.form-input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.form-select {
    padding-right: 32px; appearance: none; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23475569'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 3px var(--a1); }
.form-input::placeholder { color: var(--t3); }
input[type=checkbox], input[type=radio] { accent-color: var(--a); width: 15px; height: 15px; margin: 0; }
.help-text { font-size: 12px; color: var(--t3); margin-top: -2px; }
.form-errors { list-style: none; margin: -2px 0 0; padding: 0; font-size: 12.5px; font-weight: 500; color: var(--err); }
.has-error .form-input { border-color: var(--err); }
.has-error .form-input:focus { box-shadow: 0 0 0 3px var(--err-bg); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 16px; }
.form-grid > .form-field:first-child, .form-grid > .form-field:nth-child(2) { margin-top: 0; }
.form-field label.check { font-weight: 500; color: var(--t1); }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.scard form .alert:first-child { margin-top: 0; }
.narrow { max-width: 560px; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--t2); white-space: nowrap; cursor: pointer; }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters .form-select { width: auto; min-width: 170px; height: var(--ch); }
.search-field { position: relative; flex: 1 1 280px; max-width: 420px; }
.search-field .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--t3); pointer-events: none; }
.search-field .form-input { padding-left: 34px; height: var(--ch); }

/* ---------- Alertes ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; font-size: 13.5px; font-weight: 500; }
.alert .ico { margin-top: 2px; }
.alert-success { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-bd); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert.small { font-size: 12.5px; padding: 9px 12px; margin: 12px 0 0; }

/* ---------- Badges ---------- */
.pbadge {
    display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border-radius: 12px;
    font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.pbadge.sm { height: 20px; padding: 0 8px; font-size: 11px; margin-left: 6px; }
.pbadge.green { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-bd); }
.pbadge.red { background: var(--err-bg); color: var(--err); }
.pbadge.warning { background: var(--warn-bg); color: var(--warn); }
.pbadge.pink { background: var(--a1); color: var(--a); border: 1px solid var(--a2); }
.pbadge.gray { background: var(--bg); color: var(--t2); border: 1px solid var(--bd); }
.type {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 6px;
    font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--t2);
}
.type-scorm { background: #EDE9FE; color: #7C3AED; }
.type-html { background: #E0F2FE; color: #0284C7; }
.type-document { background: #E0F8EF; color: #059669; }
.ptag { display: inline-flex; padding: 2px 10px; background: var(--a1); color: var(--a); border: 1px solid var(--a2); border-radius: 8px; font-size: 12px; font-weight: 500; }
a.ptag-link { text-decoration: none; cursor: pointer; }
a.ptag-link:hover, a.ptag-link:focus-visible { background: var(--a2); }
a.vocab-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; white-space: nowrap; }
a.vocab-link:hover { color: var(--a); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.count { display: inline-flex; align-items: center; gap: 3px; margin-right: 10px; font-weight: 600; font-size: 12.5px; }
.count-validated { color: var(--ok); }
.count-rejected { color: var(--err); }
.count-outdated { color: var(--warn); }

/* ---------- Tableaux ---------- */
.table { width: 100%; border-collapse: collapse; }
.table thead tr { background: var(--ps); }
.table th {
    padding: 10px 14px; font-size: 11.5px; font-weight: 600; color: var(--t2);
    text-align: left; white-space: nowrap; letter-spacing: .01em; border-bottom: 1px solid var(--bd);
}
.table td { padding: 11px 14px; font-size: 13px; color: var(--t1); vertical-align: middle; border-bottom: 1px solid var(--bg); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:nth-child(even) { background: #FAFBFD; }
.table tbody tr { transition: background .08s; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: var(--a1); }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--a); }
.table tbody tr.is-removed { opacity: .55; }
.table .center { text-align: center; }
.title-link { color: var(--t1); font-weight: 600; }
.title-link:hover { color: var(--a); }
.cell-sub { font-size: 12px; color: var(--t3); margin-top: 1px; }
.table-scroll { overflow-x: auto; }
.table .row-actions { width: 1%; text-align: right; padding-top: 4px; padding-bottom: 4px; }
.user-cell { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.user-cell .tb-av { width: 28px; height: 28px; font-size: 10.5px; }

/* ---------- Mot de passe provisoire ---------- */
.credentials { margin: 16px 0; }
.credentials dd { font-size: 13.5px; }
code.secret {
    display: inline-block; padding: 4px 10px; font-size: 15px; letter-spacing: .06em;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    background: var(--a1); color: var(--t1); border: 1px solid var(--a2); user-select: all;
}

/* ---------- Fiche contenu ---------- */
.preview { width: 100%; height: 700px; border: 1px solid var(--bd); border-radius: var(--r); background: #fff; display: block; }
.warnings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.warning { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.warning .ico { margin-top: 2px; }
.warning-error { color: var(--err); }
.warning-warning { color: var(--warn); }
.warning-info { color: var(--t2); }
.warning-info .ico { color: var(--info); }
/* Accessibilité (RGAA) : numéro du critère en pastille, lien vers le référentiel. */
.rgaa:not(.rgaa-shown) { display: none; }
.rgaa-side p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.rgaa-side .pbadge.sm { margin-left: 0; }
.rgaa-side .btn { width: 100%; justify-content: center; }
.rgaa-side .btn > span:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; }
.rgaa .scard-hd-note { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.rgaa .scard-hd-note .pbadge.sm { margin-left: 0; }
.rgaa-criterion { display: inline-block; min-width: 34px; padding: 0 6px; margin-right: 4px; border: 1px solid currentColor; border-radius: 6px; font-size: 12px; font-weight: 600; text-align: center; color: inherit; text-decoration: none; }
.rgaa-criterion:hover { text-decoration: underline; }
.rgaa .warning .cell-sub { color: var(--t2); }

.my-status { margin-bottom: 4px; }
.review-form .choice { display: flex; gap: 8px; margin-top: 16px; }
.review-form .choice label {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; border: 1px solid var(--bd); border-radius: var(--r); cursor: pointer;
    font-size: 13.5px; font-weight: 500; color: var(--t2); transition: var(--trans);
}
.review-form .choice label:hover { background: var(--ps); }
.review-form .choice input { position: absolute; opacity: 0; pointer-events: none; }
.review-form .choice label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--a1); }
.review-form .choice-validated:has(input:checked) { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.review-form .choice-rejected:has(input:checked) { background: var(--err-bg); border-color: var(--err); color: var(--err); font-weight: 600; }
.review-form .actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

.review { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--bg); }
.review:first-of-type { border-top: 0; padding-top: 0; }
.review-body { flex: 1; min-width: 0; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.review .comment { margin: 6px 0 0; font-size: 13px; color: var(--t2); }

.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.meta dt { color: var(--t3); font-weight: 500; }
.meta dd { margin: 0; overflow-wrap: anywhere; color: var(--t1); }
details { border-top: 1px solid var(--bg); padding: 8px 0; }
details:first-of-type { border-top: 0; padding-top: 0; }
summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--t2); }
summary:hover { color: var(--a); }
details .meta { margin: 10px 0 4px; }

.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; font-size: 13px; }
.tree { padding-left: 0; }
.tree li { margin: 3px 0; }
.tree-row { display: inline-flex; align-items: center; gap: 6px; color: var(--t2); }
.tree-row .ico { color: var(--t3); }
.tree a { color: var(--t1); }
.tree a:hover { color: var(--a); }

.markdown { font-size: 14px; overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown h1, .markdown h2, .markdown h3 { font-family: 'Geist', 'Inter', sans-serif; font-weight: 600; letter-spacing: -0.01em; }
.markdown h1 { font-size: 20px; }
.markdown h2 { font-size: 16px; }
.markdown h3 { font-size: 14.5px; }
.markdown table { border-collapse: collapse; font-size: 13px; }
.markdown th, .markdown td { border: 1px solid var(--bd); padding: 6px 10px; }
.markdown th { background: var(--ps); }
.markdown pre { background: var(--ps); border: 1px solid var(--bd); padding: 12px; border-radius: var(--r); overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }

/* ---------- Suivi ---------- */
.legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--t2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.cell { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; vertical-align: middle; }
.cell-validated { background: var(--ok-bg); color: var(--ok); }
.cell-rejected { background: var(--err-bg); color: var(--err); }
.cell-outdated { background: var(--warn-bg); color: var(--warn); }
.cell-todo { background: var(--bg); border: 1px dashed var(--bd); }
.matrix th:not(:first-child), .matrix td:not(:first-child) { width: 1%; min-width: 110px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; padding: 32px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand .tb-logo { width: 38px; height: 38px; border-radius: 10px; }
.login-app { font-weight: 600; font-size: 15px; }
.login-title { font-family: 'Geist', 'Inter', sans-serif; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
.login-card > p { margin: 0 0 8px; font-size: 13.5px; }
.login-card .alert { margin: 16px 0 0; }

/* ---------- Petits écrans ---------- */
@media (max-width: 1000px) {
    .layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .content { padding: 16px; }
    .tb-name, .tb-appn { display: none; }
    .tb-slot { padding: 0 12px; }
    .tb-body { padding: 0 8px; }
    .tb-nav a { padding: 0 10px; }
    .tcard { overflow-x: auto; }
    .search-field { max-width: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid > .form-field:nth-child(2) { margin-top: 16px; }
}

/* ---------- Cours et leçons ---------- */
.course-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 20px; }
.course-card {
    display: block; padding: 18px 20px; color: var(--t1);
    background: #fff; border: 1px solid var(--bd); border-radius: var(--rl); box-shadow: var(--shadow); transition: var(--trans);
}
.course-card:hover { border-color: var(--a2); box-shadow: 0 4px 14px rgba(226, 0, 110, .08); color: var(--t1); }
.course-card-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.course-ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #EDE9FE; color: #7C3AED; flex-shrink: 0; }
.course-title { font-weight: 600; font-size: 14.5px; }

.progress-card { margin-bottom: 16px; }
.course-card .progress-card { margin-bottom: 0; }
.progress-bar { display: flex; height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.progress-bar .seg { display: block; height: 100%; }
.seg-validated { background: #10B981; }
.seg-rejected { background: var(--err); }
.seg-delivered { background: #C4B5FD; }
.progress-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--t2); }
.progress-legend b { color: var(--t1); font-weight: 600; }
.lg-validated b { color: var(--ok); }
.lg-rejected b { color: var(--err); }

.plan .chapter-row th { background: #fff; color: var(--t1); font-size: 12.5px; padding-top: 14px; border-bottom: 1px solid var(--bd); }
.plan tr.is-missing td { color: var(--t3); }
.plan tr.is-missing:hover { background: transparent; }
.plan tr.is-missing:hover td:first-child { box-shadow: none; }
.title-missing { color: var(--t3); }
.plan.only-delivered tr.is-missing { display: none; }

.screens { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.screens-section { font-size: 13.5px; font-weight: 600; margin: 18px 0 10px; }
.screens-section:first-of-type { margin-top: 0; }
.screen-card { border: 1px solid var(--bd); border-radius: 10px; padding: 12px 14px; background: #fff; }
.screen-card.has-warnings { border-color: #FCD34D; }
.screen-hd { display: flex; align-items: center; gap: 10px; }
.screen-num {
    display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px;
    background: var(--a1); color: var(--a); font-weight: 700; font-size: 12px;
}
.screen-title { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.screen-title strong { font-size: 13.5px; }
.screen-kind { font-size: 12px; color: var(--t3); }
.screen-texts { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.screen-texts li { font-size: 14.5px; color: var(--t1); padding-left: 36px; }
mark.typing { background: var(--a1); color: var(--a); border-bottom: 2px dashed var(--a); padding: 0 2px; border-radius: 3px; font-weight: 600; }
.screen-answers, .screen-sounds, .screen-images { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-left: 36px; }
.screen-label { font-size: 12px; color: var(--t3); margin-right: 2px; }
.sound { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t2); background: var(--ps); border: 1px solid var(--bd); border-radius: 16px; padding: 2px 10px 2px 2px; }
.sound.missing { color: var(--warn); background: var(--warn-bg); border-color: #FCD34D; padding-left: 8px; }
.sound-btn {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--a); color: #fff; padding: 0;
}
.sound-btn:hover { background: var(--a-hover); }
.sound-btn.playing { background: var(--t1); }
.screen-video { display: block; width: calc(100% - 36px); max-width: 480px; margin: 10px 0 0 36px; border-radius: 8px; background: #000; }
.screen-images img { height: 64px; max-width: 120px; object-fit: contain; border: 1px solid var(--bd); border-radius: 6px; background: var(--ps); display: block; }
.img-missing { display: inline-grid; place-items: center; width: 64px; height: 64px; border: 1px dashed #FCD34D; border-radius: 6px; color: var(--warn); background: var(--warn-bg); }
.screen-warning { margin-top: 8px; padding-left: 36px; font-size: 12.5px; color: var(--warn); display: flex; gap: 6px; align-items: center; }
.preview-note { display: flex; gap: 6px; align-items: center; margin: -6px 0 10px; }
.tree-details > summary { margin-bottom: 8px; }
.screen-texts.words { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 36px; }
.screen-texts.words li { padding: 2px 10px; border: 1px solid var(--bd); border-radius: 6px; background: var(--ps); font-size: 13.5px; }

/* ---------- Lancement SCORM (LMS simulé) ---------- */
.launch-row { display: flex; align-items: center; gap: 14px; }
.launch-row p { margin: 0 0 4px; }
.launch-row .btn { flex-shrink: 0; }
.launch-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--a1); color: var(--a); flex-shrink: 0; }

main.launcher { padding: 0; }
main.launcher > .alert { margin: 12px 16px 0; }
.lms { display: flex; flex-direction: column; }
.lms-full { height: calc(100vh - 56px); }
/* Lecteur intégré à la page d'une ressource : format 16/9, dans une carte. */
.lms-inline { background: #fff; border: 1px solid var(--bd); border-radius: var(--rl); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.lms-inline .lms-sco { flex: none; width: 100%; aspect-ratio: 16 / 9; }
.lms-inline .lms-barre { padding: 8px 12px; }
.lms-spacer { flex: 1; }
.lms-barre {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--bd);
}
.lms-back { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--bd); color: var(--t2); }
.lms-back:hover { background: var(--ps); color: var(--t1); }
.lms-titre { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lms-titre strong { font-size: 14px; }
.lms-pastilles { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.lms-pastille { font-size: 11.5px; color: var(--t3); background: var(--ps); border: 1px solid var(--bd); border-radius: 12px; padding: 2px 9px; white-space: nowrap; }
.lms-pastille b { color: var(--t1); font-weight: 600; }
.lms-pastille.ok { background: var(--ok-bg); border-color: var(--ok-bd); }
.lms-pastille.ok b { color: var(--ok); }
.lms-pastille.ko { background: var(--err-bg); border-color: #FCA5A5; }
.lms-pastille.ko b { color: var(--err); }
.lms-actions { display: flex; align-items: center; gap: 8px; }
.lms-actions .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
.lms-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--t2); font-weight: 500; margin: 0; }
.lms-mode .form-select { height: 32px; width: auto; font-size: 12.5px; }
.lms-corps { flex: 1; display: flex; min-height: 0; }
.lms-sco { flex: 1; position: relative; background: #111; min-width: 0; }
.lms-sco iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.lms-voile { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: rgba(17, 24, 39, .75); color: #fff; padding: 24px; text-align: center; }
.lms-voile p { max-width: 520px; font-size: 14px; margin: 0; }
.lms-panneau { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--bd); min-height: 0; }
.lms.panneau-ferme .lms-panneau { display: none; }
.lms-onglets { display: flex; border-bottom: 1px solid var(--bd); }
.lms-onglets button { flex: 1; padding: 10px 6px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--t2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lms-onglets button[aria-selected="true"] { color: var(--a); border-bottom-color: var(--a); font-weight: 600; }
.lms-vue { flex: 1; overflow: auto; padding: 12px; font-size: 12px; }
.lms-vue table { width: 100%; border-collapse: collapse; }
.lms-vue th, .lms-vue td { text-align: left; padding: 6px; border-bottom: 1px solid var(--bg); vertical-align: top; }
.lms-vue th { color: var(--t3); font-weight: 600; font-size: 11px; }
.lms-vue .desc { color: var(--t3); font-size: 11px; }
.lms-vue td.ok { color: var(--ok); font-weight: 600; }
.lms-vue td.ko { color: var(--err); font-weight: 600; }
.lms-vue .vide { color: var(--t3); }
#lms-appels { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
#lms-appels li { padding: 4px 0; border-bottom: 1px solid var(--bg); overflow-wrap: anywhere; color: var(--t2); }
#lms-appels li.erreur { color: var(--err); background: #FEF2F2; }
#lms-appels .methode { color: var(--a); font-weight: 600; }
#lms-dump { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }

@media (max-width: 900px) {
    .lms-full { height: auto; }
    .lms-corps { flex-direction: column; }
    .lms-sco { height: 70vh; flex: none; }
    .lms-panneau { width: auto; border-left: 0; border-top: 1px solid var(--bd); max-height: 50vh; }
    .launch-row { flex-wrap: wrap; }
}

/* ---------- Liste des ressources : filtres et tableau ---------- */
.filter-bar { background: #fff; border: 1px solid var(--bd); border-radius: var(--rl); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px; }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-row .search-field { flex: 1 1 320px; max-width: none; }
/* « Tout effacer », à côté de Rechercher : toujours là (grisé sans filtre) pour que la barre ne bouge pas. */
.filter-clear { white-space: nowrap; }
.filter-clear.is-off { opacity: .45; cursor: default; pointer-events: none; }

/* Listes de filtres sous les titres des colonnes. width: 100% les laisse se réduire à la largeur de la colonne,
   au lieu d'élargir la colonne à la taille de leur plus longue option. */
.table .filter-head th { padding: 0 6px 8px; border-bottom: 1px solid var(--bd); font-weight: 400; }
.table .filter-head th:first-child { padding-left: 14px; }
.table .filter-head th:last-child { padding-right: 14px; }
.table thead tr:first-child th { border-bottom: 0; padding-bottom: 6px; }
.filter-head .form-select {
    width: 100%; min-width: 80px; height: 30px; padding: 0 22px 0 8px; font-size: 12.5px;
    background-color: #fff; background-position: right 8px center; text-overflow: ellipsis;
}
.filter-head .form-select.on { border-color: var(--a); color: var(--a); font-weight: 600; }
.filter-head .form-select:disabled { background-color: var(--ps); color: var(--t3); cursor: not-allowed; }
/* Titres de colonnes triables : flèche discrète, pleine sur la colonne triée. */
.table th.sortable a { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.table th.sortable a:hover { color: var(--t1); }
.table th.sortable.sorted a { color: var(--a); }
/* Flèche seulement sur la colonne triée. */
.sort-ico { font-size: 9px; line-height: 1; }
.table.resources tbody tr.empty-row:hover { background: none; }
.table.resources tbody tr.empty-row:hover td:first-child { box-shadow: none; }
.empty-row td { text-align: center; padding: 40px 24px; }

.table.resources td { vertical-align: middle; }
.cell-title { min-width: 240px; }
.tbd { color: #CBD5E1; }
.level { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 6px; background: #EDE9FE; color: #6D28D9; font-size: 12px; font-weight: 700; }
.skill { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 5px; margin-right: 3px; border-radius: 6px; background: #E0F2FE; color: #0369A1; font-size: 11px; font-weight: 700; }
.type-lecon { background: #EDE9FE; color: #7C3AED; }
.type-fiche { background: #FFF0F6; color: var(--a); }
.type-evaluation { background: #FEF3C7; color: #B45309; }
.type-video-interactive { background: #FCE7F3; color: #BE185D; }
.type-jeu { background: #DCFCE7; color: #15803D; }
.type-question { background: #ECFCCB; color: #4D7C0F; }
.type-actualites { background: #FEE2E2; color: #B91C1C; }
.type-activite { background: #EDE9FE; color: #6D28D9; }
.type-exercice { background: #FEF3C7; color: #92400E; }
.type-chatbot { background: #E0F2FE; color: #0369A1; }

/* Fiche d'un chatbot : langue de l'apprenant au-dessus de l'aperçu, qui remplit la hauteur d'un écran. */
.chatbot-language { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.chatbot-language label { font-weight: 600; font-size: 13px; }
.chatbot-language .form-select { width: auto; min-width: 260px; }
.preview.preview-chatbot { height: min(820px, 85vh); min-height: 560px; }

.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--bg); background: var(--ps); flex-wrap: wrap; }
.pager { display: flex; gap: 4px; align-items: center; }
.per-page { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.per-page .muted { padding: 0 2px; }
.pb { display: inline-grid; place-items: center; height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--bd); border-radius: 7px; font-size: 12.5px; color: var(--t2); background: #fff; }
.pb:hover { background: var(--ps); color: var(--t1); }
.pb.on { background: var(--t1); border-color: var(--t1); color: #fff; }
.pb-gap { color: var(--t3); padding: 0 2px; }

/* ---------- Fiche ressource ---------- */
/* Hauteur proportionnelle à la largeur : une page A4 (1 / 1,414) ajustée à la largeur tient entière, avec la barre
   d'outils du lecteur PDF. */
.preview-pdf { height: auto; aspect-ratio: 1 / 1.5; }
/* Enregistrement d'une fiche, au-dessus de l'aperçu (templates/content/_audio.html.twig, public/js/app.js). */
.audio-player { margin: -4px 0 16px; }
.audio-player audio { width: 100%; }
.audio-controls { display: flex; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; background: var(--a1); border: 1px solid var(--a2); border-radius: 999px; }
.audio-play {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: var(--a); color: #fff; box-shadow: 0 2px 6px rgba(226, 0, 110, .3); transition: var(--trans);
}
.audio-play > span { display: inline-flex; }
.audio-play [data-when-paused] { margin-left: 3px; } /* le triangle « lecture » paraît centré */
.audio-play:hover { background: var(--a-hover); transform: scale(1.05); }
.audio-play:focus-visible { outline: 3px solid var(--a2); outline-offset: 2px; }
.is-playing .audio-play { background: var(--t1); box-shadow: none; }
.audio-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.audio-label { font-size: 13px; font-weight: 600; color: var(--t1); }
.audio-seek {
    --progress: 0%; -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 0; border-radius: 3px; cursor: pointer;
    background: linear-gradient(to right, var(--a) var(--progress), #fff var(--progress)); border: 1px solid var(--a2);
}
.audio-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--a); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--a2); }
.audio-seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--a); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--a2); }
.audio-seek:focus-visible { outline: 2px solid var(--a); outline-offset: 3px; }
.audio-time { flex: none; font-size: 12.5px; color: var(--t2); font-variant-numeric: tabular-nums; }
/* Fiche et corrigé : un onglet chacun, ou côte à côte (classe doc-split sur la mise en page, public/js/app.js). */
.doc-tablist { display: flex; gap: 4px; border-bottom: 1px solid var(--bd); margin: -4px 0 14px; }
.doc-tablist button { padding: 8px 14px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--t2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.doc-tablist button:hover { color: var(--t1); }
.doc-tablist button[aria-selected="true"] { color: var(--a); border-bottom-color: var(--a); font-weight: 600; }
.doc-panel:not(.is-active) { display: none; }
.doc-panel-title { display: none; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--t2); }
.focus { margin: 10px 0 0; }
.tags-form .form-field:first-child, .data-form .form-field:first-child, .tags-grid .form-field { margin-top: 0; }
.tags-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tags-form fieldset, .tags-form .form-field > div { border: 0; padding: 0; margin: 0; }
.tags-form input[type=checkbox] + label, .tags-form .form-check label { display: inline; font-weight: 400; color: var(--t1); font-size: 13px; margin: 0 0 0 6px; }
.tags-form .actions, .data-form .actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 14px; }
.skill-checks { display: grid; gap: 6px; }
.level-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
/* Données corrigées à la main : le champ est marqué, la valeur du dépôt rappelée dessous. */
.data-form .is-overridden :is(.form-input, .form-select) { border-color: var(--a); }
.data-form .is-overridden .help-text { color: var(--a); }
.data-reset { margin-top: 4px; }
.history > summary { cursor: pointer; margin-bottom: 0; }
.history[open] > summary { margin-bottom: 12px; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }
.history-item { overflow-wrap: anywhere; }
.table.resources .level + .level { margin-left: 3px; }
.technical { padding: 14px 24px; }
.technical > summary { margin: 0; cursor: pointer; list-style: none; }
.technical > summary::-webkit-details-marker { display: none; }
.technical[open] > summary { margin-bottom: 16px; }
.technical-hd { font-size: 12.5px; font-weight: 600; color: var(--t2); margin: 18px 0 8px; }

/* ---------- Paramètres ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.settings-table { border: 1px solid var(--bd); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
form.inline { display: inline; }
.icon-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--bd); border-radius: 6px; background: #fff; color: var(--t2); cursor: pointer; padding: 0; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.actions-cell { text-align: right; }
.scard.narrow { max-width: 640px; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }

/* ---------- Logo Onlineformapro et bouton Accueil ---------- */
.tb-nav a.tb-brand { padding: 0 10px 0 0; border: 0; margin: 0; }
.tb-brand img { display: block; height: 32px; width: auto; }
.tb-nav a.tb-home {
    align-self: center; height: 36px; padding: 0 12px; border: 0; margin: 0; border-radius: 8px;
    background: #fff; color: var(--t1); font-weight: 500;
}
.tb-nav a.tb-home:hover { background: var(--ps); }
.tb-nav a.tb-home[aria-current] { color: var(--t1); font-weight: 500; border-bottom: 0; }
/* Téléphone : « Accueil » et « Ressources » sans icône, pour tenir sur la largeur avec le logo et le compte. */
@media (max-width: 480px) {
    .tb-nav a.tb-home { padding: 0 8px; }
    .tb-nav a.tb-home svg { display: none; }
}

/* ---------- Fenêtre modale (préférences) ---------- */
dialog.modal {
    width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--bd); border-radius: 14px;
    box-shadow: 0 20px 50px rgba(17, 24, 39, .25); color: var(--t1);
}
dialog.modal::backdrop { background: rgba(17, 24, 39, .4); }
dialog.modal form { padding: 20px 24px 22px; }
.modal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-hd h2 { font-family: 'Geist', 'Inter', sans-serif; font-size: 18px; font-weight: 600; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
/* Progression de « Mettre à jour les ressources » (public/js/app.js). Bouton pendant une mise à jour : teinté, icône
   qui tourne, avancement dans l'intitulé. */
.btn .sync-ico { display: inline-flex; }
.btn.is-syncing { background: var(--a1); border-color: var(--a2); color: var(--a); font-variant-numeric: tabular-nums; }
.btn.is-syncing .sync-ico { animation: sync-spin 1.2s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-syncing .sync-ico { animation: none; } }
.modal-body { padding: 20px 24px 22px; }
.sync-step { margin: 0 0 10px; font-size: 14px; font-weight: 500; }
.sync-bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--bg); overflow: hidden; }
.sync-bar::-webkit-progress-bar { background: var(--bg); border-radius: 4px; }
.sync-bar::-webkit-progress-value { background: var(--a); border-radius: 4px; transition: width .3s ease; }
.sync-bar::-moz-progress-bar { background: var(--a); border-radius: 4px; }
/* En attente d'un total (git pull, recherche) : une bande qui défile. */
.sync-bar:indeterminate { background: linear-gradient(90deg, var(--bg) 0 30%, var(--a) 30% 55%, var(--bg) 55%) 0 0 / 250% 100%; animation: sync-wait 1.4s linear infinite; }
.sync-bar:indeterminate::-webkit-progress-bar { background: transparent; }
.sync-bar:indeterminate::-moz-progress-bar { background: transparent; }
@keyframes sync-wait { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .sync-bar:indeterminate { animation: none; background: var(--a2); } }
.sync-meta { display: flex; justify-content: space-between; margin-top: 6px; min-height: 18px; color: var(--t2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sync-modal:focus { outline: none; }
.sync-current { margin: 8px 0 0; min-height: 18px; color: var(--t3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Bilan : pastille, titre et détail, puis les chiffres en tuiles. */
.sync-head { display: flex; gap: 12px; align-items: flex-start; }
.sync-head > div { display: flex; flex-direction: column; gap: 2px; }
.sync-head strong { font-size: 15px; font-weight: 600; }
.sync-head [data-sync-detail] { color: var(--t2); font-size: 13px; }
.sync-badge { display: inline-grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; }
.sync-badge[hidden] { display: none; }
.sync-badge.ok { background: var(--ok-bg); color: var(--ok); }
.sync-badge.warn { background: var(--warn-bg); color: var(--warn); }
.sync-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 0; }
@media (max-width: 420px) { .sync-stats { grid-template-columns: repeat(2, 1fr); } }
.sync-stats[hidden] { display: none; }
.sync-stats > div { padding: 10px 12px; border: 1px solid var(--bd); border-radius: var(--r); background: var(--ps); }
.sync-stats dt { color: var(--t2); font-size: 12px; }
.sync-stats dd { margin: 2px 0 0; font-family: 'Geist', 'Inter', sans-serif; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sync-stats > .is-zero dd { color: var(--t3); }
.sync-errors { margin-top: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.sync-errors ul { max-height: 160px; overflow: auto; margin: 6px 0 0; padding-left: 18px; color: var(--t1); font-size: 12.5px; }
.switch-row { display: flex; gap: 14px; align-items: flex-start; margin: 0; font-weight: 400; cursor: pointer; }
.switch-row > span:last-child { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex-shrink: 0; width: 36px; height: 20px; border-radius: 10px; background: var(--bd); transition: var(--trans); margin-top: 2px; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: var(--trans); }
.switch-row input:checked + .switch { background: var(--a); }
.switch-row input:checked + .switch::after { left: 18px; }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--a1); }

/* ---------- Tableau des ressources : colonnes centrées, validation ---------- */
.table.resources th.center, .table.resources td.center { text-align: center; }
.table.resources .skill:last-child { margin-right: 0; }
.cell-collection { color: var(--t2); font-size: 12.5px; }
.validated { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-bd); cursor: help; }
.vocab-hit { color: var(--a); }

/* ---------- Lecteur : vue agrandie et plein écran du navigateur ---------- */
.lms-inline:not(.lms-expanded) .lms-when-expanded { display: none; }
.lms-expanded {
    position: fixed; inset: 0; z-index: 300; margin: 0; border: 0; border-radius: 0; box-shadow: none;
}
.lms-expanded .lms-barre { padding: 8px 16px; }
.lms-expanded .lms-corps { flex: 1; min-height: 0; }
.lms-expanded .lms-sco { flex: 1; aspect-ratio: auto; width: auto; }
html.lms-sans-defilement, html.lms-sans-defilement body { overflow: hidden; }
.lms-sco:fullscreen { background: #000; }
.lms-sco:fullscreen iframe { width: 100%; height: 100%; }
.lms-sco:-webkit-full-screen { background: #000; width: 100%; height: 100%; }
button.lms-back { background: #fff; padding: 0; cursor: pointer; }

/* ---------- Iframes à hauteur automatique (public/js/iframe-resizer.js) : seulement lues dans la page ---------- */
.preview.auto-height { height: var(--auto-height); }
/* Agrandir l'aperçu (boutons de l'en-tête, choix mémorisé pour les autres fiches, public/js/app.js). */
.scard-hd-actions { order: 1; display: inline-flex; gap: 6px; text-transform: none; letter-spacing: 0; }
.btn-icon { width: 28px; padding: 0; }
.btn-icon > span { display: inline-flex; }
.btn-icon > [hidden] { display: none; }
.btn-icon[aria-pressed="true"] { background: var(--a1); color: var(--a); border-color: var(--a2); }
/* En hauteur : au moins deux fois la hauteur normale. */
.preview.preview-tall { min-height: 1400px; }
/* En largeur : une seule colonne ; la colonne de droite passe sous l'aperçu (ses cartes côte à côte). */
/* Fiche et corrigé côte à côte : même mise en page, les deux documents visibles, sans onglets. */
@media (min-width: 1001px) {
    .layout.layout-wide, .layout.doc-split { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
    .layout-wide .layout-main, .doc-split .layout-main { display: contents; }
    .layout-wide .layout-side, .doc-split .layout-side { order: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); column-gap: 16px; align-items: start; }
    .layout-wide .preview-card ~ *, .doc-split .preview-card ~ * { order: 2; }
    .doc-split .doc-tablist { display: none; }
    .doc-split .doc-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .doc-split .doc-panel { display: block; }
    .doc-split .doc-panel-title { display: block; }
}
/* Fenêtre étroite : déjà une seule colonne. */
@media (max-width: 1000px) { .preview-wide-toggle, .doc-split-toggle { display: none; } }
.lms-inline:not(.lms-expanded) .lms-sco:not(:fullscreen):has(> iframe.auto-height) { aspect-ratio: auto; }
.lms-inline:not(.lms-expanded) .lms-sco:not(:fullscreen) > iframe.auto-height { height: var(--auto-height); }

/* ---------- Champ mot de passe avec œil ---------- */
.password-field { position: relative; }
.password-field .form-input { padding-right: 42px; }
.password-toggle {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
    border: 0; border-radius: 6px; background: none; color: var(--t3); cursor: pointer;
}
.password-toggle:hover { color: var(--t1); background: var(--ps); }
.password-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--a1); color: var(--t1); }
.password-toggle [hidden] { display: none; }

/* Historique des ajouts (admin) : chiffres, filtre par type, une ligne d'en-tête par jour. */
.history-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.history-filter { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.history-filter .form-select { width: auto; min-width: 190px; height: var(--ch); }
.table tbody tr.history-day, .table tbody tr.history-day:hover { background: var(--ps); }
.table tbody tr.history-day:hover td:first-child { box-shadow: none; }
.table tr.history-day th { padding-top: 14px; font-size: 12.5px; color: var(--t1); text-transform: none; }
