/* Sports Mockup — configurateur 3D */

:root {
  --ink: #e9e9ee;
  --muted: #8e8e9a;
  --bg: #07080a;
  --panel: rgba(14, 14, 18, .82);
  --surface: #121318;
  --line: rgba(255, 255, 255, .09);
  --card: rgba(255, 255, 255, .035);
  --accent: #6aa6ff;
  --danger: #ff6b6b;
  --radius: 8px;
  --panel-w: 300px;
  --sheet-h: 46vh;
  --sheet-bar: 46px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }

/* ---------- scène ---------- */
/* la scène occupe l'espace à gauche du panneau : le personnage n'est jamais masqué */
.stage { position: fixed; inset: 0 var(--panel-w) 0 0; touch-action: none; }
.stage.drop-over { box-shadow: inset 0 0 0 2px var(--accent); }
.stage.dragging-layer { cursor: grabbing; }

.brand { position: fixed; top: 18px; left: 20px; z-index: 1; }
.brand img { display: block; width: 150px; height: auto; }


/* ---------- panneau ---------- */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-w);
  padding: 16px 12px 16px 14px; overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--line); backdrop-filter: blur(10px);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.panel::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .32); background-clip: padding-box; }
.panel h2 {
  margin: 14px 2px 6px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.tab-panel > h2:first-child { margin-top: 4px; }

.sheet-toggle { display: none; }

/* ---------- compte ---------- */
/* barre en haut à droite : export, langue, utilisateur */
.topbar {
  position: fixed; top: 16px; right: calc(var(--panel-w) + 16px); z-index: 4;
  display: flex; align-items: center; gap: 8px;
}
body.readonly .topbar { right: 20px; }
.icon-round {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 10px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(10px);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.icon-round svg { width: 18px; height: 18px; flex: none; }
.icon-round:hover, .icon-round[aria-expanded="true"] { background: rgba(44, 46, 54, .92); }
.avatar-btn {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(10px); cursor: pointer;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: rgba(255, 255, 255, .35); }
.avatar-icon { width: 18px; height: 18px; }
/* pas d'overflow: hidden sur le bouton : la pastille « non enregistré » doit déborder du rond (la photo est arrondie seule) */
.avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-btn.signed-in { border-color: rgba(106, 166, 255, .7); }
.unsaved-dot {
  position: absolute; z-index: 1; top: -3px; right: -3px; width: 12px; height: 12px;
  border-radius: 50%; background: #f39200; border: 2px solid #0e0f13;
}
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; display: grid; gap: 2px; min-width: 220px; padding: 6px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer;
}
.menu-item.stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.menu-item small { font-size: 11px; color: var(--muted); }
.menu-item.stack small { color: #f7b35c; }
.menu-item[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.menu-head { display: grid; gap: 2px; padding: 6px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-head strong, .menu-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head span { font-size: 12px; color: var(--muted); }
.title-input {
  width: 100%; padding: 7px 9px; border-radius: 6px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05); font-weight: 600;
}
.title-input::placeholder { color: var(--muted); font-weight: 400; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* fenêtre « Mes créations » : création ouverte */
.doc-card { margin-bottom: 18px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.section-label {
  display: block; margin: 0 2px 6px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.badge {
  margin-left: 8px; padding: 1px 7px; border-radius: 10px; vertical-align: 1px;
  background: rgba(106, 166, 255, .16); color: var(--accent); font-size: 11px; font-weight: 600;
}
.doc-status { display: flex; align-items: center; gap: 6px; margin: 5px 2px 0; font-size: 12px; color: var(--muted); }
.doc-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.doc-status[data-state="saved"]::before { background: #4cd07d; }
.doc-status[data-state="dirty"] { color: #f7b35c; }
.doc-status[data-state="dirty"]::before { background: #f39200; }
.doc-status[data-state="busy"]::before { background: var(--accent); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.doc-actions .btn { flex: 1 1 auto; }

/* ---------- onglets ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; margin-bottom: 8px; border-radius: 9px; background: rgba(255, 255, 255, .05); }
.tab { padding: 7px 0; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: rgba(255, 255, 255, .12); color: var(--ink); }

/* ---------- contrôles ---------- */
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 5px 0; }
.row .name { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.line { display: flex; gap: 6px; margin-top: 6px; }
.line .btn { flex: 1; }
input[type=range] { width: 110px; accent-color: var(--accent); }
input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
input[type=color] { width: 40px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }
.range { display: flex; align-items: center; gap: 6px; }
.range input[type=range] { width: 96px; }
.range output { min-width: 46px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.btn {
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #07101f; font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.small { padding: 5px 2px; font-size: 12px; }
select {
  max-width: 100%; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: #1b1d23; color: var(--ink); font: inherit;
}
.btn.danger { color: var(--danger); }
.btn.block { display: block; width: 100%; }
.icon-btn {
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px;
  background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--ink); }

.block-select { width: 100%; }
.panel h2 label { cursor: default; }
.tools { padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.span2 { grid-column: span 2; }

/* cartes couleurs */
.card {
  margin: 8px 0; padding: 6px 10px 8px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 3px solid var(--swatch, #555); background: var(--card);
}
.card.sel { border-color: rgba(106, 166, 255, .55); border-left-color: var(--swatch, #555); }
.card.single { padding: 6px 10px; }
.card.single .row { margin: 0; }
.card.single .name { font-weight: 600; }
.card-head { padding: 2px 0 4px; margin-bottom: 2px; border-bottom: 1px solid var(--line); font-weight: 600; }

/* ---------- design ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.seg-btn {
  padding: 7px 4px; border-radius: 6px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04); cursor: pointer; font-size: 12px;
}
.seg-btn:hover { background: rgba(255, 255, 255, .1); }
.seg-btn[aria-checked="true"] { border-color: var(--accent); background: rgba(106, 166, 255, .16); color: #fff; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 10px; padding: 16px 10px;
  border: 1.5px dashed rgba(255, 255, 255, .22); border-radius: 10px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone span { font-size: 11px; color: var(--muted); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: rgba(106, 166, 255, .08); }
.hint { margin: 8px 2px 0; font-size: 11px; color: var(--muted); }
.empty { margin: 6px 2px; font-size: 12px; color: var(--muted); }

.layers { list-style: none; margin: 0 0 8px; padding: 0; }
.layer {
  display: flex; align-items: center; gap: 8px; margin: 4px 0; padding: 5px 6px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); cursor: pointer;
}
.layer:hover { background: rgba(255, 255, 255, .07); }
.layer.sel { border-color: var(--accent); }
.layer .thumb {
  flex: none; width: 34px; height: 34px; object-fit: contain; border-radius: 4px;
  background: repeating-conic-gradient(#2a2c33 0 25%, #1d1f25 0 50%) 0 0 / 10px 10px;
}
.layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer { user-select: none; -webkit-user-drag: none; }
.layer img { -webkit-user-drag: none; }
.layer-grip { flex: none; padding: 4px 2px; color: var(--muted); cursor: grab; touch-action: none; }
.layer.dragging { opacity: .45; cursor: grabbing; }
.layer.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.layer.drop-after { box-shadow: 0 2px 0 var(--accent); }
.thumb.text-thumb { display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.add-text { margin-top: 8px; }
.text-props, .pattern-props { display: grid; gap: 8px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.text-props textarea, .text-props input[type=text] {
  width: 100%; padding: 7px 9px; border-radius: 6px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05); font: inherit; color: inherit; resize: vertical;
}
.layer-actions { display: flex; }

/* motifs répétés : vignette recolorée (masque = SVG du motif) et propriétés */
.thumb.pattern-thumb { display: block; overflow: hidden; }
.pattern-swatch {
  display: block; width: 100%; height: 100%;
  -webkit-mask-repeat: repeat; -webkit-mask-size: 14px auto; mask-repeat: repeat; mask-size: 14px auto;
}
.pattern-props .row { margin: 0; }
.pattern-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pattern-props input[type=color]:disabled { opacity: .35; cursor: default; }

/* fenêtre de choix du motif (vignettes sur fond clair : motifs noirs) */
.pattern-grid {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px;
  max-height: 60vh; margin: 0; padding: 2px; overflow-y: auto;
}
.pattern-choice {
  display: grid; gap: 6px; width: 100%; padding: 6px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); font-size: 12px; cursor: pointer;
}
.pattern-choice:hover { background: rgba(255, 255, 255, .08); }
.pattern-choice[aria-current="true"] { border-color: var(--accent); }
.pattern-choice img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; background: #ececf0; }
.pattern-choice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* courbure d'un texte : raccourcis arc bas / droit / arc haut */
.arc-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.arc-presets .btn { padding-inline: 6px; font-size: 12px; }
.arc-presets .btn:disabled { opacity: .5; cursor: default; }

/* dé « Générer un maillot » (barre du haut) : absent de la page de partage en lecture seule */
.icon-round:disabled { opacity: .55; cursor: progress; }
body.readonly #generateJersey { display: none; }

/* fenêtre « Utilisateurs » (administration) */
.dialog.admin { width: min(720px, calc(100vw - 32px)); }
.admin-tools { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.admin-tools .field { flex: 1; }
.admin-tools .muted { margin: 0 0 9px; font-size: 12px; white-space: nowrap; }
.admin-list { list-style: none; display: grid; gap: 6px; max-height: 60vh; margin: 0; padding: 2px; overflow-y: auto; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); text-align: left;
}
button.admin-row { cursor: pointer; }
button.admin-row:hover { background: rgba(255, 255, 255, .08); }
.admin-main { display: grid; gap: 2px; min-width: 0; }
.admin-main strong, .admin-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main span { font-size: 12px; }
.admin-side { display: grid; flex: none; justify-items: end; gap: 2px; }
.admin-side.inline { display: flex; align-items: center; gap: 8px; }
.admin-side small { font-size: 11px; }
.admin-side .badge { margin-left: 0; }
.admin-user-title { margin: 10px 0 2px; font-size: 15px; }
@media (max-width: 560px) {
  .admin-row { flex-direction: column; align-items: stretch; }
  .admin-side { justify-items: start; }
}

/* fenêtre « toutes les polices » */
.dialog.fonts { width: min(760px, calc(100vw - 32px)); }
.font-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.font-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.font-cat {
  padding: 5px 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  font-size: 12px; cursor: pointer;
}
.font-cat:hover { background: rgba(255, 255, 255, .08); }
.font-cat[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.font-grid {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px;
  max-height: 58vh; margin: 0; padding: 2px; overflow-y: auto;
}
.font-choice {
  display: grid; gap: 4px; width: 100%; padding: 10px 12px; text-align: left; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
}
.font-choice:hover { background: rgba(255, 255, 255, .08); }
.font-choice[aria-current="true"] { border-color: var(--accent); }
.font-sample {
  min-height: 1.2em; overflow: hidden; font-size: 28px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis;
  opacity: .2; transition: opacity .2s;
}
.font-choice.ready .font-sample { opacity: 1; }
.font-choice.failed { opacity: .45; }
.font-name { font-size: 11px; color: var(--muted); }
@media (max-width: 560px) { .font-tools { grid-template-columns: 1fr; } }

/* ---------- chargement ---------- */
.loader { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: var(--bg); transition: opacity .4s; }
.loader > div { display: flex; flex-direction: column; align-items: center; }
.loader img { display: block; width: min(300px, 70vw); height: auto; margin-bottom: 26px; }
.loader-text { margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.loader-text:empty { display: none; }
.loader .bar { width: 240px; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .1); }
.loader .fill { width: 0; height: 100%; background: var(--ink); transition: width .15s; }
.loader.done { opacity: 0; pointer-events: none; }

/* ---------- fenêtres ---------- */
.dialog {
  width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.dialog.wide { width: min(560px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(4, 5, 8, .62); backdrop-filter: blur(3px); }
.dialog h2 { margin: 0 0 14px; font-size: 17px; }
.dialog-close { position: absolute; top: 12px; right: 12px; margin: 0; }
.providers { display: grid; gap: 8px; }
.provider { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px; font-weight: 600; }
.sep { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form { display: grid; gap: 10px; }
.field { display: grid; gap: 4px; }
.field span { font-size: 12px; color: var(--muted); }
.field input { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); }
.form-error { margin: 0; color: var(--danger); }
.copy { display: flex; gap: 6px; margin: 12px 0; }
.copy input { flex: 1; min-width: 0; padding: 7px 9px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); }

.creations { list-style: none; margin: 10px 0 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.creation-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.creation-meta { display: grid; min-width: 0; }
.creation-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creation-meta span { font-size: 12px; }
.creation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.creation-actions .btn { padding: 5px 8px; font-size: 12px; }
.dialog .line .btn { flex: 1; }

/* export */
.export-preview {
  display: grid; place-items: center; min-height: 180px; margin-bottom: 12px; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--line); background: #1b1d23;
}
/* fond transparent : damier sur l'IMAGE seulement -> le cadre du format (16:9, 4:3, 1:1) reste visible comme sans transparence */
.export-preview.transparent img { background: repeating-conic-gradient(#3a3d46 0 25%, #2a2c33 0 50%) 0 0 / 16px 16px; }
.export-preview img { display: block; max-width: 100%; max-height: 260px; }
.export-preview img:not([src]) { display: none; }
.export-views { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 6px; padding: 0; border: 0; }
.export-views legend { float: left; width: 100%; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.export-download { margin-top: 12px; }

/* réglages des lumières : un bloc par lumière (nom + marche/arrêt, puissance, angle, hauteur) */
.light-group { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.light-group:first-child { padding-top: 0; border-top: 0; }
.light-name label { font-weight: 600; }
.light-group:has(input[type="checkbox"]:not(:checked)) .row:not(.light-name) { opacity: .45; }
@media (max-width: 520px) {
  .creation-item { flex-direction: column; align-items: stretch; }
  .creation-actions { justify-content: flex-start; }
}

/* ---------- notifications ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 20; display: grid; gap: 6px; transform: translateX(-50%); pointer-events: none; }
.toast {
  padding: 9px 14px; border-radius: var(--radius); background: #1e2027; border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: opacity .3s, transform .3s;
}
.toast.error { border-color: rgba(255, 107, 107, .5); color: #ffd0d0; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- crédit ---------- */
.credit {
  position: fixed; left: 20px; bottom: 14px; z-index: 2;
  font-size: 12px; color: var(--muted); text-decoration: none;
}
.credit:hover { color: var(--ink); text-decoration: underline; }

/* ---------- lecture seule (lien partagé) ---------- */
.viewer-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(10px);
}
.viewer-title { font-weight: 600; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.readonly .panel { display: none; }
body.readonly .stage { right: 0; bottom: 0; }

/* ---------- smartphone ---------- */
@media (max-width: 700px) {
  .stage { right: 0; bottom: var(--sheet-h); }
  .panel { top: auto; left: 0; width: auto; height: var(--sheet-h); padding-top: 0; border-left: 0; border-top: 1px solid var(--line); }
  /* bouton pleine largeur, collé en haut du bandeau : replie / déplie les réglages */
  .sheet-toggle {
    position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% + 26px); height: var(--sheet-bar); margin: 0 -12px 10px -14px;
    border: 0; border-bottom: 1px solid var(--line); background: rgba(20, 20, 24, .96);
    font: 600 13px/1 system-ui, sans-serif; cursor: pointer;
  }
  .sheet-toggle::after {
    content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform .2s;
  }
  body.sheet-collapsed .sheet-toggle::after { transform: rotate(-135deg) translate(-2px, 0); }
  body.sheet-collapsed .panel { height: var(--sheet-bar); overflow: hidden; }
  body.sheet-collapsed .panel-body { display: none; }
  body.sheet-collapsed .stage { bottom: var(--sheet-bar); }
  .viewer-bar { position: fixed; right: 12px; left: 12px; bottom: 12px; justify-content: space-between; }
  .brand img { width: 120px; }
  .topbar { top: 12px; right: 12px; }
  .credit { left: 12px; bottom: calc(var(--sheet-h) + 8px); }
  body.sheet-collapsed .credit { bottom: calc(var(--sheet-bar) + 8px); }
  body.readonly .credit { bottom: 70px; }
  body.readonly .topbar { right: 12px; }
}
