/* ═══════════════════════════════════════════════
   Moirans Pratique PWA – Design System
   Dark Alpine · Material-inspired · Space Grotesk
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ──────────────────────────────────── */
:root {
  --bg:        #0c0e17;
  --bg2:       #111420;
  --surface:   #151826;
  --surface2:  #1c2033;
  --card:      #181b2c;
  --border:    #252a40;
  --border2:   #323755;

  --text:      #eef0f8;
  --text2:     #8b91b0;
  --text3:     #4e5470;

  --green:     #4ade80;
  --green-dim: rgba(74,222,128,.15);
  --blue:      #60a5fa;
  --blue-dim:  rgba(96,165,250,.15);
  --orange:    #fb923c;
  --orange-dim:rgba(251,146,60,.15);
  --red:       #f87171;
  --red-dim:   rgba(248,113,113,.15);
  --yellow:    #fbbf24;
  --yellow-dim:rgba(251,191,36,.15);
  --purple:    #c084fc;
  --purple-dim:rgba(192,132,252,.15);
  --teal:      #2dd4bf;
  --teal-dim:  rgba(45,212,191,.15);

  --font-d:  'Space Grotesk', system-ui, sans-serif;
  --font-b:  'Inter', system-ui, sans-serif;
  --font-m:  'DM Mono', 'Consolas', monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;

  --nav-h: 64px;   /* bottom nav height */
  --top-h: 56px;   /* top bar height */
}

/* ── RESET ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  height: 100%;
  overflow: hidden;           /* app-like : pas de scroll global */
  background-image:
    radial-gradient(ellipse 80% 40% at 15% 0%, rgba(74,222,128,.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 100%, rgba(96,165,250,.04) 0%, transparent 60%);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── APP SHELL ───────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ── TOP BAR ─────────────────────────────────── */
.top-bar {
  height: var(--top-h);
  flex-shrink: 0;
  background: rgba(21,24,38,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 50;
}
.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.top-bar-logo { height: 28px; width: auto; }
.top-bar-name {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.top-bar-right { display: flex; align-items: center; gap: 8px; }
.live-clock {
  font-family: var(--font-m);
  font-size: 13px;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── ALERTES BANNER ──────────────────────────── */
#alertes-container { flex-shrink: 0; }
.alerte {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown .25s ease;
}
.alerte--info    { background: rgba(96,165,250,.18); color: #93c5fd; border-bottom: 1px solid rgba(96,165,250,.25); }
.alerte--warning { background: rgba(251,191,36,.18); color: #fcd34d; border-bottom: 1px solid rgba(251,191,36,.25); }
.alerte--danger  { background: rgba(248,113,113,.18); color: #fca5a5; border-bottom: 1px solid rgba(248,113,113,.25); }
.alerte-msg { flex: 1; }
.alerte-close { opacity: .5; font-size: 16px; padding: 0 4px; transition: opacity .15s; }
.alerte-close:hover { opacity: 1; }
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── PAGES ───────────────────────────────────── */
#pages {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  /* Carte : doit rester dans le DOM avec une taille réelle */
  visibility: hidden;
}
.page.active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  visibility: visible;
}


/* ── BOTTOM NAV ──────────────────────────────── */
.bottom-nav {
  height: var(--nav-h);
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  safe-area-inset-bottom: env(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text3);
  transition: color .2s;
  position: relative;
  padding: 8px 4px;
}
.nav-btn.active { color: var(--green); }
.nav-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--green);
  border-radius: 0 0 2px 2px;
  transition: width .2s;
}
.nav-btn.active::before { width: 32px; }
.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: .02em; }

/* ── CARDS ───────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
}
.card--accent-red    { border-left: 3px solid var(--red); }
.card--accent-blue   { border-left: 3px solid var(--blue); }
.card--accent-orange { border-left: 3px solid var(--orange); }
.card--accent-yellow { border-left: 3px solid var(--yellow); }
.card--accent-green  { border-left: 3px solid var(--green); }
.card--accent-purple { border-left: 3px solid var(--purple); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 10px;
}
.card-icon { font-size: 22px; flex-shrink: 0; }
.card-title {
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  flex: 1;
}
.card-body { padding: 0 16px 14px; }
.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.card-footer a { color: var(--blue); }

/* Tap feedback */
.card-tappable { -webkit-tap-highlight-color: transparent; cursor: pointer; }
.card-tappable:active { opacity: .8; transform: scale(.99); }

/* ── CHIPS / BADGES ──────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.no-dot::before { display: none; }
.chip-green  { background: var(--green-dim);  color: var(--green);  border-color: rgba(74,222,128,.3); }
.chip-blue   { background: var(--blue-dim);   color: var(--blue);   border-color: rgba(96,165,250,.3); }
.chip-orange { background: var(--orange-dim); color: var(--orange); border-color: rgba(251,146,60,.3); }
.chip-red    { background: var(--red-dim);    color: var(--red);    border-color: rgba(248,113,113,.3); }
.chip-yellow { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(251,191,36,.3); }
.chip-purple { background: var(--purple-dim); color: var(--purple); border-color: rgba(192,132,252,.3); }
.chip-dim    { background: var(--surface2);   color: var(--text3);  border-color: var(--border); }

/* ── SKELETONS ───────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 120px;
  border-radius: var(--r-lg);
}

/* ── EMPTY / ERROR ───────────────────────────── */
.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text3);
  font-size: 13.5px;
}
.empty-icon { font-size: 28px; margin-bottom: 8px; }
.error-box {
  padding: 12px 14px;
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: var(--r-md);
  color: var(--red);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── DIVIDER ─────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 0; }

/* ── SECTION TITLE ───────────────────────────── */
.section-title {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── GRID ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack  { display: flex; flex-direction: column; gap: 10px; }

/* ════════════════════════════════════════════════
   PAGE : ACCUEIL
   ════════════════════════════════════════════════ */

/* Greeting */
.greeting { margin-bottom: 18px; }
.greeting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.greeting-text { font-family: var(--font-d); font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.greeting-sub  { font-size: 13px; color: var(--text2); margin-top: 2px; }
.meteo-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 12px;
  flex-shrink: 0;
}
.meteo-pill-emoji { font-size: 20px; }
.meteo-pill-temp  { font-family: var(--font-d); font-size: 15px; font-weight: 600; }
.meteo-pill-desc  { font-size: 11px; color: var(--text3); }

/* Trains dans accueil */
.train-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.train-time {
  font-family: var(--font-m);
  font-size: 15px;
  font-weight: 600;
  min-width: 50px;
}
.train-time.late { color: var(--orange); }
.train-dest { flex: 1; font-size: 13px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.train-dest-sub { font-size: 11px; color: var(--orange); }
.train-mins {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.train-mins.ok     { background: var(--green-dim);  color: var(--green); }
.train-mins.late   { background: var(--orange-dim); color: var(--orange); }
.train-mins.urgent { background: rgba(74,222,128,.3); color: var(--green); }

/* Bus dans accueil */
.bus-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.bus-num {
  background: var(--orange-dim);
  color: var(--orange);
  border: 1px solid rgba(251,146,60,.3);
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  min-width: 30px;
  text-align: center;
}
.bus-dir    { flex: 1; font-size: 13px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bus-stop   { font-size: 11px; color: var(--text3); }
.bus-right  { text-align: right; flex-shrink: 0; }
.bus-heure  { font-family: var(--font-m); font-size: 13px; font-weight: 500; }
.bus-dans   { font-size: 11px; color: var(--text3); }
.bus-dans.urgent { color: var(--orange); font-weight: 600; }

/* Mini agenda dans accueil */
.agenda-mini-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.agenda-mini-item:last-child { margin-bottom: 0; }
.agenda-date-pill {
  background: var(--purple-dim);
  border: 1px solid rgba(192,132,252,.25);
  border-radius: var(--r-sm);
  min-width: 36px;
  padding: 4px 6px;
  text-align: center;
  flex-shrink: 0;
}
.agenda-date-jour { display: block; font-family: var(--font-d); font-size: 15px; font-weight: 700; color: var(--purple); line-height: 1; }
.agenda-date-mois { display: block; font-size: 9px; font-weight: 600; color: var(--purple); letter-spacing: .04em; margin-top: 1px; }
.agenda-mini-titre { font-size: 13px; font-weight: 500; line-height: 1.4; }
.agenda-mini-date  { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ════════════════════════════════════════════════
   PAGE : TRANSPORTS
   ════════════════════════════════════════════════ */

/* Onglets internes */
.inner-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  gap: 2px;
}
.inner-tab {
  flex: 1;
  padding: 11px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.inner-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Gare card */
.gare-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.gare-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.gare-nom { font-family: var(--font-d); font-size: 14px; font-weight: 600; flex: 1; }
.gare-body { padding: 8px 16px 10px; }

/* Trains table */
.trains-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.trains-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 6px 6px 0;
  text-align: left;
}
.trains-table td { padding: 7px 6px 7px 0; border-bottom: 1px solid rgba(37,42,64,.6); }
.trains-table tr:last-child td { border-bottom: none; }
.train-heure-main { font-family: var(--font-m); font-weight: 600; }
.train-heure-base { font-family: var(--font-m); font-size: 11px; color: var(--text3); text-decoration: line-through; display: block; }
.train-retard-badge { font-size: 11px; color: var(--orange); font-weight: 600; }
.train-label { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(96,165,250,.3); border-radius: 6px; font-size: 10px; font-weight: 600; padding: 1px 5px; }
.dans-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.dans-badge.ok     { background: var(--green-dim);  color: var(--green); }
.dans-badge.late   { background: var(--orange-dim); color: var(--orange); }
.dans-badge.urgent { background: rgba(74,222,128,.3); color: var(--green); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* Bus arrêt selector */
.bus-arret-selector {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin-bottom: 12px;
}
.bus-arret-selector::-webkit-scrollbar { display: none; }
.bus-arret-pill {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  transition: all .18s;
}
.bus-arret-pill.active {
  background: var(--orange-dim);
  border-color: rgba(251,146,60,.4);
  color: var(--orange);
  font-weight: 600;
}

/* Bus arret card */
.bus-arret-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.bus-arret-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.bus-arret-nom { font-family: var(--font-d); font-size: 14px; font-weight: 600; }
.bus-arret-body { padding: 8px 16px 10px; }
.bus-row-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(37,42,64,.5);
}
.bus-row-detail:last-child { border-bottom: none; }

/* ════════════════════════════════════════════════
   PAGE : SERVICES
   ════════════════════════════════════════════════ */

.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.service-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.service-header-icon { font-size: 20px; }
.service-header-title { font-family: var(--font-d); font-size: 14px; font-weight: 600; flex: 1; }
.service-body { padding: 14px 16px; }
.service-footer { padding: 10px 16px; border-top: 1px solid var(--border); }

/* Pharmacie */
.pharma-nom   { font-family: var(--font-d); font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.pharma-addr  { font-size: 13px; color: var(--text2); margin-bottom: 3px; }
.pharma-tel   { font-size: 13px; color: var(--red); font-weight: 500; margin-bottom: 3px; }
.pharma-info  { font-size: 12px; color: var(--text3); margin-bottom: 2px; }
.pharma-warn  { font-size: 12px; color: var(--orange); margin-top: 5px; }

/* Horaires */
.horaire-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(37,42,64,.5);
  font-size: 13px;
}
.horaire-row:last-child { border-bottom: none; }
.horaire-jour { color: var(--text2); }
.horaire-jour.today { color: var(--green); font-weight: 600; }
.horaire-h { font-family: var(--font-m); font-size: 12.5px; }
.horaire-h.today { color: var(--text); }

/* Déchèterie grid */
.dechet-grid {
  display: flex;
  gap: 4px;
  margin: 10px 0 4px;
}
.dechet-jour-cell {
  flex: 1;
  border-radius: 6px;
  padding: 5px 2px;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 9px;
}
.dechet-jour-cell.has-hours { background: var(--green-dim); border-color: rgba(74,222,128,.25); }
.dechet-jour-cell.today { border-color: var(--green) !important; font-weight: 700; }
.dechet-jour-cell .dj-label { color: var(--text3); display: block; margin-bottom: 2px; }
.dechet-jour-cell.has-hours .dj-label { color: var(--green); }
.dechet-jour-cell .dj-mark { color: var(--text3); }
.dechet-jour-cell.has-hours .dj-mark { color: var(--green); }

/* ════════════════════════════════════════════════
   PAGE : CARTE
   ════════════════════════════════════════════════ */

#page-carte { padding: 0 !important; overflow: hidden; }
.carte-filters {
  position: absolute;
  top: 8px;
  left: 0; right: 0;
  z-index: 400;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 10px;
}
.carte-filters::-webkit-scrollbar { display: none; }
.filter-pill {
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(21,24,38,.92);
  border: 1px solid var(--border);
  color: var(--text2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all .18s;
  cursor: pointer;
}
.filter-pill.active {
  background: rgba(96,165,250,.2);
  border-color: rgba(96,165,250,.4);
  color: var(--blue);
  font-weight: 600;
}

#map { width: 100%; height: 100%; min-height: 200px; display: block; }

/* FAB localisation */
.map-fabs {
  position: absolute;
  right: 14px;
  bottom: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(.93); }
.fab.fab-lg { width: 54px; height: 54px; font-size: 22px; }
.fab.active { border-color: rgba(74,222,128,.5); background: rgba(74,222,128,.1); }
.fab.loading { opacity: .6; }

/* Indicateur GPS */
.gps-indicator {
  position: absolute;
  left: 12px;
  bottom: 20px;
  z-index: 400;
  background: rgba(21,24,38,.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.gps-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

/* Marqueur utilisateur */
.user-marker {
  width: 18px; height: 18px;
  background: white;
  border: 3px solid var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(96,165,250,.2), 0 2px 6px rgba(0,0,0,.4);
  animation: userPulse 2.5s infinite;
}
@keyframes userPulse {
  0%,100% { box-shadow: 0 0 0 6px rgba(96,165,250,.2), 0 2px 6px rgba(0,0,0,.4); }
  50%      { box-shadow: 0 0 0 12px rgba(96,165,250,.05), 0 2px 6px rgba(0,0,0,.4); }
}

/* POI marker */
.poi-marker {
  width: 38px; height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.poi-marker-box {
  width: 38px; height: 38px;
  background: var(--surface);
  border-radius: 10px;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.poi-marker-pin {
  width: 2px; height: 6px;
  background: currentColor;
  opacity: .6;
}

/* POI bottom sheet */
.poi-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 16px 20px 32px;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
}
.poi-sheet.open { transform: none; }
.poi-sheet-handle {
  width: 40px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.poi-sheet-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.poi-sheet-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.poi-sheet-name { font-family: var(--font-d); font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.poi-sheet-desc { font-size: 13.5px; color: var(--text2); }
.poi-sheet-btns { display: flex; gap: 8px; margin-top: 14px; }
.poi-sheet-btns button {
  flex: 1;
  padding: 11px 8px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  transition: opacity .15s;
}
.poi-sheet-btns button:active { opacity: .7; }
.btn-primary { background: var(--green); color: #0a1a10; }
.btn-outline  { background: var(--surface2); color: var(--text2); border: 1px solid var(--border2); }

/* Leaflet dark */
.leaflet-container { background: #1a1d2a !important; }
.leaflet-tile { filter: brightness(.85) saturate(.8); }
.leaflet-popup-content-wrapper {
  background: #1e2132 !important;
  border: 1px solid var(--border2) !important;
  border-radius: var(--r-md) !important;
  color: var(--text) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.6) !important;
}
.leaflet-popup-tip { background: #1e2132 !important; }

/* ════════════════════════════════════════════════
   PAGE : RESTAURANTS
   ════════════════════════════════════════════════ */

.resto-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.resto-card:active { opacity: .85; }
.resto-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}
.resto-img-placeholder {
  width: 100%;
  height: 100px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.resto-info { padding: 14px 16px; }
.resto-nom { font-family: var(--font-d); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.resto-meta { font-size: 12.5px; color: var(--text3); margin-bottom: 2px; }
.resto-menu-preview {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--green-dim);
  border: 1px solid rgba(74,222,128,.2);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--text2);
}
.resto-menu-preview-title { font-size: 11.5px; color: var(--green); font-weight: 700; margin-bottom: 3px; }
.resto-actions {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.resto-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
}
.action-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(74,222,128,.25); }
.action-blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(96,165,250,.25); }

/* Resto bottom sheet */
.resto-sheet {
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none;
}
.resto-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s;
}
.resto-sheet-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.resto-sheet.open { pointer-events: auto; }
.resto-sheet.open .resto-sheet-backdrop { opacity: 1; }
.resto-sheet.open .resto-sheet-panel { transform: none; }
.resto-sheet-img { width: 100%; height: 200px; object-fit: cover; }
.resto-sheet-img-ph { width: 100%; height: 120px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 52px; }
.resto-sheet-body { padding: 20px; }
.resto-sheet-nom { font-family: var(--font-d); font-size: 22px; font-weight: 700; margin-bottom: 12px; letter-spacing: -.02em; }
.resto-info-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text2); margin-bottom: 7px; }
.resto-desc {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: var(--r-md);
  border-left: 3px solid var(--green);
  font-size: 13.5px;
  color: var(--text2);
}
.resto-section-title {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.carte-categorie-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin: 12px 0 6px;
}
.carte-plat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgba(37,42,64,.5);
  font-size: 13.5px;
  gap: 8px;
}
.carte-plat-row:last-child { border-bottom: none; }
.carte-plat-nom { color: var(--text2); flex: 1; }
.carte-plat-prix { font-family: var(--font-m); font-size: 13px; color: var(--yellow); font-weight: 500; flex-shrink: 0; }
.resto-sheet-handle {
  width: 40px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ════════════════════════════════════════════════
   PAGE : AGENDA
   ════════════════════════════════════════════════ */

.agenda-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 12px;
  -webkit-tap-highlight-color: transparent;
}
.agenda-card-stripe {
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}
.agenda-card-img { width: 100%; height: 120px; object-fit: cover; }
.agenda-card-img-ph { width: 100%; height: 60px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.agenda-card-body { padding: 12px 14px; }
.agenda-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.agenda-date-chip { font-size: 11.5px; color: var(--purple); font-weight: 500; }
.agenda-card-titre { font-family: var(--font-d); font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; }
.agenda-card-lieu { font-size: 12px; color: var(--text3); }
.agenda-card-footer { padding: 9px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text3); }

/* ════════════════════════════════════════════════
   MÉTÉO (dans page accueil, section dédiée)
   ════════════════════════════════════════════════ */

.meteo-current {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.meteo-main-emoji { font-size: 40px; }
.meteo-main-temp  { font-family: var(--font-d); font-size: 36px; font-weight: 700; line-height: 1; }
.meteo-main-desc  { font-size: 13px; color: var(--text2); margin-top: 3px; }
.meteo-main-wind  { font-size: 12px; color: var(--text3); margin-top: 2px; }

.meteo-daily {
  display: flex;
  gap: 8px;
}
.meteo-day {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 5px;
  text-align: center;
}
.meteo-day-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.meteo-day-icon  { font-size: 20px; margin-bottom: 4px; }
.meteo-day-temps { font-size: 12.5px; }
.t-max { font-weight: 600; }
.t-min { color: var(--text3); margin-left: 3px; }
.meteo-day-rain { font-size: 10px; color: var(--blue); margin-top: 2px; }
.meteo-source { font-size: 10.5px; color: var(--text3); text-align: right; margin-top: 8px; }

/* ════════════════════════════════════════════════
   BOUTONS GÉNÉRAUX
   ════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { opacity: .75; }
.btn-green  { background: var(--green);   color: #0a1a10; }
.btn-ghost  { background: var(--surface2); color: var(--text2); border: 1px solid var(--border2); }
.btn-block  { width: 100%; }

/* External link chip */
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--blue);
  padding: 4px 0;
}

/* ════════════════════════════════════════════════
   RESPONSIVE / SAFE AREAS
   ════════════════════════════════════════════════ */

/* ── TABLETTE ─────────────────────────────────── */
@media (min-width: 600px) and (max-width: 899px) {
  .page { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════════════════════════════
   DESKTOP ≥ 900px
   Layout : sidebar fixe gauche + zone principale
   ════════════════════════════════════════════════ */
@media (min-width: 900px) {

  :root {
    --sidebar-w: 230px;
    --top-h:     60px;
    --content-max: 960px;
  }

  /* ── Body ──────────────────────────────────── */
  body { overflow: hidden; }

  /* ── App shell : row ───────────────────────── */
  #app {
    flex-direction: row;
    height: 100dvh;
    overflow: hidden;
  }

  /* ── Top bar : masquée (sidebar remplace) ── */
  .top-bar { display: none; }

  /* ── Alertes : bandeau fixe en haut du contenu */
  #alertes-container {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    z-index: 300;
  }

  /* ══════════════════════════════════════════
     SIDEBAR
     ══════════════════════════════════════════ */
  .bottom-nav {
    width: var(--sidebar-w);
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
    overflow: visible;
    padding-bottom: 0;
    background: var(--surface);
  }

  /* En-tête sidebar : logo + nom */
  .bottom-nav::before {
    content: 'Moirans Pratique';
    display: flex;
    align-items: center;
    height: var(--top-h);
    padding: 0 18px;
    font-family: var(--font-d);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: rgba(21,24,38,.95);
    backdrop-filter: blur(16px);
    flex-shrink: 0;
  }

  /* Boutons sidebar : mode ligne */
  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 11px 16px;
    gap: 12px;
    height: auto;
    border-radius: var(--r-md);
    margin: 2px 10px;
    width: calc(100% - 20px);
    color: var(--text2);
  }
  .nav-btn:hover { background: var(--surface2); color: var(--text); }
  .nav-btn.active {
    background: var(--green-dim);
    color: var(--green);
  }

  /* Supprimer l'indicateur top-bar */
  .nav-btn::before { display: none; }

  .nav-icon  { font-size: 18px; line-height: 1; }
  .nav-label { font-size: 13.5px; font-weight: 500; letter-spacing: 0; }

  /* Footer sidebar */
  .sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
  }
  .sidebar-clock {
    font-family: var(--font-m);
    font-size: 14px;
    color: var(--text2);
    font-weight: 500;
  }
  .sidebar-version { font-size: 10.5px; color: var(--text3); line-height: 1.6; }

  /* ══════════════════════════════════════════
     ZONE CONTENU
     ══════════════════════════════════════════ */
  #pages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    background: var(--bg);
    position: relative; /* IMPORTANT : référent pour la carte */
    height: 100dvh;
  }

  /* Pages : flow normal (pas absolute) */
  .page {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    padding: 30px 36px;
    max-width: var(--content-max);
    animation: desktopFadeIn .18s ease;
  }
  .page.active { display: block; }

  /* Page carte : plein écran géré par JS */
  #page-carte {
    position: absolute !important;
    inset: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    display: block !important;
    visibility: hidden;
    z-index: 0;
    height: 100% !important;
  }
  #page-carte.active {
    visibility: visible;
    z-index: 2;
  }

  @keyframes desktopFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }

  /* ══════════════════════════════════════════
     PAGE ACCUEIL
     ══════════════════════════════════════════ */
  #page-accueil { max-width: 1080px; }

  #page-accueil .greeting { margin-bottom: 28px; }
  #page-accueil .greeting-text { font-size: 28px; }

  /* Grille accueil 3 colonnes */
  .home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .home-grid .card--full  { grid-column: 1 / -1; }
  .home-grid .card--span2 { grid-column: span 2; }

  /* Hover cards */
  .card-tappable {
    transition: transform .2s cubic-bezier(.22,.68,0,1.2), box-shadow .2s;
    cursor: pointer;
  }
  .card-tappable:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(0,0,0,.45);
  }

  /* ══════════════════════════════════════════
     PAGE TRANSPORTS
     ══════════════════════════════════════════ */
  #page-transports .section-title { font-size: 20px; margin-bottom: 6px; }

  /* Masquer les onglets mobiles, tout afficher */
  #page-transports .inner-tabs   { display: none; }
  #page-transports .inner-tab-content { display: block !important; }

  .transports-desktop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  .transports-desktop > .inner-tab-content[data-tab="trains"] { grid-column: 1; }
  .transports-desktop > .inner-tab-content[data-tab="bus"]    { grid-column: 2; }

  /* ══════════════════════════════════════════
     PAGE SERVICES
     ══════════════════════════════════════════ */
  .services-desktop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  .services-desktop .service-card        { margin-bottom: 0; }
  .services-desktop .service-card--full  { grid-column: 1 / -1; }

  /* ══════════════════════════════════════════
     PAGE RESTAURANTS
     ══════════════════════════════════════════ */
  #page-restaurants { max-width: 1080px; }

  .restos-desktop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
  }

  /* Modal restaurant : centré sur desktop */
  .resto-sheet-panel {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-w) + 50%);
    transform: translate(-50%, calc(-50% + 30px));
    bottom: auto;
    max-width: 700px;
    width: calc(100vw - var(--sidebar-w) - 80px);
    max-height: 85dvh;
    border-radius: var(--r-xl);
    opacity: 0;
    transition: opacity .25s, transform .28s cubic-bezier(.16,1,.3,1);
  }
  .resto-sheet.open .resto-sheet-panel {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  .resto-sheet-backdrop { display: block; }

  /* ══════════════════════════════════════════
     PAGE AGENDA
     ══════════════════════════════════════════ */
  #page-agenda { max-width: 1080px; }

  .agenda-desktop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
  }

  /* ══════════════════════════════════════════
     UTILITAIRES DESKTOP
     ══════════════════════════════════════════ */
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 18px; margin-bottom: 18px; }
}

/* ── TRÈS GRANDS ÉCRANS ───────────────────────── */
@media (min-width: 1400px) {
  :root {
    --sidebar-w: 250px;
    --content-max: 1100px;
  }
  .page { padding: 36px 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
