/* © 2026 Daunis Alexandre — La Fanfartifice. Tous droits réservés. */
:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface2: #2a2a2d;
  --text: #f5f5f5;
  --dim: #cfcfcf;
  --primary: #ffb300;
  --secondary: #29b6f6;
  --error: #ff6b6b;
  --line: #ffffff22;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; }
body { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* Fond du mois (dossier fond_ecran du serveur) ; à défaut, le fond « feu d'artifice » d'origine.
   Assombri pour garder le texte lisible. */
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: linear-gradient(#000000cc, #000000dd),
    url(/web/api/fond) center top / cover no-repeat fixed,
    url(img/bg.jpg) center top / cover no-repeat fixed; }
/* Écran large (ordinateur, tablette à l'horizontale) : on prend la version horizontale du fond du mois
   (« octobre-paysage.jpeg »). S'il n'y en a pas, on retombe sur la version verticale. */
@media (orientation: landscape) {
  .screen { background: linear-gradient(#000000cc, #000000dd),
      url(/web/api/fond?f=paysage) center top / cover no-repeat fixed,
      url(/web/api/fond) center top / cover no-repeat fixed,
      url(img/bg.jpg) center top / cover no-repeat fixed; }
}
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + var(--safe-bottom)); }

/* Barre du haut */
.topbar { display: flex; align-items: center; gap: 4px; min-height: 56px;
  padding: calc(var(--safe-top) + 4px) 8px 4px 8px; background: #000000b0; backdrop-filter: blur(6px); }
.topbar h1 { flex: 1; margin: 0 4px; font-size: 20px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent;
  color: var(--text); display: grid; place-items: center; flex: none; }
.iconbtn:active { background: var(--surface2); }
.iconbtn svg { width: 24px; height: 24px; fill: currentColor; }
.iconbtn.on { color: var(--primary); }
.textbtn { border: 0; background: transparent; color: var(--primary); font-weight: 600; padding: 10px 12px;
  border-radius: 8px; letter-spacing: .03em; }
.textbtn:active { background: var(--surface2); }

/* Connexion */
.auth { align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.auth .card { width: 100%; max-width: 380px; background: #000000b8; border: 1px solid var(--line);
  border-radius: 20px; padding: 20px; }
.auth img.logo { display: block; width: 70%; max-width: 240px; margin: 0 auto 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { flex: 1; padding: 10px; border: 1px solid var(--line); background: transparent;
  border-radius: 10px; color: var(--dim); }
.tabs button.active { background: var(--primary); color: #000; border-color: var(--primary); font-weight: 600; }
label.field { display: block; margin: 10px 0; font-size: 14px; color: var(--dim); }
input.text, textarea.text { display: block; width: 100%; margin-top: 4px; padding: 12px; border-radius: 10px;
  border: 1px solid #ffffff44; background: #111; font-size: 16px; /* 16px : évite le zoom auto d'iOS */ }
input.text:focus, textarea.text:focus { outline: 2px solid var(--primary); border-color: transparent; }
.primarybtn { display: block; width: 100%; margin-top: 16px; padding: 13px; border: 0; border-radius: 12px;
  background: var(--primary); color: #000; font-weight: 700; font-size: 16px; }
.primarybtn:disabled { opacity: .5; }
.error { color: var(--error); font-size: 14px; min-height: 20px; margin-top: 10px; }
.hint { color: var(--dim); font-size: 13px; margin-top: 10px; }

/* Choix de la tonalité */
/* Accueil : logo de l'École + tonalités (2 par ligne) à gauche, grand logo de la fanfare à droite */
.home { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; }
.homeleft { flex: 0 0 auto; width: 320px; max-width: 100%; }
.homeright { flex: 1; min-width: 0; }
.bigfan { display: block; width: 100%; max-width: 900px; height: auto; margin: 0 auto; }
@media (max-width: 640px) {
  .home { flex-direction: column; align-items: stretch; }
  .homeleft { width: 100%; order: 2; }
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .homeright { order: 1; }
}
.count { padding: 4px 10px; color: var(--dim); font-size: 14px; }
.topbar h1.keystitle { flex: 0 1 auto; }
.topbar .schoolbar { height: 40px; width: auto; margin-left: 6px; border-radius: 50%; }
.topbar .spacer { flex: 1; }
.keys { display: grid; grid-template-columns: repeat(2, 140px); gap: 12px; padding: 8px 8px 12px; justify-content: start; }
.keycard { background: #1c1c1ee6; border: 0; border-radius: 16px; min-height: 84px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; padding: 14px; text-align: center; }
.keycard:active { background: var(--surface2); }
.keycard .k { font-size: 30px; font-weight: 500; }
.keycard .n { color: var(--dim); font-size: 14px; }
.keycard .last { color: var(--primary); font-size: 12px; margin-top: 2px; }

/* Liste des morceaux */
.search { padding: 8px 12px; }
.search input { width: 100%; padding: 12px 14px; border-radius: 28px; border: 1px solid #ffffff44;
  background: #111; font-size: 16px; }
.search input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.row { display: flex; align-items: center; gap: 2px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line);
  cursor: pointer; }
.row:active { background: #ffffff14; }
.row .t { flex: 1; min-width: 0; }
.row .title { font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.row .sub { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }
.row .badge { display: inline-block; font-size: 12px; color: #000; background: var(--primary); border-radius: 8px;
  padding: 0 7px; margin-right: 6px; font-weight: 700; vertical-align: 1px; }
.star { color: #8a8a8a; } .star.on { color: var(--primary); }
.media { color: var(--primary); } .media.off { color: #ffffff40; pointer-events: none; }
.empty { padding: 40px 24px; text-align: center; color: var(--dim); }

/* Menu déroulant */
.menu { position: fixed; right: 8px; top: calc(var(--safe-top) + 52px); z-index: 50; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0;
  box-shadow: 0 10px 40px #000; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 13px 18px; }
.menu button:active { background: var(--surface2); }
.scrim { position: fixed; inset: 0; z-index: 40; }

/* Fenêtres */
.modal { position: fixed; inset: 0; z-index: 80; background: #000000a0; display: grid; place-items: center; padding: 16px; }
.dialog { width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px; padding: 20px;
  max-height: 85vh; overflow-y: auto; }
.dialog h2 { margin: 0 0 10px; font-size: 20px; font-weight: 500; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.sheetitem { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0;
  background: transparent; padding: 14px 6px; border-bottom: 1px solid var(--line); }
.sheetitem:active { background: var(--surface2); }
.sheetitem .ic { color: var(--primary); width: 22px; text-align: center; }

/* Lecteur de partition */
.viewer { position: relative; flex: 1; min-height: 0; background: #000; display: flex; flex-direction: column; }
.vbar { position: absolute; z-index: 20; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 2px;
  padding: calc(var(--safe-top) + 6px) 8px 6px; background: linear-gradient(#000000e0, #00000000);
  transition: opacity .25s, transform .25s; }
.vbar.hidden { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.vbar .vt { flex: 1; min-width: 0; margin: 0 6px; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbar .vp { font-size: 14px; color: var(--dim); margin: 0 4px; white-space: nowrap; }
.vbar .round { background: #00000099; border: 1px solid var(--line); }
.stage { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; }
.stage .pagewrap { position: relative; margin: auto; flex: none; background: #fff; box-shadow: 0 0 30px #000; }
.stage canvas { display: block; }
.stage canvas.ann { position: absolute; left: 0; top: 0; }
.stage.drawing { touch-action: none; overflow: hidden; }
.stage.drawing canvas.ann { touch-action: none; cursor: crosshair; }
.vstatus { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--dim); z-index: 10; text-align: center; padding: 20px; }
.vstatus.err { color: var(--error); }
.tools { position: absolute; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 10px);
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #000000d0; border: 1px solid var(--line);
  border-radius: 28px; max-width: calc(100vw - 16px); overflow-x: auto; backdrop-filter: blur(6px); }
.tools.hidden { display: none; }
.tool { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 2px solid transparent; background: var(--surface);
  display: grid; place-items: center; color: var(--text); }
.tool.sel { border-color: var(--primary); }
.tool .sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #ffffff55; }
.tool .hl { width: 26px; height: 10px; border-radius: 3px; }
.tool svg { width: 22px; height: 22px; fill: currentColor; }
.sep { width: 1px; height: 28px; background: var(--line); flex: none; margin: 0 2px; }
.savestate { position: absolute; z-index: 20; right: 12px; bottom: calc(var(--safe-bottom) + 70px); font-size: 12px;
  color: var(--dim); background: #000000b0; padding: 3px 9px; border-radius: 10px; pointer-events: none; }
.savestate.err { color: var(--error); }
.pagenav { position: absolute; z-index: 15; top: 0; bottom: 0; width: 18%; border: 0; background: transparent; }
.pgnav { position: absolute; z-index: 25; left: auto; right: 12px; transform: none; bottom: calc(var(--safe-bottom) + 10px);
  display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 26px; background: #000000d0; border: 1px solid var(--line); }
.pgnav .pgb { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #ffffff18; color: #fff; font-size: 18px; cursor: pointer; }
.pgnav .pgb:hover:not(:disabled) { background: #ffffff35; }
.pgnav .pgb:disabled { opacity: .3; cursor: default; }
.pgnav .pgn { min-width: 56px; text-align: center; font-size: 15px; color: #fff; }
.pagenav.l { left: 0; } .pagenav.r { right: 0; }
.countdown { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; font-size: 140px; font-weight: 700;
  color: var(--primary); background: #000000a0; pointer-events: none; }
.audiobar { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 76px);
  display: flex; align-items: center; gap: 8px; background: #000000e0; border: 1px solid var(--primary); border-radius: 28px;
  padding: 6px 8px 6px 16px; max-width: calc(100vw - 16px); }
/* Pendant la lecture d'une partition : la barre son/tempo passe en haut, sous la barre d'outils, pour ne pas cacher les dernières lignes */
.audiobar.top { bottom: auto; top: calc(var(--safe-top) + 64px); }
.audiobar.dock { position: static; transform: none; flex: none; width: 100%; max-width: none; border: 0; border-top: 1px solid var(--primary);
  border-radius: 0; justify-content: center; padding: 6px 10px calc(var(--safe-bottom) + 6px); background: #0b0b0c; }
.audiobar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
.videobox { position: fixed; z-index: 70; right: 10px; bottom: calc(var(--safe-bottom) + 130px); width: min(62vw, 380px);
  background: #000; border: 1px solid var(--primary); border-radius: 12px; overflow: hidden; box-shadow: 0 8px 30px #000; touch-action: none; }
.videobox .vh { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; background: #1c1c1e; cursor: grab; font-size: 13px; }
.videobox .vh span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.videobox video { display: block; width: 100%; max-height: 50vh; background: #000; }

#toast { position: fixed; z-index: 200; left: 50%; bottom: calc(var(--safe-bottom) + 24px); transform: translateX(-50%) translateY(30px);
  background: #333; color: #fff; padding: 10px 16px; border-radius: 22px; opacity: 0; transition: .25s; pointer-events: none;
  max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.copy { text-align: center; color: #ffffff66; font-size: 12px; padding: 16px 0; }

/* Petits écrans : le zoom au pincement remplace les boutons +/− pour laisser la place au titre */
@media (max-width: 560px) { .vbar .zoombtn { display: none; } .vbar .iconbtn { width: 40px; height: 40px; } }
.dialog input[type=radio], .dialog input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }

/* Logo de la fanfare dans la barre du haut */
.toplogo { height: 40px; width: auto; flex: none; margin: 0 6px 0 4px; object-fit: contain; cursor: pointer; }
@media (max-width: 400px) { .toplogo { height: 32px; margin: 0 2px; } }

.logbox { margin: 10px 0 0; padding: 8px; max-height: 180px; overflow: auto; background: #000; border-radius: 8px;
  font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--dim); white-space: pre-wrap; word-break: break-all; }
.logbox:empty { display: none; }

/* petits écrans (iPhone) : on libère de la place pour le titre de la barre du haut */
@media (max-width: 430px) {
  .topbar { gap: 0; }
  .topbar .iconbtn { width: 40px; height: 40px; }
  .topbar h1 { font-size: 17px; margin: 0 2px; }
  .toplogo { height: 28px; margin: 0 2px; }
}

/* comptes inscrits (administrateur) */
.userrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--surface2); }
.temppw { font-family: ui-monospace, monospace; font-size: 22px; letter-spacing: 1px; user-select: all; padding: 8px 10px;
  background: var(--surface2); border-radius: 8px; text-align: center; }

/* Sélection de morceaux à imprimer */
.row .pick { width: 22px; height: 22px; margin: 0 14px 0 0; flex: none; accent-color: var(--primary); }
.row.picked { background: #ffffff10; }
.selbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #000; }
.selbar .selcount { flex: 1; color: var(--dim); font-size: 15px; }
.iconbtn.on { color: var(--primary); }
@media (max-width: 340px) { .topbar .listlogo { display: none; } }

/* Choix Portrait / Paysage avec schéma */
.orient { display: flex; gap: 10px; margin: 10px 0 4px; }
.orient-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; background: #ffffff0d; color: inherit;
  border: 2px solid var(--line); border-radius: 12px; font: inherit; cursor: pointer; text-align: center; }
.orient-btn.on { border-color: var(--primary); background: #ffffff1a; }
.orient-btn .orient-img { display: flex; align-items: center; justify-content: center; min-height: 120px; }
.orient-btn b { font-weight: 600; }
.orient-btn small { color: var(--dim); font-size: 12px; line-height: 1.25; }

.voices{border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin:4px 0 8px;font-size:14px}

/* ===== Thème « feu d'artifice » (plus clair et coloré) ===== */
:root {
  --bg: #1a0f3a;
  --surface: #2b1d52;
  --surface2: #3d2a73;
  --dim: #e4dcf7;
  --primary: #ffc233;
  --secondary: #4fd8ff;
  --line: #ffffff30;
  --c1: #ff4f81; --c2: #ffb300; --c3: #29d3ff; --c4: #7be06a; --c5: #b46bff; --c6: #ff7a3d;
}
.screen { background: linear-gradient(rgba(40, 18, 90, .38), rgba(14, 8, 48, .5)),
    url(/web/api/fond) center top / cover no-repeat fixed,
    url(img/bg.jpg) center top / cover no-repeat fixed; }
@media (orientation: landscape) {
  .screen { background: linear-gradient(rgba(40, 18, 90, .38), rgba(14, 8, 48, .5)),
      url(/web/api/fond?f=paysage) center top / cover no-repeat fixed,
      url(/web/api/fond) center top / cover no-repeat fixed,
      url(img/bg.jpg) center top / cover no-repeat fixed; }
}
.topbar { background: linear-gradient(90deg, #6a1fb0e6, #c2185be6 55%, #ff7a1ae6); backdrop-filter: blur(6px);
  box-shadow: 0 2px 14px #0006; }
.topbar .iconbtn, .topbar h1 { color: #fff; }
.topbar .iconbtn.on { color: #fff3b0; background: #ffffff30; }
.auth .card { background: #2b1d52d9; border-color: #ffffff40; }
input.text, textarea.text, .search input { background: #1d1340; border-color: #ffffff55; }
.keycard { background: #2b1d52e6; border: 2px solid var(--c); border-bottom-width: 5px; box-shadow: 0 4px 14px #0005; }
.keycard .k { color: #fff; }
.keycard:active { background: var(--surface2); }
.keys > .keycard:nth-child(6n+1) { --c: var(--c1); } .keys > .keycard:nth-child(6n+2) { --c: var(--c2); }
.keys > .keycard:nth-child(6n+3) { --c: var(--c3); } .keys > .keycard:nth-child(6n+4) { --c: var(--c4); }
.keys > .keycard:nth-child(6n+5) { --c: var(--c5); } .keys > .keycard:nth-child(6n+6) { --c: var(--c6); }
.row { border-left: 5px solid var(--c, var(--c1)); background: #2b1d5266; margin: 3px 8px; padding-left: 14px; border-radius: 10px;
  border-bottom: 0; }
.row:nth-child(6n+1) { --c: var(--c1); } .row:nth-child(6n+2) { --c: var(--c2); } .row:nth-child(6n+3) { --c: var(--c3); }
.row:nth-child(6n+4) { --c: var(--c4); } .row:nth-child(6n+5) { --c: var(--c5); } .row:nth-child(6n+6) { --c: var(--c6); }
.row:active { background: #ffffff24; }
.row.picked { background: #ffc23333; }
.row .badge { background: var(--c, var(--primary)); }
.selbar { background: #2b1d52f0; }
.menu, .dialog { border: 1px solid #ffffff30; }
.modal { background: #0a0526b0; }
.tabs button.active, .primarybtn { background: linear-gradient(90deg, #ffb300, #ff7a3d); }

/* Réglage du tempo dans la barre de lecture */
.tempo { display: flex; align-items: center; gap: 2px; background: #ffffff18; border-radius: 20px; padding: 2px; }
.tempobtn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.tempobtn:active { background: #ffffff30; }
.tempoval { min-width: 74px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 4px; }
.tempoval.changed { color: #ffb74d; }
@media (max-width: 520px) { .audiobar span { max-width: 22vw; } }

/* Écran large avec fond vertical : on montre l'image ENTIÈRE au centre (rien de coupé) et on remplit les côtés
   avec la même image agrandie et floutée, pour ne pas avoir de bandes vides. */
@media (orientation: landscape) {
  .screen { position: relative; isolation: isolate; background: none; }
  .screen::before, .screen::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
  .screen::before { background:
      url(/web/api/fond?f=paysage) center / cover no-repeat,
      url(/web/api/fond) center / cover no-repeat,
      url(img/bg.jpg) center / cover no-repeat;
    filter: blur(22px) brightness(.8); transform: scale(1.1); }
  .screen::after { background: linear-gradient(rgba(40, 18, 90, .38), rgba(14, 8, 48, .5)),
      url(/web/api/fond?f=paysage) center / cover no-repeat,
      url(/web/api/fond) center / contain no-repeat,
      url(img/bg.jpg) center / contain no-repeat; }
}

/* Mode daltonien (rouge-vert) : coche en haut + palette bleu / orange (Okabe-Ito) */
.daltotoggle { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: inherit; cursor: pointer; padding: 0 6px; white-space: nowrap; }
.daltotoggle input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 11px;
  background: #8a8a8a; cursor: pointer; transition: background .18s; }
.daltotoggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .18s; }
.daltotoggle input:checked { background: #0072B2; }
.daltotoggle input:checked::after { transform: translateX(16px); }
.daltotoggle input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hbadge { margin-left: 10px; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.hbadge.ok { background: #2e9e48; color: #fff; }
.hbadge.todo { background: #f5a524; color: #222; }
body.dalto .hbadge.ok { background: #0072B2; color: #fff; }
body.dalto .hbadge.todo { background: #D55E00; color: #fff; }
.iconbtn.validok { background: #2e9e48; color: #fff; }
body.dalto .iconbtn.validok { background: #0072B2; color: #fff; }

/* Noms de tonalité longs (Harmonica) : police réduite pour rester dans le bouton */
.keycard .k.long { font-size: 21px; max-width: 100%; }

/* Présentation publique (avant connexion) */
.auth .intro { width: 100%; max-width: 640px; margin: 22px auto 8px; padding: 0 4px; color: #fff; line-height: 1.55; font-size: 15px; }
.auth .intro .schoollogo { display: block; width: 92px; height: 92px; margin: 0 auto 10px; border-radius: 50%; }
.auth .intro h2 { font-size: 18px; font-weight: 600; text-align: center; margin: 0 0 12px; }
.auth .intro p { margin: 0 0 12px; }
.auth .intro .photos { display: flex; gap: 8px; margin: 14px 0; }
.auth .intro .photos img { flex: 1 1 0; min-width: 0; width: 50%; height: 170px; object-fit: cover; border-radius: 12px; }
@media (max-width: 480px) { .auth .intro .photos { flex-direction: column; } .auth .intro .photos img { width: 100%; height: 190px; } }
.auth { justify-content: flex-start; }
.auth > :first-child { margin-top: auto; }
.auth > :last-child { margin-bottom: auto; }

.auth .intro .photos { flex-wrap: wrap; }
.auth .intro .photos img { flex: 1 1 30%; width: auto; height: 150px; }
.auth .intro .photos img.wide { flex: 1 1 100%; height: auto; max-height: 300px; }
@media (max-width: 480px) { .auth .intro .photos img { flex: 1 1 100%; height: 190px; } .auth .intro .photos img.wide { height: auto; max-height: none; } }
@media (max-width: 480px) { .auth .intro .photos img { flex: none; width: 100%; height: 190px; } .auth .intro .photos img.wide { height: auto; } }

/* Écran d'accueil : texte et photos à gauche (70 %), connexion à droite (30 %), de front ; empilés sur téléphone */
.auth .authwrap { display: flex; gap: 28px; align-items: flex-start; width: 100%; max-width: 1240px; }
.auth .authwrap .intro { flex: 7 1 0; min-width: 0; max-width: none; margin: 0; }
.auth .authwrap .card { flex: 3 1 0; min-width: 0; max-width: none; position: sticky; top: 0; }
.auth .authwrap .intro .schoollogo { margin: 0 0 10px; }
.auth .authwrap .intro h2 { text-align: left; }
@media (max-width: 800px) {
  .auth .authwrap { flex-direction: column; gap: 8px; max-width: 640px; }
  .auth .authwrap .card { order: -1; flex: none; width: 100%; position: static; }
  .auth .authwrap .intro { flex: none; width: 100%; }
  .auth .authwrap .intro .schoollogo { margin: 0 auto 10px; }
  .auth .authwrap .intro h2 { text-align: center; }
}

/* Outil Losange (admin / bêta) */
.dialayer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.diaring { position: absolute; padding: 0; border-radius: 50%; border: 2px solid #8888; background: transparent; pointer-events: auto; cursor: pointer; }
.diaring.e { border: 3px dashed #ffb300; background: #ffc10040; }
.diaring.f { border: 3px solid #d500f9; }
.diastat { position: absolute; z-index: 30; left: 50%; top: calc(var(--safe-top) + 64px); transform: translateX(-50%); background: #111c; color: #fff; padding: 8px 14px; border-radius: 18px; font-size: 14px; max-width: 90vw; text-align: center; }
.diamodal { position: absolute; inset: 0; z-index: 60; background: #0008; display: grid; place-items: center; padding: 12px; }
.diabox { background: var(--surface, #222); color: var(--text, #fff); border-radius: 16px; padding: 16px; width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 40px #000a; }
.dia-title { font-size: 18px; font-weight: 700; }
.dia-sub { font-size: 13px; opacity: .75; }
.dia-row { display: flex; gap: 8px; }
.dia-row.wrap { flex-wrap: wrap; }
.dia-row.end { justify-content: flex-end; margin-top: 4px; }
.dia-act { flex: 1; padding: 12px 6px; border-radius: 12px; border: 2px solid var(--c); background: transparent; color: var(--c); font-weight: 700; font-size: 16px; }
.dia-act.sel { background: var(--c); color: #fff; }
.dia-hole { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--c); background: transparent; color: var(--c); font-weight: 700; font-size: 18px; }
.dia-hole.sel { background: var(--c); color: #fff; }
.dia-bend { flex: 1; padding: 8px 4px; border-radius: 10px; border: 2px solid var(--c); background: transparent; color: var(--c); font-weight: 700; }
.dia-bend.sel { background: var(--c); color: #fff; }
.dia-ok, .dia-cancel, .dia-del { padding: 10px 14px; border-radius: 10px; border: 0; font-weight: 700; font-size: 15px; }
.dia-ok { background: var(--primary, #3b82f6); color: #fff; }
.dia-ok:disabled { opacity: .4; }
.dia-cancel { background: #8884; color: inherit; }
.dia-del { background: #e5484d; color: #fff; margin-right: auto; }

/* Curseur de lecture (essai, administrateur) */
.curs { position: absolute; z-index: 6; pointer-events: none; mix-blend-mode: multiply; background: rgba(255,170,0,.22); border-left: 1.5px solid rgba(255,143,0,.65); border-right: 1.5px solid rgba(255,143,0,.65); border-radius: 3px; }

.curtog { flex: none; height: 36px; padding: 0 12px; margin: 0 4px; border-radius: 18px; white-space: nowrap;
  border: 1px solid var(--line); background: #00000099; color: #fff; font-size: 14px; cursor: pointer; }
.curtog.on { background: #ff8f00; border-color: #ff8f00; }

.bullayer { z-index: 6; }
.bubov { position: absolute; background: #fff8dc; border: 1.5px solid #ff8f00; color: #111; line-height: 1.25; box-sizing: border-box; cursor: pointer; }
.diabox { max-height: 92%; overflow: auto; }
.bub-text { flex: 1; min-height: 56px; border-radius: 10px; border: 1px solid #8886; background: #0003; color: inherit; padding: 8px; font: inherit; resize: vertical; }
.dia-pick { display: flex; flex-direction: column; gap: 10px; }
.dia-alt { display: flex; flex-direction: column; gap: 10px; }
.dia-bend { font-size: 13px; }

.bubov.erasable { border-color: #e53935; border-style: dashed; cursor: crosshair; pointer-events: auto; }
@media (max-width: 760px) { .pgnav.up { bottom: calc(var(--safe-bottom) + 76px); } }
@media (max-width: 560px) {
  .curtog { width: 40px; height: 40px; padding: 0; border-radius: 50%; margin: 0 2px; }
  .curtog .ct-l { display: none; }
  .vbar { overflow-x: auto; scrollbar-width: none; }
  .vbar .vt { flex: 1 1 0; min-width: 0; }
  .vbar .iconbtn { width: 36px; height: 36px; }
  .vbar .iconbtn[style*='width:auto'] { width: auto !important; min-width: 0 !important; padding: 0 8px !important; font-size: 12px !important; }
  .curtog { width: 36px; height: 36px; }
}

.voxtitle { margin: 14px 4px 6px; font-size: 13px; color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.voxgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.voxgrid.wide { grid-template-columns: 1fr; margin-top: 4px; }
.voxbtn { min-height: 48px; border-radius: 12px; border: 2px solid var(--c, var(--line)); border-bottom-width: 5px; background: #2b1d52e6; box-shadow: 0 3px 10px #0004; color: inherit; font-size: 17px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.voxbtn:hover, .voxbtn:active { background: var(--surface2, #3a2a6a); }
.voxgrid.wide .voxbtn { font-size: 16px; }

.dialog.statdlg { max-width: 720px; max-height: 92vh; overflow-y: auto; }
.statchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.statchips .chip { border: 1px solid var(--line); background: #ffffff10; color: inherit; border-radius: 16px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.statchips .chip.sel { background: var(--primary, #ff8f00); color: #000; border-color: transparent; }
.statbody h3 { margin: 18px 0 6px; font-size: 15px; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; margin-top: 6px; }
.kpi { background: #ffffff10; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 22px; } .kpi span { font-size: 12px; color: var(--dim); }
.statrow { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; }
.statlab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statbar { background: #ffffff10; border-radius: 6px; height: 12px; overflow: hidden; }
.statbar i { display: block; height: 100%; background: #ff8f00; border-radius: 6px; }
.statval { color: var(--dim); min-width: 40px; text-align: right; }
.stattab { width: 100%; border-collapse: collapse; font-size: 13px; }
.stattab th { text-align: left; color: var(--dim); font-weight: 500; padding: 4px 6px; }
.stattab td { padding: 5px 6px; border-top: 1px solid var(--line); }
.stattab td:not(:first-child), .stattab th:not(:first-child) { text-align: right; white-space: nowrap; }

/* Harmonica : choix du type / de la tonalité */
.tonbtn { width: auto !important; min-width: 44px; padding: 0 10px !important; font-size: 14px; font-weight: 700; color: var(--primary); border-radius: 22px !important; }
.tonrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.tonlab { font-size: 13px; color: var(--dim); min-width: 52px; }
.tonpill { border: 1px solid var(--line); background: var(--surface2); color: inherit; border-radius: 16px; padding: 6px 12px; font-size: 14px; }
.tonpill.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.tonpill.off { opacity: .45; }
.tonkeys { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tonkey { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); background: var(--surface2); color: inherit; border-radius: 10px; font-size: 15px; }
.tonkey span { font-size: 11px; color: var(--dim); text-align: center; }
.tonkey.ok b { color: #2e9e48; }
.tonkey.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.tonkey:disabled { opacity: .4; }

/* Mode « Notes » */
.notesview { position: fixed; inset: 0; z-index: 3000; background: #fff; color: #111; display: flex; flex-direction: column; }
.nvbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border-bottom: 1px solid #ccc; background: #f6f6f6; }
.nvbar .textbtn { color: #1a4f9c; }
.nvt { font-weight: 700; flex: 1 1 160px; min-width: 120px; }
.nvrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nvlabel { font-size: 13px; color: #555; }
.nvpill { border: 1px solid #999; background: #fff; border-radius: 14px; padding: 4px 10px; font-size: 13px; cursor: pointer; color: #111; }
.nvpill.on { background: #1a4f9c; border-color: #1a4f9c; color: #fff; }
.nvsel { font-size: 14px; padding: 4px 6px; border-radius: 6px; border: 1px solid #999; background: #fff; color: #111; }
.nvbody { flex: 1; overflow: auto; padding: 8px; text-align: center; }
.nvband { margin: 0 auto 4px; text-align: left; }
.nvband.sys { margin-top: 18px; }
.nvband canvas { display: block; }
.nvlab { position: relative; }
.nvn { position: absolute; transform: translateX(-50%); color: #c4191c; font-weight: 700; white-space: nowrap; display: flex; flex-direction: column; align-items: center; }
.nvn.ch { color: #8a1013; }
.nvpage { text-align: center; color: #888; font-size: 12px; margin: 14px 0 6px; border-top: 1px dashed #bbb; padding-top: 4px; }

.nvbody { display: flex; justify-content: center; align-items: flex-start; }
.nvpagebox { display: flex; flex-direction: column; align-items: center; margin: 0 auto; }
.nvband { margin-bottom: 3px; }
.nvbar .textbtn:disabled { opacity: .35; }

.bubov { touch-action: none; user-select: none; -webkit-user-select: none; }
.bubov.own { box-shadow: 0 2px 8px #0004; }
.bubh { position: absolute; right: -8px; bottom: -8px; width: 22px; height: 22px; border-radius: 50%; background: #ff8f00; border: 2px solid #fff; cursor: nwse-resize; touch-action: none; }
.bub-glyphs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.bub-g { min-width: 38px; height: 38px; font-size: 22px; border-radius: 10px; border: 1px solid #8886; background: #0002; color: inherit; cursor: pointer; }

/* Voix : barre superposée (la page garde toute la hauteur), masquée automatiquement */
.nvbar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; box-shadow: 0 2px 8px #0003; transition: opacity .2s, transform .2s; }
.nvbar.hidden { opacity: 0; transform: translateY(-100%); pointer-events: none; }

.nvn.nve{cursor:pointer;outline:1px dashed rgba(0,90,200,.5)}
.nvn.nvf{background:#ffd23f;color:#900;border-radius:3px}

/* admin : morceau avec quelque chose à faire */
.row.todo { box-shadow: 0 0 0 2px #ffb020, 0 0 14px #ffb02099; animation: todopulse 2.2s ease-in-out infinite; }
@keyframes todopulse { 0%,100% { box-shadow: 0 0 0 2px #ffb020, 0 0 6px #ffb02055; } 50% { box-shadow: 0 0 0 2px #ffb020, 0 0 18px #ffb020cc; } }
.row .todobox { margin-top: 4px; font-size: 13px; color: #ffcf70; }
.row .todoline .textbtn { font-size: 12px; margin-left: 6px; color: #ffcf70; text-decoration: underline; }

/* Fenêtre « À tester » */
.dialog.testsdlg { max-width: 640px; max-height: 92vh; overflow-y: auto; padding: 0 0 16px; }
.tests-hero { background: linear-gradient(135deg, #ff7a18, #e5258f 55%, #7b3fe4); color: #fff; padding: 22px 20px 16px; border-radius: 20px 20px 0 0; }
.tests-big { font-size: 2rem; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.tests-sub { opacity: .92; margin-top: 4px; font-size: 1rem; }
.tests-grp { margin: 14px 14px 0; }
.tests-tag { display: inline-block; font-weight: 800; font-size: .85rem; letter-spacing: .06em; padding: 5px 12px; border-radius: 999px; color: #fff; margin-bottom: 8px; }
.tests-grp.site .tests-tag { background: #1f8bff; }
.tests-grp.appli .tests-tag { background: #19b36b; }
.tests-card { padding: 9px 12px; margin-bottom: 7px; border-radius: 12px; background: #ffffff12; border-left: 5px solid; line-height: 1.4; font-size: .95rem; }
.tests-grp.site .tests-card { border-color: #1f8bff; }
.tests-grp.appli .tests-card { border-color: #19b36b; }
.tests-card b { display: block; font-size: 1.02rem; color: #ffd45c; margin-bottom: 2px; }
.tests-card span { opacity: .9; }
.tests-foot { margin: 14px 14px 4px; padding: 12px 14px; border-radius: 12px; background: #ffd45c; color: #2a1a00; font-weight: 700; }
.testsdlg .actions { padding: 8px 14px 0; }

.nvpill.nvplay { background: #19b36b; color: #fff; border-color: #19b36b; font-weight: 700; }

/* « À tester » : casiers par catégorie */
.tests-cas { margin: 10px 14px 0; border-radius: 14px; background: #ffffff0d; border: 1px solid #ffffff22; border-left: 6px solid var(--cc); overflow: hidden; }
.tests-cas > summary { cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.05rem; list-style: none; }
.tests-cas > summary::-webkit-details-marker { display: none; }
.tests-cn { color: #fff; } .tests-cnt { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--cc); color: #fff; }
.tests-cas .tests-card { margin: 0 10px 8px; border-left: 0; background: #ffffff10; }
.tests-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 3px; }
.tests-line b { margin: 0; display: inline; }
.tests-chip { font-size: .68rem; font-weight: 800; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; color: #fff; }
.st-new { background: #ff7a18; } .st-fix { background: #19b36b; } .st-test { background: #7b3fe4; }
.pf-site { background: #1f8bff; } .pf-appli { background: #0f8a52; }
