:root {
  --yellow: #ffd60a;
  --black: #0b0b0c;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --text: #f5f5f7;
  --muted: #a1a1a8;
  --line: rgba(255, 255, 255, 0.12);
  --rec: #ff3b30;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs: 40px;
  --pw: 56vw; /* largeur réglée (part de la fenêtre) */
  --pmin: 600px; /* largeur minimum : en dessous, le bandeau touche les deux bords */
  --ph: 34vh;
  --pad: clamp(14px, 3vw, 34px); /* marge du texte, qui diminue avec la fenêtre */
  --tabs: calc(58px + env(safe-area-inset-bottom)); /* barre des modes, tout en bas */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--black); color: var(--text); font-family: var(--font); overflow: hidden; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: currentColor; }

#stage { position: fixed; inset: 0; overflow: hidden; }

/* Fond : l'image de la caméra, floutée et assombrie, sur tout l'écran. */
#backdrop {
  position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; background: #000;
  filter: blur(34px) saturate(1.15) brightness(0.5);
}
#backdrop.mirror { transform: scaleX(-1); }

/* Cadre : exactement ce qui est filmé (format choisi), placé par main.js entre le bandeau et la barre. */
#frame {
  position: absolute; left: 50%; top: 50%; width: 320px; height: 180px; transform: translate(-50%, -50%);
  border-radius: 14px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 18px 60px rgba(0, 0, 0, 0.55);
  transition: width 0.25s, height 0.25s, top 0.25s;
}
#frame.recording { box-shadow: 0 0 0 3px var(--rec), 0 18px 60px rgba(0, 0, 0, 0.55); }
#preview { width: 100%; height: 100%; object-fit: cover; display: block; }
#preview.mirror { transform: scaleX(-1); }
#frame-label {
  position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: rgba(0, 0, 0, 0.5); color: rgba(255, 255, 255, 0.85); font-variant-numeric: tabular-nums;
}

/* Bouton format : un petit rectangle couché ou debout. */
.format-icon { display: block; width: 22px; height: 14px; border: 2.5px solid currentColor; border-radius: 4px; }
.portrait .format-icon { width: 14px; height: 22px; }

/* Bandeau de texte, collé en haut, au plus près de la webcam. */
#prompter {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  /* Suit la largeur réglée, jamais moins que le minimum, jamais plus que la fenêtre : pas de saut. */
  width: min(100vw, max(var(--pw), var(--pmin))); height: var(--ph); min-height: 120px;
  background: rgba(24, 24, 26, 0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 0 0 26px 26px; overflow: hidden; touch-action: none; user-select: none; cursor: grab;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
#prompter:active { cursor: grabbing; }
#prompter::before {
  /* Repère de la ligne de lecture */
  content: ""; position: absolute; left: calc(var(--pad) / 2 - 8px); top: calc(22% + var(--fs) * 0.42); z-index: 2;
  border: 9px solid transparent; border-left: 12px solid var(--yellow); transform: translateY(-50%);
}
#prompter-inner {
  position: absolute; inset: 0 var(--pad);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 82%, transparent 100%);
}
#prompter-inner.mirror { transform: scaleX(-1); }
#prompter-text {
  font-family: var(--font-round); font-weight: 700; font-size: var(--fs); line-height: 1.32;
  text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; will-change: transform; padding-bottom: 60vh;
}
#prompter-text .w { transition: color 0.25s; }
#prompter-text .w.read { color: rgba(255, 255, 255, 0.42); }
#prompter-handle {
  position: absolute; left: 50%; bottom: 6px; width: 54px; height: 5px; margin-left: -27px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.35); cursor: ns-resize; z-index: 3;
}
#prompter-handle::after { content: ""; position: absolute; inset: -10px -14px; }

/* Barre du bas */
#bar {
  position: absolute; left: 50%; bottom: calc(var(--tabs) + 14px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 999px;
  background: rgba(18, 18, 20, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; }
.round:hover, .step:hover { background: #3a3a3c; }
.stepper { display: flex; align-items: center; height: 52px; border-radius: 26px; background: var(--surface-2); padding: 0 4px; }
.step { width: 40px; height: 44px; border: 0; background: transparent; border-radius: 22px; font-size: 26px; line-height: 1; }
.stepper .value { min-width: 52px; text-align: center; display: flex; flex-direction: column; line-height: 1.05; }
.stepper .value b { font-family: var(--font-round); font-size: 22px; }
.stepper .value span { font-size: 11px; color: var(--muted); }
#speed-stepper.disabled { opacity: 0.35; pointer-events: none; }

#btn-record {
  width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 4px; margin: 0 4px;
}
#btn-record span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--rec); transition: border-radius 0.2s, transform 0.2s; }
#btn-record.recording span { border-radius: 8px; transform: scale(0.55); }

#btn-auto {
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px 0 12px; border: 0; border-radius: 26px;
  background: var(--surface-2); color: var(--text); min-width: 150px;
}
#btn-auto.on { background: var(--yellow); color: #111; }
#btn-auto .labels { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
#btn-auto b { font-family: var(--font-round); font-size: 18px; letter-spacing: 0.02em; }
#btn-auto small { font-size: 12px; opacity: 0.8; white-space: nowrap; }

#rec-indicator {
  position: absolute; top: 18px; right: 22px; display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.55); font-variant-numeric: tabular-nums; font-weight: 600;
}
#rec-indicator .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

#countdown {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--font-round); font-weight: 800; font-size: min(36vh, 300px); color: var(--yellow);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
#countdown.tick { animation: pop 0.9s ease-out; }
@keyframes pop { from { transform: scale(1.25); opacity: 0; } 20% { opacity: 1; } to { transform: scale(0.9); opacity: 0.85; } }

/* Fenêtres */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px 16px calc(16px + var(--tabs)); background: rgba(0, 0, 0, 0.62); z-index: 20; }
#app-offer { z-index: 40; padding-bottom: 16px; }
.card { background: var(--surface); border-radius: 26px; padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.start-card { max-width: 460px; text-align: center; }
/* Arrondi pour l'icône de l'app seulement : le badge App Store / Google Play garde sa forme officielle. */
.start-card > img { border-radius: 22px; }
.start-card h1, .start-card h2 { font-family: var(--font-round); margin: 14px 0 8px; }
.start-card p { color: var(--muted); line-height: 1.45; }
.primary {
  display: inline-block; border: 0; border-radius: 999px; background: var(--yellow); color: #111; font-weight: 700;
  padding: 14px 26px; margin: 10px 0; text-decoration: none; font-size: 17px;
}
.secondary { border: 0; border-radius: 999px; background: var(--surface-2); padding: 14px 22px; font-weight: 600; }
.link { border: 0; background: none; color: var(--yellow); font-weight: 600; padding: 8px; }
.fine { font-size: 13px; color: var(--muted); line-height: 1.4; }
.error { color: #ff6b61; line-height: 1.4; }
.store { display: inline-block; margin: 8px 0; }
.store img { display: block; height: 54px; border-radius: 0; }
/* Badges Google Play (PNG) : marge transparente intégrée, compensée comme sur le site
   (EN : badge de 168 px de haut sur 250 ; FR : 192 px sur 250). */
.store img.play-en { height: calc(54px * 250 / 168); margin: calc(54px * -41 / 168); }
.store img.play-fr { height: calc(54px * 250 / 192); margin: calc(54px * -29 / 192) 0; }

.take-card { width: min(820px, 100%); position: relative; }
.close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--surface-2); display: grid; place-items: center;
}
.close:hover { background: #3a3a3c; }
.close svg { width: 20px; height: 20px; }
.take-card h2 { margin: 0 0 12px; font-family: var(--font-round); }
#take-video { width: 100%; max-height: 56vh; border-radius: 16px; background: #000; display: block; }
#take-video.portrait { width: auto; max-width: 100%; margin: 0 auto; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* Réglages */
#settings {
  position: absolute; top: 0; right: 0; bottom: var(--tabs); width: min(420px, 100vw); z-index: 15;
  background: rgba(20, 20, 22, 0.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
}
#settings header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
#settings h2 { margin: 0; font-family: var(--font-round); }
#settings .scroll { overflow: auto; padding: 4px 20px 30px; }
.group { background: var(--surface); border-radius: 20px; padding: 16px; margin: 12px 0; }
.group h3 { margin: 0 0 12px; font-family: var(--font-round); font-size: 17px; }
textarea { width: 100%; resize: vertical; border-radius: 14px; border: 1px solid var(--line); background: #111113; padding: 12px; line-height: 1.45; }
.row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.between { justify-content: space-between; }
.chip { border: 0; border-radius: 999px; background: var(--surface-2); padding: 7px 14px; font-weight: 600; font-size: 14px; }
.chip.danger { color: #ff6b61; }
/* Astuce Saymila sous le texte (comme dans les apps iPhone et Android). */
.saymila-tip {
  display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: 600; text-decoration: none;
}
.saymila-tip:hover { background: rgba(255, 255, 255, 0.12); }
.saymila-tip svg { flex: none; width: 18px; height: 18px; color: var(--yellow); }
.saymila-tip span { flex: 1; }
.saymila-tip b { color: #fff; }
.saymila-tip svg.out { width: 15px; height: 15px; color: rgba(255, 255, 255, 0.5); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.choice button { text-align: left; border: 2px solid transparent; border-radius: 16px; background: var(--surface-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.choice button small { color: var(--muted); }
.choice button.selected { border-color: var(--yellow); }
.field { display: grid; gap: 6px; margin: 10px 0; font-size: 14px; color: var(--muted); }
.field select { background: #111113; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; color: var(--text); }
input[type="range"] { accent-color: var(--yellow); width: 100%; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 15px; }
.toggle input { accent-color: var(--yellow); width: 18px; height: 18px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dt { font-weight: 700; } dt kbd { background: var(--surface-2); border-radius: 6px; padding: 2px 7px; font-family: inherit; }
dd { margin: 0; color: var(--muted); }

/* Bouton « CC » (sous-titrer une vidéo) */
.cc-icon { font-family: var(--font-round); font-weight: 800; font-size: 13px; border: 2px solid currentColor; border-radius: 5px; padding: 1px 4px; line-height: 1; }

/* Sous-titres : plein écran, analyse puis éditeur */
#captions { position: absolute; inset: 0 0 var(--tabs); z-index: 25; background: var(--black); display: flex; flex-direction: column; }
#captions[hidden] { display: none; }
.cap-header { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cap-header h2 { margin: 0; font-family: var(--font-round); }
.cap-header .fine { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-header .link { flex: none; }

/* Mode Sous-titres sans vidéo : la déposer ou la choisir. */
.cap-empty { flex: 1; display: grid; place-items: center; padding: 20px 16px; overflow: auto; }
.cap-drop {
  width: min(560px, 100%); text-align: center; padding: 44px 32px 34px; border: 2px dashed rgba(255, 214, 10, 0.45);
  border-radius: 28px; background: rgba(255, 214, 10, 0.04);
}
.cap-drop .cc-icon.big { display: inline-block; font-size: 30px; border-width: 3px; border-radius: 10px; padding: 6px 10px; color: var(--yellow); }
.cap-drop h2 { font-family: var(--font-round); margin: 18px 0 8px; font-size: 28px; }
.cap-drop p { color: var(--muted); line-height: 1.45; margin: 0 auto 22px; max-width: 420px; }
.cap-drop .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 16px; }
.cap-drop .actions button { margin: 0; }
.cap-drop .fine { margin: 0 auto; text-align: center; }

/* Barre des modes : Filmer / Sous-titres. Bande jaune bien visible ; l'onglet actif est inversé (noir, texte jaune). */
#modes {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--tabs);
  display: flex; justify-content: center; gap: 8px; padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: var(--yellow);
}
#modes button {
  flex: 0 1 240px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; background: transparent; color: rgba(17, 17, 17, 0.72);
  font-family: var(--font-round); font-weight: 800; font-size: 16px; transition: background 0.15s, color 0.15s;
}
#modes button:hover { color: #111; background: rgba(0, 0, 0, 0.08); }
#modes button[aria-selected="true"] { background: #111; color: var(--yellow); }
#modes button svg { width: 24px; height: 24px; }
#modes .cc-icon { font-size: 12px; }
#modes.locked { opacity: 0.35; pointer-events: none; }
.cap-setup { flex: 1; overflow: auto; display: grid; place-items: center; padding: 20px 16px; }
.cap-setup .card { width: min(620px, 100%); }
.cap-setup h3 { margin: 0 0 12px; font-family: var(--font-round); }
.choice.three { grid-template-columns: repeat(3, 1fr); }
.choice button:disabled { opacity: 0.4; cursor: default; }
#cap-other { margin-bottom: 8px; }
.progress { margin: 10px 0; }
.progress .track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress .track span { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 4px; transition: width 0.2s; }
.progress .track.busy span { animation: busy 1.2s ease-in-out infinite; }
@keyframes busy { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.cap-editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr min(400px, 38vw); }
.cap-editor[hidden] { display: none; }
.cap-stage { position: relative; min-height: 0; background: #000; }
#cap-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#cap-canvas { position: absolute; pointer-events: none; }
.cap-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--surface); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
.tabs button { border: 0; border-radius: 12px; background: var(--surface-2); padding: 10px 6px; font-weight: 600; font-size: 14px; }
.tabs button.selected { background: var(--yellow); color: #111; }
.cap-tab { flex: 1; overflow: auto; padding: 0 12px 12px; }
.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.style-card { border: 2px solid transparent; border-radius: 14px; background: var(--surface-2); padding: 6px; display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.style-card canvas { width: 100%; height: auto; border-radius: 9px; display: block; }
.style-card.selected { border-color: var(--yellow); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); padding: 0; }
.swatch.selected { outline: 3px solid var(--yellow); outline-offset: 2px; }
.cap-tab .field .choice { margin: 4px 0 0; }
.cap-tab .choice button { padding: 10px; text-align: center; font-weight: 600; }
.cue { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; margin: 8px 0; }
.cue-time { border: 0; border-radius: 8px; background: var(--surface-2); padding: 6px 8px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--yellow); }
.cue textarea { padding: 7px 9px; border-radius: 10px; font-size: 15px; line-height: 1.35; resize: none; }
.cue-del { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px; }
.cue-del:hover { color: #ff6b61; }
.cap-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px; border-top: 1px solid var(--line); }
.cap-actions .grow { flex: 1; }
.cap-actions .primary, .cap-actions .secondary { margin: 0; padding: 12px 16px; font-size: 15px; }
#cap-export-progress { padding: 0 12px 12px; margin: 0; }

/* Glisser une vidéo sur la page */
#stage.dragging::after {
  content: attr(data-drop); position: absolute; inset: 14px; z-index: 40; display: grid; place-items: center;
  border: 3px dashed var(--yellow); border-radius: 24px; background: rgba(0, 0, 0, 0.6); color: var(--yellow);
  font-family: var(--font-round); font-weight: 800; font-size: 26px; pointer-events: none;
}

#toast {
  position: absolute; left: 50%; bottom: calc(var(--tabs) + 110px); transform: translateX(-50%); z-index: 35; max-width: min(560px, 90vw);
  background: rgba(30, 30, 32, 0.95); padding: 12px 18px; border-radius: 14px; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

#btn-flip { display: none; }
#float { display: none; }
#float:not(:empty) { display: grid; }
#speed-stepper .value { cursor: pointer; }

/*
 * Petits écrans (téléphone, fenêtre étroite) :
 * - (le bandeau, lui, atteint tout seul les deux bords sous sa largeur minimum, voir #prompter) ;
 * - la barre du bas passe sur deux rangées, comme dans l'app iPhone : format, gros bouton d'enregistrement
 *   et changement de caméra en haut ; début, taille, vitesse ou AUTO, réglages en bas.
 */
@media (max-width: 760px) {
  #prompter::before { border-width: 7px; border-left-width: 9px; }

  /* Une seule ligne en bas : début, vitesse ou AUTO, taille, format, réglages. */
  #bar {
    left: 0; right: 0; bottom: var(--tabs); transform: none; width: auto; border-radius: 22px 22px 0 0;
    padding: 10px 8px;
    display: grid; gap: 6px;
    grid-template-columns: 46px 1fr 1fr 46px 46px;
    grid-template-areas: "restart mode size format settings"; /* comme sur ordinateur : défilement à gauche, taille à droite */
    align-items: center;
    background: rgba(10, 10, 12, 0.82);
  }
  #btn-restart { grid-area: restart; }
  #bar #btn-format { grid-area: format; }
  #size-stepper { grid-area: size; }
  #speed-stepper, #btn-auto { grid-area: mode; }
  #btn-settings { grid-area: settings; }
  #btn-fullscreen { display: none; }
  .round { width: 46px; height: 46px; justify-self: center; }
  #float .round { width: 52px; height: 52px; }

  .stepper { height: 54px; border-radius: 27px; justify-content: space-between; padding: 0 1px; }
  .step { width: 34px; height: 50px; font-size: 24px; }
  .stepper .value { min-width: 0; flex: 1; }
  .stepper .value b { font-size: 24px; }

  /* Une seule commande de défilement à la fois : vitesse en manuel, AUTO en mode voix. */
  #bar[data-mode="voice"] #speed-stepper { display: none; }
  #bar[data-mode="manual"] #btn-auto { display: none; }
  #speed-stepper .value span::after { content: " · AUTO"; color: var(--yellow); font-weight: 700; }
  #btn-auto { min-width: 0; height: 56px; border-radius: 28px; justify-content: center; padding: 0 12px; }
  #btn-auto small { display: block; }

  /* Sur la vidéo, en bas du cadre : format, gros bouton rouge, caméra avant / arrière. */
  #float {
    position: absolute; left: 0; right: 0; top: var(--float-top, 60vh); z-index: 4;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 18px; pointer-events: none;
  }
  #float > * { pointer-events: auto; }
  #float #btn-record { grid-column: 2; width: 76px; height: 76px; margin: 0; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); }
  #float #btn-flip { grid-column: 3; justify-self: end; display: grid; background: rgba(0, 0, 0, 0.45); }
  #float #btn-flip[hidden] { display: none; }

  #frame-label { top: 10px; bottom: auto; }
  #rec-indicator { top: calc(var(--frame-top, 40vh) + 10px); right: 50%; transform: translateX(50%); }
  #toast { top: calc(var(--frame-top, 40vh) + 54px); bottom: auto; }
  .card { padding: 22px 18px; }
  .close { top: 10px; right: 10px; }
}

/* Éditeur de sous-titres sur téléphone ou fenêtre étroite : la vidéo en haut, les réglages en dessous. */
@media (max-width: 860px) {
  .cap-editor { grid-template-columns: 1fr; grid-template-rows: minmax(200px, 42vh) 1fr; }
  .cap-side { border-left: 0; border-top: 1px solid var(--line); }
  .choice.three { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #modes button { flex: 1; font-size: 15px; }
  .cap-drop { padding: 32px 20px 26px; }
  .cap-drop h2 { font-size: 24px; }
  .cap-actions .primary { flex: 1; }
}

/* Très petits écrans (iPhone SE, mini) : on resserre un peu. */
@media (max-width: 380px) {
  #bar { grid-template-columns: 42px 1fr 1fr 42px 42px; gap: 5px; padding-left: 6px; padding-right: 6px; }
  .round { width: 42px; height: 42px; }
  .step { width: 28px; }
  .stepper .value b { font-size: 21px; }
  #btn-auto svg { display: none; }
}
