/* RegistreMini Rallye — socle partagé, version 2026-10-11.
 * Les règles de document, de compteur et de carte restent dans leurs modules.
 * Les variantes sont limitées à leur classe de page et à l'affichage écran.
 */
:root {
  --rm-navy:#0c1b2e; --rm-navy-2:#142a43; --rm-ink:#132238;
  --rm-muted:#68768a; --rm-line:#e2e8f0; --rm-bg:#f5f6f8; --rm-card:#fff;
  --rm-red:#d9272e; --rm-red-dark:#b91f26; --rm-green:#159455;
  --rm-amber:#d98600; --rm-blue:#1769d3; --rm-radius:16px;
  --rm-shadow:0 10px 28px rgba(15,32,53,.07);
  --rm-font:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --rm-heading:Georgia,"Times New Roman",serif;
}
@media screen {
  body.rm-page {font-family:var(--rm-font);}
  body.rm-page:not(.rm-organizer):not(.rm-terrain):not(.trip-cockpit):not(.rm-access):not(.rm-home) {
    --bg:var(--rm-bg); --card:var(--rm-card); --ink:var(--rm-ink);
    --muted:var(--rm-muted); --line:var(--rm-line); --dark:var(--rm-navy);
    --red:var(--rm-red); --accent:var(--rm-red);
    margin:0; color:var(--rm-ink); background:var(--rm-bg);
  }
  body.rm-page :where(button,a,input,select,textarea,summary):focus-visible {
    outline:3px solid var(--rm-blue); outline-offset:3px;
  }
  body.rm-page:not(.rm-organizer):not(.rm-terrain):not(.trip-cockpit):not(.rm-contest-public)
    :where(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea):not(.raw) {
    border:1px solid #ccd5e0; border-radius:10px; background:var(--rm-card);
    color:var(--rm-ink); min-height:46px; font-family:var(--rm-font); font-size:16px;
    max-width:100%;
  }
  body.rm-page:not(.rm-terrain):not(.trip-cockpit) input:is([type=checkbox],[type=radio]) {
    accent-color:var(--rm-red);
  }
  body.rm-page:not(.rm-organizer):not(.rm-terrain):not(.trip-cockpit)
    :where(.btn,.navbtn,.submit,.close,.print,.export,.back,button[type=submit]) {
    display:inline-flex; align-items:center; justify-content:center;
    min-height:44px; border-radius:10px; font-family:var(--rm-font);
    font-weight:800; line-height:1.35; text-decoration:none; max-width:100%;
    white-space:normal;
  }
  body.rm-page :where(button:disabled,[aria-disabled=true]) {cursor:not-allowed;}

  /* Notices : même hiérarchie, lecture confortable, sommaires et retours conservés. */
  body.rm-help {line-height:1.6;}
  body.rm-help>header,body.rm-result>header,body.rm-trace>header {
    background:linear-gradient(165deg,var(--rm-navy-2),var(--rm-navy));
    color:#fff; padding:22px 24px;
  }
  body.rm-help>header :is(.head,.wrap),body.rm-trace>header .wrap {
    max-width:1120px; margin:0 auto;
  }
  body.rm-help h1,body.rm-result h1 {
    font:700 1.5rem/1.3 var(--rm-heading); margin:0;
  }
  body.rm-help>header :is(.sub,.subtitle,p) {color:#dbe5ef; opacity:1;}
  body.rm-help>header :is(a,button),body.rm-trace>header a {
    color:#fff; min-height:44px; display:inline-flex; align-items:center;
    padding:9px 12px; border:1px solid #ffffff44; border-radius:10px;
    font-family:var(--rm-font); font-weight:800; background:transparent;
  }
  body.rm-help>header :is(a,button):focus-visible,body.rm-trace>header a:focus-visible {
    outline-color:#fff;
  }
  body.rm-help>main,body.rm-help>main.main {
    max-width:1120px; margin:0 auto; padding:28px 24px 48px;
  }
  body.rm-help :is(.hero,.intro,.card,.toc) {
    background:var(--rm-card); border:1px solid var(--rm-line);
    border-radius:var(--rm-radius); padding:24px; margin-bottom:18px;
    box-shadow:var(--rm-shadow);
  }
  body.rm-help :is(h2,h3) {color:var(--rm-ink);}
  body.rm-help h2 {font:700 1.2rem/1.35 var(--rm-heading);}
  body.rm-help .card :is(p,li) {font-size:1rem; line-height:1.6;}
  body.rm-help :is(.hero,.intro)>p {color:var(--rm-muted);}
  body.rm-help .toc a {color:var(--rm-ink); padding:7px 0;}
  body.rm-help .top {color:var(--rm-muted);}
  body.rm-help .choice {border-color:var(--rm-line); background:#f8fafc;}
  body.rm-help :is(.choice.organizer,.choice.crew,.choice.public,.choice.admin) {
    border-left-color:var(--rm-red);
  }
  body.rm-help .step:before {background:var(--rm-navy);}
  body.rm-help :is(.tablewrap,.table-responsive) {overflow-x:auto;}

  /* Accès : la carte de connexion reste distincte du bureau organisateur. */
  body.rm-access {
    background:linear-gradient(145deg,var(--rm-navy),var(--rm-navy-2));
    color:var(--rm-ink);
  }
  body.rm-access .brand h1 {font-family:var(--rm-heading); color:#fff;}
  body.rm-access .card {border-color:var(--rm-line); border-radius:var(--rm-radius);}
  body.rm-access .card h2 {font-family:var(--rm-heading); color:var(--rm-ink);}
  body.rm-access :is(button[type=submit],.admin button) {
    background:var(--rm-red); color:#fff;
  }
  body.rm-access input:focus-visible,body.rm-access select:focus-visible {
    border-color:var(--rm-blue); outline-color:var(--rm-blue);
  }

  /* Accueil : mêmes tokens et mêmes commandes, composition de vitrine conservée. */
  body.rm-home {background:#fff;}
  body.rm-home .hero {background:linear-gradient(145deg,var(--rm-navy),var(--rm-navy-2));}
  body.rm-home :is(h1,h2) {font-family:var(--rm-heading);}
  body.rm-home :is(.navbtn,.btn.red,.submit) {background:var(--rm-red); color:#fff;}
  body.rm-home .logo {color:var(--rm-navy);}
  body.rm-home .logo span {color:var(--rm-red);}
  body.rm-home :is(.panel,.step,.loginBox) {border-color:var(--rm-line); border-radius:var(--rm-radius);}
  body.rm-home .consent input {min-height:20px; flex:0 0 20px; width:20px; height:20px;}

  /* Récupération : une page de travail claire ; aucune modification du stockage local. */
  body.rm-recovery>.wrap {max-width:1120px; padding:28px 24px 48px;}
  body.rm-recovery .top {border-color:var(--rm-line); gap:20px; padding-bottom:22px;}
  body.rm-recovery .title {font:700 1.5rem/1.3 var(--rm-heading); color:var(--rm-ink);}
  body.rm-recovery :is(.sub,.hint,.empty,.data small,.local-choice label) {color:var(--rm-muted);}
  body.rm-recovery :is(.panel,.stat,.row) {
    background:var(--rm-card); color:var(--rm-ink); border-color:var(--rm-line);
    border-radius:var(--rm-radius);
  }
  body.rm-recovery .panel {padding:24px; box-shadow:var(--rm-shadow);}
  body.rm-recovery .panel h2 {font:700 1.2rem/1.35 var(--rm-heading);}
  body.rm-recovery .stat span {color:var(--rm-muted);}
  body.rm-recovery .stat b {font-variant-numeric:tabular-nums;}
  body.rm-recovery .num {color:var(--rm-red);}
  body.rm-recovery .btn.local {background:var(--rm-red); color:#fff;}
  body.rm-recovery :is(.fileLabel,.export,.back) {
    background:#eef2f6; color:var(--rm-ink); border:1px solid var(--rm-line);
    border-radius:10px; min-height:46px; font-family:var(--rm-font);
  }
  body.rm-recovery .fileLabel {display:flex; align-items:center; justify-content:center;}
  body.rm-recovery .source {color:#166534;}
  body.rm-recovery .error {background:#fff1f0; color:#991b1b; border-color:#fecaca;}
  body.rm-recovery .raw {background:#f8fafc; color:var(--rm-ink); border-color:#ccd5e0;}
  body.rm-recovery .map {background:#e2e8f0;}

  /* Résultats et traces : identité publique commune, tableau et carte préservés. */
  body.rm-result>main,body.rm-trace>main {max-width:1200px; padding:24px; margin:0 auto;}
  body.rm-result>main:first-child {
    max-width:760px; margin:48px auto; background:var(--rm-card);
    border:1px solid var(--rm-line); border-radius:var(--rm-radius);
    box-shadow:var(--rm-shadow); text-align:center;
  }
  body.rm-result .card,body.rm-trace .card {
    border-color:var(--rm-line); border-radius:var(--rm-radius); box-shadow:var(--rm-shadow);
  }
  body.rm-result .btn:not(.secondary) {background:var(--rm-red); color:#fff;}
  body.rm-result .btn.secondary {background:#eef2f6; color:var(--rm-ink);}
  body.rm-trace>header strong {font:700 1.4rem/1.3 var(--rm-heading);}
  body.rm-trace .meta {border-color:var(--rm-line); padding:18px;}
  body.rm-trace .meta span {color:var(--rm-muted);}

  /* Équipage : choix et préparation communs ; cockpit et états de sécurité séparés. */
  body.rm-crew:not(.trip-cockpit):not(.rm-crew-ended)>header {
    background:linear-gradient(165deg,var(--rm-navy-2),var(--rm-navy));
  }
  body.rm-crew:not(.trip-cockpit)>header h1 {font-family:var(--rm-heading);}
  body.rm-crew:not(.trip-cockpit) .card {
    border-color:var(--rm-line); border-radius:var(--rm-radius); box-shadow:var(--rm-shadow);
  }
  body.rm-crew:not(.trip-cockpit) .mode-card.gps-mode {
    background:linear-gradient(145deg,var(--rm-navy-2),var(--rm-navy));
    border-color:var(--rm-navy-2); box-shadow:var(--rm-shadow);
  }
  body.rm-crew:not(.trip-cockpit) .mode-card .arrow {animation:none;}
  body.rm-crew:not(.trip-cockpit) :is(button[type=submit],.btn.finish) {
    background:var(--rm-red); color:#fff;
  }

  /* Terrain : aucun changement des chiffres, des dimensions ni des commandes GPS. */
  body.rm-terrain:not(.night),body.rm-crew.trip-cockpit:not(.night) {
    background:var(--rm-navy); color:#fff;
  }
  body.rm-terrain:not(.night) :is(.box,.small,.quality,.pill,.panel,.projectbar),
  body.rm-crew.trip-cockpit:not(.night) :is(.trip-box,.trip-small,.gps-quality,.guard-pill) {
    background:var(--rm-navy-2); border-color:#31465d;
  }
  body.rm-terrain:not(.night) .top {border-color:#31465d;}
  body.rm-terrain:not(.night) .tool {background:var(--rm-navy-2); border-color:#435971; color:#fff;}
  body.rm-terrain:not(.night) :is(.sub,.label,.small span) {color:#bdcad8;}
  body.rm-terrain:not(.night) :is(.raz,.wp:not(.ok),.finish),
  body.rm-crew.trip-cockpit:not(.night) .reset-btn.reset-big {background:var(--rm-red);}
  body.rm-terrain :is(button,a):focus-visible,body.rm-crew.trip-cockpit :is(button,a):focus-visible {
    outline-color:#fff;
  }
  body.rm-terrain.night :is(button,a):focus-visible,body.rm-crew.trip-cockpit.night :is(button,a):focus-visible {
    outline-color:#ff7545;
  }

  /* Diagnostics et document final : seules les commandes à l'écran sont harmonisées. */
  body.rm-storage>main {
    max-width:1120px; margin:28px auto; padding:28px;
    border:1px solid var(--rm-line); border-radius:var(--rm-radius); box-shadow:var(--rm-shadow);
  }
  body.rm-storage h1 {font-family:var(--rm-heading);}
  body.rm-storage :is(button,a.rm-storage-back) {
    min-height:44px; border-radius:10px; padding:12px 16px; font:800 1rem var(--rm-font);
  }
  body.rm-storage button {background:var(--rm-red); color:#fff;}
  body.rm-storage .rm-storage-back {
    display:inline-flex; align-items:center; color:var(--rm-ink); background:#eef2f6;
    text-decoration:none; margin-bottom:16px;
  }
  body.rm-cert .toolbar button {
    min-height:44px; border-radius:10px; background:var(--rm-red); color:#fff;
    font:800 .95rem var(--rm-font); padding:12px 16px;
  }
  body.rm-cert .toolbar button+button {background:#eef2f6; color:var(--rm-ink);}

  @media(max-width:720px) {
    body.rm-help>header,body.rm-result>header,body.rm-trace>header {padding:20px 16px;}
    body.rm-help>header :is(.head,.top),body.rm-trace>header .top {flex-wrap:wrap; gap:14px;}
    body.rm-help>main,body.rm-help>main.main,body.rm-result>main,body.rm-trace>main {
      padding:20px 12px 36px;
    }
    body.rm-help :is(.hero,.intro,.card,.toc) {padding:20px;}
    body.rm-help :is(h1,.title),body.rm-result h1 {font-size:1.3rem;}
    body.rm-recovery>.wrap {padding:20px 12px 36px;}
    body.rm-recovery .top {flex-wrap:wrap;}
    body.rm-recovery .title {font-size:1.3rem;}
    body.rm-recovery .panel {padding:20px 16px;}
    body.rm-storage>main {margin:16px 12px; padding:20px 16px;}
    body.rm-trace #map {min-height:360px; height:65vh;}
    body.rm-result>main:first-child {margin:28px 12px;}
  }
  @media(prefers-reduced-motion:reduce) {
    html:has(body.rm-page) {scroll-behavior:auto;}
    body.rm-page :is(button,a,.mode-card,.arrow,.start-light i) {
      transition:none; animation:none;
    }
  }
}
