/* Le bandeau de commande. Il est volontairement hors du site (fond ambré, mention
   « Maquette ») pour qu'on ne le confonde jamais avec un élément de la page. */
:root { --ambre: #F5B83D; --ambre-fonce: #3A2A05; --encre: #1D1D1F; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { display: flex; flex-direction: column; background: #E9E9EC; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ambre-fonce); }
button { font: inherit; cursor: pointer; }
:where(a, button):focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }

/* La page occupe tout sauf le bandeau : les barres fixes propres à une direction restent visibles. */
.scene { flex: 1; min-height: 0; display: flex; justify-content: center; }
.scene iframe { border: 0; width: 100%; height: 100%; background: #fff; transition: width .25s ease; }
body[data-appareil="telephone"] .scene { padding: 18px 0; }
body[data-appareil="telephone"] .scene iframe { width: 390px; max-width: 100%; border-radius: 30px; box-shadow: 0 0 0 10px var(--encre), 0 18px 40px rgba(0, 0, 0, .25); }

.bandeau { flex: none; background: var(--ambre); border-top: 2px solid rgba(0, 0, 0, .15); padding: 8px 16px 10px; display: grid; gap: 8px; }
.rang { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rang[hidden] { display: none; }
.etiquette { font-size: 12px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.etiquette span { display: block; font-weight: 500; letter-spacing: 0; }

.directions, .appareil, .options { display: flex; gap: 6px; }
.directions { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.directions::-webkit-scrollbar { display: none; }
.directions a, .appareil button, .options button, .ouvrir, .copier {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 14px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ambre-fonce);
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(0, 0, 0, .18); border-radius: 999px;
}
.directions a:hover, .appareil button:hover, .options button:hover { background: rgba(255, 255, 255, .85); }
.directions a[aria-current="true"], .appareil button[aria-pressed="true"], .options button[aria-pressed="true"] { background: var(--encre); color: #fff; border-color: var(--encre); }

.reglages { flex-wrap: wrap; row-gap: 8px; }
.groupes { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.groupe { display: flex; align-items: center; gap: 8px; }
.nom-groupe { font-size: 12px; font-weight: 700; }
.options button { font-weight: 500; padding: 5px 10px; min-height: 34px; font-size: 13.5px; }
.options { gap: 4px; }
.pastille { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .25); }
.resume { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.choix { font-size: 12.5px; line-height: 1.3; max-width: 330px; background: rgba(255, 255, 255, .7); border-radius: 10px; padding: 5px 10px; }
.choix strong { font-weight: 700; }
.copier { background: var(--encre); color: #fff; border-color: var(--encre); min-height: 34px; }
.ouvrir { display: none; }

.seul-mobile { display: none; }

/* Sur un vrai téléphone : on voit déjà la version téléphone, et la place manque.
   Les directions passent sur deux rangées (3 + 2) pour que chaque nom tienne dans son bouton,
   et les réglages se replient derrière « Personnaliser ». */
@media (max-width: 820px) {
  .bandeau { padding: 6px 8px 8px; gap: 6px; }
  .appareil, .etiquette span { display: none; }
  .etiquette { font-size: 10px; writing-mode: vertical-rl; transform: rotate(180deg); }
  .rang { gap: 8px; }
  .directions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; overflow: visible; }
  .directions a { grid-column: span 2; justify-content: center; font-size: 13px; padding: 4px 6px; min-height: 36px; white-space: nowrap; }
  .directions a:nth-child(n+4) { grid-column: span 3; }
  body[data-appareil="telephone"] .scene { padding: 0; }
  body[data-appareil="telephone"] .scene iframe { width: 100%; border-radius: 0; box-shadow: none; }
  .ouvrir { display: inline-flex; }
  .seul-mobile { display: inline; }
  .groupes { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .bandeau.ouvert .groupes { display: flex; }
  .groupe { justify-content: space-between; }
  .options { flex-wrap: wrap; justify-content: flex-end; }
  .resume { margin-left: 0; flex: 1; justify-content: flex-end; }
  .choix { display: none; font-size: 12.5px; padding: 6px 10px; max-width: none; }
  .bandeau.ouvert .resume { order: 4; width: 100%; justify-content: space-between; }
  .bandeau.ouvert .choix { display: block; }
}
@media (max-width: 360px) {
  .directions a { font-size: 11.5px; letter-spacing: -0.01em; padding: 4px 3px; font-weight: 600; }
}
