/* ============================================================================
 * Livebook — THEME DARK (complet, consolidé) [PRUNE UI tempo/volume]
 * - Variables unifiées
 * - Mise en page bandeau + partoche plein-cadre
 * - Rail latéral fixe
 * - Onglets et panneaux cohérents
 * - Édition : flex colonne, textarea qui prend tout le bas
 * - NAV (recherche) plein écran sous le bandeau
 * ========================================================================== */

/* ---------- Variables globales ---------- */
:root{
  /* Viewer (bandeau) */
  --band-font-size: 28px;
  --btn-pad-y: calc(var(--band-font-size)*.20);
  --btn-pad-x: calc(var(--band-font-size)*.45);
  --btn-radius: 12px;

  /* Dark palette */
  --lb-bg:#0a0e18;
  --lb-surface:#101526;
  --lb-surface-2:#0d1222;
  --lb-fg:#f2f6ff;
  --lb-fg-muted:#a8b0c7;
  --lb-border:#202840;
  --lb-accent:#63c6ff;
  --lb-accent-weak:rgba(99,198,255,.12);
  --lb-quota-warn:#f59e0b;
  --lb-quota-danger:#ff6b6b;
  --lb-line-height:1.15;
  --lb-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --neo-dk:rgba(0,0,0,.55);
  --neo-lt:rgba(255,255,255,.07);

  /* Boutons */
  --btn-bg-1:#12182b;
  --btn-bg-2:#18203a;
  --btn-fg:#f2f6ff;
  --btn-border:#2b3553;
  --btn-hover:#1b2442;

  /* Tabs */
  --tab-fg:#9aa3bc;
  --tab-active-fg:#fff;

  /* Partoche palette */
  --lb-dark-bg:#0b0f1a;
  --lb-dark-fg:#eaeaf0;
  --lb-dark-sub:#b8c0cc;
  --lb-chord:#ff4444;
  --lb-title:#eef3ff;

  /* Bandeau / UI scale */
  --btn-h:36px;
  --bandeau-h:56px;

  /* Police système (scopée, pas globale) */
  --sys-font-size:16px;

  /* Rail */
  --lb-rail-w:78px;
  --lb-rail-gap:8px;
  --lb-rail-top:8px;
}

/* Nav search plein ecran : masque le bandeau */
body.lb-search-open #bandeau { display: none !important; }
body.lb-search-open #navigateur {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  border-top: 0 !important;
}

/* ---------- Reset & cadre global ---------- */
html,body{
  height:100%;
  margin:0;
  padding:0;
  overflow:hidden;
  box-sizing:border-box;
}
*,*::before,*::after{ box-sizing:inherit; }

body{
  background: radial-gradient(1600px 900px at 50% -300px,#12182b 0%,#0a0e18 60%,#070a13 100%);
  color:var(--lb-fg);
  font-family:var(--lb-font);
  font-size:15px; /* base fixe (la "police système" est SCOPÉE plus bas) */
}

/* Conteneur racine plein écran */
#bordure{
  position:fixed; inset:0;
  display:flex; flex-direction:column;
  background:transparent; color:inherit!important;
  transition:left .18s ease;
}
body.editor-open #bordure{ left:530px; }
body:not(.editor-open) #bordure{ left:-5px; }
body.rail-hidden:not(.editor-open) #bordure,
body.lb-fs:not(.editor-open) #bordure{ left:0!important; }

/* ---------- Bandeau ---------- */
#bandeau{
  display:flex!important; align-items:center!important; justify-content:space-between;
  gap:10px; height:var(--bandeau-h)!important; padding:0 10px!important; margin:0!important;
  background:#121826!important; color:var(--lb-dark-fg)!important;
  border:1px solid rgba(255,255,255,.05);
  border-bottom:1px solid rgba(255,255,255,.08)!important;
  border-radius:14px;
  box-shadow:10px 10px 18px var(--neo-dk), -8px -8px 14px var(--neo-lt);
  position:sticky; top:0; z-index:1000;
  /* Taille du TITRE pilotée ici (indépendante du reste) */
  font-size: var(--band-font-size);
}
#bandeau .zone{ display:flex; align-items:center; gap:8px; min-width:0; flex:1 1 auto; }
#bandeau .zone.titre{ justify-content:center; flex:2 1 auto; min-width:120px; overflow:hidden; }
#bandeau #titre.is-overflow{ opacity:0; visibility:hidden; transition:opacity .18s,visibility .18s; }

/* Zone droite stabilisée (ne suit PAS --sys-font-size) */
#bandeau .zone.droite{ font-size:14px; }

/* Le titre hérite de --band-font-size (pas de taille fixe ici) */
#titre{
  text-align:center;
  font-weight:700;
  font-size:1em;           /* hérite de #bandeau */
  line-height:1.2;
  letter-spacing:.06em; text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  background:linear-gradient(90deg,#6cf,#f66,#6cf); background-size:200% auto;
  -webkit-background-clip:text; background-clip:text; color:transparent!important;
  animation:lbTitreGlow 6s linear infinite;
}
@keyframes lbTitreGlow{ 0%{background-position:0 0} 100%{background-position:200% 0} }

/* ---------- Partoche plein-cadre ---------- */
#partitionE{
  display:grid!important;
  grid-template-rows:var(--bandeau-h) minmax(0,1fr)!important;
  grid-template-columns:1fr!important;
  gap:0!important; min-height:0; height:100%;
  background:var(--lb-surface);
  border:1px solid rgba(255,255,255,.05);
  border-radius:20px; padding:12px; margin:0;
  box-shadow:16px 16px 30px var(--neo-dk), -14px -14px 28px var(--neo-lt);
}
#partoche-wrapper{
  grid-row:2; min-height:0!important; position:relative; overflow:hidden!important;
  padding:0!important; margin:0!important;
  background:linear-gradient(180deg,#0f1426 0,#0a0e1b 100%);
  border:none!important; border-radius:16px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35),
              12px 12px 24px var(--neo-dk), -8px -8px 18px var(--neo-lt);
}
/* Autoriser le scroll uniquement quand l’éditeur est ouvert */
body.editor-open #partoche-wrapper{ overflow:auto!important; }

#partoche{
  position:absolute; inset:0; width:100%!important; height:100%!important;
  margin:0!important; padding:0!important; border:none!important; box-sizing:border-box!important;
  overflow:clip!important;
  color:var(--lb-fg)!important; font-family:var(--lb-font); line-height:var(--lb-line-height,1.15);
}
#partoche.lb-view{
  padding: var(--lb-pad-y, 16px) var(--lb-pad-x, 24px) !important;
  box-sizing: border-box !important;
}
#partoche, .lb-line{ color:var(--lb-dark-fg)!important; }
#partoche .text, #partoche .textB, #partoche .textR, #partoche .textV, #partoche .textO, #partoche .textP, #partoche .textC{
  color:var(--lb-dark-fg)!important; font-weight:600;
}
#partoche .accord{ color:var(--lb-chord)!important; font-weight:700; padding-right:2px; }
#partoche .lb-section-label{ color:var(--lb-title)!important; }
.lb-section-label{
  display:inline-flex; align-items:center; justify-content:center; width:fit-content; max-width:100%;
  text-align:center; margin:14px auto 8px; padding:5px 14px;
  font-weight:700; font-size:var(--sys-font-size); line-height:1; font-family:var(--lb-font);
  letter-spacing:.16em; text-transform:uppercase;
  color:var(--lb-accent); background:var(--lb-accent-weak); border-radius:999px;
}

/* ---------- Champs & boutons ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
textarea, select{
  background:#0f1528; color:var(--lb-fg);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px; padding:7px 10px;
  font:14px/1.35 var(--lb-font);
  outline:none;
  transition:border-color .15s, box-shadow .15s, background .15s;
  box-shadow: inset 6px 6px 10px rgba(0,0,0,.5),
              inset -6px -6px 10px rgba(255,255,255,.05);
}
textarea{ width:100%; max-width:640px; resize:vertical; }
input:focus, textarea:focus, select:focus{
  border-color:rgba(99,198,255,.9);
  box-shadow:0 0 0 1px rgba(99,198,255,.42), inset 0 0 0 0 transparent;
  background:#121a31;
}
select.petit{ font-size:13px; padding:5px 10px; border-radius:10px; }

/* Petits inputs largeur/hauteur (Préférences) */
#contenu_onglet_preferences #largeur,
#contenu_onglet_preferences #hauteur {
  font-size: 0.9em;
  height: 30px;
}

/* Amélioration lisibilité des selects et inputs dans Préférences */
#contenu_onglet_preferences select,
#contenu_onglet_preferences input[type="number"],
#contenu_onglet_preferences input[type="text"] {
  min-height: 34px;
  padding: 4px 10px;
  font-size: 1em;
  line-height: 1.4;
}

/* Facultatif : slider */
#contenu_onglet_preferences input[type="range"] {
  height: 32px;
}

/* Boutons unifiés */
button, input[type="button"], input[type="submit"], .monbouton, .bouton{
  -webkit-appearance:none; appearance:none;
  background:linear-gradient(145deg,var(--btn-bg-1),var(--btn-bg-2))!important;
  color:var(--btn-fg)!important; border:1px solid var(--btn-border)!important;
  border-radius:999px!important; padding:8px 16px!important;
  font:600 13px/1 var(--lb-font)!important; letter-spacing:.02em; cursor:pointer; white-space:nowrap;
  transition:transform .12s, box-shadow .18s, background .18s, border-color .18s!important;
  box-shadow:8px 8px 16px rgba(0,0,0,.55), -6px -6px 12px rgba(255,255,255,.07)!important;
}
button:hover, input[type="button"]:hover, input[type="submit"]:hover, .monbouton:hover, .bouton:hover{
  background:var(--btn-hover)!important; border-color:rgba(99,198,255,.55)!important;
  transform:translateY(-1px);
  box-shadow:12px 12px 22px rgba(0,0,0,.6), -8px -8px 14px rgba(255,255,255,.08)!important;
}
button:active, input[type="button"]:active, input[type="submit"]:active, .monbouton:active, .bouton:active{
  transform:translateY(0);
  box-shadow:inset 6px 6px 12px rgba(0,0,0,.6), inset -6px -6px 12px rgba(255,255,255,.06)!important;
}
button[disabled], input[type="button"][disabled], input[type="submit"][disabled], .monbouton[disabled], .bouton[disabled]{
  opacity:.45!important; cursor:default!important; box-shadow:none!important;
}

/* Boutons dans le bandeau */
#bandeau input[type="button"], #bandeau button, #bandeau .monbouton, #bandeau .bouton{
  box-sizing:border-box; height:var(--btn-h)!important;
  line-height:calc(var(--btn-h) - 2px)!important; padding:0 var(--btn-pad-x)!important;
  display:inline-flex!important; align-items:center!important; justify-content:center!important;
  font:600 13px/1 var(--lb-font);
}

/* (SUPPRIMÉ) Styles double-bouton tempo/volume & pattern wrapper */

/* ---------- Panneaux génériques ---------- */
#contenu_onglet_fichier,
#contenu_onglet_preferences,
#contenu_onglet_espacemembres,
#contenu_onglet_midi,
.contenu_onglet{
  background:var(--lb-surface-2); color:var(--lb-fg);
  border:1px solid rgba(255,255,255,.05);
  border-radius:18px; padding:18px 20px 24px; margin:8px 8px 12px;
  box-shadow:18px 18px 30px var(--neo-dk), -14px -14px 24px var(--neo-lt);
}
.contenu_onglet input[type="text"],
.contenu_onglet input[type="number"],
.contenu_onglet textarea,
.contenu_onglet select{
  background:#0e1426; color:var(--lb-fg);
  border-radius:12px; border:1px solid rgba(255,255,255,.08);
  box-shadow: inset 6px 6px 12px rgba(0,0,0,.55),
              inset -6px -6px 12px rgba(255,255,255,.05);
}
.contenu_onglet input[type="button"],
.contenu_onglet button{
  background:linear-gradient(145deg,var(--btn-bg-1),var(--btn-bg-2));
  color:var(--btn-fg); border:1px solid var(--btn-border); border-radius:999px;
  padding:7px 16px; margin:4px 3px; font:600 13px/1 var(--lb-font);
  box-shadow:8px 8px 18px var(--neo-dk), -6px -6px 12px var(--neo-lt);
  transition:transform .12s, background .18s, box-shadow .18s;
}
.contenu_onglet input[type="button"]:hover,
.contenu_onglet button:hover{ background:var(--btn-hover); transform:translateY(-1px); }

/* ---------- Couleurs balises texte ---------- */
#partoche td.text, #partoche .text, .text, #partoche .lb-N, #partoche .lb-W, #partoche .lb-w{ color:#ffffff!important; }
#partoche td.textR, #partoche .textR, .textR, #partoche .lb-R{ color:#ff6b6b!important; }
#partoche td.textV, #partoche .textV, .textV, #partoche .lb-V{ color:#4cd964!important; }
#partoche td.textB, #partoche .textB, .textB, #partoche .lb-B{ color:#5ac8fa!important; }
#partoche td.textO, #partoche .textO, .textO, #partoche .lb-O, #partoche .lb-o{ color:#ff9500!important; }
#partoche td.textP, #partoche .textP, .textP, #partoche .lb-P{ color:#7B3FE4!important; }
#partoche td.textC, #partoche .textC, .textC, #partoche .lb-C{ color:#FF5BA7!important; }
#partoche td.text, #partoche td.textR, #partoche td.textV, #partoche td.textB, #partoche td.textO, #partoche td.textP, #partoche td.textC{
  text-shadow:0 0 0 rgba(0,0,0,0);
}

/* ---------- Onglets (barre) ---------- */
.systeme_onglets .onglets{
  display:flex; flex-wrap:nowrap; gap:8px; padding:6px 10px;
  overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; scrollbar-width:none;
  position:relative;
  mask-image:linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}
.systeme_onglets .onglets::-webkit-scrollbar{ height:4px; }
.systeme_onglets .onglets::-webkit-scrollbar-track{ background:transparent; }
.systeme_onglets .onglets::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.15); border-radius:20px; }
.systeme_onglets .onglets:hover::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.25); }

.systeme_onglets .onglets::before,
.systeme_onglets .onglets::after{
  content:""; position:absolute; top:0; width:38px; height:100%; pointer-events:none; z-index:2;
}
.systeme_onglets .onglets::before{ left:0;  background:linear-gradient(90deg,#0e111a 0%,rgba(14,17,26,0) 100%); }
.systeme_onglets .onglets::after { right:0; background:linear-gradient(270deg,#0e111a 0%,rgba(14,17,26,0) 100%); }

.systeme_onglets .onglet{
  white-space:nowrap; border-radius:999px;
  background:linear-gradient(145deg,var(--btn-bg-1),var(--btn-bg-2));
  border:1px solid var(--btn-border);
  box-shadow:8px 8px 16px rgba(0,0,0,.55), -6px -6px 12px rgba(255,255,255,.07);
  padding:0; user-select:none; cursor:pointer; scroll-snap-align:start; flex:0 0 auto;
}
.systeme_onglets .onglet h1{
  margin:0; padding:6px 12px; line-height:28px; font:600 13px/28px var(--lb-font); color:#f2f6ff; letter-spacing:.02em;
}
@media (max-width:1100px){ .systeme_onglets .onglet h1{ font-size:12px; padding:6px 10px; } }
@media (max-width:900px){  .systeme_onglets .onglet h1{ font-size:11px; padding:5px 9px;  } }

/* ---------- Fullscreen (lecture) ---------- */
body.lb-fs{ --bandeau-h:56px; }
body.lb-fs #partitionE, body.lb-fs #partoche-wrapper, body.lb-fs #partoche{
  padding:0!important; margin:0!important; box-sizing:border-box!important; max-width:100vw!important; max-height:100vh!important; overflow:hidden;
}
body.lb-fs #bandeau .monbouton,
body.lb-fs #bandeau .bouton,
body.lb-fs #bandeau input[type="button"],
body.lb-fs #bandeau button{
  height:32px!important; line-height:32px!important; padding:0 10px!important; border-radius:9px!important; font-weight:600;
}

/* ---------- NAV / Recherche plein écran ---------- */
#navigateur{
  position:fixed!important; top:var(--bandeau-h)!important; left:0!important; right:0!important; bottom:0!important;
  z-index:2147483643!important; display:none!important; flex-direction:column!important;
  background:rgba(0,0,0,.75)!important; pointer-events:auto;
}
body.nav-open #navigateur{ display:flex!important; }

#navBar{
  flex:0 0 auto!important; background:#0f1629!important; border-bottom:1px solid #2b3553!important;
  padding:10px 14px!important; color:#eaf2ff!important;
}

/* 🔎 Police système SCOPÉE (pas globale) */
#contener{
  position:static!important; flex:1 1 auto!important; min-height:0!important; height:auto!important; width:100%!important;
  margin:0!important; padding:16px!important; overflow-y:auto!important; overflow-x:hidden!important;
  background:#0c1220!important; color:#eef5ff!important;
  border:none!important; border-radius:0!important; text-align:center!important;
  scrollbar-color:rgba(255,255,255,.24) transparent; scrollbar-width:thin;

  /* utilise la variable --sys-font-size ICI uniquement */
  font-family:var(--lb-font)!important;
  font-size:var(--sys-font-size)!important;
  line-height:1.45!important;
}
#contener::-webkit-scrollbar{ width:10px; height:10px; }
#contener::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.18); border-radius:12px; }
#contener::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,.28); }

/* NAV — éléments */
#contener input[type="text"], #contener input[type="search"], #contener select{
  display:block; width:100%; margin:8px 0 10px; padding:10px 12px; border-radius:10px; border:1px solid #314066;
  background:#0f1629; color:#f3f7ff; font:14px/1.35 var(--lb-font); outline:none;
}
#contener input::placeholder{ color:#a9b6d6; }
#contener button, #contener .bouton, #contener input[type="button"]{
  height:38px; padding:0 14px; border-radius:10px; border:1px solid #2b3553;
  background:linear-gradient(145deg,#12182b,#18203a); color:#f2f6ff;
  font:600 13px/38px var(--lb-font);
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow:6px 6px 12px rgba(0,0,0,.45), -4px -4px 10px rgba(255,255,255,.05); cursor:pointer;
}
/* NAV — liste centrée + karaoké */
#contener a, #contener .result, #contener .ligne, #contener .item{
  display:block!important; text-align:center!important; margin:8px auto!important; padding:10px 14px!important; max-width:980px;
  line-height:1.25; font-weight:700;
  font-size:clamp(calc(var(--sys-font-size,16px)*1.3), 2.2vw, calc(var(--sys-font-size,16px)*1.9))!important;
}
#contener .meta, #contener .sub, #contener small{ opacity:.85; font-size:.95em; }
#contener ul, #contener ol{ list-style:none; padding:0; margin:0 auto; text-align:center; }
#contener li{ display:block; margin:6px auto; max-width:920px; }

body.nav-open #contener a,
body.nav-open #contener .result,
body.nav-open #contener .ligne,
body.nav-open #contener .item{
  background:linear-gradient(90deg,#ff8585 0%,#ffd36e 20%,#7bffb7 40%,#7ab8ff 60%,#ff7af5 80%,#ff8585 100%);
  background-size:400% 100%;
  -webkit-background-clip:text; background-clip:text; color:transparent!important;
  text-shadow:0 0 10px rgba(255,255,255,.08);
  animation:lbKaraokeShift 8s linear infinite;
}
@keyframes lbKaraokeShift{ 0%{background-position:0 0} 100%{background-position:400% 0} }
@media (prefers-reduced-motion:reduce){
  body.nav-open #contener a, body.nav-open #contener .result, body.nav-open #contener .ligne, body.nav-open #contener .item{
    animation:none!important; background-position:200% 0;
  }
}

/* ---------- RAIL (fixe à gauche) ---------- */
.lb-rail{
  position:fixed; left:var(--lb-rail-gap); top:var(--lb-rail-top); bottom:var(--lb-rail-gap);
  width:var(--lb-rail-w); padding:8px; display:flex; flex-direction:column; gap:8px;
  background:var(--lb-surface); border:1px solid var(--lb-border);
  border-radius:14px; box-shadow:0 10px 24px rgba(0,0,0,.35); z-index:40; overflow:auto;
}
.systeme_onglets, #bordure{ margin-left:calc(var(--lb-rail-w) + var(--lb-rail-gap)*2); }

.rail-btn{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  padding:10px 6px; border:1px solid var(--lb-border); border-radius:12px;
  background:var(--btn-bg-1); color:var(--lb-fg); cursor:pointer; user-select:none; text-align:center;
  box-shadow: inset 2px 2px 4px var(--neo-dk), inset -2px -2px 4px var(--neo-lt);
  transition: transform .08s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
  position:relative;
}
.rail-btn:hover{ background:var(--btn-bg-2); }
.rail-btn .ico{ font-size:20px; line-height:1; }
.rail-btn .lbl{ font-size:12px; white-space:normal; line-height:1.15; transition:opacity .18s ease; }

.rail-btn.active{
  border-color:var(--lb-accent);
  box-shadow: 0 0 0 3px rgba(99,198,255,.35), 0 10px 24px rgba(0,0,0,.45),
              inset 2px 2px 4px var(--neo-dk), inset -2px 2px 4px var(--neo-lt);
  transform:translateY(-1px);
}

/* Pas d’expansion hover sur appareils coarse */
@media (hover:none) and (pointer:coarse){
  .lb-rail{ width:var(--lb-rail-w)!important; }
  .lb-rail:hover{ width:var(--lb-rail-w)!important; }
}

/* Masquer le rail (mode Edit OFF) */
body.rail-hidden .lb-rail,
body[data-rail="hidden"] .lb-rail{ display:none!important; }
body.rail-hidden .systeme_onglets, body.rail-hidden #bordure{ margin-left:0!important; }

/* ---------- Colonne de gauche : structure de hauteur ---------- */
.systeme_onglets{
  display:flex;
  align-items:stretch;
  height:100vh;
  min-height:0;
}
.contenu_onglets{
  flex:1 1 auto;
  display:flex;
  min-height:0;
  overflow:hidden;
}
.contenu_onglet{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
}

/* ---------- Bloc ÉDITION (layout final) ---------- */
#contenu_onglet_edition{
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  padding:8px;
}

#contenu_onglet_edition .ed-toolbar{
  display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:8px;
}
#contenu_onglet_edition .ed-toolbar > *{ height:32px!important; }

#contenu_onglet_edition .ed-prevnext{
  display:flex; justify-content:center; gap:10px; margin:6px 0 12px;
}
#contenu_onglet_edition .ed-prevnext .bouton{ height:32px!important; }

#contenu_onglet_edition .ed-row{ gap:6px!important; margin:2px 0!important; }
#contenu_onglet_edition .ed-label{
  margin:0!important; min-width:88px; color:var(--lb-fg-muted); font-weight:600;
}
#contenu_onglet_edition input[type="text"]{
  height:32px; line-height:32px; padding:4px 10px; flex:1 1 320px; max-width:640px;
}

/* Style / Pattern / Tempo */
#contenu_onglet_edition .ed-stylegrid{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px; margin:10px 0 12px; align-items:start;
}
#contenu_onglet_edition .ed-field{ display:flex; flex-direction:column; gap:4px; min-width:0; }
#contenu_onglet_edition .ed-field > label{ font-weight:600; color:var(--lb-fg-muted); text-align:center; }
#contenu_onglet_edition .ed-field > select,
#contenu_onglet_edition .ed-field > input[type="number"]{ height:32px; min-width:0; width:100%; }
#contenu_onglet_edition #folderSelect,
#contenu_onglet_edition #paternSelect{ max-width:100%; white-space:nowrap; text-overflow:ellipsis; }

/* Tempo (edit4) — valeur centrée + place pour le spinner */
#contenu_onglet_edition #edit4 {
  text-align:center!important;
  padding-right:28px!important;
  padding-left:10px!important;
  font-variant-numeric:tabular-nums;
}
#contenu_onglet_edition #edit4::-webkit-outer-spin-button,
#contenu_onglet_edition #edit4::-webkit-inner-spin-button { margin:0; }

/* Paroles & Accords : prend tout l'espace restant */
#contenu_onglet_edition .ed-lyrics{
  display:flex; flex-direction:column;
  flex:1 1 auto; min-height:0; overflow:hidden;
  max-width:900px; margin:12px auto 0;
}
#contenu_onglet_edition .ed-lyrics .ed-lyrics-title{
  display:block; text-align:center; margin-bottom:6px; font-weight:700; color:var(--lb-fg-muted);
}
#contenu_onglet_edition #edit2{
  flex:1 1 auto; min-height:0; width:100%;
  height:100%;
  resize:none; overflow:auto;
}

@media (max-width:860px){
  #contenu_onglet_edition .ed-stylegrid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:560px){
  #contenu_onglet_edition .ed-stylegrid{ grid-template-columns:1fr; }
}

/* Filet de sécurité contre styles inline restants dans NAV */
body.nav-open #contener {
  margin-top:0!important; max-height:none!important; height:auto!important;
  overflow-y:auto!important; border-radius:0!important; padding:16px!important;
  background:#0c1220!important; color:#eef5ff!important;
}

/* ============================================================================
   TABLET PORTRAIT — partoche plein ecran, bandeau/panneaux masques
============================================================================ */
@media (orientation: portrait) {
  body.lb-tablet:not(.lb-phone) { overflow: hidden !important; }
  body.lb-tablet:not(.lb-phone) #boutonepingle { display: none !important; }
  body.lb-tablet:not(.lb-phone) #navigateur,
  body.lb-tablet:not(.lb-phone) .lb-rail,
  body.lb-tablet:not(.lb-phone) .lb-rail-handle { display: none !important; }
  body.lb-tablet:not(.lb-phone).nav-open #navigateur {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483646 !important;
  }
  body.lb-tablet:not(.lb-phone) #bandeau {
    display: flex !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: var(--bandeau-h,56px) !important;
    z-index: 30 !important;
  }
  body.lb-tablet:not(.lb-phone) .systeme_onglets { display: block !important; }
  body.lb-tablet:not(.lb-phone) .systeme_onglets > h2,
  body.lb-tablet:not(.lb-phone) .systeme_onglets > .onglets,
  body.lb-tablet:not(.lb-phone) .systeme_onglets > .contenu_onglets { display: none !important; }
  body.lb-tablet:not(.lb-phone).nav-open #partoche-wrapper { display: block !important; }
  body.lb-tablet:not(.lb-phone) #bordure {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    display: flex !important;
  }
  body.lb-tablet:not(.lb-phone) #partitionE {
    position: relative !important;
    display: block !important;
    grid-template-rows: none !important;
    grid-auto-rows: initial !important;
    gap: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 100% !important;
    min-height: 0 !important;
  }
  body.lb-tablet:not(.lb-phone) #partoche-wrapper {
    position: fixed !important;
    inset: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: hidden !important;
    display: block !important;
  }
  body.lb-tablet:not(.lb-phone) #partoche {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 5 !important;
    background: #0a0e18 !important;
  }
  body.lb-tablet:not(.lb-phone) #partoche {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow: auto !important;
    padding: 12px !important;
  }
  body.lb-tablet:not(.lb-phone) #partoche .lb-cols {
    display: flex !important;
    gap: var(--lb-col-gap, 24px) !important;
    width: 100% !important;
    justify-content: center !important;
  }
  body.lb-tablet:not(.lb-phone) #partoche .lb-col {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }
  body.lb-tablet:not(.lb-phone) #partoche.lb-layout-busy {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}
