/* GeoGab — carte publique.
   Langage visuel iOS : carte plein écran, volet translucide flottant, listes
   groupées et fiche inférieure sur téléphone. Les valeurs partagées viennent
   de design-tokens.css. */
:root {
  --ink: var(--gg-ink);
  --muted: var(--gg-muted);
  --faint: var(--gg-faint);
  --brand: var(--gg-brand);
  --tint: var(--gg-tint);
  --tint-soft: var(--gg-tint-soft);
  --tint-fill: #0b7558;
  --tint-fill-hover: #096249;
  --on-tint: #ffffff;
  --paper: var(--gg-paper);
  --canvas: var(--gg-canvas);
  --line: var(--gg-separator);
  --fill: var(--gg-fill);
  --fill-strong: var(--gg-fill-strong);
  --material: var(--gg-material);
  --material-thick: var(--gg-material-thick);
  --material-border: var(--gg-material-border);
  --material-filter: var(--gg-material-filter);
  --float-shadow: 0 0 0 0.5px #0000000f, 0 4px 16px #0000001f;
  --panel-shadow: 0 0 0 0.5px #00000012, 0 14px 44px #00000024;
  --focus-ring: #0071e347;
  --map-bg: #e9edf0;
  --font: var(--gg-font);
  --sidebar: 372px;
  --gutter: 12px;
  --panel-radius: 26px;
  --header-height: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --float-shadow: 0 0 0 0.5px #ffffff14, 0 4px 18px #00000066;
    --panel-shadow: 0 0 0 0.5px #ffffff14, 0 14px 44px #00000080;
    --focus-ring: #4da3ff59;
    --map-bg: #1a1c1e;
  }
}
* {
  box-sizing: border-box;
}
html {
  font-size: 100%;
}
html,
body {
  margin: 0;
  height: 100%;
  color: var(--ink);
  font-family: var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-size: 0.9375rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  background: var(--map-bg);
  height: 100dvh;
  overflow: hidden;
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button,
input {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
}
a {
  color: inherit;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid var(--gg-focus);
  outline-offset: 2px;
}
button,
a {
  transition:
    background-color var(--gg-motion),
    color var(--gg-motion),
    box-shadow var(--gg-motion),
    opacity var(--gg-motion),
    transform 240ms var(--gg-ease-out);
}
/* Retour d’appui immédiat : la cible se contracte sans se déplacer. */
button:active:not(:disabled),
a:active {
  transform: scale(0.97);
  filter: brightness(0.94);
  transition-duration: 0s;
}
[hidden] {
  display: none !important;
}
.sr-only,
.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 5000;
  padding: 12px 16px;
  border-radius: var(--gg-radius-md);
  background: var(--paper);
  color: var(--tint);
  font-weight: 600;
  box-shadow: var(--gg-shadow-raised);
}
.skip-link:focus {
  top: 12px;
}

/* ---- En-tête : posé en haut du volet translucide ---- */
.app-header {
  position: fixed;
  z-index: 1100;
  top: calc(var(--gutter) + var(--safe-top));
  left: calc(var(--gutter) + var(--safe-left));
  width: var(--sidebar);
  min-height: var(--header-height);
  padding: 7px 8px 7px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 10px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.logo-mark {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow:
    0 0 0 0.5px #0000001f,
    0 2px 5px #0000002e;
}
.brand-dot {
  color: var(--tint);
}
.header-caption {
  display: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
}
.help-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  color: var(--tint);
  font-size: 0.875rem;
  font-weight: 500;
}
.help-symbol {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fill);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}
.install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 0;
  border-radius: 999px;
  background-color: var(--tint-soft);
  /* Capsule de 32 px dessinée dans une cible tactile de 44 px. */
  background-clip: content-box;
  color: var(--tint);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}
.install-icon {
  width: 16px;
  height: 16px;
  margin-left: 12px;
}
.install-button > span:last-child {
  margin-right: 14px;
}
@media (hover: hover) and (pointer: fine) {
  .help-button:hover .help-symbol {
    background: var(--fill-strong);
  }
  .install-button:hover {
    filter: brightness(0.96);
  }
}

/* ---- Structure : la carte occupe l’écran, le volet flotte dessus ---- */
.workspace {
  position: fixed;
  inset: 0;
}
.workspace::before {
  content: "";
  position: absolute;
  z-index: 999;
  top: calc(var(--gutter) + var(--safe-top));
  bottom: calc(var(--gutter) + var(--safe-bottom));
  left: calc(var(--gutter) + var(--safe-left));
  width: var(--sidebar);
  border: 1px solid var(--material-border);
  border-radius: var(--panel-radius);
  background: var(--material);
  -webkit-backdrop-filter: var(--material-filter);
  backdrop-filter: var(--material-filter);
  box-shadow: var(--panel-shadow);
}
.explorer {
  position: absolute;
  z-index: 1000;
  top: var(
    --header-bottom,
    calc(var(--gutter) + var(--safe-top) + var(--header-height))
  );
  bottom: calc(var(--gutter) + var(--safe-bottom));
  left: calc(var(--gutter) + var(--safe-left));
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 4px 16px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--fill-strong) transparent;
  border-radius: 0 0 var(--panel-radius) var(--panel-radius);
}
.explorer-top {
  position: relative;
  z-index: 1000;
}
h1 {
  margin: 8px 4px 6px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}
.intro {
  margin: 0 4px 18px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

/* ---- Recherche ---- */
.search-form {
  position: relative;
}
.searchbar {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 2px 0 12px;
  border-radius: var(--gg-radius-md);
  background: var(--fill);
  transition:
    background-color var(--gg-motion),
    box-shadow var(--gg-motion);
}
.searchbar:focus-within {
  background: var(--paper);
  box-shadow:
    0 0 0 1.5px var(--gg-focus),
    0 0 0 5px var(--focus-ring);
}
.search-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  color: var(--muted);
}
.searchbar input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}
.searchbar input:focus-visible {
  outline: none;
}
.searchbar input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
}
/* Pastille grise de fermeture, comme les feuilles iOS. */
.icon-button .icon {
  width: 30px;
  height: 30px;
  padding: 8px;
  border-radius: 50%;
  background: var(--fill);
  stroke-width: 2.6;
  transition: background-color var(--gg-motion);
}
.searchbar .icon-button {
  width: 44px;
  min-width: 44px;
}
.searchbar .icon-button .icon {
  width: 19px;
  height: 19px;
  padding: 4.5px;
  background: var(--gg-control-border);
  color: var(--paper);
  stroke-width: 3.2;
}
.search-submit {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--tint);
}
.search-submit .icon {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 50%;
  background: var(--tint-fill);
  color: var(--on-tint);
  stroke-width: 2.4;
}
@media (hover: hover) and (pointer: fine) {
  .icon-button:hover {
    color: var(--ink);
  }
  .icon-button:hover .icon {
    background: var(--fill-strong);
  }
  .searchbar .icon-button:hover .icon {
    background: var(--muted);
  }
  .search-submit:hover .icon {
    background: var(--tint-fill-hover);
  }
}
.field-message {
  margin: 8px 4px 0;
  color: var(--gg-danger);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* ---- Boutons ---- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 8px 16px;
  border-radius: var(--gg-radius-md);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.btn.primary {
  background: var(--tint-fill);
  color: var(--on-tint);
}
.btn.secondary {
  background: var(--fill);
  color: var(--tint);
}
.location-button {
  margin-top: 10px;
  min-height: 46px;
  background: var(--tint-soft);
  color: var(--tint);
}
.location-button .icon {
  width: 17px;
  height: 17px;
}
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover:not(:disabled) {
    background: var(--tint-fill-hover);
  }
  .btn.secondary:hover:not(:disabled) {
    background: var(--fill-strong);
  }
  .location-button:hover:not(:disabled) {
    filter: brightness(0.96);
  }
}

/* ---- Accueil : liste groupée des villes ---- */
.welcome {
  padding-top: 26px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 10px;
}
.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.section-heading > span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}
.quick-places {
  border-radius: 18px;
  background: var(--fill);
  overflow: hidden;
}
.place-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 9px 12px;
  text-align: left;
}
.place-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--tint-fill);
  color: var(--on-tint);
}
.place-icon .icon {
  width: 18px;
  height: 18px;
}
.place-card strong {
  grid-column: 2;
  align-self: end;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.place-card > span:not(.place-icon) {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  color: var(--muted);
  font-size: 0.8125rem;
}
.chevron {
  width: 16px;
  height: 16px;
  color: var(--faint);
  stroke-width: 2.4;
}
.place-card > .chevron {
  grid-column: 3;
  grid-row: 1 / 3;
}
.text-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px 8px 58px;
  color: var(--tint);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: left;
}
/* Séparateurs en retrait, alignés sur le texte. */
.place-card + .place-card::before,
.text-button::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 58px;
  height: 1px;
  background: var(--line);
}
.place-card:focus-visible,
.text-button:focus-visible {
  outline-offset: -3px;
  border-radius: 14px;
}
.place-card:active:not(:disabled),
.text-button:active:not(:disabled) {
  transform: none;
  filter: none;
  background: var(--fill-strong);
}
@media (hover: hover) and (pointer: fine) {
  .place-card:hover,
  .text-button:hover {
    background: var(--fill);
  }
}
.coverage-note {
  margin: 8px 14px 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  margin-top: auto;
  padding: 12px 6px 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .sidebar-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
  }
}

/* ---- Carte et commandes flottantes ---- */
.map-workspace {
  --map-left: calc(var(--sidebar) + var(--gutter) * 2 + var(--safe-left));
  --map-edge: 14px;
  position: absolute;
  inset: 0;
  z-index: 0;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--map-bg);
}
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--map-bg);
}
#map:focus-visible {
  outline: 3px solid var(--gg-focus);
  outline-offset: -3px;
}
/* Message de secours quand la carte ne peut pas être chargée. */
#map:not(.leaflet-container) {
  display: grid;
  place-items: center;
  padding: 96px 24px 24px calc(var(--map-left) + 24px);
  color: var(--muted);
  text-align: center;
}
.leaflet-container {
  font-family: var(--font) !important;
  background: var(--map-bg) !important;
}
.leaflet-bottom.leaflet-right {
  right: var(--safe-right);
  bottom: var(--safe-bottom);
}
.leaflet-control-attribution {
  padding: 2px 8px !important;
  border-radius: 8px 0 0 0;
  background: var(--material-thick) !important;
  color: var(--muted) !important;
  font-size: 0.625rem !important;
  line-height: 1.6 !important;
}
.leaflet-control-attribution a {
  color: var(--tint) !important;
}
.leaflet-control-scale-line {
  border-color: var(--muted) !important;
  background: var(--material-thick) !important;
  color: var(--ink) !important;
  font-size: 0.625rem !important;
}
.leaflet-bottom.leaflet-left {
  bottom: calc(46px + var(--safe-bottom));
  left: calc(var(--map-left) - 10px);
}
.city-btn,
.home-button,
.map-tools,
.map-hint,
.map-legend,
.network-status {
  border: 1px solid var(--material-border);
  background: var(--material);
  -webkit-backdrop-filter: var(--material-filter);
  backdrop-filter: var(--material-filter);
  box-shadow: var(--float-shadow);
}
.map-topbar {
  position: absolute;
  z-index: 900;
  top: calc(var(--map-edge) + var(--safe-top));
  right: calc(var(--map-edge) + var(--safe-right));
  left: var(--map-left);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.map-topbar > * {
  pointer-events: auto;
}
.city-picker {
  position: relative;
  min-width: 0;
}
.city-btn,
.home-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.city-btn > .icon:first-child {
  width: 18px;
  height: 18px;
  color: var(--tint);
}
.city-btn > .icon:last-child {
  width: 15px;
  height: 15px;
  color: var(--muted);
  stroke-width: 2.4;
  transition: transform 280ms var(--gg-ease-out);
}
.city-btn[aria-expanded="true"] > .icon:last-child {
  transform: rotate(180deg);
}
.home-button {
  color: var(--tint);
}
.home-button .icon {
  width: 18px;
  height: 18px;
}
.city-menu {
  position: fixed;
  z-index: 1500;
  width: 272px;
  max-width: calc(100vw - 24px);
  max-height: min(480px, 55dvh);
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--material-border);
  border-radius: 18px;
  background: var(--material-thick);
  -webkit-backdrop-filter: var(--material-filter);
  backdrop-filter: var(--material-filter);
  box-shadow:
    0 0 0 0.5px #0000000f,
    var(--gg-shadow-raised);
  transform-origin: 32px 0;
  animation: materialize 260ms var(--gg-ease-out);
}
.city-menu-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  width: 100%;
  min-height: 54px;
  padding: 8px 40px 8px 12px;
  border-radius: 12px;
  text-align: left;
}
.city-menu-item:focus-visible {
  outline-offset: -3px;
}
.city-menu-item:active:not(:disabled) {
  transform: none;
  filter: none;
  background: var(--fill-strong);
}
@media (hover: hover) and (pointer: fine) {
  .city-btn:hover,
  .home-button:hover {
    background: var(--material-thick);
  }
  .city-menu-item:hover {
    background: var(--fill);
  }
}
/* Coche de la ville active, comme dans un menu iOS. */
.city-menu-item.active::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: var(--tint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.ci-name {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.city-menu-item.active .ci-name {
  color: var(--tint);
  font-weight: 600;
}
.ci-prov {
  color: var(--muted);
  font-size: 0.8125rem;
}
.network-status {
  position: absolute;
  z-index: 700;
  top: calc(var(--map-edge) + var(--safe-top) + 56px);
  left: var(--map-left);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(440px, calc(100% - var(--map-left) - 84px));
  padding: 4px 6px 4px 14px;
  border-radius: 22px;
  color: var(--gg-danger);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
}
.network-status .icon {
  width: 17px;
  height: 17px;
}
.network-status button {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--tint);
  font-weight: 600;
}
.map-hint {
  position: absolute;
  z-index: 700;
  bottom: calc(24px + var(--safe-bottom));
  left: calc(50% + var(--map-left) / 2);
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - var(--map-left) - 190px);
  padding: 1px 1px 1px 15px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  transform: translateX(-50%);
}
.map-hint > .icon {
  width: 17px;
  height: 17px;
  color: var(--tint);
}
.map-hint .icon-button .icon {
  width: 26px;
  height: 26px;
  padding: 7px;
}
.map-tools {
  position: absolute;
  z-index: 700;
  right: calc(var(--map-edge) + var(--safe-right));
  bottom: calc(40px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  padding: 3px;
  border-radius: 26px;
}
.map-tool {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
}
.map-tool .icon {
  width: 20px;
  height: 20px;
}
.map-tool[aria-pressed="true"] {
  background: var(--tint-soft);
  color: var(--tint);
}
#mapGeoBtn {
  color: var(--tint);
}
@media (hover: hover) and (pointer: fine) {
  .map-tool:hover:not(:disabled) {
    background: var(--fill);
  }
}
.tool-separator {
  height: 1px;
  margin: 3px 9px;
  background: var(--line);
}
.map-legend {
  position: absolute;
  z-index: 600;
  bottom: calc(var(--map-edge) + var(--safe-bottom));
  left: var(--map-left);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
}
.legend-square {
  width: 10px;
  height: 10px;
  border: 1.5px dashed var(--tint);
  border-radius: 3px;
  background: var(--tint-soft);
}
.legend-separator {
  width: 1px;
  height: 10px;
  margin: 0 2px;
  background: var(--line);
}

/* ---- Repère : goutte verte bordée de blanc, qui se pose sur la carte ---- */
.gc-marker {
  width: 32px;
  height: 32px;
  border: 2.5px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(45deg, #0b5c46, #17936f);
  box-shadow:
    0 0 0 0.5px #00000029,
    -3px 5px 12px #00000047;
  transform: rotate(-45deg);
  animation: pin-drop 420ms var(--gg-ease-out);
}
.gc-marker::after {
  content: "";
  position: absolute;
  top: 8.5px;
  left: 8.5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
}
.coverage-zone {
  stroke: var(--tint);
  fill: var(--tint);
}
.user-dot {
  filter: drop-shadow(0 1px 3px #00000059);
}

/* ---- Suggestions ---- */
.suggest {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: min(360px, 50dvh);
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--material-border);
  border-radius: 18px;
  background: var(--paper);
  box-shadow:
    0 0 0 0.5px #0000000f,
    var(--gg-shadow-raised);
  transform-origin: 50% 0;
  animation: materialize 220ms var(--gg-ease-out);
}
.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .suggest-item:hover {
    background: var(--fill);
  }
}
.suggest-item.active {
  background: var(--fill);
}
.suggest-item > .icon {
  width: 32px;
  height: 32px;
  padding: 7.5px;
  border-radius: 50%;
  background: var(--tint-soft);
  color: var(--tint);
}
.suggest-item .name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.suggest-item .sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.suggest-message {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* ---- Fiche d’adresse ---- */
.panel {
  margin-top: 22px;
}
/* Poignée de la fiche inférieure : visible seulement sur téléphone. */
.sheet-grabber {
  display: none;
}
.panel.open {
  animation: reveal 360ms var(--gg-ease-out);
}
.panel-open .explorer-top h1,
.panel-open .intro,
.panel-open .map-hint {
  display: none;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 14px;
}
.panel-head > div {
  min-width: 0;
}
.panel-head h2 {
  margin: 0 0 3px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
#panelTitle:focus {
  outline: none;
}
.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.35;
}
.panel-head .icon-button {
  margin: -7px -9px 0 0;
}
/* Le code est le produit : une carte forêt, reflet sable de l’icône. */
.code-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 16px 16px 14px;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(150deg, #24614f 0%, #173f35 50%, #102e27 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 #ffffff26,
    inset 0 0 0 1px #ffffff0f,
    0 12px 26px -12px #102e27b3;
}
.code-card::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #e5c18d3d, #e5c18d00);
  pointer-events: none;
}
.code-label {
  position: relative;
  color: #ffffffc7;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.code {
  position: relative;
  font-family: var(--font);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  /* Chiffres alignés et tirets centrés sur la hauteur des capitales. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "case" 1;
  overflow-wrap: anywhere;
}
.copy {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border-radius: var(--gg-radius-md);
  background: #ffffff2b;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
@media (hover: hover) and (pointer: fine) {
  .copy:hover:not(:disabled) {
    background: #ffffff3d;
  }
}
.copy.is-success {
  background: #ffffff;
  color: #173f35;
}
.copy:focus-visible {
  outline-color: #ffffff;
}
.copy .icon {
  width: 18px;
  height: 18px;
}
.gps-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--gg-radius-md);
  background: var(--tint-soft);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.actions > .btn {
  padding: 8px 10px;
}
.actions .icon {
  width: 18px;
  height: 18px;
}
#shareBtn {
  background: var(--tint-fill);
  color: var(--on-tint);
}
@media (hover: hover) and (pointer: fine) {
  #shareBtn:hover:not(:disabled) {
    background: var(--tint-fill-hover);
  }
}
.navigation-links {
  margin-top: 18px;
}
.navigation-links > p {
  margin: 0 4px 8px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.navigation-buttons {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8px;
}
.navigation-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: var(--gg-radius-md);
  background: var(--fill);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.navigation-link .icon {
  width: 17px;
  height: 17px;
  color: var(--tint);
}
.navigation-link .external,
.navigation-option .external {
  width: 14px;
  height: 14px;
  color: var(--muted);
  stroke-width: 2.4;
}
@media (hover: hover) and (pointer: fine) {
  .navigation-link:hover {
    background: var(--fill-strong);
  }
}
.precision-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* ---- Message bref : capsule sombre qui descend du haut ---- */
.toast {
  position: fixed;
  z-index: 4000;
  top: calc(var(--safe-top) + 20px);
  left: calc(50% + (var(--sidebar) + var(--gutter) * 2 + var(--safe-left)) / 2);
  width: max-content;
  max-width: min(440px, calc(100vw - var(--sidebar) - 200px));
  padding: 11px 20px;
  border-radius: 22px;
  background: #1c1c1eeb;
  -webkit-backdrop-filter: var(--material-filter);
  backdrop-filter: var(--material-filter);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow:
    inset 0 0 0 0.5px #ffffff24,
    0 12px 36px #00000042;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px) scale(0.96);
  transition:
    opacity 200ms,
    transform 420ms var(--gg-ease-out);
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.toast.error {
  background: #c20d20f2;
}
@media (prefers-color-scheme: dark) {
  .toast {
    background: #3a3a3cf0;
  }
  .toast.error {
    background: #c20d20f2;
  }
}

/* ---- Dialogues : carte centrée, feuille inférieure sur téléphone ---- */
.help-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  max-height: min(
    86dvh,
    calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px)
  );
  padding: 30px 26px 24px;
  overscroll-behavior: contain;
  border: 0;
  border-radius: var(--gg-radius-xl);
  background: var(--paper);
  color: var(--ink);
  box-shadow:
    0 0 0 0.5px #0000001f,
    0 24px 80px #0000004d;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition:
    opacity 200ms ease,
    transform 380ms var(--gg-ease-sheet);
  transition:
    opacity 200ms ease,
    transform 380ms var(--gg-ease-sheet),
    overlay 380ms allow-discrete,
    display 380ms allow-discrete;
}
.help-dialog[open] {
  opacity: 1;
  transform: none;
}
.help-dialog::backdrop {
  background: #00000000;
  transition: background-color 300ms ease;
  transition:
    background-color 300ms ease,
    overlay 300ms allow-discrete,
    display 300ms allow-discrete;
}
.help-dialog[open]::backdrop {
  background: var(--gg-scrim);
}
@starting-style {
  .help-dialog[open] {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  .help-dialog[open]::backdrop {
    background: #00000000;
  }
}
.help-dialog:not([open]),
.help-dialog:not([open])::backdrop {
  pointer-events: none;
}
.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
}
.help-dialog h2 {
  margin: 6px 36px 22px 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
/* Étapes numérotées dans une pastille teintée. */
.help-dialog ol {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.help-dialog li {
  position: relative;
  min-height: 32px;
  padding-left: 46px;
  counter-increment: step;
}
.help-dialog li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tint-soft);
  color: var(--tint);
  font-size: 0.9375rem;
  font-weight: 700;
}
.help-dialog li strong {
  display: block;
  padding-top: 5px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.help-dialog li p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.help-dialog .btn {
  min-height: 50px;
  margin-top: 20px;
}
.help-dialog .precision-note {
  margin-top: 16px;
}
.help-dialog .precision-note a {
  color: var(--tint);
  text-underline-offset: 2px;
}
.help-dialog .btn + .precision-note {
  text-align: center;
}
.dialog-eyebrow {
  margin: 4px 40px 0 0;
  color: var(--tint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.navigation-dialog h2,
.install-dialog h2 {
  margin: 6px 36px 10px 0;
}
.dialog-description {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
}
.navigation-destination {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--tint-soft);
  color: var(--tint);
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.navigation-options {
  display: grid;
  overflow: hidden;
  border-radius: 18px;
  background: var(--fill);
}
.navigation-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 16px 12px 14px;
  color: var(--ink);
  text-decoration: none;
}
.navigation-option + .navigation-option::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 68px;
  height: 1px;
  background: var(--line);
}
.navigation-option:focus-visible {
  outline-offset: -3px;
  border-radius: 16px;
}
.navigation-option:active {
  transform: none;
  filter: none;
  background: var(--fill-strong);
}
@media (hover: hover) and (pointer: fine) {
  .navigation-option:hover {
    background: var(--fill);
  }
}
.navigation-option > span:not(.app-tile) {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.navigation-option strong {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.navigation-option small {
  color: var(--muted);
  font-size: 0.8125rem;
}
.app-tile {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #ffffff;
  box-shadow:
    inset 0 0 0 0.5px #ffffff40,
    0 1px 3px #00000026;
}
.maps-tile {
  background: linear-gradient(180deg, #3ccb6b, #1f9f4d);
}
.waze-tile {
  background: linear-gradient(180deg, #44c6f4, #1299cf);
}
.install-dialog li {
  padding-top: 5px;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.spin {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.fatal-message {
  position: fixed;
  inset: 100px 20px auto;
  z-index: 5000;
  padding: 24px;
  border-radius: var(--gg-radius-lg);
  background: var(--paper);
  color: var(--gg-danger);
  box-shadow: var(--gg-shadow-raised);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}
@keyframes materialize {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}
@keyframes pin-drop {
  0% {
    opacity: 0;
    transform: translateY(-22px) rotate(-45deg) scale(0.5);
  }
  60% {
    opacity: 1;
    transform: translateY(2px) rotate(-45deg) scale(1.05);
  }
  100% {
    transform: rotate(-45deg) scale(1);
  }
}

/* ---- Volet plus étroit sur tablette et petite fenêtre ---- */
@media (min-width: 761px) and (max-width: 1100px) {
  :root {
    --sidebar: 328px;
  }
  .map-hint {
    display: none;
  }
  .code {
    font-size: 1.625rem;
  }
  /* « Google Maps » tient sur une ligne dans le volet étroit. */
  .navigation-link {
    gap: 5px;
    padding-inline: 6px;
    font-size: 0.875rem;
  }
}
@media (min-width: 761px) and (max-height: 820px) {
  h1 {
    margin-top: 2px;
    font-size: 1.75rem;
  }
  .intro {
    margin-bottom: 14px;
  }
  .welcome {
    padding-top: 20px;
  }
  .place-card {
    min-height: 56px;
    padding-block: 7px;
  }
}

/* ---- Téléphone en portrait : barre translucide en haut, fiche en bas ---- */
@media (max-width: 760px) and (min-height: 501px),
  (max-width: 760px) and (orientation: portrait) {
  :root {
    --header-height: 52px;
  }
  .app-header {
    top: 0;
    right: 0;
    left: 0;
    width: auto;
    min-height: calc(var(--header-height) + var(--safe-top));
    padding: var(--safe-top) max(10px, var(--safe-right)) 0
      max(16px, var(--safe-left));
  }
  .wordmark {
    gap: 9px;
    font-size: 1.3125rem;
  }
  .logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 7.5px;
  }
  .help-button {
    justify-content: center;
    min-width: 44px;
    padding: 0;
  }
  .help-label {
    display: none;
  }
  .workspace::before {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: var(--chrome-bottom, calc(var(--safe-top) + 108px));
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--material-thick);
    box-shadow: none;
  }
  .explorer {
    top: var(--header-bottom, calc(var(--safe-top) + var(--header-height)));
    right: var(--safe-right);
    bottom: auto;
    left: var(--safe-left);
    display: block;
    width: auto;
    padding: 2px 16px 10px;
    overflow: visible;
    border-radius: 0;
  }
  .explorer-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: 8px;
  }
  h1,
  .intro,
  .welcome,
  .sidebar-footer {
    display: none;
  }
  .search-form {
    min-width: 0;
  }
  .searchbar {
    height: 44px;
    padding-left: 10px;
    border-radius: 12px;
  }
  .searchbar input {
    font-size: 1rem;
  }
  .search-icon {
    margin-right: 6px;
  }
  .search-submit .icon {
    width: 30px;
    height: 30px;
    padding: 6.5px;
  }
  .location-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 12px;
  }
  .location-button .icon {
    width: 19px;
    height: 19px;
  }
  .location-button > span:not(.spin) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .suggest {
    right: -52px;
  }
  .map-workspace {
    --chrome: var(--chrome-bottom, calc(var(--safe-top) + 108px));
    --map-left: calc(12px + var(--safe-left));
    --map-edge: 12px;
  }
  #map:not(.leaflet-container) {
    padding: calc(var(--chrome) + 150px) 24px 24px;
    place-items: start center;
  }
  .leaflet-bottom.leaflet-right {
    top: var(--chrome);
    bottom: auto;
  }
  .leaflet-control-attribution {
    border-radius: 0 0 0 8px;
  }
  .map-topbar {
    top: calc(var(--chrome) + 28px);
  }
  .city-btn,
  .home-button {
    padding: 8px 12px;
    gap: 7px;
  }
  .city-menu {
    max-height: min(440px, 45dvh);
  }
  .map-tools {
    top: calc(var(--chrome) + 82px);
    bottom: auto;
    flex-direction: row;
  }
  .tool-separator {
    width: 1px;
    height: 24px;
    margin: 10px 3px;
  }
  .map-hint {
    bottom: calc(22px + var(--safe-bottom));
    left: 50%;
    max-width: calc(100% - 24px);
    padding-left: 16px;
  }
  .map-hint > .icon {
    display: none;
  }
  .map-legend {
    bottom: calc(84px + var(--safe-bottom));
  }
  .leaflet-bottom.leaflet-left {
    bottom: calc(118px + var(--safe-bottom));
    left: calc(2px + var(--safe-left));
  }
  .network-status {
    top: calc(var(--chrome) + 138px);
    max-width: calc(100% - 24px);
  }
  .toast {
    top: calc(var(--chrome-bottom, calc(var(--safe-top) + 108px)) + 30px);
    left: 50%;
    max-width: calc(100vw - 32px);
  }
  .panel {
    position: fixed;
    z-index: 1300;
    right: var(--safe-right);
    bottom: 0;
    left: var(--safe-left);
    max-height: min(
      66dvh,
      max(
        160px,
        calc(100dvh - var(--chrome-bottom, 153px) - 150px - var(--safe-bottom))
      )
    );
    margin: 0;
    padding: 0 16px max(14px, var(--safe-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--panel-radius) var(--panel-radius) 0 0;
    background: var(--paper);
    /* La dernière ombre prolonge la feuille quand un geste la soulève. */
    box-shadow:
      0 0 0 0.5px #0000001f,
      0 -10px 40px #0000002e,
      0 56px 0 var(--paper);
    /* Deux crans : ouverte, ou réduite au titre et à la carte du code. */
    transition: transform 460ms var(--gg-ease-sheet);
  }
  .panel.is-reduced {
    overflow: hidden;
  }
  /* Réduite, la fiche s’arrête sous la carte du code : le reste s’efface. */
  .gps-note,
  .actions,
  .navigation-links {
    transition: opacity 240ms ease;
  }
  .panel.is-reduced .gps-note,
  .panel.is-reduced .actions,
  .panel.is-reduced .navigation-links {
    opacity: 0;
    pointer-events: none;
  }
  .panel.open {
    animation: sheet-in 460ms var(--gg-ease-sheet);
  }
  .panel.is-dragging {
    transition: none;
    user-select: none;
  }
  .sheet-grabber {
    display: grid;
    place-items: center;
    width: 100%;
    height: 24px;
    border-radius: 12px;
    cursor: grab;
    touch-action: none;
  }
  .sheet-grabber span {
    width: 36px;
    height: 5px;
    border-radius: 3px;
    background: var(--gg-control-border);
    transition:
      width 240ms var(--gg-ease-out),
      background-color var(--gg-motion);
  }
  .sheet-grabber:active:not(:disabled) {
    transform: none;
    filter: none;
    cursor: grabbing;
  }
  .sheet-grabber:active span,
  .panel.is-dragging .sheet-grabber span {
    width: 44px;
    background: var(--muted);
  }
  .sheet-grabber:focus-visible {
    outline-offset: -3px;
  }
  .panel-head {
    margin: 0 2px 12px;
    touch-action: none;
  }
  .panel-head h2 {
    font-size: 1.375rem;
  }
  .panel-head h2,
  .panel-head p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .panel-head .icon-button {
    margin-top: -8px;
  }
  .code-card {
    gap: 2px;
    padding: 13px 14px 12px;
    border-radius: 20px;
  }
  .code {
    font-size: clamp(1.5rem, 7vw, 1.875rem);
  }
  .copy {
    min-height: 44px;
    margin-top: 8px;
  }
  .actions {
    margin-top: 8px;
  }
  .actions > .btn {
    min-height: 46px;
  }
  .navigation-links {
    margin-top: 12px;
  }
  .panel-open .map-legend,
  .panel-open .leaflet-bottom.leaflet-left {
    display: none;
  }
  .help-dialog {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - var(--safe-top) - 28px);
    margin: auto 0 0;
    padding: 28px 20px max(22px, calc(var(--safe-bottom) + 14px));
    border-radius: var(--gg-radius-xl) var(--gg-radius-xl) 0 0;
    opacity: 1;
    transform: translateY(100%);
    transition-duration: 200ms, 460ms, 460ms, 460ms;
  }
  @starting-style {
    .help-dialog[open] {
      opacity: 1;
      transform: translateY(100%);
    }
  }
  .help-dialog h2 {
    font-size: 1.625rem;
  }
}
@media (max-width: 760px) and (max-height: 740px) and (orientation: portrait) {
  .panel {
    padding: 0 14px max(10px, var(--safe-bottom));
  }
  .sheet-grabber {
    height: 20px;
  }
  .panel-head {
    margin-bottom: 8px;
  }
  .panel-head h2 {
    font-size: 1.25rem;
  }
  .panel-head p {
    font-size: 0.875rem;
  }
  .code-card {
    padding: 10px 14px;
  }
  .code-label {
    font-size: 0.6875rem;
  }
  .copy {
    margin-top: 6px;
  }
  .actions > .btn,
  .navigation-link {
    min-height: 44px;
  }
  .navigation-links {
    margin-top: 10px;
  }
  .navigation-links > p {
    margin-bottom: 6px;
  }
}

/* ---- Téléphone en paysage : volet compact à gauche ---- */
@media (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  :root {
    --sidebar: 288px;
    --gutter: 8px;
    --panel-radius: 20px;
    --header-height: 48px;
  }
  .app-header {
    padding: 2px 4px 2px 12px;
  }
  .wordmark {
    gap: 8px;
    font-size: 1.1875rem;
  }
  .logo-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .help-button {
    justify-content: center;
    min-width: 44px;
    padding: 0;
  }
  .help-label {
    display: none;
  }
  /* Volet étroit : l’installation se réduit à son icône, le nom reste lu. */
  .install-button {
    width: 44px;
    padding: 6px;
  }
  .install-icon {
    margin: 0;
  }
  .install-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .explorer {
    padding: 0 10px 8px;
  }
  h1,
  .intro,
  .sidebar-footer,
  .location-button,
  .coverage-note {
    display: none;
  }
  .searchbar {
    height: 44px;
    border-radius: 12px;
  }
  .welcome {
    padding-top: 14px;
  }
  .section-heading h2 {
    font-size: 1.0625rem;
  }
  .place-card {
    min-height: 52px;
    padding-block: 6px;
  }
  .panel {
    margin-top: 14px;
  }
  .panel-head {
    margin-bottom: 10px;
  }
  .panel-head h2 {
    font-size: 1.25rem;
  }
  .code {
    font-size: 1.5rem;
  }
  .map-workspace {
    --map-edge: 10px;
  }
  .map-topbar {
    gap: 6px;
  }
  .city-btn,
  .home-button {
    padding: 8px 11px;
  }
  .home-button span {
    display: none;
  }
  .map-tools {
    bottom: calc(26px + var(--safe-bottom));
  }
  .map-hint,
  .map-legend,
  .leaflet-bottom.leaflet-left {
    display: none;
  }
  .network-status {
    max-width: calc(100% - var(--map-left) - 76px);
  }
  .city-menu {
    max-height: 56dvh;
  }
  .toast {
    max-width: calc(100vw - var(--sidebar) - 140px);
  }
}
@media (max-width: 380px) {
  .app-header {
    padding: var(--safe-top) max(6px, var(--safe-right)) 0
      max(12px, var(--safe-left));
    gap: 2px 4px;
  }
  .wordmark {
    gap: 7px;
    font-size: 1.1875rem;
  }
  .logo-mark {
    width: 26px;
    height: 26px;
  }
  .install-icon {
    margin-left: 10px;
  }
  .install-button > span:last-child {
    margin-right: 11px;
    font-size: 0.8125rem;
  }
  .header-actions {
    gap: 0;
  }
  .explorer {
    padding-inline: 12px;
  }
  .search-icon {
    display: none;
  }
  .searchbar {
    padding-left: 12px;
  }
  .navigation-link {
    gap: 5px;
    padding-inline: 6px;
    font-size: 0.875rem;
  }
  .navigation-link > .icon:first-child {
    display: none;
  }
}

/* ---- Thème sombre : carte assombrie, sauf la vue satellite ---- */
@media (prefers-color-scheme: dark) {
  .map-workspace:not(.satellite) .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9)
      saturate(0.72);
  }
  .logo-mark {
    box-shadow:
      0 0 0 0.5px #ffffff2e,
      0 2px 5px #00000066;
  }
  .help-dialog {
    box-shadow:
      0 0 0 0.5px #ffffff24,
      0 24px 80px #000000a6;
  }
}

/* ---- Vue satellite : image sombre, surfaces plus denses pour rester lisible ---- */
.workspace:has(.map-workspace.satellite)::before {
  background: var(--paper);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.map-workspace.satellite {
  --material: var(--gg-material-thick);
}

/* ---- Préférences d’accessibilité ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  button:active:not(:disabled),
  a:active {
    transform: none;
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root {
    --material: var(--gg-paper);
    --material-thick: var(--gg-paper);
    --material-border: var(--gg-border);
    --material-filter: none;
  }
  .workspace::before,
  .city-btn,
  .home-button,
  .map-tools,
  .map-hint,
  .map-legend,
  .network-status,
  .city-menu,
  .toast {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .toast {
    background: #1c1c1e;
  }
  .toast.error {
    background: #b00d1e;
  }
  .leaflet-control-attribution,
  .leaflet-control-scale-line {
    background: var(--paper) !important;
  }
}
@media (prefers-contrast: more) {
  .searchbar,
  .btn.secondary,
  .location-button,
  .quick-places,
  .navigation-link,
  .navigation-options,
  .install-button {
    box-shadow: inset 0 0 0 1px var(--gg-control-border);
  }
  .city-btn,
  .home-button,
  .map-tools,
  .map-hint,
  .map-legend,
  .network-status,
  .city-menu {
    border-color: var(--gg-control-border);
  }
}

/* ---- Bouton de thème ---- */
.theme-button {
  justify-content: center;
  min-width: 40px;
  padding: 0;
}
@media (max-width: 760px) {
  .theme-button,
  #helpBtn {
    min-width: 36px;
  }
}
@media (max-width: 380px) {
  .install-button {
    width: 44px;
    padding: 6px;
  }
  .install-icon {
    margin: 0;
  }
  .install-button > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
