/* Présentation validée du 9 octobre 2026.
   Chargée en dernier. Les fonds forcés de l’ancien hero sont retirés dans search-rail.css. */

:root:not(.dark) {
  --mz-ground: #faf5ef;
  --mz-ink: #202631;
  --mz-muted: #596371;
  --mz-line: #e2e6eb;
  --mz-accent: #ff6b00;
  --mz-accent-ink: #1b1c1f;
  --mz-accent-text: #9e4100;
  --mz-accent-soft: #fff0e4;
}

:root:not(.dark) body.app-shell {
  background: #faf5ef;
  color: #202631;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  /* Le jeton électrique reste bleu dans tokens.css. Ici, le calculé suit la charte. */
  --mz-electric: #ff6b00;
  --mz-electric-text: #9e4100;
  --mz-electric-soft: #fff0e4;
  --mz-electric-bright: #ff6b00;
  --mz-prediction: #6741a5;
  --mz-prediction-ink: #6741a5;
}

/* Photo d’en-tête uniquement, en haut du document. Elle défile avec la page :
   pas de position:fixed, donc elle ne passe pas derrière les résultats. */
body.app-shell {
  position: relative;
}
body.app-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 280px;
  z-index: 0;
  pointer-events: none;
  background: url("/media/hero-atmosphere.webp?v=20260924uxf2") center 42% / cover no-repeat;
  background-attachment: scroll;
  filter: brightness(0.42) saturate(0.9);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

body.app-shell .mz-hero-atmosphere {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center 42%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  filter: brightness(0.42) saturate(0.9);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

body.app-shell .layout.mz-app-frame {
  position: relative;
  z-index: 1;
}

body.app-shell.has-results .mz-results-sticky-head {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--mz-ground, #faf5ef);
  background-color: var(--mz-ground, #faf5ef);
  background-image: none;
  border-bottom: 1px solid var(--mz-line, #e2e6eb);
  box-shadow: var(--mz-shadow-md, 0 4px 16px rgba(22, 26, 34, 0.08));
}

body.app-shell .mz-topbar,
body.app-shell.has-results .mz-topbar,
body.app-shell.has-results .mz-topbar.is-scrolled {
  position: relative;
  z-index: 3;
  background: transparent;
  background-color: transparent;
  background-image: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
  box-shadow: none;
  color: #fff;
}

body.app-shell .mz-topbar-name,
body.app-shell .mz-top-nav .main-tab,
body.app-shell .mz-topbar .mz-icon-btn,
body.app-shell.has-results .mz-top-nav .main-tab {
  color: #fff;
}

body.app-shell .mz-top-nav.main-tabs,
body.app-shell.has-results .mz-top-nav.main-tabs {
  background: transparent;
  background-color: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body.app-shell .mz-topbar .mz-icon-btn,
body.app-shell.has-results .mz-topbar .mz-icon-btn {
  background: transparent;
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #fff;
}

body.app-shell .mz-topbar .account-chip {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
  color: #fff;
}

body.app-shell .mz-top-nav .main-tab {
  background: transparent;
  border-radius: 10px;
  font-weight: 500;
}

body.app-shell .mz-top-nav .main-tab.active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

body.app-shell .mz-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: #ff6b00;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

body.app-shell .mz-page-intro {
  position: relative;
  z-index: 2;
  align-self: stretch;
  width: 100%;
  max-width: 1344px;
  margin: 0 auto;
  padding: 4px 28px 18px;
  box-sizing: border-box;
  color: #fff;
  text-align: left;
}

body.app-shell .mz-page-intro .mz-rail-hero-copy {
  display: block;
  max-width: none;
  width: 100%;
  margin: 0;
  text-align: left;
}

body.app-shell .mz-page-intro .mz-rail-hero-kicker {
  display: none;
}

body.app-shell .mz-page-intro .mz-rail-hello {
  margin: 0 0 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.app-shell .mz-page-intro .mz-rail-hero-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.app-shell .mz-page-intro .mz-rail-hero-lead {
  margin: 0;
  max-width: 40rem;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.app-shell.tab-planner #sidebar.mz-search-hero,
body.app-shell.tab-planner.has-results #sidebar.mz-search-hero {
  background: #fff;
  background-color: #fff;
  color: #202631;
  border: 1px solid #e2e6eb;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(32, 38, 49, 0.08);
  position: relative;
  z-index: 1;
  padding: 16px 14px 18px;
}

body.app-shell.tab-planner #sidebar .sidebar-scroll {
  position: relative;
  z-index: 1;
  padding: 0;
}

body.app-shell.tab-planner .mz-card-kicker {
  margin: 0 0 12px;
  color: #202631;
  font-size: 16px;
  font-weight: 500;
}

body.app-shell.tab-planner .welcome-kicker {
  display: none;
}

body.app-shell.tab-planner #sidebar .place-geo-btn {
  color: #596371;
}

body.app-shell.tab-planner #sidebar .station-search-input,
body.app-shell.tab-planner #sidebar .mz-slot,
body.app-shell.tab-planner #sidebar .product-btn,
body.app-shell.tab-planner #sidebar .trip-type-btn {
  background: #fff;
  color: #202631;
  border-color: #e2e6eb;
}

body.app-shell.tab-planner #sidebar .od-field-label,
body.app-shell.tab-planner #sidebar .mz-label,
body.app-shell.tab-planner #sidebar .mz-slot-kicker,
body.app-shell.tab-planner #sidebar .mz-month-opt,
body.app-shell.tab-planner #sidebar .od-empty-hint,
body.app-shell.tab-planner #sidebar .trip-type-hint {
  color: #596371;
}

body.app-shell.tab-planner #sidebar .mz-slot-value,
body.app-shell.tab-planner #sidebar .station-search-input::placeholder {
  color: #202631;
}

@media (min-width: 1024px) {
  body.app-shell.tab-planner .layout.mz-app-frame {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 17px;
    max-width: 1344px;
    width: 100%;
    margin: 0 auto;
    padding: 0 28px 42px;
    align-items: start;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
  }
  body.app-shell.tab-planner #sidebarToggle,
  body.app-shell.tab-planner #sidebarOverlay {
    display: none;
  }
}

@media (min-width: 901px) {
  body.app-shell.tab-planner .layout.mz-app-frame {
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1250px) {
  body.app-shell.tab-planner .layout.mz-app-frame {
    grid-template-columns: 350px minmax(0, 1fr);
  }
}

/* Le formulaire reste colonne 1, les résultats colonne 2, même si une carte s’insère dans la grille. */
@media (min-width: 1024px) {
  body.app-shell.tab-planner .layout.mz-app-frame > #sidebar {
    grid-column: 1;
    grid-row: 1;
  }
  body.app-shell.tab-planner .layout.mz-app-frame > main.main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  body.app-shell.tab-planner .layout.mz-app-frame > .mz-consent-prompt {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  body.app-shell.tab-planner .layout.mz-app-frame:has(> .mz-consent-prompt) > #sidebar,
  body.app-shell.tab-planner .layout.mz-app-frame:has(> .mz-consent-prompt) > main.main {
    grid-row: 2;
  }
}

body.app-shell.tab-planner #mzOdBar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.app-shell.tab-planner .mz-trip-segment {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: #eef1f4;
}

body.app-shell.tab-planner .mz-trip-segment .trip-type-btn {
  flex: 1 1 0;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #596371;
  font-weight: 500;
}

body.app-shell.tab-planner .mz-trip-segment .trip-type-btn.active,
body.app-shell.tab-planner .mz-trip-segment .trip-type-btn[aria-pressed="true"] {
  background: #fff;
  color: #202631;
}

body.app-shell.tab-planner #mzOdBar .od-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-areas:
    "dep swap"
    "arr swap";
  gap: 8px 8px;
  align-items: center;
}

body.app-shell.tab-planner #origStationWrap { grid-area: dep; }
body.app-shell.tab-planner #destStationWrap { grid-area: arr; }
body.app-shell.tab-planner .od-swap {
  grid-area: swap;
  margin: 0;
  align-self: center;
}

body.app-shell.tab-planner #mzOdBar .od-swap .swap-btn#odSwapBtn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  margin: 0 auto;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #e2e6eb;
  background: #fff;
  color: #202631;
  box-shadow: none;
}

body.app-shell.tab-planner .swap-btn-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

body.app-shell.tab-planner #daySearchSection {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.app-shell.tab-planner .mz-when-primary { order: 1; }
body.app-shell.tab-planner #tripTypeHint { order: 2; }
body.app-shell.tab-planner .mz-month-opt { order: 3; }
body.app-shell.tab-planner #mzThirtyDaysNote { order: 4; }
body.app-shell.tab-planner #mzDepartHour { order: 5; }
body.app-shell.tab-planner #mzSearchIosOptions { order: 6; }

body.app-shell.tab-planner .mz-today-chip {
  display: none;
}

body.app-shell #mzHourChips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}

body.app-shell #mzHourChips .mz-hour-all {
  flex: 1 0 100%;
  order: -1;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #596371;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

body.app-shell #mzHourChips .mz-hour-all[aria-pressed="true"] {
  background: transparent;
  color: #9e4100;
}

body.app-shell #mzHourChips .mz-hour-chip:not(.mz-hour-all) {
  flex: 1 1 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 0;
  border-radius: 10px;
  border: 1px solid #e2e6eb;
  background: #fff;
  color: #202631;
  font-size: 12px;
  font-weight: 500;
}

body.app-shell #mzHourChips .mz-hour-chip:not(.mz-hour-all).is-active,
body.app-shell #mzHourChips .mz-hour-chip:not(.mz-hour-all)[aria-pressed="true"] {
  background: #fff0e4;
  border-color: #ffc599;
  color: #9e4100;
}

body.app-shell .mz-depth-segment {
  min-width: 0;
  max-width: 100%;
}

body.app-shell .mz-depth-row {
  display: flex;
  gap: 0;
  padding: 3px;
  border-radius: 10px;
  background: #eef1f4;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

body.app-shell .mz-depth-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  box-sizing: border-box;
  padding: 6px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #596371;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  font-family: inherit;
}

/* Deux boutons de 44 px ne tiennent pas côte à côte. On les empile. */
@media (max-width: 180px) {
  body.app-shell .mz-depth-row {
    flex-direction: column;
    gap: 4px;
  }
  body.app-shell .mz-depth-btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
  }
}

body.app-shell .mz-depth-btn.is-on,
body.app-shell .mz-depth-btn[aria-pressed="true"] {
  background: #fff;
  color: #202631;
}

body.app-shell .mz-depth-note,
body.app-shell .mz-month-note {
  margin: 4px 0 0;
  color: #596371;
  font-size: 12px;
}

body.app-shell .mz-ios-deep {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

body.app-shell .mz-hour-fold-toggle {
  display: none;
}

body.app-shell.tab-planner #daySearchBtn {
  width: 100%;
  min-height: 44px;
  background: #ff6b00;
  color: #1b1c1f;
  border: 0;
  border-radius: 10px;
  font-weight: 500;
}

body.app-shell .mz-trip-options {
  margin-top: 4px;
  color: #202631;
}

body.app-shell .mz-trip-options > summary {
  cursor: pointer;
  color: #596371;
  font-size: 13px;
  font-weight: 500;
}

body.app-shell .welcome.mz-empty,
body.app-shell .mz-onboarding {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 0 24px;
  max-width: 36rem;
}

body.app-shell #welcomeTitle,
body.app-shell .mz-onboarding h1 {
  font-size: 19px;
  font-weight: 500;
  color: #202631;
  margin: 0 0 8px;
}

body.app-shell .welcome-lead {
  color: #596371;
  font-size: 14px;
}

body.app-shell .mz-freshness {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #596371;
  font-size: 12px;
}

:root:not(.dark) body.app-shell .mz-rail-card,
:root:not(.dark) body.app-shell .journey-card {
  background: #fff;
  border: 1px solid #e2e6eb;
  border-radius: 16px;
  padding: 19px;
  margin-bottom: 12px;
}

:root:not(.dark) body.app-shell .mz-rail-times .j-dep,
:root:not(.dark) body.app-shell .mz-rail-times .j-arr {
  font-size: 27px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #202631;
}

:root:not(.dark) body.app-shell .mz-kind-tab.is-on {
  color: #9e4100;
}

body.app-shell.tab-account #mainContent,
body.app-shell.tab-alerts #mainContent,
body.app-shell.tab-trips #mainContent {
  max-width: 1344px;
  margin: 0 auto;
  padding: 0 28px 42px;
  position: relative;
  z-index: 1;
}

body.app-shell .mz-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  margin: 0;
  border-radius: 0;
  z-index: 30;
  background: #fff;
  color: #202631;
  border-top: 1px solid #e2e6eb;
}

body.app-shell .mz-bottom-nav-btn {
  color: #596371;
}

body.app-shell .mz-bottom-nav-btn.active {
  color: #9e4100;
}

@media (min-width: 1024px) {
  body.app-shell .mz-bottom-nav {
    display: none;
  }
}

/* Sous 1024 : une seule colonne, formulaire puis résultats, comme sur mobile. */
@media (max-width: 1023px) {
  body.app-shell.tab-planner .layout.mz-app-frame {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 1344px;
    margin: 0 auto;
    padding: 0 16px calc(88px + env(safe-area-inset-bottom, 0px));
    gap: 16px;
    box-sizing: border-box;
    align-items: stretch;
  }
  body.app-shell.tab-planner #sidebar,
  body.app-shell.tab-planner #sidebar.mz-search-hero,
  body.app-shell.tab-planner .main,
  body.app-shell.tab-planner #mainContent {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 0 0 auto;
  }
  body.app-shell.tab-planner .station-search-wrap,
  body.app-shell.tab-planner .place-search-field,
  body.app-shell.tab-planner .station-search-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 700px) {
  body.app-shell .layout.mz-app-frame,
  body.app-shell.tab-planner .layout.mz-app-frame {
    padding: 0 12px calc(76px + env(safe-area-inset-bottom, 0px));
  }
  body.app-shell .mz-page-intro {
    padding: 4px 12px 14px;
  }
  body.app-shell .mz-page-intro .mz-rail-hero-title {
    font-size: 24px;
  }
}

@media (max-width: 430px) {
  body.app-shell.tab-planner .mz-topbar-name {
    display: inline;
    font-size: 15px;
    color: #fff;
  }
}

/* ── Contraste, charte, un seul bloc d’options, carte résultat ── */

body.app-shell .mz-topbar .mz-icon-btn,
body.app-shell.has-results .mz-topbar .mz-icon-btn {
  color: #1b1c1f;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.app-shell .mz-topbar .mz-icon-btn svg {
  stroke: #1b1c1f;
}

body.app-shell .mz-topbar-name,
body.app-shell .mz-page-intro .mz-rail-hello,
body.app-shell .mz-page-intro .mz-rail-hero-title,
body.app-shell .mz-page-intro .mz-rail-hero-lead {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

body.app-shell :focus-visible,
body.app-shell button:focus-visible,
body.app-shell a:focus-visible,
body.app-shell input:focus-visible,
body.app-shell select:focus-visible,
body.app-shell summary:focus-visible,
body.app-shell .mz-results-date-tab:focus-visible {
  outline: 2px solid #ff6b00;
  outline-offset: 2px;
}

body.app-shell.tab-planner .mz-trip-segment .trip-type-btn,
body.app-shell.tab-planner .mz-trip-segment .trip-type-btn.active,
body.app-shell.tab-planner .mz-trip-segment .trip-type-btn[aria-pressed="true"],
body.app-shell .product-btn.active,
body.app-shell .date-preset-btn.is-active,
body.app-shell .date-leg-btn.active,
body.app-shell .smc-day.picked {
  border: 0 !important;
  box-shadow: none;
}

body.app-shell .product-btn.active,
body.app-shell .smc-day.picked {
  background: #fff0e4 !important;
  color: #9e4100 !important;
}

body.app-shell .mz-product-badge {
  display: none;
}

body.app-shell .mz-rail-week-day.is-active,
body.app-shell .mz-results-day-chip.active {
  background: #fff0e4;
  border-color: #ffc599;
  color: #9e4100;
  box-shadow: none;
}

body.app-shell .mz-rail-week-day.is-active .mz-rail-week-pred,
body.app-shell .mz-rail-week-day.is-active .mz-rail-week-dot,
body.app-shell .mz-rail-week-day.is-active .mz-rail-week-price.is-empty,
body.app-shell .mz-rail-week-day.is-active .mz-rail-week-price.is-voir {
  color: #9e4100;
}

body.app-shell .mz-results-day-chip.active .mz-rdc-dow,
body.app-shell .mz-results-day-chip.active .mz-rdc-count {
  color: #9e4100;
}

body.app-shell .mz-filter-bar .mz-btn.active,
body.app-shell .mz-filter-sheet .mz-btn.active {
  background: #fff0e4;
  border-color: #ffc599;
  color: #9e4100;
}

body.app-shell .mz-rail-tl-dot,
body.app-shell .user-inbox-badge {
  background: #ff6b00;
  color: #1b1c1f;
}

body.app-shell .mz-result-detail summary,
body.app-shell .mz-rail-card .mz-result-detail summary {
  color: #9e4100;
}

body.mz-has-plan-cta .mz-topbar #accountPlanCta {
  order: 5;
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

body.mz-has-plan-cta .mz-topbar #accountChip {
  order: 6;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
}

body.mz-has-plan-cta .mz-topbar #accountChipLabel,
body.mz-has-plan-cta .mz-topbar #accountPlanBadge {
  display: none;
}

body.app-shell .mz-topbar {
  overflow: visible;
}

body.app-shell #toastContainer {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
  width: min(1344px, calc(100% - 24px));
  margin: 0 auto 8px;
  padding: 0 12px;
  z-index: 2;
  align-items: stretch;
  box-sizing: border-box;
}

body.app-shell #toastContainer .toast {
  width: 100%;
  max-width: none;
  border-radius: 12px;
  text-align: left;
  opacity: 1;
  transform: none;
  transition: none;
}

body.app-shell #toastContainer .toast.toast-info,
body.app-shell #toastContainer .toast.toast-info span {
  background: #1b1c1f;
  color: #fff;
}

body.app-shell #mzTripOptions #advancedSearch {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  max-width: none;
}

body.app-shell #mzTripOptions #advancedSearch > summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Carte résultat : une rangée horaire, puis une rangée d’actions. */
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 2px;
  align-items: start;
  width: 100%;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-card-top,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-times,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-stations,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-pills {
  display: contents;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-arrow {
  display: none;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-type {
  grid-column: 1 / 4;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  color: #596371;
  font-size: 13px;
  font-weight: 600;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-price {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  align-self: center;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-dep,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-arr,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-station,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-city {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-dep {
  grid-column: 1;
  grid-row: 2;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-dur {
  grid-column: 2;
  grid-row: 2 / span 2;
  justify-self: end;
  align-self: center;
  text-align: right;
  color: #596371;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-arr {
  grid-column: 4;
  grid-row: 2;
  justify-self: end;
  text-align: right;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-kind {
  grid-column: 3;
  grid-row: 2 / span 2;
  justify-self: start;
  align-self: center;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 0;
  color: #596371;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-station:first-child {
  grid-column: 1;
  grid-row: 3;
  text-align: left;
  color: #596371;
  font-size: 13px;
  font-weight: 500;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-station:first-child + .mz-result-city {
  grid-column: 1;
  grid-row: 4;
  text-align: left;
  color: #596371;
  font-size: 12px;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-station ~ .mz-result-station {
  grid-column: 4;
  grid-row: 3;
  justify-self: end;
  text-align: right;
  color: #596371;
  font-size: 13px;
  font-weight: 500;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-result-station ~ .mz-result-station + .mz-result-city {
  grid-column: 4;
  grid-row: 4;
  justify-self: end;
  text-align: right;
  color: #596371;
  font-size: 12px;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-places-slot {
  grid-area: auto;
  grid-column: 1 / -1;
  grid-row: 5;
  justify-self: start;
  align-self: start;
  align-items: flex-start;
  width: max-content;
  max-width: 46%;
  margin: 10px 0 0;
  z-index: 1;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-card-actions {
  grid-area: auto;
  grid-column: 1 / -1;
  grid-row: 5;
  justify-self: end;
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 96px);
  min-width: 0;
  margin: 10px 0 0;
}

body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-summary > :not(.mz-rail-card-top):not(.mz-rail-stations):not(.mz-result-pills):not(.j-places-slot):not(.mz-rail-card-actions),
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-night-tag,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-ongoing-tag,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-shortest-tag,
body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-pill:not(.mz-result-kind):not(.mz-result-type) {
  grid-column: 1 / -1;
  min-width: 0;
}

body.app-shell .mz-partial-card .mz-rail-times,
body.app-shell .mz-prediction-card .mz-rail-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 12px;
  width: 100%;
}

body.app-shell .mz-partial-card .mz-rail-arrow,
body.app-shell .mz-prediction-card .mz-rail-arrow {
  display: none;
}

body.app-shell .mz-partial-card .mz-rail-times .j-dep,
body.app-shell .mz-prediction-card .mz-rail-times .j-dep {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

body.app-shell .mz-partial-card .mz-rail-times .mz-rail-dur,
body.app-shell .mz-prediction-card .mz-rail-times .mz-rail-dur {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  text-align: center;
}

body.app-shell .mz-partial-card .mz-rail-times .mz-rail-dur {
  grid-row: 1 / span 2;
  align-self: center;
}

body.app-shell .mz-partial-card .mz-rail-times .mz-result-station {
  grid-row: 2;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #596371;
  font-size: 13px;
  line-height: 1.3;
}

body.app-shell .mz-partial-card .mz-rail-times .mz-result-station:first-of-type {
  grid-column: 1;
  justify-self: start;
  text-align: left;
}

body.app-shell .mz-partial-card .mz-rail-times .mz-result-station:last-of-type {
  grid-column: 3;
  justify-self: end;
  text-align: right;
}

body.app-shell .mz-partial-card .mz-rail-times .j-arr,
body.app-shell .mz-prediction-card .mz-rail-times .j-arr {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  text-align: right;
}

body.app-shell .mz-rail-card-actions .mz-rail-open,
body.app-shell .mz-rail-card-actions .mz-btn {
  letter-spacing: normal;
  word-spacing: normal;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-ligatures: none;
  font-kerning: none;
}

body.app-shell .mz-local-note {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 10px;
  background: #fff;
  color: #202631;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

body.app-shell .mz-support-banner {
  position: relative;
  z-index: 2;
  display: block;
  width: min(1344px, calc(100% - 32px));
  margin: 8px auto 12px;
  padding: 12px 14px;
  box-sizing: border-box;
  background: #fff;
  color: #202631;
  border: 1px solid #e2e6eb;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(32, 38, 49, 0.06);
}
body.app-shell .mz-support-banner[hidden] { display: none; }
body.app-shell .mz-support-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
body.app-shell .mz-support-banner-inner p {
  display: block;
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
  color: #202631;
  font-size: 14px;
  line-height: 1.4;
}
body.app-shell .mz-support-banner .mz-btn-primary {
  flex: 0 0 auto;
  min-height: 44px;
  background: #ff6b00;
  color: #1b1c1f;
}
@media (max-width: 700px) {
  body.app-shell .mz-support-banner {
    width: calc(100% - 24px);
    margin: 8px auto 12px;
  }
  body.app-shell .mz-support-banner-inner { align-items: stretch; }
  body.app-shell .mz-support-banner-inner p {
    display: block;
    flex: 1 1 100%;
  }
  body.app-shell .mz-support-banner .mz-btn-primary { align-self: flex-start; }
}

body.app-shell .mz-consent-prompt {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: #fff;
  color: #202631;
  border: 1px solid #e2e6eb;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(32, 38, 49, 0.06);
}

body.app-shell .mz-consent-prompt h2 {
  margin: 0 0 6px;
  color: #202631;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

body.app-shell .mz-consent-prompt p {
  margin: 0 0 8px;
  color: #596371;
  font-size: 13px;
}

body.app-shell .mz-consent-checks {
  color: #202631;
  font-size: 13px;
}

body.app-shell .mz-consent-prompt-primary {
  background: #ff6b00;
  color: #1b1c1f;
}

/* Guide première recherche : hors de la grille du formulaire.
   Masqué dès qu’un résultat est affiché. Sinon, ligne compacte. */
body.app-shell.has-results .mz-first-run {
  display: none;
}

body.app-shell .mz-first-run {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #fff;
  color: #202631;
  border: 1px solid #e2e6eb;
  border-radius: 12px;
  box-shadow: none;
}

body.app-shell .mz-first-run p {
  display: none;
}

body.app-shell .mz-first-run h2 {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
  color: #202631;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  white-space: normal;
}

body.app-shell .mz-first-run-actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
  min-width: 0;
  max-width: 100%;
}

body.app-shell .mz-first-run-actions button {
  flex: 0 1 auto;
  min-height: 44px;
  padding: 6px 12px;
  white-space: normal;
}

body.app-shell.has-results .mz-first-run,
body.app-shell:has(.journey-card, .mz-result-card, .mz-results-stack) .mz-first-run {
  display: none;
}

body.app-shell .mz-first-run-primary {
  background: #ff6b00;
  color: #1b1c1f;
}

body.app-shell .mz-first-run-ghost {
  background: #fff;
  color: #202631;
  border-color: #e2e6eb;
}

body.app-shell #mainContent:has(> #mzFirstRun) > .welcome,
body.app-shell #mainContent:has(> #mzFirstRun) > #mzLoggedEmpty {
  display: none;
}

@media (max-width: 700px) {
  body.app-shell > .mz-first-run {
    position: relative;
    z-index: 2;
    width: min(1344px, calc(100% - 24px));
    margin: 0 auto 8px;
    padding: 6px 10px;
    box-sizing: border-box;
    background: #fff;
  }
}

@media (max-width: 700px) {
  body.app-shell .mz-consent-prompt {
    margin: 0 0 8px;
    padding: 8px 10px;
  }
  body.app-shell .mz-consent-prompt p {
    display: none;
  }
  body.app-shell .mz-consent-prompt h2 {
    font-size: 14px;
  }
  body.app-shell .mz-consent-checks {
    gap: 6px;
  }
  body.app-shell .mz-consent-checks label {
    font-size: 13px;
    line-height: 1.35;
  }
}

body.app-shell .mz-prediction-card .mz-rail-stations {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

body.app-shell .mz-prediction-card .mz-result-station {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}

body.app-shell .mz-prediction-card .mz-result-station:last-of-type {
  text-align: right;
}

body.app-shell .mz-partial-card .mz-rail-card-actions,
body.app-shell .mz-prediction-card .mz-prediction-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

@media (max-width: 700px) {
  body.app-shell .mz-topbar {
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 8px;
  }
  body.app-shell .mz-topbar-brand {
    min-width: 0;
    flex: 1 1 auto;
  }
  body.app-shell .mz-topbar-name,
  body.app-shell.tab-planner .mz-topbar-name {
    display: inline;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.app-shell .mz-topbar-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
    gap: 6px;
  }
  body.app-shell .mz-topbar #accountPlanCta,
  body.app-shell .mz-topbar #mzUserInboxBtn,
  body.app-shell .mz-topbar #mzNotifBtn {
    display: none;
  }
  body.app-shell .mz-topbar .mz-icon-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
  body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .j-places-slot {
    grid-column: 1 / -1;
    grid-row: 5;
    margin-left: 0;
    justify-self: start;
  }
  body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-card-actions {
    grid-column: 1 / -1;
    grid-row: 6;
    justify-self: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: none;
  }
  body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-card-actions .mz-btn,
  body.app-shell .mz-partial-card .mz-rail-card-actions .mz-btn,
  body.app-shell .mz-prediction-card .mz-prediction-actions .mz-btn,
  body.app-shell .mz-prediction-card .mz-prediction-actions a {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    justify-content: center;
    text-align: center;
  }
  body.app-shell .journey-card.mz-rail-card:not(.mz-partial-card):not(.mz-prediction-card) .mz-rail-card-actions .mz-rail-alert {
    width: 44px;
    justify-self: end;
  }
  body.app-shell .mz-partial-card .mz-rail-card-actions,
  body.app-shell .mz-prediction-card .mz-prediction-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Une seule surcouche : question MAX et bandeau d’essai cèdent la place au calendrier. */
body.app-shell.mz-agenda-open .mz-max-card,
body.app-shell.mz-agenda-open #toastContainer {
  display: none !important;
}

body.app-shell .mz-agenda-close,
body.app-shell .date-plan-limit {
  color: #202631;
}

@media (max-width: 1023px) {
  body.app-shell.mz-agenda-open {
    overflow-x: hidden;
  }
  body.app-shell #sidebarMiniCalWrap.mz-agenda-sheet:not(.is-collapsed) {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.app-shell #sidebarMiniCalWrap .sidebar-mini-cal,
  body.app-shell #sidebarMiniCalWrap .smc-grid,
  body.app-shell #sidebarMiniCalWrap .smc-weekdays,
  body.app-shell #sidebarMiniCalWrap .smc-grid > [role="row"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.app-shell #sidebarMiniCalWrap .smc-grid > [role="row"],
  body.app-shell #sidebarMiniCalWrap .smc-weekdays {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  body.app-shell #sidebarMiniCalWrap .smc-day,
  body.app-shell #sidebarMiniCalWrap .smc-wd {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
  }
  body.app-shell #sidebarMiniCalWrap .smc-day {
    min-height: 44px;
  }
}

/* Reflow et cibles tactiles. La charte ne change pas : encre, sable, orange. */
@media (max-width: 820px) {
  body.app-shell .layout.mz-app-frame,
  body.app-shell #sidebar,
  body.app-shell main.main,
  body.app-shell #mainContent,
  body.app-shell .mz-search-card,
  body.app-shell .sidebar-scroll,
  body.app-shell .sidebar-block {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  body.app-shell .mz-topbar .mz-icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }
  body.app-shell .mz-topbar .account-chip {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    padding: 0;
    border-radius: 999px;
    justify-content: center;
  }
  body.app-shell #mzHourChips .mz-hour-chip,
  body.app-shell #mzHourChips .mz-hour-all,
  body.app-shell .mz-depth-btn,
  body.app-shell .mz-btn,
  body.app-shell .mz-filter-sheet-toggle,
  body.app-shell .acct-link-btn,
  body.app-shell .acct-logout,
  body.app-shell .acct-delete-btn,
  body.app-shell .mz-plan-cta,
  body.app-shell .mz-solution-add,
  body.app-shell .via-add-btn,
  body.app-shell .auth-pwd-toggle,
  body.app-shell .mz-ios-switch,
  body.app-shell .traveler-btn,
  body.app-shell button:not(.smc-day) {
    min-height: 44px;
  }
  body.app-shell .mz-ios-switch,
  body.app-shell .auth-pwd-toggle,
  body.app-shell .traveler-btn,
  body.app-shell .mz-icon-btn,
  body.app-shell .mz-bottom-nav-btn {
    min-width: 44px;
  }
  body.app-shell .acct-link-btn {
    display: inline-flex;
    align-items: center;
  }
  body.app-shell .time-row,
  body.app-shell .search-meta-row,
  body.app-shell .mz-solution-field,
  body.app-shell .mz-slot,
  body.app-shell #datePresets,
  body.app-shell #datePickBtn,
  body.app-shell input,
  body.app-shell select,
  body.app-shell textarea {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.app-shell .time-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    width: 100%;
  }
  body.app-shell .search-meta-row {
    flex-wrap: wrap;
  }
  body.app-shell .search-meta-row .traveler-row {
    flex: 1 1 100%;
    min-width: 0;
  }
  body.app-shell.tab-account #mainContent,
  body.app-shell.tab-account #mainContent * {
    overflow-wrap: anywhere;
  }
  body.app-shell .layout.mz-app-frame,
  body.app-shell.tab-account #mainContent,
  body.app-shell.tab-alerts #mainContent,
  body.app-shell.tab-trips #mainContent,
  body.app-shell.tab-planner #mainContent {
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }
  body.app-shell {
    scroll-padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }
  #authModal.modal-overlay,
  #alertModal.modal-overlay,
  #paywallModal.modal-overlay {
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100vw;
    padding: 12px 12px calc(28px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }
  #authModal .modal,
  #alertModal .modal,
  #paywallModal .paywall-modal,
  #paywallModal .modal {
    width: min(560px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    min-width: 0;
    box-sizing: border-box;
  }
  #paywallModal .pw-compare-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  body.app-shell.mz-agenda-open .mz-bottom-nav {
    display: none !important;
  }
  body.app-shell {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  }
  body.app-shell .mz-results-kind-meta .mz-btn,
  body.app-shell.has-results .mz-results-kind-meta .mz-filter-sheet-toggle,
  body.app-shell .mz-solution-field input,
  body.app-shell .mz-solution-field select,
  body.app-shell .time-row input,
  body.app-shell #minStayInput,
  body.app-shell .via-add-btn,
  body.app-shell .mz-solution-add,
  body.app-shell #daySearchBtn {
    min-height: 44px;
    max-width: 100%;
  }
  body.app-shell .via-add-btn,
  body.app-shell .mz-solution-add,
  body.app-shell .traveler-btn {
    min-width: 44px;
  }
  body.app-shell label:has(> input[type="checkbox"]),
  body.app-shell label:has(> input[type="radio"]) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  body.app-shell .traveler-row,
  body.app-shell .traveler-stepper {
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
  }
  body.app-shell #daySearchBtn {
    white-space: normal;
    height: auto;
  }
}

@media (max-width: 700px) {
  body.app-shell .mz-rail-card .j-leg {
    grid-template-columns: auto minmax(0, 1fr);
  }
  body.app-shell .mz-rail-card .j-leg-num {
    overflow: visible;
    white-space: nowrap;
    min-width: max-content;
  }
  body.app-shell .mz-rail-card .j-leg-places,
  body.app-shell .mz-rail-card .j-leg-seg {
    white-space: normal;
    min-width: 0;
  }
}

/* Le formulaire reste dans la colonne, même quand la barre compacte desktop veut s’étendre. */
@media (min-width: 1024px) {
  body.app-shell.tab-planner .layout.mz-app-frame > #sidebar {
    min-width: 0;
    max-width: 100%;
  }
  body.app-shell.tab-planner.has-results #mzOdBar.mz-od-bar {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body.app-shell.tab-planner.has-results #mzOdBar > .sidebar-dock,
  body.app-shell.tab-planner.has-results #mzOdBar > #daySearchSection,
  body.app-shell.tab-planner.has-results #mzOdBar .day-search-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    height: auto !important;
    max-height: none !important;
    white-space: normal !important;
  }
}

body.app-shell .traveler-profiles-add button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  background: #ff6b00;
  color: #1b1c1f;
}

body.app-shell #alertModal .mz-alert-swap {
  min-height: 44px;
  height: auto;
}

@media (max-width: 820px) {
  body.app-shell .modal-input,
  body.app-shell select.modal-input,
  body.app-shell textarea,
  #alertModal .station-search-input,
  #authModal .modal-input,
  .mz-onb-input {
    min-height: 44px;
  }
  body.app-shell input.modal-input,
  body.app-shell select.modal-input,
  #alertModal .station-search-input,
  #authModal input.modal-input,
  .mz-onb-input {
    height: 44px;
  }
}

@media (max-height: 520px) {
  body.mz-onb-open .mz-onb {
    justify-content: flex-start;
    overflow-y: auto;
  }
  body.mz-onb-open .mz-onb-panel {
    max-height: none;
  }
  #authModal.modal-overlay {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 12px 12px 28px;
  }
  #authModal .modal,
  #authModal .auth-modal {
    margin-top: 0;
    max-height: none;
  }
}

/* Sous 308 px, sept cibles de 44 px ne tiennent pas. La grille rétrécit
   (minmax(0, 1fr)) au lieu d’imposer 308 px : une police plus large
   ne peut plus élargir la page. */
@media (max-width: 308px) {
  body.app-shell #sidebarMiniCalWrap .sidebar-mini-cal,
  body.app-shell #sidebarMiniCalWrap .smc-grid,
  body.app-shell #sidebarMiniCalWrap .smc-weekdays,
  body.app-shell #sidebarMiniCalWrap .smc-grid > [role="row"] {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.app-shell #sidebarMiniCalWrap .smc-weekdays,
  body.app-shell #sidebarMiniCalWrap .smc-grid > [role="row"] {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  body.app-shell #sidebarMiniCalWrap .smc-wd,
  body.app-shell #sidebarMiniCalWrap .smc-day {
    min-width: 0;
    max-width: 100%;
    width: auto;
    overflow: hidden;
  }
  body.app-shell #sidebarMiniCalWrap .smc-wd {
    font-size: 8px;
    letter-spacing: 0;
    line-height: 1.1;
  }
}

@media (max-width: 220px) {
  body.app-shell .mz-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0;
  }
  body.app-shell .mz-bottom-nav-btn {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    height: auto;
    white-space: normal;
    padding: 8px 2px;
  }
  body.app-shell .layout.mz-app-frame,
  body.app-shell #sidebar,
  body.app-shell .sidebar-scroll,
  body.app-shell #mzOdBar,
  body.app-shell .mz-slot,
  body.app-shell .mz-date-primary,
  body.app-shell .mz-when-primary,
  body.app-shell #daySearchSection,
  body.app-shell .mz-slot-date {
    min-width: 0;
    max-width: 100%;
  }
  body.app-shell .mz-slot-value,
  body.app-shell #mzDateSlotValue {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 430px) {
  body.app-shell #sidebarMiniCalWrap.mz-agenda-sheet {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
  body.app-shell #sidebarMiniCalWrap .smc-grid > [role="row"],
  body.app-shell #sidebarMiniCalWrap .smc-weekdays {
    gap: 0;
  }
  body.app-shell .time-row {
    grid-template-columns: minmax(0, 1fr);
  }
  body.app-shell .time-sep {
    display: none;
  }
}

/* Liens et « Modifier » : orange de la charte, soulignés. Pas de bleu navigateur. */
:root:not(.dark) body.app-shell a,
:root:not(.dark) #authModal .acct-check-text a,
:root:not(.dark) .mz-onb-check a,
:root:not(.dark) .mz-search-summary-edit {
  color: #9e4100;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
:root:not(.dark) body.app-shell .mz-topbar a,
:root:not(.dark) body.app-shell a.mz-topbar-brand {
  color: #fff;
  text-decoration: none;
}
:root:not(.dark) body.app-shell a.mz-btn,
:root:not(.dark) body.app-shell a.mz-btn-primary,
:root:not(.dark) body.app-shell a.mz-plan-cta,
:root:not(.dark) body.app-shell a.day-search-btn {
  color: #1b1c1f;
  text-decoration: none;
}
:root:not(.dark) .j-tier-alternatif,
:root:not(.dark) .ro-badge.tc {
  background: #fff0e4;
  color: #9e4100;
  border-color: #ff6b00;
}
:root:not(.dark) #authModal .modal-optional {
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 1;
  color: #596371;
}

/* 6 à 8 px entre un champ et son texte d’aide (le -6 px historique collait le texte). */
body.app-shell .modal-hint,
#authModal .modal-hint,
#alertModal .modal-hint,
.mz-onb-form .mz-onb-hint {
  margin-top: 8px;
  margin-bottom: 4px;
}

/* Feuille d’inscription opaque : le texte de la page ne traverse pas. */
#authModal.modal-overlay,
#authModal.auth-modal-overlay:not(.hidden) {
  background-color: #1b1c1f;
  background-image: none;
}
#authModal .auth-modal,
#authModal .modal.auth-modal {
  background-color: #ffffff;
  background-image: none;
  opacity: 1;
}
.mz-onb {
  background-color: #1b1c1f;
}
.mz-onb-panel {
  background-color: #ffffff;
  background-image: none;
  opacity: 1;
}
@media (max-width: 1023px) {
  body.app-shell.mz-agenda-open .mz-bottom-nav {
    display: none !important;
  }
  body.app-shell .mz-max-card {
    bottom: calc(var(--mz-bottom-nav-h, 68px) + 16px + env(safe-area-inset-bottom, 0px));
  }
}

:root:not(.dark) body.app-shell .mz-prediction-when-chip {
  border-color: #6741a5;
  background: #f4effc;
}
:root:not(.dark) body.app-shell .mz-prediction-when-chip .mz-prediction-blur,
:root:not(.dark) body.app-shell .mz-prediction-mark,
:root:not(.dark) body.app-shell .mz-prediction-publish-clock {
  color: #6741a5;
}
:root:not(.dark) body.app-shell .mz-kind-tab.is-pred.is-on {
  background: #6741a5;
  color: #fff;
}

@media (max-width: 900px) {
  body.mz-onb-open { overflow: hidden; }
  body.mz-onb-open .mz-onb {
    position: fixed;
    inset: 0;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  body.mz-onb-open .mz-onb-panel {
    flex: 1 0 auto;
    max-height: none;
    overflow: visible;
  }
  .mz-onb-check {
    position: relative;
    align-items: flex-start;
    min-height: 44px;
    padding-top: 11px;
    padding-bottom: 11px;
    margin-top: 0;
    margin-bottom: 0;
  }
  .mz-onb-check input {
    width: 22px;
    height: 22px;
    margin: 0;
    flex: 0 0 22px;
  }
  .mz-onb-check a {
    display: inline;
    min-width: 0;
    min-height: 0;
    padding: 12px 0;
    line-height: inherit;
    vertical-align: baseline;
  }
}

@media (max-width: 820px) {
  #authModal.modal-overlay {
    padding: 0;
    background-color: #ffffff;
    align-items: stretch;
  }
  #authModal .auth-modal,
  #authModal .modal.auth-modal {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    height: auto;
    max-height: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
