:root { --ink:#24313f; --muted:#65707d; --paper:#fffdf9; --canvas:#f1eee7; --accent:#1f3a5f; --accent-dark:#16293f; --cta:#8a6a2f; --cta-dark:#6f5526; --border:#ded8cc; --ok:#15734b; --wrong:#b3392d; }
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:radial-gradient(circle at top right,#e7d4bd 0,transparent 32rem),var(--canvas); font-family:Georgia, "Times New Roman", serif; }
.bg-mosaic { position:fixed; inset:0; z-index:0; display:grid; grid-template-columns:repeat(5, 1fr); grid-template-rows:repeat(3, 1fr); gap:2px; overflow:hidden; }
body.dragging-topbar .bg-mosaic { pointer-events:none; }
body.dragging-topbar { touch-action:none; user-select:none; }
.bg-tile { position:relative; overflow:hidden; background:#c9c1ae; cursor:pointer; }
.bg-tile.touched, .bg-tile:hover { z-index:2; }
.bg-tile img { width:100%; height:100%; object-fit:cover; display:block; filter:blur(6px) grayscale(.3); opacity:.45; transform:scale(1.15); transition:filter .35s, opacity .35s, transform .35s; }
.bg-tile:hover img, .bg-tile.touched img { filter:blur(0) grayscale(0); opacity:1; transform:scale(1.3); }
button, input { font:inherit; }

.app-shell { width:min(1600px, calc(100% - 32px)); margin:0 auto; padding:56px 0 20px; display:flex; align-items:stretch; gap:26px; min-height:100vh; pointer-events:none; position:relative; z-index:1; }
.sidebar { flex:1 1 0; display:flex; flex-direction:column; gap:14px; justify-content:center; position:sticky; top:20px; align-self:stretch; background:#f6ecd6; border-radius:12px; padding:28px; }
.main-content { flex:1 1 0; min-width:0; display:flex; flex-direction:column; justify-content:flex-start; }
.main-content > * { pointer-events:auto; }
.sidebar-illustration { width:100%; height:100%; flex:1 1 auto; min-height:0; object-fit:contain; border-radius:6px; display:block; }
.illustration-caption { margin:0; font-family:Georgia, "Times New Roman", serif; font-size:.85rem; font-style:italic; color:var(--muted); line-height:1.4; text-align:center; }
.eyebrow { margin:0 0 7px; font-family:Arial,sans-serif; font-size:.72rem; font-weight:700; letter-spacing:.13em; color:var(--accent); }
h1,h2,h3,p { margin-top:0; } h2 { font-size:1.7rem; font-weight:500; }

.import-button,.folder-button,.primary-button,.secondary-button { display:inline-flex; align-items:center; justify-content:center; cursor:pointer; border-radius:5px; border:0; padding:13px 17px; text-align:center; font-family:Arial,sans-serif; font-size:1rem; font-weight:700; transition:transform .15s, background .15s; }
.import-button,.primary-button { color:white; background:var(--cta); } .import-button:hover,.primary-button:hover { background:var(--cta-dark); transform:translateY(-1px); } .import-button input,.folder-button input,.primary-button input[type="file"] { display:none; }
.folder-button { color:var(--ink); background:transparent; border:1px solid var(--border); }.folder-button:hover { background:#fff; transform:translateY(-1px); }
.secondary-button { color:var(--accent); background:transparent; border:1px solid var(--accent); } .secondary-button:hover { background:#fff; color:var(--accent-dark); border-color:var(--accent-dark); }.secondary-button:disabled { cursor:not-allowed; opacity:.45; }

.welcome-panel { max-width:640px; width:100%; margin:auto; padding:30px 46px; text-align:center; background:rgba(255,253,249,.97); border:1px solid var(--border); box-shadow:0 16px 35px rgba(54,45,31,.08); border-radius:8px; position:relative; z-index:1; }

/* Mode « fenêtre superposée » : la page de configuration d'un exercice s'affiche par-dessus le
   menu des exercices (resté visible en fond), plutôt que de le remplacer entièrement — pour voir
   tout de suite l'effet sur le bouton en refermant. */
.config-popup-mode { position:fixed !important; top:50%; left:50%; transform:translate(-50%, -50%); z-index:151; max-height:88vh; overflow-y:auto; width:min(680px, 92vw); box-shadow:0 20px 60px rgba(0,0,0,.4); }
/* Croix de fermeture standard d'une fenêtre modale, dans son coin supérieur droit — invisible
   hors du mode fenêtre superposée (elle ne sert à rien sur une page normale). */
.modal-close-x { display:none; }
.config-popup-mode .modal-close-x { display:flex; position:absolute; top:12px; right:12px; width:32px; height:32px; border-radius:50%; background:#fff; border:1px solid var(--border); color:var(--ink); font-size:1rem; align-items:center; justify-content:center; cursor:pointer; z-index:5; box-shadow:0 1px 4px rgba(0,0,0,.15); }
.config-popup-mode .modal-close-x:hover { background:var(--wrong); color:#fff; border-color:var(--wrong); }
.config-popup-mode .settings-title-band { padding-right:60px; }
/* Panneaux "hauts" (plusieurs accordéons empilés) : marge fixe en haut plutôt que centrage
   vertical automatique, sinon leur partie supérieure dépasse au-dessus de l'écran et tout
   semble tassé vers le bas. Plus larges aussi, pour respirer davantage. */
#impregnation-setup-panel, #quiz-setup-panel, #intrus-setup-panel, #reconstitution-setup-panel, #vraifaux-setup-panel, #famille-setup-panel, #enigme-setup-panel { margin:30px auto; max-width:720px; }
.enig-image-wrap { position:relative; display:inline-block; max-width:100%; }
.enig-image-wrap img { max-width:100%; max-height:min(760px,74vh); display:block; }
.enig-circle { position:absolute; border:3px solid #ffd23f; border-radius:50%; box-shadow:0 0 0 2px rgba(0,0,0,.5); transform:translate(-50%, -50%); display:flex; align-items:flex-end; justify-content:center; }
.enig-circle span { position:absolute; top:-24px; left:50%; transform:translateX(-50%); background:#ffd23f; color:#1b1c1e; font-family:Arial,sans-serif; font-weight:700; font-size:.85rem; width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.enig-item { margin-bottom:18px; padding-bottom:14px; border-bottom:1px solid var(--border); }
.enig-item:last-child { border-bottom:0; }
.enig-item-title { font-family:Arial,sans-serif; font-size:.82rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:8px; }
.enig-person-row { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.enig-person-row .enig-letter { flex:0 0 26px; height:26px; border-radius:50%; background:#ffd23f; color:#1b1c1e; font-family:Arial,sans-serif; font-weight:700; font-size:.85rem; display:flex; align-items:center; justify-content:center; }
.enig-person-row input { flex:1; padding:8px; border:1px solid #cfc8bc; border-radius:4px; font-family:Arial,sans-serif; }
.enig-qcm-question { font-size:1rem; margin-bottom:10px; }
.enig-qcm-option { display:block; width:100%; text-align:left; padding:10px 12px; margin-bottom:6px; border:1px solid var(--border); border-radius:5px; background:#fff; cursor:pointer; font-family:Arial,sans-serif; font-size:.9rem; transition:border-color .15s, background .15s; }
.enig-qcm-option:hover:not(:disabled) { border-color:var(--accent); background:#f7f2ea; }
.enig-qcm-option.selected { border-color:var(--accent); background:#eef2f6; }
.enig-qcm-option.correct { border-color:var(--ok); background:#eaf6f0; }
.enig-qcm-option.wrong { border-color:var(--wrong); background:#fbeceb; }
.enig-person-verdict { font-family:Arial,sans-serif; font-size:.85rem; font-weight:700; margin-left:6px; }
.enig-correct-note { display:block; margin-top:6px; color:var(--ok); font-weight:700; font-family:Arial,sans-serif; font-size:.85rem; }
.fam-image-grid { display:grid; grid-template-columns:repeat(4, 1fr); grid-auto-rows:1fr; gap:10px; width:100%; min-height:min(640px,72vh); padding:10px; background:#1b1c1e; }
.fam-image-grid.fam-count-6 { grid-template-columns:repeat(3, 1fr); }
.chrono-row { display:grid; gap:10px; padding:10px; background:#1b1c1e; min-height:min(260px,30vh); }
.chrono-row .fam-image-cell, .chrono-row .chrono-target-slot { min-height:min(240px,28vh); }
.chrono-row img { max-height:min(230px,27vh); width:100%; object-fit:contain; }
@media (max-width:640px) {
  .chrono-row { min-height:min(160px,20vh); gap:6px; padding:6px; }
  .chrono-row .fam-image-cell, .chrono-row .chrono-target-slot { min-height:min(145px,18vh); }
  .chrono-row img { max-height:min(140px,17vh); }
}
.fam-result-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; width:100%; padding:14px; background:#1b1c1e; min-height:min(500px,60vh); }
.fam-result-rows { display:flex; flex-direction:column; gap:14px; width:100%; background:#1b1c1e; padding:14px 0; }
.fam-result-rows .fam-result-grid { min-height:min(230px,28vh); padding:0 14px; }
.fam-result-pending { border:2px dashed #444; border-radius:6px; min-height:100%; }
.fam-result-row-wrong .fam-result-item img { border-color:var(--wrong); }
.fam-result-item { display:flex; flex-direction:column; gap:8px; }
.fam-result-item img { width:100%; height:min(220px,32vh); object-fit:contain; background:#1b1c1e; border-radius:6px; border:3px solid var(--ok); }
.fam-result-caption { font-family:Arial,sans-serif; font-size:.78rem; color:#fff; text-align:center; line-height:1.35; }
.fam-result-caption strong { display:block; font-size:.85rem; }
@media (max-width:640px) {
  .fam-result-grid { grid-template-columns:repeat(2, 1fr); }
}
.fam-image-cell { position:relative; border:3px solid transparent; border-radius:6px; padding:2px; background:none; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:border-color .15s; }
.chrono-target-slot { min-height:100%; border:2px dashed #555; border-radius:6px; background:#242526; display:flex; align-items:center; justify-content:center; color:#777; font-family:Arial,sans-serif; font-size:.78rem; cursor:pointer; position:relative; }
.chrono-target-slot.filled { border-style:solid; border-color:var(--accent); cursor:grab; }
.chrono-target-slot img { width:100%; height:100%; object-fit:contain; border-radius:4px; }
.chrono-target-slot .chrono-slot-num { position:absolute; top:4px; left:4px; width:22px; height:22px; border-radius:50%; background:var(--accent); color:#fff; font-weight:700; font-size:.8rem; display:flex; align-items:center; justify-content:center; }
.chrono-source-item.used { opacity:.25; pointer-events:none; }
.chrono-source-item.picked { border-color:var(--accent); box-shadow:0 0 0 3px rgba(31,58,95,.35); }
.chrono-source-item { touch-action:none; }
.chrono-target-slot.wrong { border-color:var(--wrong); }
.chrono-target-slot.right { border-color:var(--ok); }
.fam-image-cell img { width:100%; height:100%; object-fit:contain; background:#1b1c1e; border-radius:4px; display:block; }
.fam-image-cell.selected { border-color:var(--accent); }
.fam-image-cell.selected::after { content:attr(data-num); position:absolute; top:6px; right:6px; width:26px; height:26px; border-radius:50%; background:var(--accent); color:#fff; font-weight:700; font-size:1rem; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 6px rgba(0,0,0,.4); }
.fam-title-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.fam-title-row .fam-num-badge { flex:0 0 28px; height:28px; border-radius:50%; background:var(--accent); color:#fff; font-family:Arial,sans-serif; font-weight:700; font-size:.9rem; display:flex; align-items:center; justify-content:center; }
.fam-title-row .fam-drop-slot { flex:1; min-height:40px; padding:9px 12px; border:2px dashed #cfc8bc; border-radius:4px; font-family:Arial,sans-serif; font-size:.9rem; display:flex; align-items:center; cursor:pointer; color:var(--muted); transition:border-color .15s, background .15s; }
.fam-title-row .fam-drop-slot:hover { border-color:var(--accent); background:#f7f2ea; }
.fam-title-row .fam-drop-slot.filled { border-style:solid; color:var(--ink); font-weight:700; }
.fam-title-row .fam-drop-slot.vf-was-wrong { border-color:var(--wrong); color:var(--wrong); text-decoration:line-through; }
.fam-title-row .fam-drop-slot.vf-updated { border-color:var(--ok); color:var(--ok); text-decoration:none; }
.fam-labels-pool { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.fam-label-chip { padding:8px 14px; border:1px solid var(--accent); border-radius:20px; background:#fff; color:var(--accent); font-family:Arial,sans-serif; font-size:.85rem; font-weight:700; cursor:pointer; transition:background .15s; touch-action:none; }
.fam-label-chip:hover:not(:disabled) { background:#f7f2ea; }
.fam-label-chip.picked { background:var(--accent); color:#fff; }
.fam-label-chip:disabled { opacity:.35; cursor:not-allowed; }
.fam-image-cell.correct { border-color:var(--ok); }
.fam-image-cell.wrong { border-color:var(--wrong); }
.fam-image-cell:disabled { cursor:not-allowed; }
.fam-rubrique-row { margin-bottom:14px; }
.fam-rubrique-row label { display:block; font-family:Arial,sans-serif; font-size:.82rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:6px; }
.fam-rubrique-row input[type="text"] { width:100%; padding:10px; border:1px solid #cfc8bc; border-radius:4px; font-family:Arial,sans-serif; font-size:.95rem; }
.fam-rubrique-row .fam-verdict { font-weight:700; margin-left:8px; }
.fam-rubrique-row .fam-correct-answer { display:block; margin-top:4px; color:var(--ok); font-weight:700; font-family:Arial,sans-serif; }
.vf-line-wrong { color:var(--wrong); text-decoration:line-through; }
.vf-line-correct { color:var(--ok); }
.vf-field-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.vf-false-alarm-note { flex-basis:100%; font-family:Arial,sans-serif; font-size:.75rem; color:var(--wrong); font-style:italic; }
.vf-field-row:last-child { border-bottom:0; }
.vf-field-row .vf-field-label { flex:0 0 100px; font-family:Arial,sans-serif; font-size:.78rem; font-weight:700; color:#9aa3ab; text-transform:uppercase; letter-spacing:.03em; }
.vf-field-row .vf-field-value { flex:1; font-size:1.02rem; font-weight:700; color:var(--ink); transition:color .4s; }
.vf-field-row .vf-field-value.vf-updated { color:var(--ok); }
.vf-field-row .vf-field-value.vf-was-wrong { color:var(--wrong); text-decoration:line-through; }
.vf-toggle { flex:0 0 auto; display:flex; border:1px solid var(--border); border-radius:20px; overflow:hidden; }
.vf-toggle button { -webkit-appearance:none; appearance:none; border:0; background:#fff; padding:5px 12px; font-family:Arial,sans-serif; font-size:.75rem; font-weight:700; cursor:pointer; color:var(--muted); }
.vf-toggle button.active[data-val="true"] { background:var(--ok); color:#fff; }
.vf-toggle button.active[data-val="false"] { background:var(--wrong); color:#fff; }
.vf-toggle button:disabled { cursor:not-allowed; opacity:1; }
.recon-detail-crop { width:100%; height:100%; min-height:min(640px,72vh); background-repeat:no-repeat; background-size:340% auto; border-radius:4px; }
.recon-full-image { max-width:100%; max-height:min(820px,74vh); display:block; margin:0 auto; }
.results-panel { max-width:none; width:100%; margin:0 auto; padding:52px 46px; text-align:center; background:rgba(255,253,249,.86); border:1px solid var(--border); box-shadow:0 16px 35px rgba(54,45,31,.08); border-radius:8px; }
.welcome-panel p,.results-panel p { color:var(--muted); line-height:1.5; font-size:1.02rem; }.hint { margin:23px auto 0; font-size:1rem; }
.app-brand-name { text-align:center; font-family:Georgia,"Times New Roman",serif; font-weight:700; letter-spacing:.12em; font-size:1.1rem; color:var(--accent); margin:0 0 4px; }
.home-eyebrow { text-align:center; }
.home-tagline { font-family:Georgia,"Times New Roman",serif; font-weight:400; font-size:1.32rem; line-height:1.3; margin:0 0 14px; color:var(--ink); }
.home-illustration { margin:0 0 14px; }
.home-illustration img { width:100%; max-height:220px; object-fit:contain; border-radius:6px; display:block; background:#f6ecd6; }
.home-illustration figcaption { margin:6px 0 0; font-family:Georgia,"Times New Roman",serif; font-size:.78rem; font-style:italic; color:var(--muted); }
.home-mode-buttons { display:grid; grid-template-columns:1fr; gap:16px; margin-top:8px; }
.home-mode-buttons.account-buttons-row { grid-template-columns:1fr 1fr; }
.training-exercise-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin-top:6px; }
.training-exercise-grid .home-mode-button { padding:12px 8px; position:relative; }
.quiz-final-button { width:100%; margin-top:12px; padding:13px 10px; position:relative; background:var(--accent); }
.quiz-final-button:hover { background:var(--accent-dark, #16293f); }
.exercise-num { display:block; font-family:Arial,sans-serif; font-weight:700; font-size:.62rem; text-transform:uppercase; letter-spacing:.05em; opacity:.75; margin-bottom:2px; }
.exercise-summary { display:block; font-family:Arial,sans-serif; font-weight:400; font-size:.68rem; opacity:.85; margin-top:2px; }
.exercise-summary-edit { display:none; position:absolute; top:2px; right:2px; width:34px; height:34px; font-size:1rem; cursor:pointer; opacity:.95; background:rgba(255,255,255,.92); border-radius:50%; align-items:center; justify-content:center; box-shadow:0 1px 4px rgba(0,0,0,.25); z-index:2; }
.exercise-summary:not(:empty) + .exercise-summary-edit { display:flex; }
.exercise-summary-edit:hover, .exercise-summary-edit:active { opacity:1; background:#fff; }
.score-filter-btn.inactive { background:transparent; color:var(--cta); }
.score-filter-btn.inactive:hover { background:#f7f2ea; }
.intrus-mode-btn.inactive { background:transparent; color:var(--cta); }
.intrus-mode-btn.inactive:hover { background:#f7f2ea; }
.intrus-choice-list { display:grid; gap:12px; }
.intrus-choice-btn { display:block; width:100%; text-align:left; padding:14px 16px; border:1px solid var(--border); border-radius:6px; background:#fff; color:var(--ink); font-family:Arial,sans-serif; font-size:.95rem; cursor:pointer; transition:border-color .15s, background .15s; }
.intrus-choice-btn:hover:not(:disabled) { border-color:var(--accent); background:#f7f2ea; }
.intrus-choice-btn img { width:100%; height:140px; object-fit:contain; background:#1b1c1e; border-radius:4px; display:block; margin-bottom:8px; }
.intrus-choice-btn.correct { border-color:var(--ok); background:#eaf6f0; }
.intrus-choice-btn.wrong { border-color:var(--wrong); background:#fbeceb; }
.intrus-choice-btn:disabled { cursor:not-allowed; }
.intrus-image-choices { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; width:100%; height:100%; }
.intrus-image-choice { border:2px solid transparent; border-radius:6px; padding:6px; background:none; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:border-color .15s, background .15s; }
.intrus-image-choice:hover:not(:disabled) { border-color:var(--accent); background:rgba(255,255,255,.06); }
.intrus-image-choice img { width:100%; max-height:min(600px, 68vh); object-fit:contain; display:block; }
.intrus-image-choice.correct { border-color:var(--ok); }
.intrus-image-choice.wrong { border-color:var(--wrong); }
.intrus-image-choice:disabled { cursor:not-allowed; }
.intrus-image-choices:has(.intrus-image-choice-solo) { display:flex; align-items:center; justify-content:center; }
.intrus-image-choice-solo { width:100%; }
.intrus-image-choice-solo img { max-height:min(760px, 78vh); }
.intrus-verdict { font-family:Arial,sans-serif; font-weight:700; }
.correction-details, #intrus-correction-details { display:grid; grid-template-columns:max-content 1fr; column-gap:14px; row-gap:4px; align-items:baseline; margin-top:16px; }
#intrus-correction-details .correction-label { grid-column:1; font-family:Arial,sans-serif; font-size:.78rem; font-weight:700; color:#9aa3ab; text-transform:uppercase; letter-spacing:.03em; }
#intrus-correction-details .correction-value { grid-column:1/-1; font-size:1.05rem; font-weight:700; color:var(--ink); line-height:1.3; margin-bottom:14px; }
.home-mode-button { position:relative; padding:20px; border:1px solid var(--cta); border-radius:4px; background:var(--cta); color:#fff; cursor:pointer; text-align:center; transition:background .15s; }
.home-mode-button:hover { background:var(--cta-dark); border-color:var(--cta-dark); }
.home-mode-button .label { display:block; font-family:Arial,sans-serif; font-size:.98rem; font-weight:700; color:#fff; margin-bottom:4px; }
.home-mode-button .desc { display:block; font-family:Georgia,"Times New Roman",serif; font-size:.83rem; color:var(--muted); font-style:italic; }
.tooltip-bubble { position:absolute; left:50%; bottom:calc(100% + 10px); transform:translateX(-50%) translateY(4px); width:240px; background:var(--ink); color:#fff; font-family:Arial,sans-serif; font-size:.76rem; font-weight:400; font-style:normal; line-height:1.45; padding:10px 12px; border-radius:5px; opacity:0; pointer-events:none; transition:opacity .15s, transform .15s; z-index:20; }
.tooltip-bubble::after { content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%); border:6px solid transparent; border-top-color:var(--ink); }
.home-mode-button:hover .tooltip-bubble,
.home-mode-button:focus-visible .tooltip-bubble,
.home-mode-button.show-tooltip .tooltip-bubble { opacity:1; transform:translateX(-50%) translateY(0); }
.intro-banner { background:#f3e6c9; color:var(--ink); padding:14px 20px; border-radius:6px; font-family:Arial,sans-serif; font-size:.92rem; font-weight:700; line-height:1.42; text-align:justify; margin-bottom:14px; }
#training-hub-panel .home-tagline { font-size:1.25rem; margin-bottom:12px; }
#training-hub-panel .intro-banner { font-size:.95rem; line-height:1.48; padding:16px 20px; margin-bottom:16px; }
.intro-banner a { color:var(--accent-dark); text-decoration:underline; }
.intro-banner a:hover { color:var(--accent); }
@keyframes introPulse { 0%,100% { box-shadow:0 0 0 0 rgba(31,58,95,.6); } 50% { box-shadow:0 0 0 8px rgba(31,58,95,0); } }
.intro-highlight { animation:introPulse 1s ease-in-out 3; }
@keyframes introIconPulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.35; transform:scale(1.25); } }
.intro-icon-sync { display:inline-block; animation:introIconPulse 1s ease-in-out 3; }
.account-bar { display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:6px; font-family:Arial,sans-serif; font-size:.85rem; color:var(--muted); }
.account-buttons-row { margin-bottom:14px; }
.account-slot { grid-column:2; }
#account-login-button, #account-page-button { grid-column:1; }
.account-slot-email { font-size:.68rem; font-weight:400; opacity:.85; word-break:break-all; }
.account-error { color:var(--wrong); font-family:Arial,sans-serif; font-size:.85rem; margin:6px 0 0; }
.account-notice { color:var(--ok); font-family:Arial,sans-serif; font-size:.85rem; margin:6px 0 0; line-height:1.4; }
#account-form { display:flex; flex-direction:column; gap:12px; }
#account-form label { display:flex; flex-direction:column; gap:5px; font-family:Arial,sans-serif; font-size:.85rem; font-weight:700; color:var(--ink); text-align:left; }
#account-form input { padding:10px; border:1px solid #cfc8bc; border-radius:4px; font-size:1rem; }
.score-save-box { margin-top:18px; }
.my-scores-box { margin-top:22px; padding-top:16px; border-top:1px solid var(--border); text-align:left; }
.my-scores-box h3 { font-size:.95rem; margin-bottom:8px; }
.my-scores-box ul { list-style:none; padding:0; margin:0; font-family:Arial,sans-serif; font-size:.88rem; color:var(--muted); display:grid; gap:4px; }

.account-panel { text-align:left; }
.account-table-scroll { overflow-x:auto; }
.account-table { width:100%; min-width:720px; border-collapse:collapse; font-family:Arial,sans-serif; font-size:.85rem; }
.account-table th { text-align:left; padding:8px 10px; border-bottom:2px solid var(--border); color:var(--muted); font-size:.74rem; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
.account-table td { padding:9px 10px; border-bottom:1px solid var(--border); color:var(--ink); vertical-align:middle; }
.account-table td.col-contenu, .account-table th.col-contenu { min-width:220px; } /* colonne élargie pour les sélections de contenu étendues */
.rubriques-tested { font-size:.74rem; color:var(--muted); font-weight:400; }
.account-page-footnote { margin-top:26px; }
.delete-score-button { border:none; background:none; color:var(--wrong); cursor:pointer; font-size:1rem; padding:2px 5px; margin-left:4px; border-radius:50%; line-height:1; }
.delete-score-button:hover { background:rgba(197,79,56,.15); }
.evolution-up { color:var(--ok); font-weight:700; }
.evolution-down { color:var(--wrong); font-weight:700; }
.evolution-flat { color:var(--muted); }
.account-page-actions { display:flex; gap:12px; margin:0 0 20px; flex-wrap:wrap; justify-content:center; }
.copyright-notice { margin:16px auto 0; padding-top:10px; border-top:1px solid var(--border); font-family:Arial,sans-serif; font-size:.62rem; color:var(--muted); line-height:1.4; }
.copyright-more-link { font-size:.62rem; text-decoration:underline; }

.rubriques-fieldset { margin:0 0 6px; padding:18px 20px; border:1px solid var(--border); border-radius:6px; text-align:left; background:rgba(255,255,255,.5); }
.rubriques-fieldset legend { padding:0 4px; font-family:Arial,sans-serif; font-size:1.1rem; font-weight:700; color:var(--ink); text-align:left; line-height:1.35; }
.rubrique-option { display:flex; align-items:center; gap:10px; font-family:Arial,sans-serif; font-size:1.02rem; color:var(--ink); padding:7px 0; cursor:pointer; }
.rubrique-option input { width:19px; height:19px; accent-color:var(--accent); cursor:pointer; }
.rubrique-option.disabled { opacity:.5; cursor:not-allowed; }

.choices-panel { text-align:left; margin-bottom:16px; }
.choices-group { border:0; border-top:1px solid var(--border); margin:0 0 16px; padding:14px 0 0; }
.choices-group legend { padding:0; font-family:Arial,sans-serif; font-size:.82rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:6px; cursor:help; }
.choices-group .rubrique-option { padding:5px 0; }
.choices-group .modal-hint { margin:6px 0 0; }
.accordion-group { margin-bottom:10px; }
.accordion-toggle { display:block; width:100%; text-align:left; padding:14px 16px; border:1px solid var(--border); border-radius:6px; background:#fff; color:var(--ink); font-family:Arial,sans-serif; font-weight:700; font-size:.95rem; cursor:pointer; transition:border-color .15s, background .15s; }
.accordion-toggle:hover { border-color:var(--accent); background:#f7f2ea; }
.accordion-toggle.accordion-toggle-done { border-color:var(--accent); color:var(--accent-dark); }
.accordion-body { padding:14px 4px 4px; text-align:left; }
.accordion-body .rubrique-option { padding:6px 0; }
.accordion-body .modal-hint { margin:8px 0 12px; font-size:.82rem; }
.accordion-body .modal-subheading { margin:14px 0 8px; font-family:Arial,sans-serif; font-size:.82rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
.accordion-columns { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.settings-title-band { background:#fff; margin:-52px -46px 24px; padding:24px 46px; border-bottom:2px solid var(--accent); border-radius:8px 8px 0 0; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.config-section-title { font-family:Arial,sans-serif; font-size:.95rem; font-weight:700; color:var(--accent); margin:18px 0 8px; }
.config-table { display:grid; gap:0 20px; background:#fff; border:1px solid var(--border); border-radius:8px; padding:14px 18px; }
.config-table-3 { grid-template-columns:repeat(3, 1fr); }
.config-table-col-title { font-family:Arial,sans-serif; font-size:.78rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin:0 0 8px; }
.config-table .rubrique-option { padding:3px 0; font-size:.86rem; }
@media (max-width:640px) {
  .config-table-3 { grid-template-columns:1fr; gap:14px 0; }
  .config-table-col-title { margin-top:10px; }
}
.opt-row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-family:Arial,sans-serif; font-size:.85rem; color:var(--ink); margin:14px 0; text-align:left; }
.opt-row select { padding:6px 8px; border-radius:4px; border:1px solid var(--border); font-family:Arial,sans-serif; max-width:230px; }
.quiz-action-row { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:14px; }
.quiz-action-row .secondary-button { min-height:52px; font-size:.95rem; }
.quiz-action-row .primary-button { min-height:52px; }
.topbar-banner { position:fixed; top:0; left:0; right:0; z-index:200; display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--paper); padding:8px 16px; box-shadow:0 2px 8px rgba(0,0,0,.1); min-height:44px; }
.topbar-zone { display:flex; align-items:center; gap:8px; min-width:0; }
.topbar-zone-left { flex:1 1 0; justify-content:flex-start; flex-direction:column; align-items:flex-start; gap:0; font-family:Arial,sans-serif; }
.topbar-zone-left span { line-height:1.2; }
#topbar-exercise-name { font-weight:700; font-size:.85rem; color:var(--accent); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
#topbar-exercise-progress { font-size:.75rem; color:var(--muted); }
.topbar-zone-center { flex:0 0 auto; }
#topbar-timer { font-family:Arial,sans-serif; font-size:.85rem; font-weight:700; color:var(--ink); min-width:36px; text-align:center; }
.topbar-zone-right { flex:1 1 0; justify-content:flex-end; font-family:Arial,sans-serif; font-size:.85rem; font-weight:700; color:#c0392b; white-space:nowrap; }
@media (max-width:640px) {
  .topbar-banner { padding:6px 8px; gap:4px; }
  #topbar-exercise-name { font-size:.7rem; }
  #topbar-exercise-progress, .topbar-zone-right { font-size:.68rem; }
  #topbar-timer { font-size:.75rem; min-width:28px; }
  .global-topbar-button { width:24px; height:24px; font-size:.78rem; }
}
.global-topbar-button { width:28px; height:28px; border-radius:6px; border:1px solid var(--border); background:var(--paper); font-size:.9rem; cursor:pointer; flex:0 0 auto; }
.global-topbar-button:hover { background:#f7f2ea; }
.hamburger-button { box-shadow:none; }
.hamburger-menu { position:absolute; top:52px; right:16px; left:auto; background:var(--paper); border:1px solid var(--border); border-radius:10px; box-shadow:0 12px 30px rgba(0,0,0,.18); min-width:240px; padding:8px; }
body.lefty .hamburger-menu { right:auto; left:16px; }
.hamburger-item { display:block; width:100%; text-align:left; padding:12px 14px; border-radius:6px; border:0; background:transparent; cursor:pointer; font-family:Arial,sans-serif; font-size:.92rem; color:var(--ink); }
.hamburger-item:hover { background:#f7f2ea; }
.home-icon-button { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:6px; border:1px solid var(--border); background:#e9e5dc; color:#8a837a; font-size:.95rem; cursor:pointer; opacity:.8; filter:grayscale(1); transition:opacity .15s, background .15s; }
.exercise-icon-button { background:var(--accent); border-color:var(--accent); color:#fff; opacity:1; filter:none; width:38px; height:38px; border-radius:50%; font-size:1.05rem; }
.exercise-icon-button:hover { background:var(--accent-dark); border-color:var(--accent-dark); }
.exercise-icon-hub { background:var(--cta); border-color:var(--cta); }
.exercise-icon-hub:hover { background:var(--cta-dark); border-color:var(--cta-dark); }
.exercise-icon-scores { background:#8a2be2; border-color:#8a2be2; }
.exercise-icon-scores:hover { background:#6f1fb8; border-color:#6f1fb8; }
.home-icon-button:hover { opacity:1; background:#f7f2ea; }
.quiz-action-row-single { grid-template-columns:1fr; }
.grey-button:hover { background:#d8d0c0 !important; }
.modal-nav-row { display:flex; gap:10px; margin-top:20px; }
.modal-nav-row .secondary-button, .modal-nav-row .primary-button { flex:1; margin-top:0; }
.quiz-summary { border:1px solid var(--border); border-radius:10px; padding:20px; margin-bottom:20px; background:#fff; }
.summary-line { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-family:Arial,sans-serif; font-size:.92rem; }
.summary-line:last-child { border-bottom:none; }
.summary-line .link-label { flex-shrink:0; }
.modal-subheading { margin:20px 0 12px; font-size:1.05rem; border-top:1px solid var(--border); padding-top:16px; }
.artist-list-mode-row { display:flex; gap:10px; margin-bottom:14px; }
.artist-list-mode-row .secondary-button { flex:1; }
.artist-list-mode-row .secondary-button.active-mode { background:var(--accent); border-color:var(--accent); color:#fff; }
.link-label { color:var(--accent); font-weight:700; cursor:pointer; text-decoration:underline; font-family:Arial,sans-serif; font-size:.92rem; }
.link-label:hover { color:var(--accent-dark); }

.modal-overlay { position:fixed; inset:0; background:rgba(36,49,63,.6); display:flex; align-items:center; justify-content:center; z-index:250; padding:20px; }
.modal-box { background:var(--paper); border-radius:10px; padding:30px; max-width:440px; width:100%; text-align:left; box-shadow:0 24px 60px rgba(0,0,0,.32); max-height:85vh; overflow-y:auto; -webkit-overflow-scrolling:touch; }
#modal-fonctionnement .modal-box { max-width:900px; max-height:92vh; }
#modal-artist-list .modal-box { max-width:720px; }
.modal-box h3 { margin-bottom:18px; font-size:1.25rem; }
#modal-fonctionnement p { text-align:justify; }
.modal-box .primary-button { margin-top:20px; width:100%; position:sticky; bottom:0; background:var(--cta); }
.modal-hint { font-family:Arial,sans-serif; font-size:.82rem; color:var(--muted); margin:10px 0 14px; line-height:1.4; }

.quiz-topbar { display:flex; justify-content:flex-end; gap:8px; margin-bottom:6px; }
.hidden { display:none !important; }.quiz-reference { margin:0; font-family:Arial,sans-serif; font-size:.8rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }.progress-row { display:none; }.score-summary-highlight { color:#c0392b; font-weight:800; font-size:1rem; white-space:nowrap; }.progress-track { height:7px; overflow:hidden; margin:0 0 20px; background:#ddd7cd; border-radius:10px; }.progress-bar { height:100%; width:0; background:var(--accent); transition:width .25s; }
.quiz-grid { display:grid; grid-template-columns:minmax(0,1.9fr) minmax(340px,.6fr); background:var(--paper); box-shadow:0 14px 35px rgba(54,45,31,.1); border-radius:8px; overflow:hidden; }
/* Gaucher : l'image passe à droite, la marge de réponses/références à gauche — dans tous les
   exercices, puisqu'ils partagent tous la même structure .artwork-column + .answer-card. */
body.lefty .quiz-grid { grid-template-columns:minmax(340px,.6fr) minmax(0,1.9fr); }
body.lefty .quiz-grid .artwork-column { order:2; }
body.lefty .quiz-grid .answer-card { order:1; }
.artwork-column { display:flex; flex-direction:column; min-width:0; }
.artwork-card { position:relative; min-height:min(640px, 72vh); max-height:80vh; margin:0; padding:22px; background:#1b1c1e; display:flex; align-items:center; justify-content:center; transition:min-height .2s; }
.artwork-card img { display:block; max-width:100%; max-height:min(820px, 74vh); width:auto; height:auto; object-fit:contain; }
.image-message { position:absolute; inset:auto 20px 20px; color:white; background:rgba(20,20,20,.8); padding:12px; font-family:Arial,sans-serif; font-size:.9rem; }
.artwork-source-link { position:absolute; right:12px; bottom:10px; color:rgba(255,255,255,.75); background:rgba(20,20,20,.55); padding:4px 9px; border-radius:4px; font-family:Arial,sans-serif; font-size:.7rem; text-decoration:none; }
.artwork-source-link:hover { color:#fff; background:rgba(20,20,20,.8); }
.answer-card { padding:30px 26px; }.answer-card h2 { margin-bottom:7px; font-size:1.3rem; }.answer-card form { display:grid; gap:14px; }.answer-card label { display:grid; gap:6px; font-family:Arial,sans-serif; font-size:.82rem; font-weight:700; }.answer-card input { width:100%; padding:10px; color:var(--ink); border:1px solid #cfc8bc; border-radius:4px; background:#fff; transition:background .15s, border-color .15s; }.answer-card input:focus { outline:2px solid #df947f; border-color:var(--accent); }.answer-card input:disabled { background:#f4f1eb; }
#impregnation-panel .answer-card { display:flex; flex-direction:column; min-height:100%; }
#imp-correction-details { display:grid; grid-template-columns:max-content 1fr; column-gap:14px; row-gap:4px; align-items:baseline; }
#imp-correction-details .correction-label { grid-column:1; font-family:Arial,sans-serif; font-size:.78rem; font-weight:700; color:#9aa3ab; text-transform:uppercase; letter-spacing:.03em; }
#imp-correction-details .correction-value { grid-column:1/-1; font-size:1.1rem; font-weight:700; color:var(--ink); line-height:1.3; margin-bottom:14px; min-height:1.3em; opacity:0; transform:translateY(3px); transition:opacity .35s, transform .35s; }
#imp-correction-details .correction-value.written { opacity:1; transform:translateY(0); }

.field-row { display:flex; gap:8px; align-items:stretch; }
.field-row input { flex:1; min-width:0; }
.field-label-button { flex-shrink:0; min-width:64px; border-radius:4px; border:1px solid #cfc8bc; background:#fff; color:var(--ink); cursor:pointer; font-family:Arial,sans-serif; font-size:.82rem; font-weight:700; transition:background .15s, border-color .15s; }
.field-label-button:hover { background:#f7f2ea; border-color:var(--accent); }
.field-label-button.field-target-active { background:#fdeb8f; border-color:var(--accent); }
body.lefty .field-row { flex-direction:row-reverse; }
.mic-nav-row { display:flex; align-items:center; gap:6px; margin-bottom:10px; }
.mic-nav-row .primary-button { flex:1; }
.nav-arrow-button { flex:0 0 auto; width:38px; height:38px; border-radius:50%; border:1px solid var(--accent); background:var(--accent); color:#fff; font-size:1rem; font-weight:700; cursor:pointer; transition:background .15s; }
.nav-arrow-button:hover:not(:disabled) { background:var(--accent-dark); }
.nav-arrow-button:disabled { opacity:.35; cursor:not-allowed; }
.mic-icon-button { flex-shrink:0; width:44px; height:44px; border-radius:50%; border:1px solid #cfc8bc; background:#fff; color:var(--ink); cursor:pointer; font-size:1.1rem; transition:background .15s, border-color .15s; }
.mic-icon-button:hover:not(:disabled) { background:#f7f2ea; border-color:var(--accent); }
.mic-icon-button:disabled { cursor:not-allowed; opacity:.4; }
.mic-icon-button.listening { background:var(--accent); border-color:var(--accent); color:#fff; animation:mic-pulse 1.1s ease-in-out infinite; }
.mic-wrap { position:relative; }
.mic-tooltip { margin:-2px 0 10px; padding:12px 14px; background:var(--ink); color:#fff; border-radius:6px; font-family:Arial,sans-serif; font-size:.8rem; line-height:1.45; }
.mic-tooltip p { margin:0 0 10px; color:#fff; }
.mic-tooltip .rubrique-option { color:#fff; padding:0 0 10px; font-size:.8rem; }
.mic-tooltip .rubrique-option input { width:16px; height:16px; }
.mic-tooltip .secondary-button { color:#fff; border-color:#fff; padding:6px 14px; font-size:.78rem; }
.mic-tooltip .secondary-button:hover { background:rgba(255,255,255,.12); color:#fff; border-color:#fff; }
/* Barre de navigation persistante : toujours visible (question comme correction), pour ne
   jamais bloquer la personne sans moyen d'avancer ou de revenir en arrière. */
.quiz-bottom-bar { display:flex; align-items:center; gap:10px; margin-top:16px; }
.nav-bottom-button { flex:1; border-radius:5px; border:1px solid var(--border); background:transparent; color:var(--ink); padding:11px 10px; font-family:Arial,sans-serif; font-size:.88rem; font-weight:700; cursor:pointer; transition:background .15s; }
.nav-bottom-button:hover:not(:disabled) { background:#f7f2ea; }
.nav-bottom-button:disabled { opacity:.35; cursor:not-allowed; }
.quiz-bottom-bar .primary-button { flex-shrink:0; padding:11px 24px; }
body.is-corrected .quiz-bottom-bar .primary-button { display:none; }
.topbar-nav-button { display:none; }
body.is-corrected .topbar-nav-button { display:inline-flex; flex:0 0 auto; width:auto; padding:6px 12px; font-size:.78rem; }
.quiz-topbar { flex-wrap:nowrap; }
@keyframes mic-pulse { 0%,100% { transform:scale(1); } 50% { transform:scale(1.015); } }

.correction { padding:12px 16px; background:#f7f2ea; border-left:4px solid var(--accent); }
#correction-details { display:grid; grid-template-columns:max-content 1fr; column-gap:14px; row-gap:2px; align-items:baseline; }
.correction-item { display:contents; }
.answer-result { grid-column:2; justify-self:end; font-size:1.05rem; font-weight:700; font-family:Arial,sans-serif; }
.answer-result.info { color:var(--muted); font-weight:400; text-transform:uppercase; font-size:.72rem; letter-spacing:.03em; }
.correct { color:var(--ok); } .incorrect { color:var(--wrong); }
.correction-label { grid-column:1; font-family:Arial,sans-serif; font-size:.85rem; font-weight:700; color:#9aa3ab; text-transform:uppercase; letter-spacing:.03em; }
.correction-value { grid-column:1 / -1; font-size:1.2rem; font-weight:700; color:var(--ink); line-height:1.2; margin-bottom:14px; }
.correction-value em { font-style:italic; }
.artist-dates { font-size:.75em; font-weight:400; color:var(--muted); }
.dim-hl { font-size:.75em; font-weight:400; color:var(--muted); }
.artist-list-table { max-height:60vh; overflow-y:auto; overflow-x:auto; margin:14px 0; border:1px solid var(--border); border-radius:8px; }
.artist-table { width:100%; border-collapse:collapse; font-family:Arial,sans-serif; font-size:.85rem; }
.artist-table th { position:sticky; top:0; background:var(--paper); text-align:left; padding:8px 10px; border-bottom:2px solid var(--border); font-size:.75rem; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); }
.artist-table td { padding:6px 10px; border-bottom:1px solid var(--border); }
.artist-table tr:hover td { background:#f7f2ea; }
.artist-table th.sortable-col { cursor:pointer; user-select:none; }
.artist-table th.sortable-col:hover { color:var(--accent); }
.artist-list-filters { display:flex; flex-wrap:wrap; gap:10px; margin-top:16px; }
.artist-list-filters select { flex:1; min-width:140px; padding:8px 10px; border-radius:8px; border:1px solid var(--border); background:var(--paper); font-family:Arial,sans-serif; font-size:.85rem; color:var(--ink); }
#correction-details .correction-item:last-child .correction-value { margin-bottom:0; }

.other-works-toggle { width:100%; margin-top:14px; }
.other-works-panel { max-width:1200px; margin:16px auto; padding:16px 26px 30px; }
.other-works-panel .quiz-bottom-bar { position:sticky; top:0; z-index:5; background:var(--paper); padding:8px 0; margin:0 0 16px; }
.other-works-header { justify-content:space-between; }
.other-works-artist-info { display:flex; flex-direction:column; align-items:center; text-align:center; font-family:Arial,sans-serif; flex:1; min-width:0; padding:0 8px; }
.other-works-artist-info strong { font-size:1.05rem; color:var(--accent); }
#other-works-artist-dates { font-size:.82rem; color:var(--muted); }
#other-works-artist-flag { font-size:1.3rem; }
@media (max-width:640px) {
  .other-works-artist-info strong { font-size:.85rem; }
  #other-works-artist-dates { font-size:.7rem; }
  #other-works-artist-flag { font-size:1rem; }
}
.other-works-panel-list { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:16px; }
.other-works-panel-list .other-work-card-big { width:auto; text-align:center; border:2px solid transparent; border-radius:8px; background:none; padding:8px; cursor:pointer; font:inherit; transition:border-color .15s, background .15s; }
.other-works-panel-list .other-work-card-big:hover { background:#f7f2ea; border-color:var(--accent); }
.other-works-panel-list .other-work-card-big img { width:100%; height:min(30vh, 260px); object-fit:contain; border-radius:6px; display:block; margin-bottom:10px; background:#1b1c1e; }
.other-works-panel-list .other-work-card-big .other-work-caption { font-family:Arial,sans-serif; font-size:.9rem; }
/* Les images s'adaptent au nombre d'œuvres à afficher, pour limiter le défilement (voir
   renderOtherWorksPanel en JS, qui pose ces classes selon le nombre). */
.other-works-panel-list.count-1 { grid-template-columns:1fr; }
.other-works-panel-list.count-1 .other-work-card-big img { height:min(76vh, 880px); object-fit:contain; background:#1b1c1e; }
.other-works-panel-list.count-2 { grid-template-columns:repeat(2, 1fr); }
.other-works-panel-list.count-2 .other-work-card-big img { height:min(56vh, 540px); }
.other-works-panel-list.count-3-4 { grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); }
.other-works-panel-list.count-3-4 .other-work-card-big img { height:min(42vh, 400px); }
.other-works-panel-list.count-5-8 { grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); }
.other-works-panel-list.count-5-8 .other-work-card-big img { height:min(28vh, 260px); }
.other-works-panel-list.count-9plus { grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); }
.other-works-panel-list.count-9plus .other-work-card-big img { height:min(20vh, 190px); }
/* Sur PC, on force explicitement plusieurs colonnes (rangée horizontale) plutôt que de laisser
   auto-fit décider seul — plus fiable pour un alignement visiblement horizontal. */
@media (min-width:641px) {
  .other-works-panel-list.count-3-4 { grid-template-columns:repeat(4, 1fr); }
  .other-works-panel-list.count-5-8 { grid-template-columns:repeat(4, 1fr); }
  .other-works-panel-list.count-9plus { grid-template-columns:repeat(5, 1fr); }
}
.image-lightbox { position:fixed; inset:0; z-index:300; background:rgba(10,10,10,.96); display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px; }
.image-lightbox .quiz-topbar { position:absolute; top:12px; right:12px; margin:0; }
.image-lightbox img { max-width:92vw; max-height:78vh; object-fit:contain; border-radius:4px; cursor:pointer; }
.lightbox-caption { color:#fff; font-family:Arial,sans-serif; font-size:1rem; text-align:center; margin-top:16px; }
.other-works { margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }
.other-works-title { font-family:Arial,sans-serif; font-size:.78rem; font-weight:700; color:#9aa3ab; text-transform:uppercase; letter-spacing:.03em; margin-bottom:12px; }
.other-works-list { display:flex; flex-wrap:wrap; gap:12px; }
.other-work-card { width:108px; text-align:center; border:2px solid transparent; border-radius:6px; background:none; padding:4px; cursor:pointer; font:inherit; transition:border-color .15s, background .15s; }
.other-work-card:hover { background:#f7f2ea; }
.other-work-card.active { border-color:var(--accent); background:#f7f2ea; }
.other-work-card img { width:100%; height:90px; object-fit:cover; border-radius:4px; display:block; margin-bottom:6px; background:#1b1c1e; }
.other-work-caption { display:block; font-family:Arial,sans-serif; font-size:.7rem; line-height:1.3; color:var(--muted); margin:0; }
.other-work-caption strong { color:var(--ink); font-weight:700; }
.other-work-caption em { font-style:italic; }
.other-works-separator { width:100%; display:flex; align-items:center; gap:8px; margin:2px 0; }
.other-works-separator::before, .other-works-separator::after { content:""; flex:1; height:1px; background:var(--border); }
.other-works-separator span { font-family:Arial,sans-serif; font-size:.68rem; font-weight:700; color:#9aa3ab; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }

/* Quand des œuvres du même peintre s'affichent en dessous, on réduit la fiche corrigée (texte)
   pour laisser de la place, mais pas l'image de l'œuvre elle-même sur grand écran. */
body.has-other-works .correction-value { font-size:1.02rem; margin-bottom:10px; }
body.has-other-works .answer-result { font-size:.95rem; }
body.has-other-works .correction-label { font-size:.76rem; }

.navigation { display:flex; justify-content:space-between; gap:10px; margin-top:16px; }
.nav-button { flex:1; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; border-radius:4px; border:1px solid var(--border); background:transparent; color:var(--ink); padding:9px 10px; font-family:Arial,sans-serif; font-size:.88rem; font-weight:700; transition:background .15s; }
.nav-button:hover:not(:disabled) { background:#f7f2ea; }
.nav-button:disabled { cursor:not-allowed; opacity:.4; }

.results-panel { margin-top:40px; }.results-panel h2 { font-size:2rem; }.results-panel p { color:var(--muted); }
.results-actions { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; margin-top:26px; }
.export-actions { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; margin-top:16px; padding-top:16px; border-top:1px solid var(--border); }
.export-feedback { margin-top:14px; font-family:Arial,sans-serif; font-size:.85rem; color:var(--ok); }

@media (max-width:640px) {
  .fam-image-grid { grid-template-columns:repeat(2, 1fr) !important; }
  .training-exercise-grid { grid-template-columns:1fr 1fr; }
  .accordion-columns { grid-template-columns:1fr; gap:0; }
  .app-shell { flex-direction:column; width:min(100% - 24px, 1120px); padding-top:44px; min-height:auto; }
  #quiz-panel .progress-row { margin-top:10px; }
  .sidebar { flex-direction:column; width:100%; max-width:100%; flex-basis:auto; position:static; align-self:stretch; padding:18px; }
  .sidebar-illustration { max-height:160px; }
  .welcome-panel,.results-panel { padding:24px 14px; margin:24px auto; }
  .home-mode-buttons { gap:8px; }
  .home-mode-button { padding:12px 8px; }
  .home-mode-button .label { font-size:.8rem; }
  .account-slot-email { font-size:.6rem; }
  .quiz-grid { grid-template-columns:1fr; }
  .home-icon-button { width:26px; height:26px; font-size:.85rem; }
  #other-works-panel-list { margin-top:36px; }
  .artwork-card { min-height:52vh; padding:10px; }
  .artwork-card img { max-height:48vh; }
  body.four-fields .artwork-card { min-height:42vh; }
  body.four-fields .artwork-card img { max-height:38vh; }
  .answer-card { padding:18px 16px; }
  .quiz-selectors { grid-template-columns:1fr; }
  .quiz-action-row { grid-template-columns:1fr; }
  .modal-box { padding:22px; max-height:90vh; }
  .progress-row { font-size:.76rem; }
  .results-actions,.export-actions { flex-direction:column; }

  /* Une fois la correction affichée : on réduit l'image pour que la correction
     complète et les boutons Précédente/Suivante tiennent sans défiler. */
  body.is-corrected .artwork-card { min-height:26vh; padding:6px; }
  body.is-corrected .artwork-card img { max-height:24vh; }
  body.is-corrected .progress-row,
  body.is-corrected .progress-track { margin-bottom:6px; }
  body.is-corrected .correction { padding:6px 10px; }
  body.is-corrected .correction-label { font-size:.68rem; }
  body.is-corrected .correction-value { font-size:.92rem; margin-bottom:6px; }
  body.is-corrected .answer-result { font-size:.82rem; }
  body.is-corrected .quiz-bottom-bar { margin-top:8px; }
  body.is-corrected .nav-bottom-button { padding:8px 6px; font-size:.78rem; }
  body.is-corrected .other-works-toggle { margin-top:8px; padding:8px; font-size:.78rem; }
  body.has-other-works.is-corrected .artwork-card { min-height:20vh; }
  body.has-other-works.is-corrected .artwork-card img { max-height:18vh; }
  body.has-other-works .artwork-card { min-height:360px; }
  body.has-other-works .artwork-card img { max-height:420px; }
  .other-works { margin-top:14px; padding-top:10px; }
  .other-work-card { width:84px; }
  .other-work-card img { height:70px; }

  /* Formulaire de réponse resserré : objectif zéro défilement même avec les 4 champs actifs. */
  .answer-card form { gap:10px; }
  .answer-card label { gap:3px; font-size:.76rem; }
  .answer-card input { padding:8px; }
  .nav-bottom-button { padding:9px 6px; font-size:.8rem; }
  .field-label-button { min-width:52px; font-size:.75rem; }
  .mic-icon-button { width:36px; height:36px; font-size:.95rem; }
  .mic-nav-row { gap:4px; }
  .mic-nav-row .nav-arrow-button { width:32px; height:32px; font-size:.85rem; }
  .mic-nav-row .primary-button { padding:8px 10px; font-size:.82rem; }
  .quiz-bottom-bar .primary-button { padding:9px 16px; font-size:.9rem; }
  .other-works-toggle { margin-top:10px; padding:10px; font-size:.85rem; }
  .other-works-panel { padding:20px 16px; margin:14px auto; }
  .other-works-panel-list { grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:12px; }
  .other-works-panel-list .other-work-card-big img { height:140px; }
}
