/* ============================================================
   MtlTrafic — v24 : Assistant vocal + Transport (métro/bus)
   ============================================================ */

/* ---------------- Bouton micro (dans la carte) ----------------
   Colonne GPS (bas gauche). v249 : pile COMPACTE 2.35rem d'écart
   (38px de bouton + gap 0.05rem) pour que les 7 boutons tiennent
   dans la carte téléphone sans déborder sur les pubs :
   GPS 8 → 🚦 10.35 → 🎤 12.7 → 🚌 15.05 → ⚡ 17.4 → ⛶ 19.75 → 🧭 22.1rem */
/* v272.57 : FAMILLE OCTOGONALE — les 6 boutons de cette feuille sont les
   « ronds » de la capture client 00h08 (voice-transport.css est chargée
   APRÈS style.css : ses border-radius:999px écrasaient les octogones). */
#map .voice-btn {
  position: absolute;
  left: 0.7rem;
  bottom: 12.7rem;
  z-index: 1100;
  width: 38px;
  height: 38px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  font-size: 1.05rem;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#map .voice-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
#map .voice-btn.rec {
  background: var(--accent);
  border-color: var(--accent);
  animation: voice-pulse 1.1s ease-in-out infinite;
}
/* v244 : mode auto (mot-réveil) = anneau doré permanent */
#map .voice-btn.wake {
  border-color: #f5a524;
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.25), var(--shadow-md);
}
#map .voice-btn.wake::after {
  content: "";
  position: absolute;
  top: -3px; right: -3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #f5a524;
  animation: voice-pulse 2s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 73, 47, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(226, 73, 47, 0); }
}

/* ---------------- Bulle vocale ---------------- */
.voice-bubble {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 1200;
  max-width: min(86%, 480px);
  background: rgba(16, 24, 40, 0.92);
  color: #fff;
  border-radius: 14px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.voice-bubble.show { opacity: 1; }
.voice-bubble b { color: #ffd7cd; }

/* ---------------- Bouton transport ---------------- */
#map .transport-fab {
  position: absolute;
  left: 0.7rem;
  bottom: 15.05rem;
  z-index: 1100;
  width: 38px;
  height: 38px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  font-size: 1.05rem;
  cursor: pointer;
  pointer-events: auto;
}
#map .transport-fab:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ---------------- Panneau transport ---------------- */
.transport-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 96vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(16, 24, 40, 0.18);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s ease;
}
.transport-panel.open { transform: translateX(0); }
.tp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}
.tp-head strong { font-family: var(--font-display); font-size: 0.95rem; }
.tp-x {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
}
.tp-x:hover { background: var(--line); }
.tp-search { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
.tp-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  outline: none;
}
.tp-search input:focus { border-color: var(--accent); }
.tp-body { flex: 1; overflow-y: auto; padding: 0.8rem 1rem; -webkit-overflow-scrolling: touch; }
.tp-sec {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 0.9rem 0 0.45rem;
}
.tp-sec:first-child { margin-top: 0; }
.tp-nearest {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.tp-nearest i { color: var(--ink-soft); font-style: normal; font-size: 0.74rem; }
.tp-go {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.tp-grid { display: flex; flex-direction: column; gap: 0.35rem; }
.tp-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.tp-line b { font-size: 0.95rem; }
.tp-stations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.tp-st {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.tp-st:hover { border-color: var(--accent); color: var(--accent); }
.tp-inc {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-size: 0.76rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.tp-busgrid {
  columns: 2;
  column-gap: 0.5rem;
  margin-top: 0.4rem;
}
.tp-bus {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  break-inside: avoid;
  padding: 0.22rem 0.3rem;
  font-size: 0.74rem;
  border-bottom: 1px dashed var(--line);
}
.tp-bus i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.tp-bus b { min-width: 2.1rem; }
.tp-foot { border-top: 1px solid var(--line); padding: 0.7rem 1rem; }
.tp-prices {
  display: block;
  text-align: center;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 0.55rem;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
}
.tp-prices:hover { background: var(--accent); }

/* Mobile : panneau pleine largeur, pile resserrée au-dessus du zoom */
@media (max-width: 720px) {
  .transport-panel { width: 100vw; }
  .voice-bubble { bottom: 0.6rem; font-size: 0.72rem; }
  .tp-busgrid { columns: 1; }
  #map .safety-fab { bottom: 17.4rem; }
}

/* ============================================================
   v272.64 — CONSOLE DICTÉE TEXTE (⌨️ voice-tty)
   Les mêmes commandes que la voix, écrites au clavier. Mode nuit :
   aucune parole, tout se lit. Octogone famille, octo-final.css s'applique.
   ============================================================ */
#voice-tty {
  position: fixed;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 3.4rem;
  z-index: 2800;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #d9e0ea);
  border-radius: 14px;
  box-shadow: var(--shadow-lg, 0 14px 34px -8px rgba(16,24,40,.35));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
  max-height: min(52vh, 420px);
  display: flex;
  flex-direction: column;
}
#voice-tty.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
#voice-tty .tty-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line, #d9e0ea);
  font-weight: 700; font-size: 0.82rem;
}
#voice-tty .tty-silent { margin-left: auto; font-weight: 600; font-size: 0.72rem; display: flex; gap: 0.3rem; align-items: center; cursor: pointer; }
#voice-tty .tty-x { border: none; background: none; font-size: 0.95rem; cursor: pointer; color: var(--ink-soft, #5d6b7e); padding: 0.15rem 0.3rem; }
#voice-tty .tty-log {
  overflow-y: auto; padding: 0.5rem 0.7rem;
  font-size: 0.8rem; line-height: 1.45;
  min-height: 2.2rem; max-height: 30vh;
}
#voice-tty .tty-line { padding: 0.12rem 0; word-break: break-word; }
#voice-tty .tty-row { display: flex; gap: 0.4rem; padding: 0.45rem 0.55rem 0.55rem; }
#voice-tty #tty-in {
  flex: 1; font: inherit; font-size: 0.88rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line, #d9e0ea); border-radius: 10px;
  background: var(--bg, #f6f5f1); color: var(--ink, #1c2733);
}
#voice-tty #tty-in:focus { outline: 2px solid rgba(26,115,232,.35); border-color: #1a73e8; }
body.dark #voice-tty { background: #16202c; border-color: #2a3a4d; }
body.dark #voice-tty .tty-head { border-color: #2a3a4d; }
body.dark #voice-tty #tty-in { background: #0f1722; border-color: #2a3a4d; color: #e8eef6; }

/* ============================================================
   v25 : HUB SÉCURITÉ ⚡
   ============================================================ */
#map .safety-fab {
  position: absolute;
  left: 0.7rem;
  bottom: 17.4rem;
  z-index: 1100;
  width: 38px;
  height: 38px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  border-radius: 0;
  border: 1px solid #ffd66e;
  background: linear-gradient(160deg, #fff8e1, #ffe9a8);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 214, 110, 0.4);
  font-size: 1.05rem;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#map .safety-fab:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ============================================================
   v248 : PLEIN ÉCRAN — bouton ⛶ (au-dessus de ⚡) + toast
   ============================================================ */
#map .fs-fab {
  position: absolute;
  left: 0.7rem;
  bottom: 19.75rem;
  z-index: 1100;
  width: 38px;
  height: 38px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  border-radius: 0;
  border: 1px solid #c9d4e3;
  background: linear-gradient(160deg, #ffffff, #e8eef7);
  box-shadow: var(--shadow-md);
  font-size: 1.05rem;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#map .fs-fab:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
@media (max-width: 1099px) {
  #map .fs-fab { bottom: 19.75rem; }
}
.fs-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  background: rgba(16, 24, 40, 0.92);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 5000;
  pointer-events: none;
  max-width: min(92vw, 480px);
  text-align: center;
}
.fs-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.safety-panel {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  z-index: 3100;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.safety-panel.open { opacity: 1; pointer-events: auto; }
.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff8e1, var(--accent-soft));
}
.sp-head strong { font-family: var(--font-display); font-size: 0.95rem; }
.sp-x {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
}
.sp-x:hover { background: var(--line); }
.sp-body { flex: 1; overflow-y: auto; padding: 0.6rem 0.9rem; -webkit-overflow-scrolling: touch; }
.sp-foot {
  border-top: 1px solid var(--line);
  padding: 0.55rem 1rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: var(--bg);
}
/* La feuille : ancrée en bas à droite sur desktop, pleine largeur bas sur mobile */
.sp-sheet {
  background: var(--panel);
  border-radius: 18px 18px 0 0;
  width: min(430px, 100vw);
  height: min(86dvh, 780px);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(16, 24, 40, 0.25);
  overflow: hidden;
  transform: translateY(24px);
  transition: transform 0.28s ease;
}
.safety-panel.open .sp-sheet { transform: translateY(0); }

/* Sections déroulantes de niveau 1 */
.sp-sec {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 0.55rem;
  background: var(--panel);
  overflow: hidden;
}
.sp-sec > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  user-select: none;
}
.sp-sec > summary::-webkit-details-marker { display: none; }
.sp-sec > summary i { font-style: normal; font-size: 1.25rem; flex: 0 0 auto; }
.sp-sec > summary span { display: flex; flex-direction: column; gap: 0.05rem; flex: 1; min-width: 0; }
.sp-sec > summary b { font-size: 0.88rem; }
.sp-sec > summary small { font-size: 0.7rem; color: var(--ink-soft); }
.sp-sec > summary em.sp-chev { font-style: normal; color: var(--ink-soft); transition: transform 0.2s ease; }
.sp-sec[open] > summary em.sp-chev { transform: rotate(180deg); }
.sp-sec[open] { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.sp-sec-body { padding: 0.1rem 0.8rem 0.75rem; }

/* Sous-groupes (niveau 2) */
.sp-sub { border: 1px dashed var(--line-strong); border-radius: 10px; margin-top: 0.5rem; }
.sp-sub > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.sp-sub > summary::-webkit-details-marker { display: none; }
.sp-sub > summary em.sp-chev { font-style: normal; transition: transform 0.2s ease; }
.sp-sub[open] > summary em.sp-chev { transform: rotate(90deg); }
.sp-sub-body { padding: 0.4rem 0.6rem 0.6rem; }

/* Contenu commun */
.sp-live {
  font-size: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.5rem;
  line-height: 1.45;
}
.sp-links { display: flex; flex-direction: column; gap: 0.3rem; }
.sp-links a {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.sp-links a:hover { border-color: var(--accent); background: var(--accent-soft); }
.sp-note { font-size: 0.74rem; color: var(--ink-soft); line-height: 1.5; margin-top: 0.45rem; }
.sp-nearest-h {
  font-size: 0.84rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sp-nearest-h i { color: var(--ink-soft); font-style: normal; font-size: 0.74rem; }
.sp-go {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.sp-hlist { display: flex; flex-direction: column; gap: 0.25rem; max-height: 240px; overflow-y: auto; }
.sp-hst {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.sp-hst:hover { border-color: var(--accent); color: var(--accent); }
.sp-hst small { color: var(--ink-soft); font-weight: 400; }
.sp-nums { display: grid; grid-template-columns: 1fr; gap: 0.3rem; }
.sp-num {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  border-bottom: 1px dashed var(--line);
  padding: 0.3rem 0.1rem;
  font-size: 0.76rem;
}
.sp-num a { font-weight: 900; color: var(--accent); text-decoration: none; font-size: 0.86rem; white-space: nowrap; }
.sp-num span { color: var(--ink-soft); }
.sp-loading2 { font-size: 0.78rem; color: var(--ink-soft); }

/* Mobile : hub sécurité en feuille basse pleine largeur */
@media (max-width: 720px) {
  .sp-sheet { width: 100vw; height: 88dvh; border-radius: 18px 18px 0 0; }
  .sp-nums { grid-template-columns: 1fr; }
}

/* ============================================================
   v25 : BOUTONS À FINE BORDURE autour des boîtes de pub
   Un liseré élégant (double trait + coin accentué) transforme chaque
   emplacement publicitaire en carte premium, sans surcharger.
   ============================================================ */
.map-ad {
  position: relative;
  border: 1.5px solid var(--line-strong) !important;
  border-radius: 14px;
  background: var(--panel);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.map-ad::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  pointer-events: none;
}
.map-ad::after {
  content: "";
  position: absolute;
  top: -1.5px; left: 18px;
  width: 34px; height: 3px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
  pointer-events: none;
}
.map-ad:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.map-ad:hover::before { border-color: var(--line-strong); }
/* Les rails latéraux : même liseré, coins adaptés */
.map-ad-rail { border: 1.5px solid var(--line-strong) !important; }
.map-ad-rail::after { top: 18px; left: -1.5px; width: 3px; height: 34px; border-radius: 0 4px 4px 0; }
/* Mode sombre : bordures discrètes */
body.dark .map-ad { border-color: #3a4150; }
body.dark .map-ad::before { border-color: #2c3340; }
body.dark .map-ad::after { background: var(--accent); }
body.dark #map .safety-fab { background: linear-gradient(160deg, #3a3320, #4d431f); border-color: #6b5c22; }
body.dark .sp-head { background: linear-gradient(135deg, #3a3320, #2b1c14); }
