/*
 * La Bétaillère — Design system v3
 * Couche visuelle finale et réversible chargée après les styles historiques.
 */

:root {
  color-scheme: dark;
  --lb-font-display: "Orbitron", "Segoe UI", sans-serif;
  --lb-font-body: "Rajdhani", "Segoe UI", system-ui, sans-serif;

  --lb-bg: #030b13;
  --lb-bg-elevated: #071725;
  --lb-surface: rgba(6, 24, 37, 0.9);
  --lb-surface-strong: rgba(7, 30, 46, 0.97);
  --lb-surface-soft: rgba(11, 42, 59, 0.62);
  --lb-line: rgba(76, 226, 241, 0.2);
  --lb-line-strong: rgba(75, 234, 246, 0.52);
  --lb-cyan: #31e7f2;
  --lb-cyan-strong: #00cfe4;
  --lb-blue: #1687d9;
  --lb-text: #effcff;
  --lb-text-soft: #bdd8df;
  --lb-muted: #7d9da8;
  --lb-green: #33d884;
  --lb-yellow: #ffd447;
  --lb-orange: #ff943d;
  --lb-orange-deep: #e8661c;
  --lb-red: #ff4e5c;

  --lb-radius-xs: 8px;
  --lb-radius-sm: 12px;
  --lb-radius-md: 17px;
  --lb-radius-lg: 24px;
  --lb-shadow-card: 0 18px 45px rgba(0, 0, 0, 0.28);
  --lb-shadow-focus: 0 0 0 3px rgba(49, 231, 242, 0.2);
  --lb-page-width: 1380px;
  --lb-reading-width: 980px;
  --lb-touch: 44px;

  --top-bar-height: 72px;
  --bottom-bar-height: 72px;
  --lb-topbar-h: var(--top-bar-height);
  --lb-bottomnav-h: var(--bottom-bar-height);
}

html {
  min-height: 100%;
  background: var(--lb-bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body.lb-v3 {
  width: 100%;
  max-width: none !important;
  min-height: 100%;
  margin: 0 !important;
  padding:
    calc(var(--top-bar-height) + env(safe-area-inset-top, 0px) + 22px)
    max(16px, env(safe-area-inset-right, 0px))
    calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px) + 26px)
    max(16px, env(safe-area-inset-left, 0px)) !important;
  overflow-x: clip;
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 205, 229, 0.12), transparent 36rem),
    linear-gradient(180deg, #06131f 0, var(--lb-bg) 38rem);
  color: var(--lb-text);
  font-family: var(--lb-font-body);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.lb-v3.monde-betaillere {
  --lb-bg: #0f0905;
  --lb-bg-elevated: #211207;
  --lb-surface: rgba(35, 19, 8, 0.92);
  --lb-surface-strong: rgba(48, 25, 9, 0.97);
  --lb-surface-soft: rgba(69, 36, 13, 0.66);
  --lb-line: rgba(255, 174, 72, 0.23);
  --lb-line-strong: rgba(255, 187, 82, 0.58);
  --lb-cyan: #ffb84c;
  --lb-cyan-strong: #e78622;
  --lb-blue: #b65120;
  --lb-text: #fff7e7;
  --lb-text-soft: #e7c9a2;
  --lb-muted: #ad8968;
}

body.lb-v3::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(49, 231, 242, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 231, 242, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

body.lb-v3 *,
body.lb-v3 *::before,
body.lb-v3 *::after {
  box-sizing: border-box;
}

body.lb-v3 [hidden] {
  display: none !important;
}

body.lb-v3 h1,
body.lb-v3 h2,
body.lb-v3 h3,
body.lb-v3 h4,
body.lb-v3 .fav-title,
body.lb-v3 .console-header {
  font-family: var(--lb-font-display);
  text-wrap: balance;
}

body.lb-v3 p {
  text-wrap: pretty;
}

body.lb-v3 img,
body.lb-v3 svg,
body.lb-v3 canvas,
body.lb-v3 video {
  max-width: 100%;
}

body.lb-v3 :where(button, input, select, textarea) {
  font: inherit;
}

body.lb-v3 :where(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--lb-cyan) !important;
  outline-offset: 3px;
  box-shadow: var(--lb-shadow-focus);
}

body.lb-v3 :where(button, [role="button"], summary) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.lb-v3 .lb-skip-link {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 100000;
  transform: translateY(-150%);
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--lb-cyan);
  color: #001018;
  font-weight: 800;
  text-decoration: none;
}

body.lb-v3 .lb-skip-link:focus {
  transform: translateY(0);
}

/* App shell */
body.lb-v3 .top-bar {
  top: 0 !important;
  height: calc(var(--top-bar-height) + env(safe-area-inset-top, 0px)) !important;
  padding-top: env(safe-area-inset-top, 0px);
  border: 0 !important;
  border-bottom: 1px solid var(--lb-line-strong) !important;
  background:
    linear-gradient(180deg, rgba(8, 32, 48, 0.98), rgba(3, 14, 24, 0.94)) !important;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.32), 0 1px 20px rgba(22, 219, 235, 0.15) !important;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

body.lb-v3 .top-bar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--lb-cyan), transparent);
  opacity: 0.72;
}

body.lb-v3 .top-bar__inner {
  width: min(100%, var(--lb-page-width));
  max-width: var(--lb-page-width) !important;
  padding-inline: clamp(14px, 3vw, 28px) !important;
  gap: 14px;
}

body.lb-v3 .top-bar__brand {
  min-width: 0;
  flex: 1 1 auto;
}

body.lb-v3 .top-bar__brand-logos {
  gap: 11px;
}

body.lb-v3 .top-bar__logo-icon {
  height: 42px !important;
}

body.lb-v3 .top-bar__logo-text {
  height: 26px !important;
  max-width: min(38vw, 270px);
}

body.lb-v3 .top-bar__actions {
  gap: 10px;
}

body.lb-v3 .top-bar__socials {
  display: flex !important;
  gap: 9px !important;
}

body.lb-v3 .top-bar__social-link {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--lb-text-soft);
}

body.lb-v3 .top-bar__social-link:hover,
body.lb-v3 .top-bar__social-link:focus-visible {
  background: rgba(49, 231, 242, 0.09);
  color: var(--lb-text);
}

body.lb-v3 .top-bar__support {
  min-height: 38px;
  padding: 7px 12px !important;
  border: 1px solid rgba(255, 212, 71, 0.68) !important;
  background: linear-gradient(135deg, #ffe37b, #f5ae38) !important;
  box-shadow: 0 8px 24px rgba(255, 174, 47, 0.2) !important;
}

body.lb-v3 .lb-header-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--lb-line);
  border-radius: 999px;
  color: var(--lb-text-soft);
  font-family: var(--lb-font-body);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

body.lb-v3 .lb-header-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lb-green);
  box-shadow: 0 0 10px currentColor;
}

body.lb-v3 .lb-header-status.is-offline {
  color: #ffd2d5;
  border-color: rgba(255, 78, 92, 0.36);
}

body.lb-v3 .lb-header-status.is-offline::before {
  background: var(--lb-red);
}

body.lb-v3 .lb-header-account {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--lb-line-strong);
  border-radius: 50%;
  background: rgba(8, 37, 52, 0.9);
  color: var(--lb-text);
  cursor: pointer;
}

body.lb-v3 .lb-header-account img {
  width: 24px;
  height: 24px;
}

body.lb-v3 .bottom-nav {
  inset: auto 0 0 !important;
  height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px)) !important;
  min-height: 0 !important;
  padding:
    7px max(12px, env(safe-area-inset-right, 0px))
    max(7px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px)) !important;
  border: 0 !important;
  border-top: 1px solid var(--lb-line-strong) !important;
  background: rgba(3, 15, 25, 0.93) !important;
  box-shadow: 0 -16px 38px rgba(0, 0, 0, 0.3), 0 -1px 18px rgba(22, 219, 235, 0.12) !important;
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
}

body.lb-v3 .bottom-nav__items {
  width: min(100%, 920px) !important;
  height: 100%;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(7, minmax(64px, 1fr)) !important;
  align-items: stretch;
  gap: 5px !important;
}

body.lb-v3 .bottom-nav__item {
  position: relative;
  min-width: 0;
  min-height: 52px !important;
  padding: 5px 8px 4px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px !important;
  border: 1px solid transparent !important;
  border-radius: 15px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lb-muted) !important;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease !important;
}

body.lb-v3 .bottom-nav__item::before {
  content: none !important;
}

body.lb-v3 .bottom-nav__item:hover {
  color: var(--lb-text-soft) !important;
  background: rgba(49, 231, 242, 0.055) !important;
}

body.lb-v3 .bottom-nav__item:active,
body.lb-v3 .bottom-nav__item.is-pressed {
  transform: scale(0.96) !important;
}

body.lb-v3 .bottom-nav__item.active,
body.lb-v3 .bottom-nav__item.is-active,
body.lb-v3 .bottom-nav__item[aria-current="page"] {
  border-color: rgba(49, 231, 242, 0.38) !important;
  background: linear-gradient(180deg, rgba(29, 182, 209, 0.22), rgba(14, 111, 153, 0.16)) !important;
  color: var(--lb-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 20px rgba(0, 211, 229, 0.12) !important;
}

body.lb-v3 .bottom-nav__icon,
body.lb-v3 .bottom-nav__icon-img {
  width: 27px !important;
  height: 27px !important;
  max-width: 27px !important;
  max-height: 27px !important;
  filter: saturate(0.45) brightness(0.82) !important;
  opacity: 0.82;
  transition: filter 150ms ease, opacity 150ms ease, transform 150ms ease !important;
}

body.lb-v3 .bottom-nav__item.active .bottom-nav__icon,
body.lb-v3 .bottom-nav__item.active .bottom-nav__icon-img,
body.lb-v3 .bottom-nav__item[aria-current="page"] .bottom-nav__icon,
body.lb-v3 .bottom-nav__item[aria-current="page"] .bottom-nav__icon-img {
  filter: none !important;
  opacity: 1;
  transform: none !important;
}

body.lb-v3 .bottom-nav__label {
  max-width: 100%;
  overflow: hidden;
  color: inherit !important;
  font-family: var(--lb-font-body);
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0.015em !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none !important;
}

body.lb-v3 #lbMoreNavButton {
  display: none !important;
}

/* Pages and hierarchy */
body.lb-v3 .app-page {
  width: min(100%, var(--lb-page-width));
  margin-inline: auto !important;
  scroll-margin-top: calc(var(--top-bar-height) + 16px);
}

body.lb-v3 .app-page.is-page-active {
  animation: lbPageIn 190ms ease-out both;
}

@keyframes lbPageIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

body.lb-v3 .lb-page-intro {
  width: 100%;
  margin: 0 auto 14px;
  padding: 16px clamp(16px, 2.5vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--lb-line);
  border-radius: var(--lb-radius-md);
  background:
    linear-gradient(110deg, rgba(16, 78, 98, 0.28), rgba(6, 23, 36, 0.86) 58%),
    var(--lb-surface);
  box-shadow: var(--lb-shadow-card);
}

body.lb-v3 .lb-page-intro__copy {
  min-width: 0;
}

body.lb-v3 .lb-page-intro__eyebrow {
  margin: 0 0 4px;
  color: var(--lb-cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.lb-v3 .lb-page-intro h1 {
  margin: 0;
  color: var(--lb-text);
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  line-height: 1.18;
  /*
   * Les styles historiques appliquaient à tous les h1 deux animations
   * infinies (halo pulsé + reflet traversant). Le titre reste volontairement
   * statique : même identité visuelle, sans travail graphique permanent.
   */
  animation: none !important;
  text-shadow: none !important;
}

body.lb-v3 .lb-page-intro h1::before,
body.lb-v3 .lb-page-intro h1::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}

body.lb-v3 .lb-page-intro p {
  margin: 5px 0 0;
  color: var(--lb-text-soft);
  font-size: 0.92rem;
}

body.lb-v3 .lb-page-intro__actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

body.lb-v3 .lb-context-link {
  min-height: 40px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--lb-line);
  border-radius: 12px;
  background: rgba(49, 231, 242, 0.06);
  color: var(--lb-text-soft);
  font-weight: 700;
  text-decoration: none;
}

body.lb-v3 .lb-context-link:hover {
  border-color: var(--lb-line-strong);
  color: var(--lb-text);
}

/* Shared components */
body.lb-v3 :where(
  .home-card,
  .fav-card,
  .stats-v2__card,
  .search-card,
  .console-section,
  .media-section,
  .train-detail-card,
  .lb-profile-card,
  .lb-prefs-card
) {
  border-color: var(--lb-line) !important;
  border-radius: var(--lb-radius-md) !important;
  background:
    linear-gradient(145deg, rgba(11, 43, 59, 0.34), rgba(5, 19, 31, 0.82)),
    var(--lb-surface) !important;
  box-shadow: var(--lb-shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

body.lb-v3 :where(
  .home-card,
  .fav-card,
  .stats-v2__card,
  .search-card,
  .train-detail-card
) {
  overflow: clip;
}

body.lb-v3 :where(.home-card, .stats-v2__card, .fav-card, .search-card)::before {
  opacity: 0.55 !important;
}

body.lb-v3 :where(
  button:not(.bottom-nav__item):not(.tron-close-button):not(.lb-auth-close):not(.selection-modal__close),
  .btn,
  .home-action,
  .mini-btn,
  .train-detail-btn
) {
  min-height: var(--lb-touch);
  border-radius: 12px;
}

body.lb-v3 :where(
  button[aria-pressed="true"],
  button[aria-selected="true"],
  button.is-active,
  .stats-v2__entry-chip.is-active,
  .stats-v2__entry-subchoice.is-active
) {
  border-color: rgba(75, 234, 246, 0.72) !important;
  background: linear-gradient(135deg, rgba(12, 158, 195, 0.92), rgba(18, 102, 176, 0.92)) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(0, 166, 204, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.17) !important;
}

body.lb-v3 :where(input, select, textarea) {
  min-height: var(--lb-touch);
  border: 1px solid var(--lb-line-strong) !important;
  border-radius: 12px !important;
  background: rgba(2, 13, 22, 0.82) !important;
  color: var(--lb-text) !important;
  accent-color: var(--lb-cyan-strong);
}

body.lb-v3 :where(input, select, textarea)::placeholder {
  color: #78939d;
  opacity: 1;
}

body.lb-v3 :where(input, select, textarea):focus {
  border-color: var(--lb-cyan) !important;
}

body.lb-v3 details > summary {
  min-height: var(--lb-touch);
}

body.lb-v3 .loading,
body.lb-v3 [aria-busy="true"] {
  cursor: progress;
}

/* Home dashboard */
body.lb-v3 #home {
  max-width: var(--lb-page-width) !important;
}

body.lb-v3 .home-dashboard {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch;
}

body.lb-v3 .home-welcome-line {
  grid-column: 1 / -1;
  margin: 0 0 2px !important;
  padding: 0 2px !important;
  color: var(--lb-text-soft) !important;
  font-family: var(--lb-font-body) !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-align: left !important;
  text-transform: none !important;
}

body.lb-v3 .home-card {
  min-width: 0;
  margin: 0 !important;
  padding: clamp(14px, 1.8vw, 20px) !important;
}

body.lb-v3.page-home:not(.monde-betaillere) #home .home-dashboard > .home-card > h2,
body.lb-v3.page-home:not(.monde-betaillere) #home .home-dashboard > .home-card .live-wall-title {
  margin: 0 0 10px !important;
  min-height: 1.2em !important;
  color: var(--lb-cyan) !important;
  font-family: var(--lb-font-display) !important;
  font-size: clamp(1.05rem, 1.35vw, 1.28rem) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em !important;
  text-align: center !important;
  text-shadow: 0 0 12px rgba(49, 231, 242, 0.2) !important;
}

body.lb-v3.page-home:not(.monde-betaillere) #home .home-dashboard > .home-punct-card #homePunctCardTitle {
  margin: 0 0 10px !important;
  min-height: 1.2em !important;
  font-size: clamp(1.05rem, 1.35vw, 1.28rem) !important;
  line-height: 1.2 !important;
}

body.lb-v3 .home-traffic-premium {
  grid-column: span 4;
}

body.lb-v3 .live-wall-card--home {
  grid-column: span 8;
}

body.lb-v3 .home-quick-card,
body.lb-v3 .home-punct-card,
body.lb-v3 .home-card:last-of-type {
  grid-column: span 4;
}

body.lb-v3 .traffic-split-row {
  min-height: 46px !important;
  padding: 8px 0 !important;
}

body.lb-v3 .traffic-pill {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  font-family: var(--lb-font-body);
  font-weight: 800;
}

body.lb-v3 .lb-community-actions {
  gap: 9px !important;
}

body.lb-v3 .lb-community-btn {
  min-height: 40px !important;
  font-family: var(--lb-font-body) !important;
  font-size: 0.88rem !important;
}

body.lb-v3 .home-quick-presets__btn {
  min-height: 50px !important;
  font-size: 0.94rem !important;
}

/* Search journey */
body.lb-v3 #search.command-console {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.lb-v3 #search > .console-header {
  display: none !important;
}

body.lb-v3 #search > details.console-section {
  margin: 0 !important;
  padding: 0 !important;
}

body.lb-v3 #search > details.console-section > .section-summary {
  display: none !important;
}

body.lb-v3 #search .section-content {
  padding: clamp(14px, 2.5vw, 24px) !important;
}

body.lb-v3 .tableau-mode-switch {
  margin-bottom: 16px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.lb-v3 .tableau-mode-switch__label {
  display: block !important;
  margin-bottom: 8px;
  color: var(--lb-text-soft) !important;
  font-size: 0.82rem !important;
  font-weight: 800;
}

body.lb-v3 .tableau-mode-switch__select.lb-mode-select-enhanced {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

body.lb-v3 .lb-search-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.lb-v3 .lb-search-mode {
  min-width: 0;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--lb-line) !important;
  background: rgba(2, 15, 25, 0.55) !important;
  color: var(--lb-muted) !important;
  box-shadow: none !important;
  font-family: var(--lb-font-body);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

body.lb-v3 .lb-search-mode.is-active {
  border-color: var(--lb-line-strong) !important;
  background: linear-gradient(135deg, rgba(10, 158, 193, 0.9), rgba(14, 91, 161, 0.9)) !important;
  color: white !important;
}

body.lb-v3 .manual-compact-grid {
  gap: 14px !important;
}

body.lb-v3 .compact-presets,
body.lb-v3 .compact-train-search,
body.lb-v3 .compact-fields {
  min-width: 0;
}

body.lb-v3 .search-card {
  padding: clamp(14px, 2vw, 20px) !important;
}

body.lb-v3 .proposer-btn,
body.lb-v3 #tableauTrainSearchSubmit,
body.lb-v3 #loadTrains {
  border: 1px solid rgba(75, 234, 246, 0.72) !important;
  background: linear-gradient(135deg, #04b8cd, #0877c5) !important;
  color: white !important;
  font-weight: 900 !important;
  box-shadow: 0 12px 28px rgba(0, 170, 215, 0.22) !important;
}

/* Favorites, map, stats and fun */
body.lb-v3 #favTrainsWidget {
  padding: clamp(14px, 2.5vw, 24px) !important;
}

body.lb-v3 .fav-title {
  margin-bottom: 14px !important;
  color: var(--lb-text) !important;
  font-size: clamp(1rem, 2vw, 1.32rem) !important;
}

body.lb-v3 .fav-grid {
  gap: 14px !important;
}

body.lb-v3 .fav-card {
  padding: clamp(14px, 2vw, 20px) !important;
}

body.lb-v3 #carte.media-section,
body.lb-v3 #multimedia.media-section,
body.lb-v3 #divertissement.media-section {
  padding: clamp(14px, 2vw, 20px) !important;
}

body.lb-v3 #carte > h2,
body.lb-v3 #multimedia > h2,
body.lb-v3 #divertissement > h2 {
  display: none;
}

body.lb-v3 .map-embed-shell {
  border: 1px solid var(--lb-line-strong) !important;
  border-radius: var(--lb-radius-md) !important;
  overflow: clip;
  box-shadow: var(--lb-shadow-card);
}

body.lb-v3 #carte .map-embed-shell {
  min-height: calc(100dvh - var(--top-bar-height) - var(--bottom-bar-height) - 132px);
}

body.lb-v3 #carte iframe {
  width: 100%;
  min-height: inherit;
}

body.lb-v3 #stats.command-console {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.lb-v3 #statsConsole {
  margin: 0 !important;
}

body.lb-v3 #statsConsole > .section-summary {
  display: none !important;
}

body.lb-v3 #statsConsole > .section-content {
  padding: 0 !important;
}

body.lb-v3 .stats-v2 {
  max-width: none !important;
}

body.lb-v3 .stats-v2__entry-chip:not(.is-active),
body.lb-v3 .stats-v2__entry-subchoice:not(.is-active),
body.lb-v3 .stats-v2__choice:not(.is-active),
body.lb-v3 .stats-v2__period-chip:not(.is-active) {
  border-color: var(--lb-line) !important;
  background: rgba(4, 20, 31, 0.5) !important;
  color: var(--lb-muted) !important;
  box-shadow: none !important;
}

body.lb-v3 .media-grid {
  gap: 14px !important;
}

body.lb-v3 .media-card {
  overflow: clip;
  border: 1px solid var(--lb-line) !important;
  border-radius: var(--lb-radius-md) !important;
  background: var(--lb-surface) !important;
  box-shadow: var(--lb-shadow-card) !important;
}

/* Dialogs and sheets */
body.lb-v3 :where(dialog, .lb-auth-modal, .selection-modal, #betaModal) {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.lb-v3 :where(.lb-auth-card, .faq-container, .selection-modal__panel, #betaModal > div) {
  border: 1px solid var(--lb-line-strong) !important;
  border-radius: var(--lb-radius-lg) !important;
  background:
    radial-gradient(circle at 50% 0, rgba(21, 99, 121, 0.3), transparent 45%),
    rgba(3, 17, 28, 0.98) !important;
  box-shadow: 0 28px 85px rgba(0, 0, 0, 0.56), 0 0 34px rgba(0, 208, 225, 0.13) !important;
}

body.lb-v3 .lb-more-sheet {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  align-items: end;
  padding:
    16px max(12px, env(safe-area-inset-right, 0px))
    calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px) + 10px)
    max(12px, env(safe-area-inset-left, 0px));
  background: rgba(0, 5, 10, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.lb-v3 .lb-more-sheet[hidden] {
  display: none !important;
}

body.lb-v3 .lb-more-sheet__panel {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 10px;
  display: grid;
  gap: 7px;
  border: 1px solid var(--lb-line-strong);
  border-radius: 22px;
  background: rgba(5, 24, 37, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

body.lb-v3 .lb-more-sheet__head {
  padding: 6px 8px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--lb-text-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

body.lb-v3 .lb-more-sheet__close {
  min-height: 34px !important;
  padding: 5px 9px;
  border: 0;
  background: transparent;
  color: var(--lb-text-soft);
  cursor: pointer;
}

body.lb-v3 .lb-more-sheet__item {
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--lb-line);
  border-radius: 14px;
  background: rgba(49, 231, 242, 0.045);
  color: var(--lb-text);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

body.lb-v3 .lb-more-sheet__item small {
  display: block;
  color: var(--lb-muted);
  font-size: 0.74rem;
  font-weight: 600;
}

body.lb-v3 .lb-more-sheet__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: rgba(49, 231, 242, 0.1);
  color: var(--lb-cyan);
}

body.lb-v3.lb-sheet-open {
  overflow: hidden;
}

/* Lightweight status feedback */
body.lb-v3 .lb-toast-region {
  position: fixed;
  z-index: 13000;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px) + 16px);
  width: min(390px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

body.lb-v3 .lb-toast {
  padding: 11px 13px;
  border: 1px solid var(--lb-line-strong);
  border-radius: 13px;
  background: rgba(5, 26, 39, 0.96);
  color: var(--lb-text);
  box-shadow: var(--lb-shadow-card);
  font-size: 0.86rem;
  font-weight: 700;
  animation: lbToastIn 180ms ease-out both;
}

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

/* Tablet */
@media (max-width: 980px) {
  body.lb-v3 .home-traffic-premium,
  body.lb-v3 .home-quick-card,
  body.lb-v3 .home-punct-card {
    grid-column: span 6;
  }

  body.lb-v3 .live-wall-card--home,
  body.lb-v3 .home-card:last-of-type {
    grid-column: span 6;
  }

  body.lb-v3 .top-bar__socials {
    display: none !important;
  }

  body.lb-v3 .lb-header-status span {
    display: none;
  }

  body.lb-v3 .lb-header-status {
    width: 32px;
    justify-content: center;
    padding: 0;
  }
}

/* Mobile: five primary destinations + More */
@media (max-width: 720px) {
  :root {
    --top-bar-height: 62px;
    --bottom-bar-height: 68px;
  }

  body.lb-v3 {
    padding:
      calc(var(--top-bar-height) + env(safe-area-inset-top, 0px) + 10px)
      max(10px, env(safe-area-inset-right, 0px))
      calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px) + 12px)
      max(10px, env(safe-area-inset-left, 0px)) !important;
    font-size: 16px;
    background:
      radial-gradient(circle at 50% -8%, rgba(0, 205, 229, 0.11), transparent 25rem),
      linear-gradient(180deg, #06131f 0, var(--lb-bg) 28rem);
  }

  body.lb-v3 .top-bar__inner {
    padding-inline: 11px !important;
    gap: 8px;
  }

  body.lb-v3 .top-bar__logo-icon {
    height: 35px !important;
  }

  body.lb-v3 .top-bar__logo-text {
    height: 20px !important;
    max-width: 39vw;
  }

  body.lb-v3 .top-bar__actions {
    gap: 6px;
  }

  body.lb-v3 .top-bar__support {
    min-height: 34px;
    padding: 5px 8px !important;
    font-size: 0.62rem !important;
  }

  body.lb-v3 .top-bar__support .line2 {
    display: none;
  }

  body.lb-v3 .lb-header-account {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  body.lb-v3 .lb-header-status {
    display: none;
  }

  body.lb-v3 .bottom-nav {
    padding-top: 5px !important;
    padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px)) !important;
  }

  body.lb-v3 .bottom-nav__items {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 3px !important;
  }

  body.lb-v3 .bottom-nav__item {
    min-height: 51px !important;
    padding: 4px 2px 3px !important;
    border-radius: 12px !important;
  }

  body.lb-v3 .bottom-nav__icon,
  body.lb-v3 .bottom-nav__icon-img {
    width: 25px !important;
    height: 25px !important;
    max-width: 25px !important;
    max-height: 25px !important;
  }

  body.lb-v3 .bottom-nav__label {
    font-size: clamp(0.58rem, 2.5vw, 0.66rem) !important;
  }

  body.lb-v3 .bottom-nav__item[href="#stats"],
  body.lb-v3 .bottom-nav__item[href="#loisirs"],
  body.lb-v3 #bottomAccountBtn {
    display: none !important;
  }

  body.lb-v3 #lbMoreNavButton {
    display: flex !important;
  }

  body.lb-v3 .lb-page-intro {
    margin-bottom: 10px;
    padding: 12px 13px;
    border-radius: 15px;
  }

  body.lb-v3 .lb-page-intro__eyebrow,
  body.lb-v3 .lb-page-intro p {
    display: none;
  }

  body.lb-v3 .lb-page-intro h1 {
    font-size: 0.98rem;
  }

  body.lb-v3 .lb-page-intro__actions {
    gap: 5px;
  }

  body.lb-v3 .lb-context-link {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 0.76rem;
  }

  body.lb-v3 .home-dashboard {
    display: flex !important;
    flex-direction: column;
    gap: 10px !important;
  }

  body.lb-v3 .home-welcome-line {
    order: -2;
    font-size: 0.78rem !important;
  }

  body.lb-v3 .home-card {
    width: 100%;
    padding: 13px !important;
    border-radius: 15px !important;
  }

  body.lb-v3 .home-card h2 {
    font-size: 0.88rem !important;
  }

  body.lb-v3 .lb-search-modes {
    gap: 5px;
  }

  body.lb-v3 .lb-search-mode {
    min-height: 46px;
    padding: 6px 4px;
    gap: 4px;
    border-radius: 11px;
    font-size: 0.76rem;
  }

  body.lb-v3 #search .section-content,
  body.lb-v3 #favTrainsWidget,
  body.lb-v3 #carte.media-section,
  body.lb-v3 #multimedia.media-section {
    padding: 10px !important;
  }

  body.lb-v3 #carte .map-embed-shell {
    min-height: calc(100dvh - var(--top-bar-height) - var(--bottom-bar-height) - 108px);
  }

  body.lb-v3 .lb-toast-region {
    right: 10px;
    bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom, 0px) + 10px);
    width: calc(100vw - 20px);
  }
}

@media (max-width: 390px) {
  body.lb-v3 .top-bar__logo-text {
    display: none !important;
  }

  body.lb-v3 .top-bar__support .label {
    display: none;
  }

  body.lb-v3 .top-bar__support {
    width: 34px;
    justify-content: center;
    border-radius: 50% !important;
  }

  body.lb-v3 .lb-context-link span {
    display: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  body.lb-v3 :where(button, .btn, .home-action, .mini-btn, .train-detail-btn):not(:disabled):hover {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body.lb-v3 *,
  body.lb-v3 *::before,
  body.lb-v3 *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --lb-line: rgba(142, 246, 255, 0.55);
    --lb-line-strong: rgba(173, 250, 255, 0.9);
    --lb-muted: #b4cbd2;
  }
}

/* =========================================================
   Recherche v8 — un même composant pour les trois parcours
   ========================================================= */
body.lb-v3 #search .tableau-mode-switch {
  margin-bottom: 12px !important;
}

body.lb-v3 #search .tableau-mode-switch__label {
  margin-bottom: 7px !important;
  color: var(--lb-text-soft) !important;
  font-family: var(--lb-font-body) !important;
  font-size: 0.82rem !important;
  line-height: 1.15 !important;
}

body.lb-v3 #search .lb-search-modes {
  gap: 8px !important;
}

body.lb-v3 #search .lb-search-mode {
  min-height: 48px;
  border-radius: 12px !important;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

body.lb-v3 #search .lb-search-mode.is-active {
  box-shadow:
    inset 0 1px 0 rgba(210, 252, 255, 0.2) !important,
    0 0 18px rgba(20, 215, 238, 0.18) !important;
}

body.lb-v3 #search .manual-compact-grid {
  display: block !important;
}

body.lb-v3 #search .lb-mode-panel {
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: clamp(13px, 1.8vw, 18px) !important;
  gap: 10px !important;
  border: 1px solid var(--lb-line-strong) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 50% 0, rgba(37, 221, 240, 0.07), transparent 46%),
    linear-gradient(145deg, rgba(5, 30, 45, 0.9), rgba(2, 18, 30, 0.9)) !important;
  box-shadow:
    inset 0 1px 0 rgba(164, 249, 255, 0.06),
    0 13px 34px rgba(0, 0, 0, 0.2) !important;
}

body.lb-v3 #search .lb-mode-panel__title {
  margin: 0 0 10px !important;
  padding: 0 !important;
  color: var(--lb-cyan) !important;
  font-family: var(--lb-font-display) !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.045em !important;
  text-transform: uppercase !important;
  text-shadow: 0 0 12px rgba(49, 231, 242, 0.22);
}

body.lb-v3 #search .lb-mode-panel > .search-card,
body.lb-v3 #search .lb-mode-panel .station-date-grid > .search-card {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.lb-v3 #search .lb-mode-panel .search-card::before {
  display: none !important;
}

body.lb-v3 #search .lb-mode-panel .search-card h4 {
  margin: 0 0 7px !important;
  color: var(--lb-text-soft) !important;
  font-family: var(--lb-font-body) !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  letter-spacing: 0.035em !important;
}

body.lb-v3 #search .compact-presets .preset-stack {
  gap: 9px !important;
}

body.lb-v3 #search .compact-presets .preset-btn {
  min-height: 44px !important;
  justify-content: center !important;
  border-radius: 11px !important;
}

body.lb-v3 #search .compact-train-search {
  display: flex;
  flex-direction: column;
}

body.lb-v3 #search .manual-compact[data-search-mode="quick"] .compact-presets {
  display: flex !important;
}

body.lb-v3 #search .manual-compact[data-search-mode="quick"] :is(.compact-train-search, .compact-fields) {
  display: none !important;
}

body.lb-v3 #search .manual-compact[data-search-mode="train"] .compact-train-search {
  display: flex !important;
}

body.lb-v3 #search .manual-compact[data-search-mode="train"] :is(.compact-presets, .compact-fields) {
  display: none !important;
}

body.lb-v3 #search .manual-compact[data-search-mode="advanced"] .compact-fields {
  display: flex !important;
}

body.lb-v3 #search .manual-compact[data-search-mode="advanced"] :is(.compact-presets, .compact-train-search) {
  display: none !important;
}

body.lb-v3 #search .tableau-train-search__fields {
  gap: 10px !important;
}

body.lb-v3 #search .tableau-train-search__status {
  margin: 8px 0 0 !important;
  color: var(--lb-text-soft) !important;
  font-size: 0.78rem !important;
  line-height: 1.25 !important;
}

body.lb-v3 #search .station-date-grid {
  display: grid !important;
  grid-template-columns: minmax(280px, 0.9fr) minmax(390px, 1.35fr) !important;
  gap: clamp(14px, 2vw, 22px) !important;
  align-items: start !important;
}

body.lb-v3 #search .search-card--trajet {
  min-width: 0;
}

body.lb-v3 #search .search-card--filters {
  min-width: 0;
  padding-left: clamp(14px, 2vw, 22px) !important;
  border-left: 1px solid rgba(94, 233, 244, 0.18) !important;
}

body.lb-v3 #search .search-card--filters .date-time-stack {
  gap: 8px !important;
}

body.lb-v3 #search .search-card--filters .filters-date-time {
  grid-template-columns: minmax(170px, 0.9fr) minmax(220px, 1.1fr) !important;
  gap: 9px !important;
}

body.lb-v3 #search .search-card--filters .date-field,
body.lb-v3 #search .search-card--filters .time-range {
  min-width: 0;
  padding: 8px 10px !important;
  border-color: var(--lb-line) !important;
  border-radius: 11px !important;
  background: rgba(1, 18, 30, 0.58) !important;
}

body.lb-v3 #search .search-card--filters .filters-options {
  margin-top: 2px !important;
}

body.lb-v3 #search .search-card--filters .search-options-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px 14px !important;
}

body.lb-v3 #search .search-card--filters .option-toggle {
  position: relative;
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  grid-template-columns: none !important;
  cursor: pointer;
}

body.lb-v3 #search .search-card--filters .option-toggle input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.lb-v3 #search .search-card--filters .option-toggle span {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

body.lb-v3 #search .search-card--filters .option-toggle span::before {
  content: "";
  width: 17px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(88, 231, 243, 0.55);
  border-radius: 4px;
  background: rgba(1, 15, 25, 0.85);
  color: #00131c;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 7px rgba(0, 218, 235, 0.12);
}

body.lb-v3 #search .search-card--filters .option-toggle input[type="checkbox"]:checked + span::before {
  content: "✓";
  border-color: #34eaf2;
  background: #23d9e6;
  box-shadow: 0 0 10px rgba(35, 217, 230, 0.38);
}

body.lb-v3 #search .search-card--filters .option-toggle input[type="checkbox"]:focus-visible + span::before {
  outline: 2px solid rgba(169, 249, 255, 0.95);
  outline-offset: 2px;
}

body.lb-v3 #search .search-card--filters .actions-main {
  margin-top: 4px !important;
}

body.lb-v3 #search #btnProposer {
  min-height: 42px !important;
  margin-bottom: 0 !important;
}

body.lb-v3 #favTrainsWidget > .lb-page-intro + .fav-grid {
  margin-top: 0 !important;
}

@media (max-width: 920px) {
  body.lb-v3 #search .station-date-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.lb-v3 #search .search-card--filters {
    padding-top: 12px !important;
    padding-left: 0 !important;
    border-top: 1px solid rgba(94, 233, 244, 0.18) !important;
    border-left: 0 !important;
  }
}
