/* ============================================================================
   /raid/custom - Personnalisation du site des raids (refonte du 2026-09-27)
   Mêmes teintes, rayons et typographie que le jeu (styles/raids/ds.css).
   Jetons posés sur body.rc (et non :root) : site_menu.css, injecté après coup par
   navmenu_v2.js pour le menu du site, redéfinit --accent sur :root (thème saisonnier).
   Téléphone : l'aperçu est collant en haut de l'écran et se replie ; rien de positionné
   dans l'en-tête ; cibles >= 40 px.
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
body.rc {
  --bg: #070709; --bg2: #0e0e14; --card: #101019; --card2: #16161f;
  --line: #20202a; --line2: #2c2c39;
  --txt: #f2f2f6; --txt2: #cdd2e0; --mut: #9c9cab; --dim: #7e7e8b;
  --accent: #a78bff; --accent2: #c3b0ff; --accent-dim: rgba(167, 139, 255, .12); --accent-line: rgba(167, 139, 255, .38);
  --on-accent: #0b0b10; --ok: #3be08a; --bad: #ff7676; --warn: #ffb020;
  --ok-line: rgba(59, 224, 138, .4); --bad-dim: rgba(255, 118, 118, .12); --bad-line: rgba(255, 118, 118, .42);
  --scrim: rgba(4, 4, 7, .72);   /* voile des fenêtres : reste sombre dans tous les thèmes (comme .rgd-modal de ds.css) */
  --r-s: 10px; --r-m: 14px; --r-l: 18px; --r-xl: 24px;
  --hl: inset 0 1px 0 rgba(255, 255, 255, .035);
  --shadow-pop: 0 24px 60px -24px rgba(0, 0, 0, .8);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Archivo', system-ui, sans-serif;
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--txt2);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scrollbar-color: #2b2b38 transparent; }   /* sur html : les jetons de body.rc n'y sont pas visibles */
/* Lueur d'ambiance : couche fixe composée une seule fois (pas de background-attachment:fixed). */
body.rc::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 480px at 88% -6%, rgba(167, 139, 255, .12), transparent 60%), var(--bg);
}
body.rc a { color: var(--accent2); text-decoration: none; }
body.rc a:hover { color: var(--txt); }
body.rc :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
body.rc ::selection { background: rgba(167, 139, 255, .35); color: #fff; }
body.rc h1, body.rc h2, body.rc h3 { color: var(--txt); margin: 0; line-height: 1.18; letter-spacing: -.012em; }
.rc-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Barre du haut (dans le flux) ─────────────────────────────────────────── */
.rc-top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 1480px; margin: 0 auto; padding: 14px clamp(16px, 3vw, 32px);
  padding-right: 88px;                       /* place du bouton menu du site (navmenu_v2) */
  border-bottom: 1px solid var(--line);
}
.rc-brand { display: inline-flex; align-items: center; gap: 9px; font: 800 1.02rem var(--font-display); letter-spacing: -.01em; }
body.rc .rc-brand, body.rc .rc-brand:hover { color: var(--txt); }
.rc-brand img { width: 32px; height: 32px; object-fit: contain; }
.rc-brand b { color: var(--accent); font-weight: 800; }
.rc-top-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.rc-back, .rc-top-link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: 11px;
  font-weight: 650; font-size: .88rem;
}
body.rc .rc-back, body.rc .rc-top-link { color: var(--mut); }
body.rc .rc-back:hover, body.rc .rc-top-link:hover { color: var(--txt); background: rgba(255, 255, 255, .045); }

/* ── Page ─────────────────────────────────────────────────────────────────── */
.rc-wrap { max-width: 1480px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 32px) 40px; }
.rc-head { max-width: 760px; margin: 0 0 22px; }
.rc-eyebrow { margin: 0 0 10px; font: 700 .7rem/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--accent2); }
body.rc h1 { font: 800 clamp(1.9rem, 1.2rem + 2.6vw, 3rem)/1.04 var(--font-display); letter-spacing: -.028em; margin: 0 0 12px; }
.rc-hl { color: var(--accent2); }
.rc-sub { margin: 0; color: var(--txt2); font-size: 1rem; line-height: 1.6; max-width: 640px; }

/* ── Bannière de partage ──────────────────────────────────────────────────── */
.rc-share-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 20px; padding: 14px 16px;
  background: var(--accent-dim); border: 1px solid var(--accent-line); border-radius: var(--r-l);
}
.rc-share-banner[hidden] { display: none; }
.rc-share-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card); color: var(--accent2); flex: 0 0 40px; }
.rc-share-banner-txt { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-share-banner-txt strong { color: var(--txt); font-weight: 750; }
.rc-share-banner-txt > span { color: var(--mut); font-size: .88rem; overflow-wrap: anywhere; }
.rc-share-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Grille : réglages à gauche, aperçu collant à droite ─────────────────── */
.rc-grid { display: grid; grid-template-columns: minmax(340px, 480px) minmax(0, 1fr); gap: clamp(16px, 2vw, 24px); align-items: start; }
.rc-controls { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rc-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; box-shadow: var(--hl); }
body.rc .rc-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.04rem; font-weight: 750; }
body.rc .rc-sec h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.rc-num {
  display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 6px; border-radius: 8px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--mut);
  font: 700 .7rem var(--font); letter-spacing: .06em; font-variant-numeric: tabular-nums;
}
body.rc .rc-sub-h { margin: 18px 0 10px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); }

/* ── Préréglages et cartes de thème ───────────────────────────────────────── */
.rc-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rc-my-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rc-preset {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 8px 8px 10px; border-radius: var(--r-m);
  background: var(--bg2); border: 1px solid var(--line); color: var(--txt);
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .15s var(--ease);
}
.rc-preset:hover { border-color: var(--line2); background: var(--card2); }
.rc-preset:active { transform: translateY(1px); }
.rc-preset.on { border-color: var(--accent); background: var(--accent-dim); }
.rc-preset.on::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0b10' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.rc-preset b { display: block; margin-top: 5px; padding: 0 2px; font-size: .88rem; font-weight: 750; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-preset small { display: block; padding: 0 2px; color: var(--mut); font-size: .76rem; line-height: 1.3; overflow-wrap: anywhere; }
/* Mini-maquette d'un thème : fond, carte, titre, ligne, bouton aux couleurs du thème. */
.rc-mock {
  display: block; height: 58px; padding: 8px; border-radius: 10px;
  background: var(--m-bg); border: 1px solid rgba(255, 255, 255, .06);
}
.rc-mock > i { display: flex; flex-direction: column; gap: 5px; height: 100%; padding: 7px 8px; border-radius: 7px; background: var(--m-sf); border: 1px solid var(--m-ln); }
.rc-mock i i { display: block; height: 5px; border-radius: 3px; }
.rc-mock .m-h { width: 58%; background: var(--m-tx); }
.rc-mock .m-l { width: 82%; background: var(--m-mu); opacity: .75; }
.rc-mock .m-b { width: 36%; height: 8px; margin-top: auto; background: var(--m-ac); border-radius: 4px; }
.rc-theme-card { display: flex; }
.rc-badge-pub {
  align-self: flex-start; margin: 2px 0 0 2px; padding: 1px 7px; border-radius: 999px;
  font-size: .64rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ok); border: 1px solid var(--ok-line);
}
.rc-use-count { display: block; padding: 0 2px; font-size: .72rem; color: var(--dim); }
.rc-theme-actions { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.rc-theme-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 34px; min-width: 34px; padding: 0 9px;
  border-radius: 9px; border: 1px solid var(--line2); background: var(--card2); color: var(--txt);
  font: 650 .76rem var(--font); cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background-color .15s, color .15s;
}
.rc-theme-btn:hover { border-color: var(--accent-line); color: var(--accent2); }
.rc-theme-btn svg { width: 15px; height: 15px; }
.rc-theme-btn-del { color: var(--bad); }
.rc-theme-btn-del:hover { border-color: var(--bad-line); color: var(--bad); background: var(--bad-dim); }
.rc-theme-btn-del.is-arm { background: var(--bad-dim); border-color: var(--bad); }
.rc-theme-btn-adopt { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.rc-theme-btn-adopt:hover { color: var(--on-accent); filter: brightness(1.08); border-color: transparent; }
.rc-themes-empty {
  grid-column: 1 / -1; margin: 0; padding: 14px; border-radius: var(--r-m);
  background: var(--bg2); border: 1px dashed var(--line2); color: var(--mut); font-size: .86rem; line-height: 1.5;
}
.rc-login-hint { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--mut); font-size: .84rem; }
.rc-login-hint[hidden] { display: none; }

/* ── Couleurs ─────────────────────────────────────────────────────────────── */
.rc-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-color {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-m); cursor: pointer;
  transition: border-color .15s;
}
.rc-color:hover, .rc-color:focus-within { border-color: var(--line2); }
.rc-color input[type="color"] {
  -webkit-appearance: none; appearance: none; flex: 0 0 42px; width: 42px; height: 42px; padding: 0;
  border: none; border-radius: 11px; background: none; cursor: pointer;
}
.rc-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.rc-color input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255, 255, 255, .16); border-radius: 11px; }
.rc-color input[type="color"]::-moz-color-swatch { border: 1px solid rgba(255, 255, 255, .16); border-radius: 11px; }
.rc-color-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rc-color-txt b { color: var(--txt); font-size: .84rem; font-weight: 700; line-height: 1.2; }
.rc-color-txt small { color: var(--dim); font-size: .72rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-color-txt input {
  width: 92px; margin-top: 2px; padding: 2px 6px; border-radius: 7px;
  background: transparent; border: 1px solid transparent; color: var(--mut);
  font: 600 .78rem ui-monospace, 'SFMono-Regular', Consolas, monospace; letter-spacing: .02em; text-transform: lowercase; outline: none;
}
.rc-color-txt input:hover { border-color: var(--line2); }
.rc-color-txt input:focus { border-color: var(--accent); color: var(--txt); background: var(--card); }
.rc-color-txt input.is-bad { border-color: var(--bad); color: var(--bad); }

/* ── Ajustements ──────────────────────────────────────────────────────────── */
.rc-adjust { display: grid; gap: 8px; }
.rc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-m);
}
.rc-row-txt { min-width: 0; }
.rc-row-txt b { display: block; color: var(--txt); font-size: .88rem; font-weight: 700; }
.rc-row-txt small { color: var(--mut); font-size: .78rem; font-variant-numeric: tabular-nums; }
body.rc input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 200px; max-width: 52%; height: 28px; background: none; cursor: pointer;
}
body.rc input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--line2) var(--p, 0%)); }
body.rc input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line2); }
body.rc input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent); }
body.rc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%;
  background: var(--txt); border: 4px solid var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
body.rc input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--txt); border: 4px solid var(--accent); }

/* ── Boutons ──────────────────────────────────────────────────────────────── */
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-actions-2 { margin-top: 8px; }
.rc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  background: var(--card2); border: 1px solid var(--line2); color: var(--txt);
  font: 700 .88rem/1 var(--font); letter-spacing: -.005em; text-decoration: none;
  transition: border-color .15s, filter .15s, transform .12s var(--ease), background-color .15s;
}
body.rc a.rc-btn { color: var(--txt); }
.rc-btn:hover { border-color: var(--accent-line); }
.rc-btn:active { transform: translateY(1px); }
.rc-btn:disabled { opacity: .5; cursor: not-allowed; }
.rc-btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 8px 22px -12px rgba(167, 139, 255, .55); }
.rc-btn-primary:hover { filter: brightness(1.08); border-color: transparent; }
.rc-btn-outline { background: transparent; border-color: var(--accent-line); color: var(--accent2); }
.rc-btn-ghost { background: transparent; }
.rc-note { margin: 12px 2px 0; color: var(--mut); font-size: .82rem; }

/* ── Aperçu ───────────────────────────────────────────────────────────────── */
.rc-preview {
  grid-column: 2; grid-row: 1;
  position: sticky; top: 16px;
  display: flex; flex-direction: column;
  height: calc(100vh - 32px); min-height: 560px;
  background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-l); overflow: hidden;
  box-shadow: var(--shadow-pop), var(--hl);
}
.rc-preview-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--card2); border-bottom: 1px solid var(--line);
}
.rc-live { flex: 0 0 8px; width: 8px; height: 8px; margin: 0 2px 0 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(59, 224, 138, .18); }
.rc-page-pick { position: relative; min-width: 0; flex: 0 1 230px; }
.rc-page-pick select {
  width: 100%; min-height: 36px; padding: 0 30px 0 11px; border-radius: 10px; cursor: pointer;
  background: var(--bg2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c9cab' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 9px center / 14px no-repeat;
  border: 1px solid var(--line2); color: var(--txt); font: 600 .84rem var(--font);
  -webkit-appearance: none; appearance: none;
}
.rc-page-pick select:focus { outline: none; border-color: var(--accent); }
.rc-device { display: flex; gap: 2px; padding: 3px; margin-left: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; }
.rc-dev {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--mut); font: 650 .78rem var(--font); cursor: pointer;
}
.rc-dev:hover { color: var(--txt); }
.rc-dev.on { background: var(--card2); color: var(--txt); box-shadow: var(--hl), 0 1px 2px rgba(0, 0, 0, .4); }
.rc-open, .rc-fold {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line2); color: var(--mut); cursor: pointer;
}
body.rc .rc-open { color: var(--mut); }
.rc-open:hover, .rc-fold:hover { color: var(--txt); border-color: var(--accent-line); }
body.rc .rc-open:hover { color: var(--txt); }
.rc-fold { display: none; }
.rc-frame-box { position: relative; flex: 1; min-height: 0; background: var(--bg); display: flex; justify-content: center; }
#rcFrame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); transition: width .25s var(--ease); }
.rc-preview.is-mob #rcFrame { width: 390px; max-width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.rc-frame-wait {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg); color: var(--mut); font-size: .88rem; transition: opacity .25s;
}
.rc-frame-wait.is-off { opacity: 0; pointer-events: none; }
.rc-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--accent); animation: rc-spin .8s linear infinite; }
@keyframes rc-spin { to { transform: rotate(360deg); } }

/* ── Pied de page ─────────────────────────────────────────────────────────── */
/* Deux groupes de liens (.rc-foot-g) séparés par un filet ; sous 820 px ils passent l'un sous
   l'autre et le filet disparaît (il se retrouvait seul en début de deuxième ligne). */
.rc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.rc-foot-g { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-width: 0; }
body.rc .rc-foot a { color: var(--mut); font-size: .84rem; font-weight: 600; }
body.rc .rc-foot a:hover { color: var(--txt); }
.rc-foot-sep { flex: 0 0 1px; width: 1px; height: 14px; background: var(--line2); }
@media (max-width: 819px) {
  .rc-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rc-foot-sep { display: none; }
}

/* ── Notification ─────────────────────────────────────────────────────────── */
.rc-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 1600;
  width: max-content; max-width: calc(100vw - 28px); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;   /* max-content : sans lui, left:50% bridait la largeur à la moitié de l'écran (4 lignes sur téléphone) */
  padding: 12px 18px; border-radius: 14px; background: var(--card2); border: 1px solid var(--accent-line); color: var(--txt);
  font-weight: 650; font-size: .9rem; box-shadow: var(--shadow-pop);
  transition: opacity .25s, transform .25s var(--ease);
}
.rc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.rc-toast.rc-toast-err { border-color: var(--bad-line); }

/* ── Fenêtre « Enregistrer comme thème » ──────────────────────────────────── */
.rc-modal-overlay {
  position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 18px;
  background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
/* Fermée (attribut hidden) : retirée du rendu, sinon display:flex l'emportait sur hidden et ses champs
   invisibles restaient atteignables au clavier. app.js retire hidden avant d'ouvrir. */
.rc-modal-overlay[hidden] { display: none; }
.rc-modal-overlay.open { opacity: 1; pointer-events: auto; }
.rc-modal {
  width: 100%; max-width: 460px; padding: 24px 22px 22px;
  background: var(--card); border: 1px solid var(--line2); border-radius: 20px; box-shadow: var(--shadow-pop), var(--hl);
  transform: translateY(12px); transition: transform .25s var(--ease);
}
.rc-modal-overlay.open .rc-modal { transform: none; }
body.rc .rc-modal h3 { font: 800 1.12rem var(--font-display); letter-spacing: -.02em; margin: 0 0 18px; }
.rc-modal-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.rc-modal-field label { font-size: .74rem; font-weight: 700; color: var(--mut); letter-spacing: .08em; text-transform: uppercase; }
.rc-modal-field input[type="text"] {
  min-height: 44px; padding: 0 13px; border-radius: 11px; outline: none;
  background: var(--bg2); border: 1px solid var(--line2); color: var(--txt); font: 500 .95rem var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.rc-modal-field input[type="text"]::placeholder { color: var(--dim); }
.rc-modal-field input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167, 139, 255, .18); }
.rc-modal-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; margin-bottom: 20px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .15s;
}
.rc-modal-toggle-row:hover { border-color: var(--line2); }
.rc-modal-toggle-txt { min-width: 0; }
.rc-modal-toggle-txt b { display: block; color: var(--txt); font-size: .9rem; font-weight: 650; }
.rc-modal-toggle-txt small { display: block; color: var(--mut); font-size: .78rem; }
/* case à cocher présentée en interrupteur */
.rc-modal-toggle-row input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; cursor: pointer;
  width: 48px; height: 28px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card2);
  transition: background-color .2s, border-color .2s;
}
.rc-modal-toggle-row input[type="checkbox"]::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--mut); transition: transform .2s var(--ease), background-color .2s;
}
.rc-modal-toggle-row input[type="checkbox"]:checked { background: var(--accent-dim); border-color: var(--accent); }
.rc-modal-toggle-row input[type="checkbox"]:checked::after { transform: translateX(20px); background: var(--accent); }
.rc-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Bouton flottant « Voir l'aperçu » (téléphone) ─────────────────────────── */
.rc-preview-fab {
  display: none; position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 1450;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 750 .9rem var(--font);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .7);
}
.rc-preview-fab.is-on { display: inline-flex; align-items: center; }
/* Bouton visible (classe posée par app.js) : place en bas de page pour qu'il ne recouvre pas le dernier lien du pied. */
body.rc.rc-fab-on .rc-wrap { padding-bottom: 88px; }

/* ── Tablette et téléphone : aperçu collant EN HAUT, repliable ─────────────── */
@media (max-width: 899px) {
  .rc-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rc-preview {
    grid-column: 1; grid-row: 1;
    top: 0; z-index: 20; height: auto; min-height: 0;
    margin: 0 calc(-1 * clamp(16px, 3vw, 32px));             /* bord à bord : l'aperçu garde toute la largeur */
    border-radius: 0; border-left: 0; border-right: 0;
    box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .9);
  }
  .rc-controls { grid-row: 2; }
  .rc-frame-box { height: clamp(210px, 33vh, 330px); flex: none; }
  .rc-preview.is-folded .rc-frame-box { display: none; }
  .rc-fold { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font: 650 .8rem var(--font); }
  .rc-preview.is-folded .rc-fold svg { transform: rotate(180deg); }
  .rc-device { display: none; }
  .rc-page-pick { flex: 1 1 auto; }
  .rc-open { margin-left: 0; }
  /* bouton du menu du site : dans le haut du document, il ne flotte plus sur l'aperçu */
  body.rc #navToggle, body.rc .navtoggle:not(.open) { position: absolute; }
  /* cibles tactiles >= 40 px (charte §4) : sélecteur de page, Ouvrir, Réduire, curseur d'arrondi */
  .rc-page-pick select { min-height: 40px; }
  .rc-open, .rc-fold { min-width: 40px; height: 40px; }
  body.rc input[type="range"] { height: 40px; }
  /* couleurs : le code hexa passe à droite de la ligne, en vrai champ de 40 px (il faisait 23 px) */
  .rc-colors { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
  .rc-color-txt { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; }
  .rc-color-txt b { grid-column: 1; grid-row: 1; align-self: end; }
  .rc-color-txt small { grid-column: 1; grid-row: 2; align-self: start; white-space: normal; }
  .rc-color-txt input { grid-column: 2; grid-row: 1 / span 2; width: 108px; min-height: 40px; margin: 0; padding: 0 10px; border-color: var(--line2); background: var(--card); color: var(--txt2); }
}
@media (max-width: 560px) {
  body.rc { font-size: 15px; }
  .rc-top { padding: 10px 14px; padding-right: 70px; gap: 8px; }
  .rc-top-link { display: none; }
  .rc-back { padding: 0 8px; }
  .rc-wrap { padding: 18px 14px 32px; }
  .rc-preview { margin: 0 -14px; }
  .rc-head { margin-bottom: 16px; }
  .rc-sub { font-size: .94rem; }
  .rc-sec { padding: 14px; border-radius: 16px; }
  .rc-presets, .rc-my-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rc-colors { grid-template-columns: 1fr; }
  .rc-color-txt small { white-space: normal; }
  .rc-actions .rc-btn { flex: 1 1 auto; }
  .rc-share-banner-actions { width: 100%; }
  .rc-share-banner-actions .rc-btn { flex: 1; }
  .rc-modal-overlay { align-items: flex-end; padding: 0; }
  .rc-modal { max-width: none; border-radius: 22px 22px 0 0; border-bottom: 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .rc-modal-actions .rc-btn { flex: 1; }
  /* Safari iOS zoome au focus d'un champ de moins de 16 px */
  body.rc input[type="text"], body.rc select { font-size: 16px; }
  .rc-color-txt input { font-size: 16px; }
  .rc-theme-btn { min-height: 40px; min-width: 40px; }
  /* lien « Connecte-toi » dans une phrase : zone de toucher agrandie sans changer la ligne */
  .rc-login-hint a { padding: 12px 4px; margin: -12px -4px; }
  .rc-toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  /* liens du pied de page : cibles tactiles de 40 px */
  .rc-foot { gap: 0; }
  .rc-foot-g { gap: 0 18px; }
  body.rc .rc-foot a { display: inline-flex; align-items: center; min-height: 40px; }
  /* Planchers de lecture (charte §4.5) : micro-étiquettes >= 12 px, texte courant >= 13 px. */
  .rc-eyebrow, .rc-num, body.rc .rc-sub-h, .rc-badge-pub, .rc-use-count { font-size: .75rem; }
  .rc-color-txt small, .rc-preset small { font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-preset, .rc-btn, .rc-toast, .rc-modal, .rc-modal-overlay, #rcFrame { transition: none; }
  .rc-spin { animation-duration: 2.4s; }
}
