/* SignalNids Rando — expérience unifiée. 
   Feuille additive chargée après le thème du site.
   Compatibilité : site, PWA, WebView Android ; GPS Live laissé intact.
   Cette feuille ne masque aucun contenu essentiel ni aucune action métier.
*/
:root {
  --snux-green: #12583d;
  --snux-ink: #163e2d;
  --snux-muted: #637669;
  --snux-border: #dce7de;
  --snux-paper: #fff;
  --snux-background: #f7f9f6;
  --snux-focus: #19875a;
  --snux-gutter: clamp(16px, 3vw, 42px);
}
@media screen {
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page) {
    color: var(--snux-ink);
    background: var(--snux-background);
  }
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page) :where(p, li, dd) {
    line-height: 1.63;
  }
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page)
    :where(a, button, input, textarea, select):focus-visible {
      outline: 3px solid var(--snux-focus);
      outline-offset: 3px;
  }
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page)
    :where(img, video, iframe, canvas, svg) { max-width: 100%; }

  /* Une seule grille éditoriale : titres, blocs et pied de page alignés sur PC. */
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page) .wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: 1420px;
    margin-inline: auto;
  }
  body.snr290-discussion .wrap.snr290-discussion-content,
  body.snr290-discussion .snr290-hero > .wrap {
    width: 100%;
    max-width: 1420px;
    margin-inline: auto;
  }
  body.snr290-discussion .snr290-discussion-content > :is(.sn-panel, .sn-community-feed, .snr290-replies) {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }
  body.snr290-discussion .snr290-discussion-content :is(textarea, .snr290-post-form, .snr290-reply-list) {
    max-width: 100%;
    min-width: 0;
  }

  /* Sobriété commune sur PC : bordure légère, pas de cartes flottantes énormes. */
  body:not(.snr-live-body) .site-shell :is(
    .sn-panel, .sn-filter-bar, .sn-filter-sidebar, .sn-trail-card,
    .snr300-card, .snr300-badge, .snr300-route-card,
    .snr290-composer, .snr290-feed, .snr290-members,
    .snr250-card, .snr260-panel, .snr270-card,
    .snr190-section, .snr310-community-home, .snr310-home-topics
  ) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    border-color: var(--snux-border);
    box-shadow: 0 8px 24px rgba(10, 57, 36, .045);
  }
  body:not(.snr-live-body) .site-shell :is(.btn, button, input, select, textarea) {
    touch-action: manipulation;
  }
  body:not(.snr-live-body) .site-shell :where(input, textarea, select) {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body:not(.snr-live-body) .site-shell :where(h1, h2, h3) {
    overflow-wrap: break-word;
  }
  body:not(.snr-live-body) .site-shell :is(
    .sn-interior-hero, .sn-community-hero, .sn-unified-hero,
    .sn-detail-hero, .sn-editor-head, .snr250-hero, .snr260-hero, .snr270-hero
  ) :where(p, h1) {
    max-width: min(100%, 940px);
  }
  body:not(.snr-live-body) .site-shell :where(.snr300-grid, .sn-browse-main, .sn-detail-layout,
    .snr290-layout, .snr270-grid, .snr260-grid, .sn-editor-grid) > * { min-width: 0; }
}

/* Tablette : pas de colonne étroite insérée à côté d'un grand formulaire. */
@media screen and (min-width: 768px) and (max-width: 1050px) {
  body.snr290-community .sn-community-content,
  body.sn-browse .sn-browse-main,
  body.sn-detail .sn-detail-layout,
  body.sn-editor .sn-editor-grid,
  body.snr300-page .snr300-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Expérience mobile : plein écran, sections bord à bord, contenu lisible. */
@media screen and (max-width: 767px) {
  :root { --snux-mobile-gutter: 16px; }
  html { width: 100%; max-width: 100%; -webkit-text-size-adjust: 100%; }
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page) {
    margin: 0; min-width: 0; width: 100%; background: var(--snux-background);
    -webkit-tap-highlight-color: transparent;
  }
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page) .site-shell,
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page) .site-shell > main {
    min-width: 0; width: 100%; max-width: 100%;
  }
  body:not(.snr-live-body):not(.snr210-live):not(.snr-live-page) .site-shell .wrap {
    box-sizing: border-box; width: 100%; max-width: none;
    padding-left: var(--snux-mobile-gutter);
    padding-right: var(--snux-mobile-gutter);
    margin-inline: 0;
  }
  /* Le container remplit l'écran ; les textes et champs gardent une gouttière intérieure. */
  body:not(.snr-live-body) .site-shell :is(
    .snr300-container, .snr290-discussion-content, .sn-browse-screen,
    .sn-community-content, .snr250-body, .snr260-body, .snr270-body,
    .sn-detail-layout, .snr190-layout, .sn-editor-content
  ).wrap { padding-inline: 0 !important; }
  body:not(.snr-live-body) .site-shell :is(
    .snr300-container, .sn-browse-screen, .sn-community-content,
    .snr250-body, .snr260-body, .snr270-body, .sn-detail-layout,
    .sn-editor-content
  ) { max-width: 100%; min-width: 0; }
  body:not(.snr-live-body) .site-shell :is(
    .snr300-grid, .snr290-layout, .sn-browse-main, .sn-detail-layout,
    .sn-editor-grid, .snr250-grid, .snr260-grid, .snr270-grid
  ) { grid-template-columns: minmax(0, 1fr) !important; max-width:100%; gap: 0; }

  /* Les héro nature restent bord à bord, titre et description accessibles. */
  body:not(.snr-live-body) .site-shell :is(
    .sn-hero, .sn-interior-hero, .sn-unified-hero, .sn-community-hero,
    .sn-detail-hero, .sn-editor-head, .snr250-hero, .snr260-hero, .snr270-hero,
    .snrp-hero
  ) { width: 100%; max-width: none; margin: 0; border-radius: 0 !important; }
  body:not(.snr-live-body) .site-shell :is(
    .sn-interior-hero, .sn-unified-hero, .sn-community-hero,
    .snr250-hero, .snr260-hero, .snr270-hero
  ) > .wrap { padding: 34px var(--snux-mobile-gutter) 38px !important; }
  body:not(.snr-live-body) .site-shell :is(.sn-detail-hero-inner, .sn-editor-head-inner, .snr250-hero-inner) {
    padding-inline: var(--snux-mobile-gutter) !important;
  }
  body:not(.snr-live-body) .site-shell :is(
    .sn-hero, .sn-interior-hero, .sn-unified-hero, .sn-community-hero,
    .snr250-hero, .snr260-hero, .snr270-hero
  ) h1 { font-size: clamp(2.1rem, 8.7vw, 3.15rem); line-height: 1.08; }
  body:not(.snr-live-body) .site-shell :is(
    .sn-interior-hero, .sn-unified-hero, .sn-community-hero,
    .snr250-hero, .snr260-hero, .snr270-hero
  ) p { font-size: clamp(14px, 3.8vw, 17px); line-height: 1.55; }

  /* Surfaces de contenu sans coins arrondis, sans marge extérieure inutile. */
  body:not(.snr-live-body) .site-shell :is(
    .sn-panel, .sn-filter-bar, .sn-filter-sidebar, .sn-trail-card,
    .sn-full-map-card, .snr300-card, .snr300-badge, .snr300-route-card,
    .snr290-composer, .snr290-feed, .snr290-members,
    .snr250-card, .snr260-panel, .snr270-card,
    .snr190-section, .snr310-community-home, .snr310-home-topics,
    .snr310-home-topic, .snr310-topic-card, .sn-quick-dialog,
    .sn-detail-facts, .sn-route-description, .sn-follow-card
  ) {
    min-width: 0; max-width: 100%; border-radius: 0 !important; box-shadow: none !important;
  }
  body:not(.snr-live-body) .site-shell :is(.sn-panel, .snr300-card, .snr250-card,
    .snr260-panel, .snr270-card, .snr190-section, .sn-filter-sidebar, .sn-filter-bar) {
    border-left: 0; border-right: 0;
    margin-left: 0; margin-right: 0;
  }
  body:not(.snr-live-body) .site-shell :is(.snr300-card, .snr250-card, .snr260-panel,
    .snr270-card, .sn-filter-sidebar, .sn-panel) { padding: 18px var(--snux-mobile-gutter); }

  /* Rythme de lecture : une action primaire visible et les secondaires en ruban. */
  body:not(.snr-live-body) .site-shell :is(
    .sn-detail-hero-actions, .sn-unified-hero-actions, .sn-community-hero-actions,
    .snr260-actions, .snr300-tabs, .snr290-tabs, .snr310-community-shortcuts,
    .snr300-quick-links
  ) {
    display: flex !important; flex-wrap: nowrap !important; align-items: stretch;
    gap: 10px; width: 100%; min-width: 0; max-width: 100%;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  body:not(.snr-live-body) .site-shell :is(
    .sn-detail-hero-actions, .sn-unified-hero-actions, .sn-community-hero-actions,
    .snr260-actions, .snr300-tabs, .snr290-tabs, .snr310-community-shortcuts,
    .snr300-quick-links
  )::-webkit-scrollbar { display: none; }
  body:not(.snr-live-body) .site-shell :is(
    .sn-detail-hero-actions, .sn-unified-hero-actions, .sn-community-hero-actions,
    .snr260-actions, .snr300-tabs, .snr290-tabs, .snr310-community-shortcuts,
    .snr300-quick-links
  ) > :is(a,button) {
    flex: 0 0 auto; max-width: 82vw; width: auto; min-width: max-content;
    scroll-snap-align: start; white-space: nowrap;
  }
  body.sn-detail .sn-detail-hero-actions > :is(a, button) {
    flex: 0 0 min(76vw, 290px) !important;
    min-width: 0 !important; max-width: 290px !important; width: auto !important;
    white-space: normal; min-height: 48px;
  }
  body:not(.snr-live-body) .site-shell :is(.snr300-badges, .snr310-challenge-slider) { min-width:0; max-width:100%; }
  .snux-swipe-hint[hidden] { display:none !important; }
  .snux-swipe-hint {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; line-height: 1.3; font-weight: 600;
    color: #6b8975; padding: 3px var(--snux-mobile-gutter) 9px;
  }
  .sn-detail-hero .snux-swipe-hint,
  .sn-unified-hero .snux-swipe-hint,
  .sn-community-hero .snux-swipe-hint { color: rgba(255,255,255,.94); }
  /* Onglets/filtres : accès confortables, pas de tailles de police minuscules. */
  body:not(.snr-live-body) .site-shell :is(.snr300-tabs a, .snr290-tabs a,
    .snr310-community-shortcuts a) {
    font-size: 13px; min-height: 44px; padding: 11px 14px;
    border-radius: 0 !important; line-height: 1.25;
  }
  body:not(.snr-live-body) .site-shell :is(.btn, button, input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    max-width: 100%; border-radius: 0 !important;
  }
  body:not(.snr-live-body) .site-shell :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    min-width: 0; box-sizing: border-box; font-size: 16px !important;
  }
  body:not(.snr-live-body) .site-shell :is(.btn,button) { min-height: 44px; }
  body:not(.snr-live-body) .site-shell :is(.btn-primary, .snr300-submit, .snr290-post-form button[type="submit"]) {
    min-height: 48px; font-weight: 800;
  }
  body:not(.snr-live-body) .site-shell :is(.snr290-post-form textarea,.snr300-form textarea,.snr270-form textarea) {
    width:100%; box-sizing:border-box; min-height:120px;
  }
  body:not(.snr-live-body) .site-shell :is(.snr300-field-row,.snr270-fields,.form-grid) > * { min-width:0; }
  body:not(.snr-live-body) .site-shell :is(.snr300-progress,.snr300-progress>span) { border-radius:0 !important; }

  /* La page Discussion conserve les interactions et occupe la vraie largeur. */
  body.snr290-discussion .wrap.snr290-discussion-content {
    width: 100%; max-width: none; padding: 14px 0 95px !important; margin:0;
    display:flex; flex-direction:column; gap: 14px;
  }
  body.snr290-discussion .snr290-discussion-content > .snr290-back { padding-inline: var(--snux-mobile-gutter); }
  body.snr290-discussion .snr290-discussion-content > :is(.sn-panel, .sn-community-feed,.snr290-replies) {
    width:100%; max-width:none; margin:0; border-inline:0; border-radius:0 !important;
  }
  body.snr290-discussion .snr290-discussion-content :is(.snr290-entry, .snr290-post-form, .snr290-reply-list) {
    box-sizing:border-box; width:100%; max-width:100%;
  }
  body.snr290-discussion .snr290-discussion-content .snr290-post-form-footer {
    display:flex; flex-direction:column; align-items:stretch; gap:12px;
  }
  body.snr290-discussion .snr290-discussion-content .snr290-post-form-footer .btn { width:100%; }

  /* Authentification récemment validée : garder les deux colonnes sur PC, aucun cadre sur mobile. */
  body.sn-auth-page .site-shell :is(.sn-auth-frame.wrap, .sn-auth-split),
  body.snra-enabled .site-shell :is(.snra-shell, .snra-layout, .snra-panel) {
    box-sizing: border-box; width:100%; max-width:none; margin-inline:0;
    border-radius:0 !important;
  }
  body.sn-auth-page .site-shell :is(.sn-auth-frame.wrap, .sn-auth-split) { padding-inline: 0 !important; }
  body.sn-auth-page .site-shell .sn-auth-panel__inner { padding-inline: var(--snux-mobile-gutter); }
  body.snra-enabled .site-shell :is(.snra-panel,.snra-panel-inner) { padding-inline: var(--snux-mobile-gutter); }

  /* Navigation native existante : garder les cinq accès sans footer géant. */
  body:not(.snr-live-body) .sn-bottom-nav {
    width:100%; max-width:none; left:0; right:0; bottom:0;
    border-radius:0 !important; z-index:850;
    padding-bottom:max(4px, env(safe-area-inset-bottom, 0px));
  }
  body:not(.snr-live-body) .sn-bottom-nav :is(a,button) { min-width:0; }
  body:not(.snr-live-body) .sn-bottom-nav .sn-add-circle { border-radius:50% !important; }
  body:not(.snr-live-body) .site-shell > main { padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px)); }
  body:not(.snr-live-body) .footer { display:none; }
  body:not(.snr-live-body) .sn-quick-dialog { border-radius:0 !important; max-width:100%; }

  /* Corrige l'espace vide de la WebView, qui masque la navigation du site.
     Cette classe est ajoutée seulement quand l'application Android injecte son style. */
  html.snux-native-shell body:not(.snr-live-body) .site-shell > main { padding-bottom:0 !important; }
  html.snux-native-shell body:not(.snr-live-body) :is(.topbar,.sn-bottom-nav,.footer) { display:none !important; }
  html.snux-native-shell body.sn-auth-page .site-shell .sn-auth-shell { padding-bottom:0; }
}
@media screen and (max-width: 359px) {
  :root { --snux-mobile-gutter: 12px; }
  body:not(.snr-live-body) .site-shell :is(.snr300-card,.snr250-card,.snr260-panel,.snr270-card) {
    padding-inline:12px;
  }
}
@media (prefers-reduced-motion:reduce) {
  body:not(.snr-live-body) .site-shell :is(.sn-detail-hero-actions,.snr300-tabs,.snr290-tabs) {
    scroll-behavior:auto !important;
  }
}
