/**
 * GPSwitch v3 : peau « Nuit bordeaux, la carte s'allume »
 * Contrat : design/VISUAL_SPEC_V3.md (forge-da, 2026-08-12)
 * Stratégie UNIQUE (spec §5) : ce fichier est chargé APRÈS precision-instrument.css
 * et globe.css, et les surcharge. Toutes les règles composant sont préfixées
 * [data-theme] pour battre les overrides [data-theme="light"] de la base :
 * la v3 est nocturne par nature, quel que soit l'état du thème mécanique.
 * Couleurs : UNIQUEMENT les tokens §2 (+ transparent / currentColor / color-mix de tokens).
 */

/* ============================================================
   FONTS : auto-hébergées, zéro requête tierce (interdit n°7)
   ============================================================ */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/spacegrotesk.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

/* ============================================================
   TOKENS §2 : collés tels quels (VISUAL_SPEC_V3.md)
   ============================================================ */
:root{
  /* Nuit bordeaux : famille du #261419 (hero D, VETO passé). Teinte ~343 degrés. */
  --night-0:#261419;   /* fond de page, LA référence */
  --night-1:#2F1A20;   /* surface basse : header, cards secondaires, champ creusé */
  --night-2:#3A2129;   /* surface haute, hover de surface */
  --night-3:#4A2E35;   /* bordures */
  --night-4:#6E464F;   /* traits décoratifs au repos : carte de principe, séparateurs forts */

  /* Texte (contrastes mesurés sur #261419) */
  --ink-1:#F6ECE7;     /* titres, valeurs : 15.10:1 */
  --ink-2:#C9B3AD;     /* corps, labels : 8.80:1 */
  --ink-3:#A8898D;     /* légendes, placeholders : 5.54:1 (AA) */

  /* Accent UNIQUE : la menthe du logo C */
  --mint:#3ECFB2;            /* 9.00:1 sur night-0 */
  --mint-hover:#5CDCC2;
  --mint-ink:#0C332B;        /* texte sur aplat menthe : 7.07:1 */
  --mint-line:rgba(62,207,178,.30);  /* filets, focus ring */
  --mint-veil:rgba(62,207,178,.14);  /* halo de succès, opacité MAX */

  /* États : fonctionnels uniquement, jamais décoratifs */
  --success:var(--mint);     /* le succès EST la menthe */
  --warning:#E8B04B;         /* position approximative : 8.98:1 */
  --error:#E8705C;           /* erreur, et rien d'autre : 5.77:1 */

  /* La carte = contenu lumineux (verre lait, hero D) */
  --milk-glass:rgba(246,236,231,.09);
  --milk-glass-border:rgba(246,236,231,.18);
  --milk-layer-1:rgba(246,236,231,.045);  /* couche de superposition arrière */
  --milk-layer-2:rgba(246,236,231,.06);   /* couche intermédiaire */

  /* Rayons */
  --r-card:18px; --r-field:10px; --r-chip:9px;

  /* Ombres : superposition, pas de glow */
  --shadow-card:0 30px 60px rgba(15,5,8,.5);
  --shadow-inset-field:inset 0 2px 6px rgba(15,5,8,.35);
}

/* ------------------------------------------------------------
   Remap des tokens hérités de precision-instrument.css.
   Déclaré pour :root ET les deux valeurs de data-theme : le thème
   clair est neutralisé (toggle masqué, v3 nocturne par nature).
   ------------------------------------------------------------ */
:root,
:root[data-theme="dark"],
:root[data-theme="light"]{
  --ink:      var(--night-0);
  --slate:    var(--night-1);
  --graphite: var(--night-1);
  --wire:     var(--night-3);
  --signal:   var(--mint);
  --topo:     var(--mint);
  --beacon:   var(--warning);
  --snow:     var(--ink-1);
  --mist:     var(--ink-2);

  --bg:       var(--night-0);
  --surface:  var(--night-1);
  --input-bg: var(--night-1);
  --border:   var(--night-3);
  --text:     var(--ink-1);
  --text-2:   var(--ink-2);
  --accent:   var(--mint);

  --mono: 'JetBrains Mono', monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}

/* ============================================================
   FOND : nuit plate + grain 3 %. Beams Signal Blue SUPPRIMÉS.
   ============================================================ */
[data-theme] .bg-beams { display: none; }

[data-theme] body {
  background: var(--night-0);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Grain contre le banding (technique proto-D) : image de bruit, pas une couleur */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme] ::selection { background: var(--mint-line); color: var(--ink-1); }

/* ============================================================
   LAYOUT : colonne élargie, grille 2 colonnes desktop
   ============================================================ */
[data-theme] .app-wrap { max-width: 600px; }

@media (min-width: 960px) {
  [data-theme] .app-wrap { max-width: 1140px; }

  [data-theme] main#main-content {
    display: grid;
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    column-gap: 44px;
    align-items: start;
  }
  [data-theme] main#main-content > * { grid-column: 1; min-width: 0; }
  [data-theme] main#main-content > .v3-side {
    grid-column: 2;
    /* Rangees 1 a 5 = les blocs de la colonne gauche (input, loading, error,
       geocoding, results) ; la rangee 6 est celle du globe pleine largeur.
       PAS de position:sticky ici (bug Fred 13/08) : Chrome ne contraint pas un
       item de grille sticky a sa grid area, il continuait de coller par-dessus
       le globe, rendant la carte et les boutons illisibles au scroll. Safari a
       en plus des bugs connus sur sticky-en-grille. La colonne defile normalement. */
    grid-row: 1 / 6;
    align-self: start;
  }
  [data-theme] main#main-content > .globe-section,
  [data-theme] main#main-content > .v5-footer { grid-column: 1 / -1; }
}

/* ============================================================
   HEADER : wordmark, surfaces nuit, dropdown skinné, toggle masqué
   ============================================================ */
[data-theme] .v5-header {
  background: var(--night-0);
  border-bottom: 1px solid var(--night-3);
}
[data-theme] .v5-header.scrolled {
  background: var(--night-0);
  border-color: var(--night-3);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme] .header-logo-icon {
  width: auto;
  height: 28px;
  border-radius: 0;
}
/* Aires de contact 44px sans grossir le dessin (technique proto-D) */
[data-theme] .header-logo,
[data-theme] .lang-dropdown-btn { position: relative; }
[data-theme] .header-logo::after,
[data-theme] .lang-dropdown-btn::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
}
[data-theme] .header-logo-name { display: none; } /* le wordmark porte déjà le nom */
[data-theme] .theme-toggle { display: none; }     /* v3 nocturne : réversible (spec §6.5) */

[data-theme] .lang-dropdown-btn {
  border-color: var(--night-3);
  color: var(--ink-2);
}
[data-theme] .lang-dropdown-btn:hover,
[data-theme] .lang-dropdown-btn[aria-expanded="true"] {
  color: var(--ink-1);
  border-color: var(--mint-line);
  background: var(--night-1);
}
[data-theme] .lang-dropdown-menu {
  background: var(--night-1);
  border-color: var(--night-3);
  box-shadow: var(--shadow-card);
}
[data-theme] .lang-dropdown-item { color: var(--ink-2); }
[data-theme] .lang-dropdown-item:hover,
[data-theme] .lang-dropdown-item:focus {
  color: var(--ink-1);
  background: var(--night-2);
}
[data-theme] .lang-dropdown-item.active { color: var(--mint); }

/* ============================================================
   HERO : H1, tagline verrouillée, champ creusé, CTA menthe
   ============================================================ */
[data-theme] .input-section { padding-top: 34px; }
/* 40px (et plus 56) : l'objectif dur est le résultat visible sans scroll en 1440x900 */
@media (min-width: 960px) { [data-theme] .input-section { padding-top: 40px; } }

[data-theme] .app-title {
  font-family: var(--sans);
  font-size: clamp(32px, 3.6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.06;
  color: var(--ink-1);
  text-wrap: balance;
  margin-bottom: 12px;
}
@media (min-width: 480px) { [data-theme] .app-title { font-size: clamp(32px, 3.6vw, 44px); } }

[data-theme] .app-tagline {
  font-size: 17px;
  font-weight: 400;
  color: var(--ink-2);
  text-align: left;
  margin: 0 0 26px;
  letter-spacing: 0;
}

[data-theme] .section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 9px;
}

/* Pulse rings recolorés (spec §5 hero) : le JS existant les anime */
[data-theme] .pulse-ring { border-color: var(--mint-line); }

/* Le champ : surface CREUSÉE. Aucun flou derrière (interdit n°5). */
[data-theme] .coord-input {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-field);
  box-shadow: var(--shadow-inset-field);
  color: var(--ink-1);
  font-family: var(--mono);
  font-size: 16px;
  height: 88px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme] .coord-input::placeholder {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 14px;
}
[data-theme] .coord-input:focus {
  border-color: var(--mint);
  box-shadow: var(--shadow-inset-field), 0 0 0 3px var(--mint-line);
}

[data-theme] .input-format-hint { font-size: 12px; color: var(--ink-3); }

/* Boutons : CTA = seul aplat saturé de l'écran. Secondaire en nuit. */
[data-theme] .btn-convert {
  background: var(--mint);
  border: 1px solid var(--mint);
  border-radius: var(--r-field);
  color: var(--mint-ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  min-height: 48px;
  box-shadow: none;
}
[data-theme] .btn-convert:hover {
  background: var(--mint-hover);
  border-color: var(--mint-hover);
  opacity: 1;
  box-shadow: none;
}
[data-theme] .btn-convert:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--mint-line); }

[data-theme] .btn-location {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-field);
  color: var(--ink-1);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  min-height: 48px;
}
[data-theme] .btn-location:hover {
  border-color: var(--mint-line);
  color: var(--ink-1);
  background: var(--night-2);
}

/* Photo drop zone */
[data-theme] .photo-drop-zone {
  background: transparent;
  border: 1px dashed var(--night-3);
  border-radius: var(--r-field);
}
[data-theme] .photo-drop-zone:hover,
[data-theme] .photo-drop-zone.drag-over {
  border-color: var(--mint-line);
  background: var(--night-1);
}
[data-theme] .photo-drop-zone.success {
  border-color: var(--mint);
  background: color-mix(in srgb, var(--mint) 6%, transparent);
}
[data-theme] .photo-drop-zone.error {
  border-color: var(--error);
  background: color-mix(in srgb, var(--error) 6%, transparent);
}
[data-theme] .photo-drop-zone.processing {
  border-color: var(--mint-line);
  background: var(--night-1);
}
[data-theme] .photo-drop-zone:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
[data-theme] .photo-drop-text, [data-theme] .photo-drop-icon { color: var(--ink-3); }
[data-theme] .photo-preview-coords { color: var(--mint); }

/* ============================================================
   EXEMPLES : chips : point menthe 8px à la place des émojis
   ============================================================ */
[data-theme] .example-chip {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-chip);
}
[data-theme] .example-chip:hover {
  border-color: var(--mint-line);
  background: var(--night-2);
  transform: translateX(2px);
}
[data-theme] .example-chip:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* L'émoji est neutralisé (font-size 0), le point 8px prend sa place (grammaire proto-D) */
[data-theme] .chip-icon {
  font-size: 0;
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: var(--mint);
  border-radius: 50%;
  margin: 0 8px;
}
[data-theme] .chip-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--ink-3);
}
[data-theme] .chip-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
[data-theme] .chip-arrow { color: var(--ink-3); }

/* ============================================================
   ÉTATS : spinner menthe, erreur fonctionnelle, LE MOMENT du lieu
   ============================================================ */
[data-theme] .loading-state { color: var(--ink-2); }
[data-theme] .loading-spinner {
  border-color: var(--night-3);
  border-top-color: var(--mint);
}

[data-theme] .error-state {
  background: var(--night-1);
  border: 1px solid var(--error);
  border-radius: var(--r-field);
  color: var(--error);
}

/* #geocoding-resolved = le moment « nom du lieu en grand » (spec §5) */
[data-theme] .geocoding-resolved {
  background: transparent;
  border: 0;
  padding: 18px 2px 4px;
  gap: 14px;
  color: var(--ink-1);
  align-items: baseline;
}
[data-theme] .geocoding-resolved__text {
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--ink-1);
  text-wrap: balance;
}
/* La LED de confiance : pastille 8px, lumière sur LED, jamais sur texte */
[data-theme] .geocoding-resolved__icon {
  font-size: 0;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
  align-self: center;
}
[data-theme] .geocoding-resolved--approximate { color: var(--ink-1); }
[data-theme] .geocoding-resolved--approximate .geocoding-resolved__icon {
  background: var(--warning);
  box-shadow: 0 0 12px var(--warning);
}

/* ============================================================
   RÉSULTATS : LA carte lumineuse : verre lait + superposition + halo
   ============================================================ */
[data-theme] .results-section {
  position: relative;
  margin-top: 26px;
  padding: 22px 20px 18px;
  background: var(--milk-glass);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--milk-glass-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
@media (min-width: 960px) { [data-theme] .results-section { padding: 26px 24px 20px; } }

/* Couches de superposition décalées (pile hero D) : derrière le verre */
.v3-layers { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.v3-layers i { position: absolute; inset: 0; border-radius: var(--r-card); display: block; }
.v3-layer-1 { transform: translate(-34px, -34px); background: var(--milk-layer-1); }
.v3-layer-2 { transform: translate(-17px, -17px); background: var(--milk-layer-2); }
@media (max-width: 959px) {
  .v3-layer-1 { transform: translate(-17px, -17px); }
  .v3-layer-2 { transform: translate(-9px, -9px); }
}

/* Halo de succès SOUS le verre + filet d'arête (clippés à la carte) */
.v3-glass-fx {
  position: absolute;
  inset: 0;
  border-radius: var(--r-card);
  overflow: hidden;
  pointer-events: none;
}
.v3-glass-fx::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -46%;
  width: 130%;
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, var(--mint-veil), transparent 68%);
  opacity: 0;
  animation: v3-halo .9s cubic-bezier(.16,1,.3,1) .15s forwards;
}
@keyframes v3-halo { to { opacity: 1; } }
.v3-glass-fx::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mint-line), transparent);
}
/* Position approximative : le halo vire à --warning, même opacité (grammaire proto-D) */
[data-theme] .results-section.v3-approx .v3-glass-fx::before {
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--warning) 14%, transparent), transparent 68%);
}
[data-theme] .results-section.v3-approx .v3-glass-fx::after {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--warning) 30%, transparent), transparent);
}

/* --- Ouvrir dans : services en secondaire, logos conservés --- */
[data-theme] .service-card-glass {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-field);
}
[data-theme] .service-card-glass:hover {
  border-color: var(--mint-line);
  box-shadow: none;
  background: var(--night-2);
}
[data-theme] .service-card-glass:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
[data-theme] .service-name { color: var(--ink-2); font-family: var(--sans); }

/* --- Formats : lignes mono à séparateurs, label menthe 700 --- */
[data-theme] .coordinate-item-glass {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--night-3);
  border-radius: 0;
  padding: 12px 4px;
  min-height: 44px; /* aire tactile */
  margin-bottom: 0;
}
[data-theme] .coordinate-item-glass:last-child { border-bottom: 0; }
[data-theme] .coordinate-item-glass:hover {
  border-color: var(--night-3);
  background: var(--milk-layer-1);
}
[data-theme] .coordinate-item-glass:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
[data-theme] .coordinate-item-glass.copy-success {
  border-color: var(--night-3);
  background: color-mix(in srgb, var(--mint) 8%, transparent);
}
[data-theme] .coord-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--mint);
  min-width: 92px;
}
[data-theme] .coord-value {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink-1);
}
[data-theme] .coord-copy-icon { color: var(--ink-3); }
[data-theme] .coordinate-item-glass:hover .coord-copy-icon { color: var(--mint); opacity: 1; }

/* --- La coordonnée décimale principale : en grand, compteur qui roule --- */
[data-theme] #coordinates-list .coordinate-item-glass:first-child {
  position: relative;
  display: block;
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-field);
  padding: 14px 52px 14px 16px;
  margin-bottom: 12px;
  container-type: inline-size;
}
[data-theme] #coordinates-list .coordinate-item-glass:first-child:hover {
  background: var(--night-1);
  border-color: var(--mint-line);
}
[data-theme] #coordinates-list .coordinate-item-glass:first-child .coord-label {
  display: block;
  margin-bottom: 6px;
}
[data-theme] #coordinates-list .coordinate-item-glass:first-child .coord-value {
  /* Échelle spec : clamp(34px,4vw,52px) : bornée par la largeur réelle (cqi)
     pour garantir zéro débordement horizontal (§7 dim 9) */
  font-size: clamp(34px, 4vw, 52px);
  font-size: min(clamp(34px, 4vw, 52px), 8cqi);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
}
[data-theme] #coordinates-list .coordinate-item-glass:first-child .coord-copy-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 18px;
  height: 18px;
}

/* Le compteur (porté de proto-D) : chaque chiffre est une colonne de cellules.
   Position d'arrivée en cellules (--i), AUCUNE mesure JS. */
.v3-roller {
  --cell: 1.3em;
  display: flex;
  align-items: flex-start;
  height: var(--cell);
  overflow: hidden;
  min-width: 0;
}
.v3-roller .v3-col {
  display: block;
  height: var(--cell);
  overflow: hidden;
  position: relative;
}
.v3-roller .v3-strip {
  display: block;
  transform: translateY(0);
  /* Courbe en S : accélère, tourne, se pose (spec §5 résultats) */
  transition: transform 1.15s cubic-bezier(.55, 0, .15, 1);
  will-change: transform;
}
.v3-roller .v3-strip.land { transform: translateY(calc(var(--i, 30) * var(--cell) * -1)); }
.v3-roller .v3-strip b {
  display: block;
  height: var(--cell);
  line-height: var(--cell);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.v3-roller .v3-sep {
  display: block;
  height: var(--cell);
  line-height: var(--cell);
}

/* --- QR : modules sombres sur tuile claire, scannabilité avant style --- */
[data-theme] .share-container-v23 {
  background: transparent;
  border: 0;
  padding: 0;
}
[data-theme] .qr-code-v23 {
  background: var(--ink-1) !important;
  border-radius: 10px;
}
[data-theme] .share-btn-v23 {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-field);
  color: var(--ink-2);
  font-family: var(--sans);
  min-height: 44px;
}
[data-theme] .share-btn-v23:hover {
  color: var(--ink-1);
  border-color: var(--mint-line);
  background: var(--night-2);
}

/* Modal QR zoom : tuile lait, modules sombres */
[data-theme] .qr-modal { background: var(--ink-1); }
[data-theme] .qr-modal-hint { color: var(--night-1); }

/* --- Carte embed : cadre verre --- */
[data-theme] .map-glass-container {
  background: var(--milk-glass);
  border: 1px solid var(--milk-glass-border);
  border-radius: var(--r-card);
}

/* --- Affiliate : surface basse, accent fonctionnel --- */
[data-theme] .affiliate-container {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-field);
}
[data-theme] .affiliate-icon { color: var(--ink-3); }
[data-theme] .affiliate-title { color: var(--ink-1); font-family: var(--sans); }
[data-theme] .affiliate-subtitle { color: var(--ink-3); }
[data-theme] .affiliate-cta {
  background: transparent;
  border: 1px solid var(--night-3);
  border-radius: var(--r-field);
  color: var(--mint);
  font-family: var(--sans);
  min-height: 44px; /* aire tactile */
}
[data-theme] .affiliate-cta:hover {
  opacity: 1;
  border-color: var(--mint-line);
  background: var(--night-2);
}
[data-theme] .affiliate-disclosure { color: var(--ink-3); }

/* ============================================================
   COLONNE DROITE .v3-side : contenu utile (la carte de principe
   décorative est SUPPRIMÉE : retour Fred 13/08)
   - idle  : 3 exemples cliquables + formats entrées/sorties
   - live  : vraie carte Google Maps + « Ouvrir dans » (desktop) + affiliate
   ============================================================ */
.v3-side { margin-top: 20px; }
@media (min-width: 960px) { .v3-side { margin-top: 40px; } }

/* Les chips existent déjà (empty-state) ; ici leur conteneur perd sa marge haute */
.v3-side .empty-state { margin-top: 0; }

/* Carte info formats : surface basse, tags mono. Informe, ne décore pas. */
.v3-inout-card {
  margin-top: 14px;
  padding: 16px 16px 14px;
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-card);
}
.v3-inout-card .section-label { margin-bottom: 8px; }
.v3-inout-card .section-label + .v3-inout-list { margin-bottom: 16px; }
.v3-inout-card .v3-inout-list:last-child { margin-bottom: 0; }
.v3-inout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.v3-inout-list li {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  color: var(--ink-2);
  background: var(--night-2);
  border: 1px solid var(--night-3);
  border-radius: var(--r-chip);
  padding: 6px 9px;
}

/* Bloc live : carte réelle en premier plan, services puis affiliate dessous.
   [hidden] doit gagner sur display:flex (piège classique de l'attribut hidden). */
.v3-side-live { display: flex; flex-direction: column; gap: 14px; }
.v3-side-idle[hidden], .v3-side-live[hidden] { display: none; }
.v3-side-live > * { margin-bottom: 0; }
.v3-side-live .services-section .section-label { margin-bottom: 8px; }

/* La vraie carte prend la place que le décor gaspillait */
@media (min-width: 960px) {
  [data-theme] .v3-side .map-glass { height: clamp(320px, 46vh, 460px); }
}

/* ============================================================
   GLOBE : palette via CSS ; les couleurs canvas JS ne sont PAS touchées
   (consigne spec §5 : on signale, zéro refonte JS)
   ============================================================ */
[data-theme] .globe-section { background: transparent; }
[data-theme] .globe-section::before {
  background: linear-gradient(90deg, transparent, var(--night-3), transparent);
}
[data-theme] .globe-title {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink-1);
}
[data-theme] .globe-subtitle {
  font-family: var(--sans);
  font-style: normal;
  color: var(--ink-3);
}
[data-theme] #globe-container canvas { filter: none; }
[data-theme] #globe-container canvas:hover { filter: none; }
[data-theme] .world-map-active {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  border-radius: var(--r-card);
}
[data-theme] .world-pin:focus { outline: 2px solid var(--mint-line); }
[data-theme] .globe-stat-pill {
  background: var(--night-1);
  border: 1px solid var(--night-3);
  color: var(--ink-2);
  font-family: var(--sans);
}
[data-theme] .globe-stat-pill:hover {
  background: var(--night-2);
  border-color: var(--mint-line);
}
[data-theme] .globe-stat-pill strong { color: var(--mint); font-family: var(--mono); }
[data-theme] .globe-stats-sep { background: var(--night-3); }
[data-theme] .globe-privacy-note { color: var(--ink-3); font-family: var(--sans); opacity: 1; }
[data-theme] .globe-fallback {
  background: var(--night-1);
  border: 1px solid var(--night-3);
}
[data-theme] .globe-fallback-icon { color: var(--night-4); }
[data-theme] .globe-fallback-text { color: var(--ink-3); font-family: var(--sans); }

/* ============================================================
   FOOTER : lockup Enumalon + version
   ============================================================ */
[data-theme] .v5-footer {
  border-top: 1px solid var(--night-3);
  gap: 16px;
  padding-top: 28px;
  margin-top: 44px;
}
.v3-footer-lockup { display: block; line-height: 0; }
.v3-footer-lockup img { height: 44px; width: auto; display: block; }
.v3-footer-lockup:focus-visible { outline: 2px solid var(--mint-line); outline-offset: 4px; border-radius: 4px; }
[data-theme] .footer-version { color: var(--ink-3); font-family: var(--mono); }

/* ============================================================
   TOAST / CONTEXT MENU / SKIP LINK
   ============================================================ */
[data-theme] .toast {
  background: var(--night-1);
  color: var(--ink-1);
  border: 1px solid var(--night-3);
  box-shadow: var(--shadow-card);
}
[data-theme] .toast.success { background: var(--mint); color: var(--mint-ink); border: 0; }
[data-theme] .toast.error   { background: var(--error); color: var(--ink-1); border: 0; }
[data-theme] .toast.warning { background: var(--warning); color: var(--night-0); border: 0; }
[data-theme] .notification-toast.success {
  background: var(--mint);
  color: var(--mint-ink);
  box-shadow: var(--shadow-card);
}
[data-theme] .notification-toast.error {
  background: var(--error);
  color: var(--ink-1);
  box-shadow: var(--shadow-card);
}
[data-theme] .context-menu-content {
  background: var(--night-1);
  border-color: var(--night-3);
}
[data-theme] .context-action-btn {
  background: var(--night-2);
  border-color: var(--night-3);
  color: var(--ink-1);
}
[data-theme] .context-action-btn:hover {
  border-color: var(--mint-line);
  background: var(--night-2);
}
[data-theme] .skip-link {
  color: var(--mint);
  background: var(--night-1);
  border-color: var(--mint);
}
[data-theme] .skip-link:focus-visible { outline: 2px solid var(--mint-line); }

/* ============================================================
   MOUVEMENT RÉDUIT : compteur posé, halo sans animation, rings figés
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .v3-glass-fx::before { animation: none; opacity: 1; }
  .v3-roller .v3-strip { transition: none; }
}

/* ============================================================
   ANTI-CHEVAUCHEMENT (fix 13/08) : le globe et le pied de page sont
   pleine largeur et doivent occuper des rangees APRES la colonne sticky.
   ============================================================ */
@media (min-width: 960px) {
  [data-theme] main#main-content > #globe-section { grid-row: 6; }
  [data-theme] main#main-content > .v5-footer     { grid-row: 7; }
}
