@font-face {
  font-family: "Rotis II Sans Pro";
  src: url("fonts/Rotis II Sans Pro.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manopidi";
  src:
    url("municipios/alcoi/Manopidi.otf") format("opentype"),
    url("municipios/alcoi/Manopidi.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rotis II Sans Pro";
  src: url("fonts/Rotis II Sans Pro Bold.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue-900: #0a2a66;
  --blue-700: #0b4db5;
  --blue-500: #1b7ae6;
  --ice-100: #f4f9ff;
  --ice-200: #e5f0ff;
  --white: #ffffff;
  --shadow: 0 20px 45px rgba(4, 20, 55, 0.22);
  --tap-target-size: 44px;
  --control-height: var(--tap-target-size);
  --actions-gap: 10px;
  --line-picker-width: calc(var(--control-height) * 2 + 8px);
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-edge-offset: 6px;
  --safe-top-offset: calc(var(--safe-edge-offset) + var(--safe-area-top));
  --safe-right-offset: calc(var(--safe-edge-offset) + var(--safe-area-right));
  --safe-bottom-offset: calc(var(--safe-edge-offset) + var(--safe-area-bottom));
  --safe-left-offset: calc(var(--safe-edge-offset) + var(--safe-area-left));
}

* {
  box-sizing: border-box;
}

@supports (top: constant(safe-area-inset-top)) {
  :root {
    --safe-area-top: constant(safe-area-inset-top);
    --safe-area-right: constant(safe-area-inset-right);
    --safe-area-bottom: constant(safe-area-inset-bottom);
    --safe-area-left: constant(safe-area-inset-left);
  }
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 20px;
  height: 20px;
}

body {
  margin: 0;
  font-family: "Fira Sans Condensed", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e8f2ff 0%, #f7fbff 35%, #d9e8ff 100%);
  color: var(--blue-900);
  min-height: 100vh;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 10000;
  padding: 10px 14px;
  background: var(--blue-900, #0b4db5);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #ffd000;
  outline-offset: 2px;
}

body.is-night {
  background: radial-gradient(circle at top, #0c1424 0%, #0a1220 45%, #060c18 100%);
}

body.has-cookie-consent {
  overflow: hidden;
}

.cookie-consent-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 18, 40, 0.42);
  opacity: 0;
  pointer-events: none;
  z-index: 1190;
  transition: opacity 0.2s ease;
}

.cookie-consent-backdrop[hidden],
.cookie-consent[hidden] {
  display: none;
}

.cookie-consent-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-consent {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-area-bottom));
  transform: translate(-50%, 18px);
  width: min(520px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(11, 77, 181, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--blue-900);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cookie-consent.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.cookie-consent__title,
.cookie-consent__text {
  margin: 0;
}

.cookie-consent__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.cookie-consent__text {
  margin-top: 3px;
  color: rgba(10, 42, 102, 0.78);
  font-size: 0.86rem;
  line-height: 1.35;
}

.cookie-consent__link {
  display: inline-flex;
  color: var(--blue-700);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.cookie-consent__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 5px;
}

.cookie-consent__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cookie-consent__btn {
  border: 1px solid rgba(11, 77, 181, 0.24);
  border-radius: 999px;
  padding: 8px 13px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
}

.cookie-consent__btn--primary {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: var(--white);
}

.cookie-consent__btn--secondary {
  background: transparent;
  border-color: transparent;
  color: var(--blue-700);
  font-size: 0.84rem;
  font-weight: 700;
  min-height: 0;
  padding: 0;
  text-decoration: none;
}

body.is-night .cookie-consent {
  background: #0c1424;
  border-color: rgba(255, 255, 255, 0.16);
  color: #eef3ff;
}

body.is-night .cookie-consent__text {
  color: rgba(238, 243, 255, 0.78);
}

body.is-night .cookie-consent__link {
  color: #9fc8ff;
}

body.is-night .cookie-consent__btn--secondary {
  background: transparent;
  color: #9fc8ff;
  border-color: transparent;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 18, 40, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 800;
  padding: 20px;
}

.welcome-modal.is-open {
  display: flex;
}

.welcome-modal__card {
  width: min(340px, 90vw);
  background: var(--white);
  border-radius: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: 0 18px 36px rgba(3, 12, 28, 0.28);
  display: grid;
  gap: 10px;
}

.welcome-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.welcome-modal__intro {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(10, 42, 102, 0.8);
}

.welcome-modal__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.85);
}

.welcome-modal__item {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 10px;
}

.welcome-modal__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(11, 77, 181, 0.25);
  background: rgba(11, 77, 181, 0.08);
  color: var(--blue-900);
  font-size: 0.8rem;
  line-height: 1;
  padding: 4px 8px;
  min-width: 34px;
  justify-self: center;
}

.welcome-modal__chip .icon {
  width: 16px;
  height: 16px;
}

.welcome-modal__chip--circle {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.85rem;
}

.welcome-modal__flag {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(10, 42, 102, 0.25);
}

.welcome-modal__flag--es {
  background: linear-gradient(to bottom,
      #c60b1e 0%,
      #c60b1e 33%,
      #ffc400 33%,
      #ffc400 66%,
      #c60b1e 66%,
      #c60b1e 100%);
}

.welcome-modal__chip--line {
  gap: 6px;
  min-width: 56px;
  justify-content: center;
}

.welcome-modal__chip-badge {
  background: #e3503c;
  color: var(--white);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 700;
}

.welcome-modal__chip-caret {
  font-size: 0.65rem;
  color: rgba(10, 42, 102, 0.7);
}

.welcome-modal__close {
  border: none;
  background: var(--blue-700);
  color: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  justify-self: end;
}

body.is-night .welcome-modal__card {
  background: #0c1424;
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef3ff;
}

body.is-night .welcome-modal__intro,
body.is-night .welcome-modal__list {
  color: rgba(238, 243, 255, 0.8);
}

body.is-night .welcome-modal__chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #eef3ff;
}

body.is-night .welcome-modal__chip-caret {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .welcome-modal__flag {
  box-shadow: 0 0 0 1px rgba(238, 243, 255, 0.35);
}

.map-picker {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 820;
  padding: 20px;
}

.map-picker.is-open {
  display: flex;
}

.map-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 18, 40, 0.45);
}

.map-picker__card {
  position: relative;
  z-index: 1;
  width: min(320px, 92vw);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: var(--shadow);
}

.map-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-picker__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-900);
}

.map-picker__close {
  border: none;
  background: var(--ice-100);
  color: var(--blue-900);
  font-weight: 700;
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  border-radius: 999px;
  cursor: pointer;
}

.map-picker__subtitle {
  margin: 0;
  color: rgba(10, 42, 102, 0.7);
  font-size: 0.9rem;
}

.map-picker__options {
  display: grid;
  gap: 8px;
}

.map-picker__option {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-700);
  min-height: var(--tap-target-size);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

body.is-night .map-picker__card {
  background: rgba(9, 16, 30, 0.96);
  border-color: rgba(101, 144, 210, 0.25);
}

body.is-night .map-picker__title,
body.is-night .map-picker__subtitle {
  color: var(--white);
}

body.is-night .map-picker__option,
body.is-night .map-picker__close {
  background: rgba(9, 20, 38, 0.8);
  border-color: rgba(101, 144, 210, 0.35);
  color: var(--white);
}

.route-map-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 845;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.route-map-modal.is-open {
  display: flex;
}

.route-map-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 18, 40, 0.48);
}

.route-map-modal__card {
  position: relative;
  width: min(920px, calc(100vw - 28px));
  height: min(760px, calc(100vh - 36px));
  height: min(760px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(10, 42, 102, 0.12);
  box-shadow: 0 24px 80px rgba(17, 32, 52, 0.28);
}

.route-map-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.route-map-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(10, 42, 102, 0.95);
}

.route-map-modal__close {
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  border-radius: 999px;
  border: 1px solid rgba(10, 42, 102, 0.12);
  background: #f5f8fc;
  color: rgba(10, 42, 102, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.route-map-modal__close-icon {
  width: 18px;
  height: 18px;
}

.route-map-modal__body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.route-map-modal__frame {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 1px solid rgba(10, 42, 102, 0.14);
  border-radius: 14px;
  background: #f5f8fc;
}

.route-map-modal__fallback {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: rgba(10, 42, 102, 0.66);
}

.route-map-modal__actions {
  display: flex;
  justify-content: flex-start;
}

.route-map-modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-target-size);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(11, 77, 181, 0.18);
  background: rgba(11, 77, 181, 0.08);
  color: rgba(10, 42, 102, 0.92);
  text-decoration: none;
  font-weight: 700;
}

body.is-night .route-map-modal__card {
  background: rgba(9, 16, 30, 0.96);
  border-color: rgba(101, 144, 210, 0.25);
}

body.is-night .route-map-modal__title,
body.is-night .route-map-modal__fallback,
body.is-night .route-map-modal__link {
  color: var(--white);
}

body.is-night .route-map-modal__frame,
body.is-night .route-map-modal__close,
body.is-night .route-map-modal__link {
  background: rgba(9, 20, 38, 0.8);
  border-color: rgba(101, 144, 210, 0.35);
}

body.is-night .route-map-modal__close {
  color: var(--white);
}

@media (max-width: 720px) {
  .route-map-modal {
    align-items: flex-start;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .route-map-modal__card {
    width: min(100%, 920px);
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    padding: 16px;
    gap: 12px;
  }

  .route-map-modal__frame {
    min-height: 0;
  }
}

.announcement-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 840;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.announcement-modal.is-open {
  display: flex;
}

.announcement-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 18, 40, 0.45);
}

.announcement-modal__card {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  padding: 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(10, 42, 102, 0.12);
  box-shadow: 0 24px 80px rgba(17, 32, 52, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.announcement-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.announcement-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(10, 42, 102, 0.95);
}

.announcement-modal__close {
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  border-radius: 999px;
  border: 1px solid rgba(10, 42, 102, 0.12);
  background: #f5f8fc;
  color: rgba(10, 42, 102, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.announcement-modal__close-icon {
  width: 18px;
  height: 18px;
}

.announcement-modal__body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  line-height: 1.48;
  color: rgba(10, 42, 102, 0.82);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.announcement-modal__body > *:first-child {
  margin-top: 0;
}

.announcement-modal__body > *:last-child {
  margin-bottom: 0;
}

.announcement-modal__body table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  border: 1px solid rgba(10, 42, 102, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.announcement-modal__body th,
.announcement-modal__body td {
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
  border: 1px solid rgba(10, 42, 102, 0.18);
}

.announcement-modal__body th {
  font-weight: 700;
  color: rgba(10, 42, 102, 0.92);
  background: rgba(11, 77, 181, 0.08);
}

.announcement-modal__image-link {
  display: block;
  margin: 12px 0;
}

.announcement-modal__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(10, 42, 102, 0.12);
  background: #fff;
}

.announcement-modal__actions {
  display: flex;
  justify-content: flex-start;
}

.announcement-modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-target-size);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(11, 77, 181, 0.18);
  background: rgba(11, 77, 181, 0.08);
  color: rgba(10, 42, 102, 0.92);
  text-decoration: none;
  font-weight: 700;
}

body.is-night .announcement-modal__card {
  background: rgba(9, 16, 30, 0.96);
  border-color: rgba(101, 144, 210, 0.25);
}

body.is-night .announcement-modal__title,
body.is-night .announcement-modal__body,
body.is-night .announcement-modal__link {
  color: var(--white);
}

body.is-night .announcement-modal__body table {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

body.is-night .announcement-modal__body th,
body.is-night .announcement-modal__body td {
  border-color: rgba(255, 255, 255, 0.24);
}

body.is-night .announcement-modal__body th {
  color: #eef3ff;
  background: rgba(255, 255, 255, 0.08);
}

body.is-night .announcement-modal__close {
  background: rgba(9, 20, 38, 0.8);
  border-color: rgba(101, 144, 210, 0.35);
  color: var(--white);
}

body.is-night .announcement-modal__link {
  background: rgba(9, 20, 38, 0.8);
  border-color: rgba(101, 144, 210, 0.35);
}

@media (max-width: 720px) {
  .announcement-modal {
    align-items: flex-start;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .announcement-modal__card {
    width: min(100%, 760px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    margin: 0 auto;
    padding: 16px;
    gap: 12px;
  }
}

.line-selector {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 900;
  transition: opacity 0.2s ease;
}

.line-selector.is-open {
  opacity: 1;
  pointer-events: auto;
}

.line-selector__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 18, 42, 0.45);
}

.line-selector__card {
  position: relative;
  width: min(92vw, 440px);
  max-height: 85vh;
  background: var(--ice-100);
  border-radius: 20px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.line-selector__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  gap: 12px;
}

.line-selector__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-900);
}

.line-selector__close {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.line-selector__close-icon {
  width: 16px;
  height: 16px;
}

.line-selector__body {
  overflow-y: auto;
  padding-bottom: 16px;
}

.line-selector__areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 10px;
}

.line-selector__pill {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  min-height: var(--tap-target-size);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.line-selector__pill.is-active {
  background: var(--blue-700);
  color: #fff;
  border-color: var(--blue-700);
}

.line-selector__search {
  padding: 0 18px 12px;
}

.line-selector__search-input {
  width: 100%;
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: #ffffff;
  color: var(--blue-900);
  border-radius: 999px;
  min-height: var(--tap-target-size);
  padding: 8px 14px;
  font-size: 0.9rem;
  outline: none;
}

.line-selector__subgroups {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 12px;
}

.line-selector__subgroups.is-visible {
  display: grid;
}

.line-selector__subgroup-btn {
  min-height: var(--tap-target-size);
  border: 1px solid rgba(11, 77, 181, 0.18);
  border-radius: 10px;
  background: #ffffff;
  color: var(--blue-900);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 10px;
  text-align: center;
}

.line-selector__subgroup-btn.is-active {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: #ffffff;
}

.line-selector__section-title {
  margin: 4px 18px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-700);
}

.line-selector__section + .line-selector__section {
  margin-top: 10px;
}

.line-selector__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 18px;
}

.line-selector__ad {
  position: relative;
  border: 1px dashed rgba(11, 77, 181, 0.28);
  background: rgba(11, 77, 181, 0.04);
  border-radius: 14px;
  padding: 6px 12px 8px;
  min-height: 44px;
  overflow: hidden;
}

.line-selector__ad-label {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(10, 42, 102, 0.45);
}

.line-selector__ad-ins {
  display: block;
  width: 100%;
}

body.is-night .line-selector__ad {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

body.is-night .line-selector__ad-label {
  color: rgba(255, 255, 255, 0.5);
}

.line-selector__group-title {
  margin: 8px 2px 0;
  color: rgba(11, 77, 181, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.line-selector__group-title:first-child {
  margin-top: 0;
}

.line-selector__option {
  border: 1px solid rgba(11, 77, 181, 0.15);
  background: var(--ice-100);
  color: var(--blue-900);
  min-height: var(--tap-target-size);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.line-selector__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
}

.line-selector__option.is-active {
  border-color: rgba(11, 77, 181, 0.4);
  box-shadow: 0 8px 16px rgba(11, 77, 181, 0.15);
}

.line-selector__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.line-selector__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue-900);
}

.line-selector__area {
  font-size: 0.75rem;
  color: rgba(11, 77, 181, 0.7);
}

.line-selector__empty {
  display: none;
  padding: 10px 18px 0;
  font-size: 0.85rem;
  color: rgba(11, 77, 181, 0.6);
}

.line-selector__empty.is-visible {
  display: block;
}

.line-selector__section--recent.is-hidden {
  display: none;
}

body.is-night .line-selector__card {
  background: #0b1730;
  border-color: rgba(255, 255, 255, 0.14);
}

body.is-night .line-selector__title,
body.is-night .line-selector__name {
  color: #ffffff;
}

body.is-night .line-selector__close,
body.is-night .line-selector__pill,
body.is-night .line-selector__subgroup-btn,
body.is-night .line-selector__option,
body.is-night .line-selector__search-input {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body.is-night .line-selector__pill.is-active {
  background: var(--blue-500);
  border-color: var(--blue-500);
}

body.is-night .line-selector__subgroup-btn.is-active {
  background: var(--blue-500);
  border-color: var(--blue-500);
}

body.is-night .line-selector__area {
  color: rgba(255, 255, 255, 0.7);
}

body.is-night .line-selector__section-title {
  color: rgba(255, 255, 255, 0.7);
}

body.is-night .line-selector__group-title {
  color: rgba(255, 255, 255, 0.68);
}

body.is-night .line-selector__empty {
  color: rgba(255, 255, 255, 0.6);
}

#map {
  position: absolute;
  inset: 0;
  background: #dcecf2;
}

.map-poster {
  position: absolute;
  inset: 0;
  z-index: 250;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

body.is-night #map,
body.is-night .map-poster {
  background: #18252d;
}

body.is-night .map-poster {
  filter: brightness(0.42) saturate(0.65) hue-rotate(155deg);
}

/* In-app reserved bottom ad band (Display unit). The map physically shrinks to
   make room, so the ad sits in its own space and never floats over the map; the
   fixed bottom controls lift above it via the shared --safe-bottom-offset. */
:root {
  --app-ad-height: 0px;
}

body.has-app-ad {
  --app-ad-height: 56px;
  --safe-bottom-offset: calc(var(--safe-edge-offset) + var(--safe-area-bottom) + var(--app-ad-height));
}

body.has-app-ad #map {
  bottom: var(--app-ad-height);
}

body.has-app-ad .loading {
  bottom: calc(20px + var(--safe-area-bottom) + var(--app-ad-height));
}

/* The cookie prompt uses the raw --safe-area-bottom, so lift it above the ad
   band too or the two overlap. Higher specificity than the base rule, so it
   wins. */
body.has-app-ad .cookie-consent {
  bottom: calc(16px + var(--safe-area-bottom) + var(--app-ad-height));
}

.app-ad-band {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--app-ad-height);
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--white, #fff);
  border-top: 1px solid rgba(11, 77, 181, 0.15);
  z-index: 540;
  overflow: hidden;
}

body.has-app-ad .app-ad-band {
  display: flex;
}

.app-ad-band__label {
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(10, 42, 102, 0.45);
  pointer-events: none;
}

body.is-night .app-ad-band {
  background: #0b1b3a;
  border-top-color: rgba(255, 255, 255, 0.12);
}

body.is-night .app-ad-band__label {
  color: rgba(255, 255, 255, 0.45);
}

.leaflet-top {
  top: var(--safe-area-top);
}

.leaflet-right {
  right: var(--safe-area-right);
}

.leaflet-bottom {
  bottom: var(--safe-area-bottom);
}

.leaflet-left {
  left: var(--safe-area-left);
}

.map-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 77, 181, 0.18), rgba(255, 255, 255, 0));
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.8s ease;
}

body.ready .map-sheen {
  opacity: 0.45;
}

.topbar {
  position: fixed;
  top: var(--safe-top-offset);
  left: var(--safe-left-offset);
  right: auto;
  width: max-content;
  max-width: calc(100% - var(--safe-left-offset) - var(--safe-right-offset));
  z-index: 500;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

body.ready .topbar {
  opacity: 1;
  transform: translateY(0);
}

.topbar__main {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.brand__title {
  font-family: "Fira Sans Condensed", "Segoe UI", sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.5px;
}

.brand__logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.brand__subtitle {
  font-family: "Fira Sans Condensed", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  color: rgba(10, 42, 102, 0.75);
  white-space: pre-line;
}

.topbar__controls {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  justify-content: start;
  justify-items: center;
  row-gap: 10px;
}

.topbar__controls .line-picker {
  justify-self: start;
}

.topbar__button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--actions-gap);
  row-gap: var(--actions-gap);
  align-items: end;
  justify-content: stretch;
  justify-items: center;
  --line-action-offset: 2px;
  width: 100%;
}

.topbar__button-grid .line-picker {
  grid-column: 1 / span 2;
  justify-self: center;
  width: var(--line-picker-width, max-content);
  align-self: end;
}

.topbar__actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--actions-gap);
  align-items: center;
  justify-content: stretch;
  justify-items: center;
  width: 100%;
}

.topbar__actions-left,
.topbar__actions-right {
  display: contents;
}

.topbar__actions .stop-search__toggle,
.topbar__actions .mode-toggle,
.topbar__actions .favorites__button {
  width: var(--control-height);
  height: var(--control-height);
  min-width: var(--control-height);
  padding: 0;
  margin: 0;
}

.control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(10, 42, 102, 0.65);
}

.control__label {
  line-height: 1;
}

.control__input {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.2px;
  min-width: 140px;
  height: var(--control-height);
}

.lang-flags__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stop-search {
  position: relative;
}

.stop-search__toggle {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stop-search__toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

.stop-search__icon {
  width: 18px;
  height: 18px;
  display: block;
}

.stop-search__panel {
  display: none;
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  right: auto;
  min-width: 240px;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(11, 77, 181, 0.2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 650;
  transform: translateX(calc(-50% + var(--stop-search-shift, 0px)));
}

.stop-search.is-open .stop-search__panel {
  display: grid;
  gap: 8px;
}

.stop-search__input {
  width: 100%;
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--white);
  color: var(--blue-900);
  padding: 8px 10px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.85rem;
}

.stop-search__empty {
  font-size: 0.8rem;
  color: rgba(10, 42, 102, 0.65);
}

.stop-search__empty.is-hidden {
  display: none;
}

.stop-search__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.stop-search__list button {
  width: 100%;
  border: 1px solid rgba(11, 77, 181, 0.12);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
  font-size: 0.8rem;
}

.stop-search__section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(10, 42, 102, 0.55);
  padding: 2px 2px 0;
}

.stop-search__name {
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}

.stop-search__code {
  font-weight: 700;
  color: rgba(10, 42, 102, 0.7);
  flex: 0 0 auto;
}

.floating-lang {
  position: fixed;
  left: var(--safe-left-offset);
  bottom: var(--safe-bottom-offset);
  display: grid;
  gap: 8px;
  z-index: 550;
}

.lang-picker {
  position: relative;
}

.site-footer {
  position: fixed;
  left: var(--safe-left-offset);
  bottom: var(--safe-bottom-offset);
  transform: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 8px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: 0 12px 28px rgba(4, 20, 55, 0.18);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-align: center;
  z-index: 520;
}

.site-footer__toggle {
  display: none;
}

.site-footer a {
  color: var(--blue-700);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  white-space: pre-line;
}

.site-footer__column {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.site-footer__column>* {
  width: 100%;
  padding: 4px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-footer__column>a.site-footer__icon {
  padding: 3px 0;
}

.site-footer__column>*+* {
  border-top: 1px solid rgba(10, 42, 102, 0.2);
}

.site-footer a.site-footer__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap-target-size);
  line-height: 0;
  margin: 0;
  vertical-align: middle;
  color: var(--blue-700);
}

.site-footer__icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

body.is-night .site-footer__icon {
  color: #eef3ff;
}

body.is-night .site-footer__column>*+* {
  border-top-color: rgba(255, 255, 255, 0.7);
}

.site-footer__divider {
  display: none;
}

.site-footer__divider--vertical {
  display: inline-block;
  width: 1px;
  height: 100%;
  background: rgba(10, 42, 102, 0.4);
  align-self: center;
}

body.is-night .site-footer__divider--vertical {
  background: rgba(255, 255, 255, 0.7);
}

.site-footer__languages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  justify-content: center;
}

.site-footer__languages .lang-picker__toggle {
  border: none;
  background: transparent;
  padding: 0;
  min-height: var(--tap-target-size);
  min-width: var(--tap-target-size);
  display: inline-flex;
  justify-content: center;
  width: auto;
}

.site-footer__languages .lang-picker__panel {
  left: 50%;
  transform: translateX(-50%);
}

.site-footer__languages .lang-flag {
  min-width: var(--tap-target-size);
  min-height: var(--tap-target-size);
  padding: 4px 6px;
}

.site-footer__languages .flag {
  width: 24px;
  height: 16px;
}

.lang-picker__toggle {
  border: 1px solid rgba(11, 77, 181, 0.35);
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue-900);
  padding: 8px 12px;
  min-height: var(--tap-target-size);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang-picker__value {
  display: inline-flex;
  align-items: center;
}

.lang-picker__chevron {
  font-size: 0.75rem;
  color: rgba(10, 42, 102, 0.7);
}

.lang-picker__panel {
  display: none;
  gap: 10px;
  padding: 10px;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(11, 77, 181, 0.25);
  box-shadow: var(--shadow);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
}

.lang-picker.is-open .lang-picker__panel {
  display: flex;
}

.lang-flag {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  min-width: var(--tap-target-size);
  min-height: var(--tap-target-size);
  padding: 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lang-flag:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

.lang-flag.is-active {
  border-color: rgba(11, 77, 181, 0.55);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

.flag {
  width: 32px;
  height: 20px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.flag--es {
  background: linear-gradient(#c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.flag--en {
  background-color: #012169;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 36'%3E%3Crect width='60' height='36' fill='%23012169'/%3E%3Cpath d='M0 0 L60 36 M60 0 L0 36' stroke='%23ffffff' stroke-width='12' stroke-linecap='square'/%3E%3Cpath d='M0 0 L60 36 M60 0 L0 36' stroke='%23c8102e' stroke-width='6' stroke-linecap='square'/%3E%3Cpath d='M0 18 H60 M30 0 V36' stroke='%23ffffff' stroke-width='20' stroke-linecap='square'/%3E%3Cpath d='M0 18 H60 M30 0 V36' stroke='%23c8102e' stroke-width='10' stroke-linecap='square'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.flag--va {
  background:
    linear-gradient(90deg, #1f4aa8 0 24%, transparent 24% 100%),
    repeating-linear-gradient(0deg,
      #d81e05 0 12.5%,
      #ffdc00 12.5% 25%);
}

.line-picker {
  position: relative;
}

.line-picker__actions {
  display: contents;
}

.line-picker__actions.is-hidden {
  display: none;
}

.line-picker__action {
  border: 1px solid var(--line-action-border, rgba(11, 77, 181, 0.2));
  background: var(--line-action-bg, var(--ice-100));
  color: var(--line-action-fg, var(--blue-900));
  width: var(--control-height);
  height: var(--control-height);
  min-width: var(--control-height);
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateY(var(--line-action-offset, 0px));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.line-picker__action-icon {
  width: 16px;
  height: 16px;
}

.line-picker__action:hover {
  transform: translateY(calc(var(--line-action-offset, 0px) - 1px));
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

.line-picker__action:disabled {
  cursor: default;
  opacity: 0.5;
  transform: translateY(var(--line-action-offset, 0px));
  box-shadow: none;
}

.line-picker__action--clear {
  font-size: 1.1rem;
}

.line-picker__button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-content: center;
  column-gap: 0px;
  position: relative;
  padding-left: 0px;
  padding-right: 0px;
  width: var(--line-picker-width, max-content);
  min-width: 0;
}

.line-picker__announcement-hint {
  position: absolute;
  top: calc(100% - 12px);
  left: 50%;
  width: min(100%, 420px);
  min-width: 0;
  transform: translateX(-50%);
  z-index: 0;
  border: 1px solid var(--line-hint-border, rgba(11, 77, 181, 0.18));
  border-top: 0;
  background: var(--line-hint-bg, rgba(11, 77, 181, 0.08));
  color: var(--line-hint-fg, rgba(10, 42, 102, 0.88));
  border-radius: 0 0 16px 16px;
  padding: 20px 12px 10px;
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.line-picker__announcement-hint:hover {
  transform: translateX(-50%) translateY(1px);
  box-shadow: 0 10px 24px rgba(11, 77, 181, 0.14);
  filter: brightness(0.98);
}

.line-picker__value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-picker__chevron {
  font-size: 0.75rem;
  color: rgba(10, 42, 102, 0.7);
  position: static;
  justify-self: end;
}

.line-picker.is-selected .line-picker__chevron {
  display: none;
}

.line-picker.is-selected .line-picker__button {
  grid-template-columns: 1fr;
  column-gap: 0;
}

.line-picker__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: 80vw;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: var(--shadow);
  padding: 10px;
  display: none;
  z-index: 600;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

.line-picker.is-open .line-picker__panel {
  display: grid;
  gap: 8px;
}

.line-picker__option {
  border: 1px solid rgba(11, 77, 181, 0.15);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
}

.line-picker__option--line {
  width: 90px;
  justify-content: center;
  padding: 8px;
}

.line-picker__option--line .line-badge {
  margin: 0 auto;
}

.line-picker__option--all {
  width: 100%;
  justify-content: flex-start;
}

.mode-toggle {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 40px;
}

.mode-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

.mode-toggle__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.locate-toggle.is-loading {
  opacity: 0.7;
}

.locate-toggle__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.line-picker__option.is-active {
  border-color: rgba(11, 77, 181, 0.5);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.12);
}

.line-badge {
  background: var(--line-color, var(--blue-700));
  color: var(--line-text-color, var(--white));
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0 1px;
  font-family: "Quicksand", "Fira Sans Condensed", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 0;
  line-height: 1;
}

.line-badge__text {
  display: block;
}

/* Shared badge rules are kept in the single application stylesheet so the two
   tiny regional stylesheets do not create separate render-blocking requests. */
.line-badge--tram {
  border-radius: 15%;
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  font-family: "Rotis II Sans Pro", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
}

.line-badge--tram.len-2 {
  font-size: 0.95rem;
}

.line-badge.line-badge--elxRodalia {
  border-radius: 4px 4px 16px 4px;
  font-family: "Roboto Condensed", "Fira Sans Condensed", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.52rem;
  letter-spacing: -0.03em;
  line-height: 0.94;
  padding-left: 3px;
  padding-right: 5px;
}

.line-badge.line-badge--elxRodalia.len-1 {
  width: 28px;
  min-width: 28px;
  padding-left: 0;
  padding-right: 0;
}

.line-badge.line-badge--elxRodalia.len-2 {
  min-width: 36px;
  padding-left: 2px;
  padding-right: 4px;
}

.line-badge.line-badge--elxRodalia.len-3 {
  min-width: 46px;
  padding-left: 2px;
  padding-right: 4px;
}

.line-badge.line-badge--elxRodalia.len-4 {
  min-width: 56px;
  padding-left: 2px;
  padding-right: 5px;
}

.line-badge.line-badge--elxRodalia.line-badge--dash.len-3 {
  min-width: 50px;
  padding-left: 2px;
  padding-right: 4px;
}

.line-badge.line-badge--elxRodalia.line-badge--dash.len-4 {
  min-width: 62px;
  padding-left: 2px;
  padding-right: 4px;
}

.line-badge.line-badge--alcoi {
  border-radius: 999px;
  font-family: "Manopidi", "Quicksand", "Fira Sans Condensed", "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 1.28rem;
  letter-spacing: 0;
  line-height: 1;
}

.line-badge.line-badge--alcoi .line-badge__text {
  transform: translate(0.03em, 0.16em);
}

.line-badge.line-badge--alcoi.len-1,
.line-badge.line-badge--alcoi.len-2 {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.line-badge.line-badge--alcoi.len-3 {
  min-width: 38px;
  padding: 0 5px;
}

.line-badge.line-badge--alcoi.len-4 {
  min-width: 46px;
  padding: 0 7px;
}

.line-badge.len-1 {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.line-badge.len-2 {
  min-width: 34px;
  padding: 0 4px;
}

.line-badge.len-3 {
  min-width: 42px;
  padding: 0 7px;
}

.line-badge.len-4 {
  min-width: 50px;
  padding: 0 8px;
}

.line-badge.line-badge--dash.len-3 {
  min-width: 46px;
  padding: 0 6px;
}

.line-badge.line-badge--dash.len-4 {
  min-width: 58px;
  padding: 0 6px;
}

.line-badge.is-wide {
  padding: 0 6px;
  min-width: 36px;
}

.stop-line-label.leaflet-div-icon {
  background: transparent;
  border: none;
  box-shadow: none;
}

.stop-line-label.leaflet-marker-icon {
  width: max-content !important;
  height: max-content !important;
}

.stop-line-label {
  pointer-events: none;
}

.stop-line-label__badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  max-width: min(220px, 70vw);
  --stop-label-shift: 0px;
  --stop-label-shift-x: 0px;
  transform-origin: center bottom;
}

.stop-line-label__badge {
  border: none;
  cursor: pointer;
  pointer-events: auto;
}

.stop-line-label__badge .line-badge__text {
  pointer-events: none;
}

.stop-line-label__row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.stop-line-label--pos-top .stop-line-label__badges {
  transform:
    translate(calc(-50% + var(--stop-label-shift-x)),
      calc(-100% - 14px - var(--stop-label-shift))) scale(0.9);
}

.stop-line-label--pos-bottom .stop-line-label__badges {
  transform:
    translate(calc(-50% + var(--stop-label-shift-x)),
      calc(0% + 14px + var(--stop-label-shift))) scale(0.9);
}

.stop-line-label--pos-left .stop-line-label__badges {
  transform: translate(calc(-100% - 14px - var(--stop-label-shift)), -50%) scale(0.9);
}

.stop-line-label--pos-right .stop-line-label__badges {
  transform: translate(calc(0% + 14px + var(--stop-label-shift)), -50%) scale(0.9);
}

.stop-line-label--pos-top-right .stop-line-label__badges {
  transform:
    translate(calc(0% + 14px + var(--stop-label-shift)),
      calc(-100% - 14px - var(--stop-label-shift))) scale(0.9);
}

.stop-line-label--pos-top-left .stop-line-label__badges {
  transform:
    translate(calc(-100% - 14px - var(--stop-label-shift)),
      calc(-100% - 14px - var(--stop-label-shift))) scale(0.9);
}

.stop-line-label--pos-bottom-right .stop-line-label__badges {
  transform:
    translate(calc(0% + 14px + var(--stop-label-shift)),
      calc(0% + 14px + var(--stop-label-shift))) scale(0.9);
}

.stop-line-label--pos-bottom-left .stop-line-label__badges {
  transform:
    translate(calc(-100% - 14px - var(--stop-label-shift)),
      calc(0% + 14px + var(--stop-label-shift))) scale(0.9);
}

.favorites {
  position: relative;
  display: flex;
  align-items: center;
}

.favorites__button {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.favorites__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

/* Alert pip shown when any favorited line/stop has an active announcement. */
.favorites__button.has-alerts::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #e23b3b;
  border: 2px solid var(--ice-100);
  box-sizing: content-box;
}

.favorites__count {
  background: var(--blue-700);
  color: var(--white);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 0.7rem;
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  text-align: center;
}

.favorites__icon {
  width: 18px;
  height: 18px;
  display: block;
}

.stops {
  position: relative;
  display: flex;
  align-items: center;
}

.stops__button {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stops__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

.stops__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, 80vw);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: var(--shadow);
  padding: 12px;
  display: none;
  z-index: 600;
}

.stops.is-open .stops__panel {
  display: block;
}

.stops__empty {
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.65);
}

.stops__list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.stops__item-btn {
  border: 1px solid rgba(11, 77, 181, 0.15);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
}

.stops__item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.stops__item-code {
  font-size: 0.8rem;
  color: rgba(10, 42, 102, 0.65);
}

body.is-night .stops__item-name {
  color: #eef3ff;
}

body.is-night .stops__item-btn {
  background: rgba(18, 30, 56, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
  color: #eef3ff;
}

body.is-night .stops__item-code {
  color: rgba(238, 243, 255, 0.7);
}

.favorites__panel {
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  width: min(320px, 80vw);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: var(--shadow);
  padding: 12px;
  display: none;
  z-index: 600;
  transform: translateX(var(--favorites-shift, 0px));
}

.favorites.is-open .favorites__panel {
  display: block;
}

.favorites__section {
  display: grid;
  gap: 6px;
}

.favorites__section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(10, 42, 102, 0.55);
}

.favorites__section-divider {
  height: 1px;
  background: rgba(11, 77, 181, 0.15);
  margin: 8px 0;
}

.favorites__empty {
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.65);
}

.favorites__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
}

.favorites__item {
  position: relative;
  display: flex;
  align-items: center;
}

.favorites__item-btn {
  border: 1px solid rgba(11, 77, 181, 0.15);
  background: var(--ice-100);
  color: var(--blue-900);
  min-height: var(--tap-target-size);
  padding: 8px 54px 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  flex: 1;
  min-width: 0; /* allow the button to shrink so long names ellipsize, not scroll */
  text-align: left;
  display: grid;
  gap: 2px;
}

.favorites__item--line .favorites__item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorites__line-badge {
  flex-shrink: 0;
}

.favorites__item-name--line {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
  /* Wrap the full line name across lines instead of truncating it, so long
     suburban names stay readable. The button grows in height; the remove
     button stays vertically centred and clear of the text (54px right pad). */
  white-space: normal;
  overflow-wrap: anywhere;
}

.favorites__item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.favorites__item-code {
  font-size: 0.8rem;
  color: rgba(10, 42, 102, 0.65);
}

/* Favorites dashboard: inline next-arrivals under each favorite stop (B1). */
.favorites__item-arrivals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  min-height: 18px;
}

.favorites__item-arrivals:empty {
  display: none;
}

.favorites__item-arrivals-msg {
  font-size: 0.75rem;
  color: rgba(10, 42, 102, 0.6);
}

.fav-arrival {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fav-arrival__badge.line-badge {
  height: 18px;
  min-width: 18px;
  font-size: 0.72rem;
  padding: 0 5px;
  border-radius: 999px;
  flex-shrink: 0;
}

.fav-arrival__time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-900);
}

body.is-night .favorites__item-arrivals-msg {
  color: rgba(238, 243, 255, 0.6);
}

body.is-night .fav-arrival__time {
  color: #eef3ff;
}

/* Per-favorite alert dot — marks a line/stop with an active announcement. */
.favorites__item-alert {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e23b3b;
  align-self: center;
}

.favorites__item--line .favorites__item-btn .favorites__item-alert {
  margin-left: auto;
}

.favorites__item:not(.favorites__item--line) .favorites__item-btn {
  position: relative;
}

.favorites__item:not(.favorites__item--line) .favorites__item-alert {
  position: absolute;
  top: 8px;
  right: 56px; /* clear of the absolute remove button (~4-48px) */
}

.favorites__item-remove {
  position: absolute;
  top: 50%;
  right: 4px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue-900);
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

.favorites__item-remove-icon {
  width: 14px;
  height: 14px;
}

.stats {
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.65);
}

.loading {
  position: absolute;
  inset: auto calc(20px + var(--safe-area-right)) calc(20px + var(--safe-area-bottom)) auto;
  width: min(360px, calc(100% - 24px));
  min-height: 38px;
  background: rgba(10, 42, 102, 0.9);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.3;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow);
  z-index: 600;
  opacity: 1;
  transition: opacity 0.3s ease;
  text-wrap: balance;
}

.loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.noscript {
  position: absolute;
  inset: 20px;
  background: var(--white);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  color: var(--blue-900);
  z-index: 700;
}

.leaflet-control-attribution {
  font-size: 9px;
}

body.is-night .leaflet-control-attribution {
  background: transparent;
  color: #eef3ff;
  border: none;
  border-radius: 0;
  padding: 0;
}

body.is-night .leaflet-control-attribution a {
  color: #eef3ff;
}

/* OSM's fallback raster style has no dark variant. CARTO supplies its own Dark
   Matter layer, so only transform the tile pane while the fallback is active. */
body.is-night:not(.uses-carto-basemap) .leaflet-tile-pane {
  filter: invert(0.9) hue-rotate(180deg) brightness(0.72) contrast(1.08) saturate(0.75);
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(4, 20, 55, 0.2);
  border: 2px solid var(--blue-900);
}


.leaflet-popup-tip {
  background: var(--white);
  border: none;
  box-shadow: 0 0 0 2px var(--blue-900);
}

.leaflet-popup-tip-container {
  margin-top: -2px;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-family: "Fira Sans Condensed", "Segoe UI", sans-serif;
  max-width: min(280px, 70vw);
}

.leaflet-popup-content-wrapper {
  min-width: 260px;
}

.leaflet-control-zoom a,
.leaflet-touch .leaflet-control-zoom a {
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  line-height: var(--tap-target-size);
  color: var(--blue-900);
}

body.is-night .leaflet-control-zoom a {
  background: rgba(18, 30, 56, 0.92);
  color: #eef3ff;
  border-color: rgba(255, 255, 255, 0.2);
}

body.is-night .leaflet-control-zoom a:hover {
  background: rgba(24, 40, 70, 0.95);
}

.user-location-icon {
  background: transparent;
  border: none;
  color: var(--blue-700);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 6px rgba(4, 20, 55, 0.35));
}

.user-location-icon__glyph {
  display: block;
  width: 20px;
  height: 20px;
}

.poi-marker-icon {
  border: 0;
  background: transparent;
}

.poi-marker {
  position: relative;
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
  background: #c53d1d;
  box-shadow: 0 5px 14px rgba(56, 18, 8, 0.38);
  color: #fff;
  font-family: "Fira Sans Condensed", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  transform: rotate(-45deg);
}

.poi-marker::before {
  content: "H";
  transform: rotate(45deg);
}

.poi-marker-icon .poi-marker {
  font-size: 0;
}

.popup--poi {
  min-width: 220px;
}

.popup__poi-hint {
  margin: 7px 0 0;
  color: rgba(10, 42, 102, 0.76);
  line-height: 1.4;
}

body.is-night .popup__poi-hint {
  color: rgba(238, 243, 255, 0.76);
}

.popup__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.popup__title-code {
  margin-left: 6px;
  font-weight: 600;
  color: rgba(10, 42, 102, 0.6);
}

.popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.popup--tram .popup__header {
  background: #ec7406;
  margin: -10px -12px 10px;
  padding: 10px 12px;
  border-radius: 10px 10px 0 0;
  color: #ffffff;
}

.popup--tram .popup__title-code {
  color: rgba(255, 255, 255, 0.85);
}

.popup--tram .popup__fav-btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.popup--tram .popup__fav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.popup--tram .popup__fav-btn.is-active {
  background: #ffffff;
  color: #ec7406;
}

.leaflet-popup--tram .leaflet-popup-content-wrapper {
  border-color: #ec7406;
}

.leaflet-popup--tram .leaflet-popup-tip {
  box-shadow: 0 0 0 2px #ec7406;
}

.popup__header-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-self: center;
}

.popup__meta {
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.7);
}

.popup__effects {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.popup__effect {
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 0.86rem;
  line-height: 1.35;
  border: 1px solid rgba(11, 77, 181, 0.12);
}

.popup__effect--temporary {
  background: rgba(241, 200, 74, 0.18);
  border-color: rgba(201, 156, 18, 0.35);
  color: rgba(74, 56, 0, 0.95);
}

.popup__effect--removed {
  background: rgba(209, 82, 82, 0.1);
  border-color: rgba(209, 82, 82, 0.3);
  color: rgba(107, 25, 25, 0.95);
}

.popup__effect-title {
  font-weight: 700;
  margin-bottom: 3px;
}

.popup__effect-replacement {
  margin-top: 5px;
  font-weight: 600;
}

.popup__lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0;
}

.popup__line-summary {
  margin-bottom: 8px;
}

.popup__line-badge {
  border: none;
  cursor: pointer;
  position: relative;
}

.popup__line-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, var(--tap-target-size));
  height: max(100%, var(--tap-target-size));
  transform: translate(-50%, -50%);
}

.popup--custom-effect .popup__header-main {
  gap: 6px;
}

.popup--custom-effect .popup__lines {
  margin: 4px 0 8px;
}

.popup--custom-effect .popup__effects {
  margin-top: 2px;
}

.popup__fav-btn {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-700);
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}

.popup__fav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 77, 181, 0.18);
}

.popup__fav-btn.is-active {
  background: var(--blue-700);
  color: var(--white);
  border-color: transparent;
}

.popup__fav-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.popup__buses {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.popup__section-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.popup__buses-body {
  display: grid;
  gap: 8px;
  position: relative;
}

.popup__tad {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.popup__refresh {
  font-size: 0.75rem;
  color: rgba(10, 42, 102, 0.65);
  text-align: center;
}

.popup__actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.popup__ad {
  position: relative;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(11, 77, 181, 0.12);
  min-height: 34px;
  text-align: center;
  overflow: hidden;
}

.popup__ad-label {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(10, 42, 102, 0.45);
}

/* No data-ad-format on the <ins>: AdSense sizes the ad from this box
   (full popup width x a fixed height), which fills better than the old
   horizontal-only slot while keeping the banner short. Height doubles as
   the cap so a filled ad can never dominate the popup. */
.popup__ad-ins {
  display: block;
  width: 100%;
  height: var(--popup-ad-height, 90px);
}

body.is-night .popup__ad {
  border-top-color: rgba(255, 255, 255, 0.12);
}

body.is-night .popup__ad-label {
  color: rgba(255, 255, 255, 0.45);
}

.popup__action-btn {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: inherit;
}

.popup__action-btn:link,
.popup__action-btn:visited {
  color: var(--blue-900);
}

.popup__action-btn--remove-poi {
  border-color: rgba(197, 61, 29, 0.3);
  background: rgba(197, 61, 29, 0.08);
  color: #8f2c15;
}

.popup__action-btn--remove-poi:hover {
  background: rgba(197, 61, 29, 0.14);
}

.popup__tad-btn {
  text-decoration: none;
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  min-height: var(--tap-target-size);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
}

.popup__tad-btn:link,
.popup__tad-btn:visited {
  color: var(--blue-900);
}

.popup__buses-status {
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.7);
}

.popup__buses-status--error {
  color: #a21c1c;
}

.popup__buses-status-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: rgba(10, 42, 102, 0.7);
}

.popup__buses-qr-link {
  margin-top: 8px;
  text-decoration: none;
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  min-height: var(--tap-target-size);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.popup__buses-qr-link:link,
.popup__buses-qr-link:visited {
  color: var(--blue-900);
}

.popup__buses-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.popup__buses-body.has-scroll-hint .popup__buses-list {
  padding-bottom: 34px;
}

.popup__buses-scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  min-height: 48px;
  padding: 22px 10px 6px;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.92) 42%,
      rgba(255, 255, 255, 0.98)
    );
  color: rgba(10, 42, 102, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.popup__buses-scroll-hint::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}

.popup__buses-body.has-scroll-hint:not(.is-scroll-end) .popup__buses-scroll-hint {
  display: flex;
}

.popup--tram .popup__buses-scroll-hint {
  background:
    linear-gradient(
      to bottom,
      rgba(255, 248, 242, 0),
      rgba(255, 248, 242, 0.92) 42%,
      rgba(255, 248, 242, 0.98)
    );
  color: #b85a00;
}

.popup__bus-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--ice-100);
  border: 1px solid rgba(11, 77, 181, 0.15);
  min-width: 0;
}

.popup__bus-item.has-line-color {
  background: rgba(var(--popup-bus-card-rgb), 0.13);
  border-color: rgba(var(--popup-bus-card-rgb), 0.28);
}

.popup__bus-badge {
  border: none;
  cursor: pointer;
  position: relative;
}

.popup__bus-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, var(--tap-target-size));
  height: max(100%, var(--tap-target-size));
  transform: translate(-50%, -50%);
}

.popup__bus-badge.is-disabled {
  cursor: default;
  opacity: 0.7;
}

.popup__bus-dest {
  font-size: 0.8rem;
  color: rgba(10, 42, 102, 0.7);
  min-width: 0;
  justify-self: center;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.2;
  grid-column: 2;
}

.popup__bus-min {
  font-weight: 700;
  color: var(--blue-700);
  font-size: 0.85rem;
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  line-height: 1.2;
  grid-column: 3;
  justify-self: center;
}

.popup__bus-arrival {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.popup__bus-separator {
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(27, 122, 230, 0.25);
  margin: 3px 0;
}

.popup__bus-time {
  white-space: nowrap;
}

.popup__bus-distance {
  font-size: 0.7rem;
  color: rgba(11, 77, 181, 0.7);
}

.popup__bus-occupancy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(10, 42, 102, 0.7);
  white-space: nowrap;
}

.popup__bus-occupancy::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--occ-color, #32cd32);
  box-shadow: 0 0 0 1px rgba(10, 42, 102, 0.2);
}

body.is-night .leaflet-popup-content-wrapper {
  background: #0c1424;
  color: #eef3ff;
  box-shadow: 0 16px 32px rgba(2, 6, 16, 0.45);
}

body.is-night .leaflet-popup-tip {
  background: #0c1424;
  border: none;
  box-shadow: 0 0 0 2px var(--blue-900);
}

body.is-night .popup__meta {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .popup__effect--temporary {
  background: rgba(241, 200, 74, 0.18);
  color: rgba(255, 239, 188, 0.95);
}

body.is-night .popup__effect--removed {
  background: rgba(209, 82, 82, 0.18);
  color: rgba(255, 214, 214, 0.95);
}

body.is-night .popup__title-code {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .popup__line-badge {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.is-night .popup__fav-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #eef3ff;
}

body.is-night .popup__fav-btn.is-active {
  background: var(--blue-700);
  color: var(--white);
}

body.is-night .popup__bus-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

body.is-night .popup__buses-scroll-hint {
  background:
    linear-gradient(
      to bottom,
      rgba(12, 20, 36, 0),
      rgba(12, 20, 36, 0.92) 42%,
      rgba(12, 20, 36, 0.98)
    );
  color: rgba(238, 243, 255, 0.76);
}

body.is-night .popup__bus-item.has-line-color {
  background: rgba(var(--popup-bus-card-rgb), 0.2);
  border-color: rgba(var(--popup-bus-card-rgb), 0.34);
}

body.is-night .popup__bus-dest {
  color: var(--white);
}

body.is-night .popup__buses-status {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .popup__bus-min {
  color: #7fb7ff;
}

body.is-night .popup__bus-occupancy {
  color: rgba(238, 243, 255, 0.8);
}

body.is-night .popup__refresh {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .popup__action-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #eef3ff;
}

body.is-night .popup__action-btn--remove-poi {
  border-color: rgba(255, 153, 128, 0.42);
  background: rgba(197, 61, 29, 0.2);
  color: #ffd5cb;
}

body.is-night .popup__tad-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #eef3ff;
}

body.is-night .popup__buses-status-hint {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .popup__buses-qr-link,
body.is-night .popup__buses-qr-link:link,
body.is-night .popup__buses-qr-link:visited {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #eef3ff;
}

.line-info {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 24, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 700;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.line-info.is-open {
  display: flex;
}

.line-info__card {
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  width: min(420px, 90vw);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(11, 77, 181, 0.18);
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.line-info__close {
  position: absolute;
  top: 4px;
  right: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(10, 42, 102, 0.7);
  width: var(--tap-target-size);
  height: var(--tap-target-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.line-info__close-icon {
  width: 18px;
  height: 18px;
}

.line-info__header {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "badge title"
    "hint hint"
    "meta meta";
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  margin-bottom: 0;
}

.line-info__badge {
  grid-area: badge;
  justify-self: start;
}

.line-info__title {
  grid-area: title;
  font-weight: 700;
  font-size: 1.05rem;
}

.line-info__hint {
  grid-area: hint;
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.7);
}

.line-info__meta {
  grid-area: meta;
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.65);
}

.line-info__body {
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
  color: rgba(10, 42, 102, 0.8);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.line-info__tad-alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(243, 165, 36, 0.4);
  background: rgba(243, 165, 36, 0.12);
  color: rgba(94, 58, 10, 0.92);
  font-weight: 600;
  line-height: 1.35;
}

.line-info__alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: rgba(11, 77, 181, 0.12);
  color: rgba(10, 42, 102, 0.92);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  display: grid;
  gap: 6px;
}

.line-info__alert--announcement {
  text-align: left;
}

.line-info__alert--announcements {
  gap: 10px;
}

.line-info__alert--danger {
  border-color: rgba(209, 82, 82, 0.32);
  background: rgba(209, 82, 82, 0.08);
  color: rgba(107, 25, 25, 0.96);
}

.line-info__alert--info {
  border-color: rgba(11, 77, 181, 0.16);
  background: rgba(27, 122, 230, 0.08);
}

.line-info__alert-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.line-info__announcement-list {
  display: grid;
  gap: 8px;
}

.line-info__announcement-btn {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(11, 77, 181, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  padding: 9px 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.line-info__announcement-btn:hover {
  border-color: rgba(11, 77, 181, 0.3);
  background: rgba(255, 255, 255, 0.92);
}

.line-info__alert-heading {
  font-size: 0.95rem;
  font-weight: 700;
}

.line-info__route-status {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(243, 165, 36, 0.34);
  border-radius: 12px;
  background: rgba(243, 165, 36, 0.08);
}

.line-info__route-status-heading {
  color: rgba(94, 58, 10, 0.94);
  font-weight: 700;
}

.line-info__route-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(94, 58, 10, 0.12);
}

.line-info__route-status-direction {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-info__route-status-direction span {
  overflow: hidden;
  color: rgba(10, 42, 102, 0.68);
  font-size: 0.78rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-info__route-status-value {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(27, 122, 230, 0.1);
  color: rgba(10, 42, 102, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.line-info__route-status-row.is-changed .line-info__route-status-value {
  background: rgba(243, 165, 36, 0.18);
  color: rgba(94, 58, 10, 0.96);
}

.line-info__alert-time {
  font-size: 0.9rem;
  font-weight: 600;
}

.line-info__alert-fixture {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 700;
}

.line-info__alert-fixture img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.line-info__tad {
  display: flex;
  gap: 8px;
}

.line-info__tad-btn {
  flex: 1;
  border: 1px solid rgba(11, 77, 181, 0.2);
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--blue-900);
  background: var(--ice-100);
  font-weight: 600;
  text-align: center;
}

.line-info__empty {
  font-size: 0.9rem;
  color: rgba(10, 42, 102, 0.65);
}

.line-info__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.line-info__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(10, 42, 102, 0.55);
}

.line-info__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.line-info__links-left,
.line-info__links-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.line-info__links-left {
  flex: 1 1 auto;
  min-width: 0;
}

.line-info__links-right {
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.line-info__links .popup__fav-btn {
  width: var(--tap-target-size);
  height: var(--tap-target-size);
}

.line-info__links .popup__fav-icon {
  width: 14px;
  height: 14px;
}

.line-info__actions {
  display: flex;
  justify-content: flex-end;
}

.line-info__action-btn {
  border: 1px solid rgba(11, 77, 181, 0.2);
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--blue-900);
  background: var(--ice-100);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.line-info__stops {
  border: 1px solid rgba(11, 77, 181, 0.15);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(245, 249, 255, 0.7);
  display: grid;
  gap: 10px;
  min-height: 0;
}

.line-info__map-action {
  display: flex;
  justify-content: center;
  margin: 6px 0 2px;
}

.line-info__stops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.line-info__stops-body {
  max-height: 220px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.line-info__route-toggle {
  display: inline-flex;
  gap: 6px;
  background: var(--ice-100);
  border: 1px solid rgba(11, 77, 181, 0.2);
  border-radius: 999px;
  padding: 4px;
}

.line-info__route-btn {
  border: none;
  background: transparent;
  color: var(--blue-900);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}

.line-info__route-btn.is-active {
  background: var(--blue-700);
  color: var(--white);
}

.line-info__stops-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: none;
  position: relative;
}

.line-info__stops-list::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(11, 77, 181, 0.35);
}

.line-info__stops-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
}

.line-info__stops-list li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-700);
  transform: translate(-50%, -50%);
}

.line-info__stop-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(11, 77, 181, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.line-info__stop {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}

.line-info__stop.is-disabled {
  cursor: default;
  opacity: 0.6;
}

.line-info__stop-text {
  display: inline-block;
  transform: skewX(-8deg);
}

.line-info__stop-lines {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.line-info__stop-badge {
  border: none;
  cursor: pointer;
}

.line-info__stops[data-active-route="ida"] .line-info__stops-list[data-route="ida"],
.line-info__stops[data-active-route="vuelta"] .line-info__stops-list[data-route="vuelta"] {
  display: block;
}

.line-info__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(11, 77, 181, 0.2);
  min-height: var(--tap-target-size);
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--blue-900);
  background: var(--ice-100);
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  text-align: center;
}

.line-info__favorite-btn {
  position: relative;
  z-index: 1;
}

.line-info__details {
  border: 1px solid rgba(11, 77, 181, 0.15);
  border-radius: 14px;
  padding: 8px 12px;
  background: rgba(245, 249, 255, 0.8);
}

.line-info__details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--blue-700);
  list-style: none;
}

.line-info__details summary::-webkit-details-marker {
  display: none;
}

.line-info__schedule {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.line-info__schedule-block {
  display: grid;
  gap: 8px;
}

.line-info__schedule-season {
  font-weight: 700;
  color: var(--blue-900);
}

.line-info__schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.line-info__schedule-table th,
.line-info__schedule-table td {
  text-align: left;
  padding: 6px 4px;
  vertical-align: top;
  border-bottom: 1px solid rgba(11, 77, 181, 0.12);
}

.line-info__schedule-table th {
  color: rgba(10, 42, 102, 0.7);
  font-weight: 600;
}

.line-info__schedule-empty {
  margin-top: 8px;
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.65);
}

body.is-night .line-info__card {
  background: #0c1424;
  color: #eef3ff;
  border-color: rgba(255, 255, 255, 0.12);
}

body.is-night .line-info__meta,
body.is-night .line-info__label {
  color: rgba(238, 243, 255, 0.6);
}

body.is-night .line-info__hint {
  color: rgba(238, 243, 255, 0.75);
}

body.is-night .line-info__empty {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .line-info__tad-alert {
  background: rgba(243, 165, 36, 0.18);
  border-color: rgba(243, 165, 36, 0.4);
  color: #ffe1a3;
}

body.is-night .line-info__alert {
  background: rgba(11, 77, 181, 0.2);
  border-color: rgba(11, 77, 181, 0.35);
  color: #eef3ff;
}

body.is-night .line-info__announcement-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #eef3ff;
}

body.is-night .line-info__announcement-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

body.is-night .line-info__alert--danger {
  border-color: rgba(255, 148, 148, 0.26);
  background: rgba(209, 82, 82, 0.18);
}

body.is-night .line-info__alert-logos img {
  background: none;
  border: none;
}

body.is-night .line-info__tad-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #eef3ff;
  border-color: rgba(255, 255, 255, 0.12);
}

.stop-effect-marker-icon {
  background: transparent;
  border: 0;
}

.temporary-stop-marker-icon {
  background: transparent;
  border: 0;
}

.temporary-stop-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--temporary-stop-size, 12px);
  height: var(--temporary-stop-size, 12px);
  border-radius: 999px;
  background: #f1c84a;
  border: 1px solid #b07a00;
  box-shadow: 0 1px 4px rgba(95, 70, 0, 0.18);
}

.temporary-stop-marker__inner {
  width: var(--temporary-stop-inner-size, 4px);
  height: var(--temporary-stop-inner-size, 4px);
  border-radius: 999px;
  background: #ffffff;
}

.stop-effect-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(10, 42, 102, 0.18);
  line-height: 1;
}

.stop-effect-marker--temporary {
  width: 13px;
  height: 13px;
  background: #f1c84a;
  color: #5f4600;
  border: 1.5px solid rgba(95, 70, 0, 0.34);
  box-shadow: 0 2px 6px rgba(95, 70, 0, 0.16);
}

.stop-effect-marker--removed {
  width: 16px;
  height: 16px;
  background: #fff;
  color: #d15252;
  border: 2px solid rgba(209, 82, 82, 0.48);
  font-size: 0.95rem;
}

.stop-effect-marker__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.is-night .line-info__link {
  background: rgba(255, 255, 255, 0.08);
  color: #eef3ff;
  border-color: rgba(255, 255, 255, 0.12);
}

body.is-night .line-info__action-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #eef3ff;
  border-color: rgba(255, 255, 255, 0.12);
}

body.is-night .line-info__stops {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

body.is-night .line-info__route-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

body.is-night .line-info__route-btn {
  color: #eef3ff;
}

body.is-night .line-info__route-btn.is-active {
  background: #eef3ff;
  color: #0c1424;
}

body.is-night .line-info__stops-list::before {
  background: rgba(238, 243, 255, 0.4);
}

body.is-night .line-info__stops-list li {
  color: #eef3ff;
}

body.is-night .line-info__stops-list li::before {
  background: #eef3ff;
}

body.is-night .line-info__stop-row {
  background: rgba(10, 22, 44, 0.6);
  border-color: rgba(238, 243, 255, 0.18);
}

body.is-night .line-info__details {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

body.is-night .line-info__details summary {
  color: #eef3ff;
}

body.is-night .line-info__schedule-season {
  color: #eef3ff;
}

body.is-night .line-info__schedule-table th,
body.is-night .line-info__schedule-table td {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.is-night .line-info__schedule-table th {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .line-info__schedule-empty {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .site-footer {
  background: rgba(12, 20, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

body.is-night .site-footer a {
  color: #eef3ff;
}

body.is-night .site-footer__divider {
  color: rgba(238, 243, 255, 0.55);
}

body.is-night .topbar {
  background: none;
  border-color: transparent;
  box-shadow: none;
}

body.is-night .topbar__main {
  background: rgba(12, 20, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

body.is-night .topbar,
body.is-night .topbar .brand__subtitle,
body.is-night .topbar .control,
body.is-night .topbar .line-picker__button,
body.is-night .topbar .favorites__button,
body.is-night .topbar .mode-toggle,
body.is-night .topbar .stop-search__toggle {
  color: #eef3ff;
}

body.is-night .topbar .line-picker__announcement-hint {
  color: var(--line-hint-fg, #eef3ff);
}

body.is-night .topbar .control__input,
body.is-night .topbar .line-picker__button,
body.is-night .topbar .favorites__button,
body.is-night .topbar .mode-toggle,
body.is-night .topbar .stop-search__toggle {
  background: rgba(18, 30, 56, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
}

body.is-night .topbar .line-picker__chevron {
  color: rgba(238, 243, 255, 0.8);
}

body.is-night .line-picker__panel {
  background: rgba(12, 20, 36, 0.95);
  border-color: rgba(255, 255, 255, 0.16);
}

body.is-night .line-picker__option {
  background: rgba(18, 30, 56, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
  color: #eef3ff;
}

body.is-night .stop-search__panel,
body.is-night .favorites__panel,
body.is-night .lang-picker__panel {
  background: rgba(12, 20, 36, 0.95);
  border-color: rgba(255, 255, 255, 0.16);
}

body.is-night .stop-search__input,
body.is-night .favorites__item-btn,
body.is-night .favorites__item-remove,
body.is-night .lang-flag {
  background: rgba(18, 30, 56, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
  color: #eef3ff;
}

body.is-night .stop-search__input {
  color: #eef3ff;
}

body.is-night .stop-search__empty,
body.is-night .favorites__empty,
body.is-night .favorites__item-code {
  color: rgba(238, 243, 255, 0.7);
}

body.is-night .favorites__section-title,
body.is-night .stop-search__section-title {
  color: rgba(238, 243, 255, 0.6);
}

body.is-night .favorites__section-divider {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 720px) {
  .topbar {
    top: var(--safe-top-offset);
    left: var(--safe-left-offset);
    right: auto;
    width: max-content;
    max-width: min(calc(100% - var(--safe-left-offset) - var(--safe-right-offset)), 368px);
  }

  .topbar__main {
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }

  .topbar__controls {
    width: max-content;
    margin-left: auto;
    justify-content: start;
  }

  .brand__title {
    font-size: 1.6rem;
  }

  .brand {
    align-items: center;
    text-align: center;
  }

  .brand__logo {
    width: 52px;
    height: 52px;
  }

  .brand__subtitle {
    font-size: 0.86rem;
    line-height: 1.05;
    max-width: 112px;
  }

  .loading {
    right: var(--safe-right-offset);
    bottom: var(--safe-bottom-offset);
  }

  .floating-lang {
    left: var(--safe-left-offset);
    bottom: var(--safe-bottom-offset);
  }

  .site-footer {
    bottom: var(--safe-bottom-offset);
  }
}

@media (max-width: 540px) {
  .cookie-consent {
    grid-template-columns: 1fr;
  }

  .cookie-consent__actions {
    justify-content: flex-end;
  }

  .topbar {
    --actions-gap: 8px;
    --control-height: var(--tap-target-size);
    right: auto;
    width: max-content;
    max-width: calc(100% - var(--safe-left-offset) - var(--safe-right-offset));
  }

  .topbar__main {
    gap: 4px;
    padding: 6px;
    border-radius: 16px;
  }

  .brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: var(--control-height);
    height: var(--control-height);
    gap: 0;
  }

  .line-picker__announcement-hint {
    width: min(100%, 320px);
  }

  .topbar__controls {
    column-gap: var(--actions-gap);
    row-gap: 0;
    width: max-content;
  }

  .topbar .control__label {
    display: none;
  }

  .brand__logo {
    width: 30px;
    height: 30px;
  }

  .brand__subtitle {
    display: none;
  }

  .topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--actions-gap);
    flex: 0 0 auto;
    width: auto;
  }

  .topbar__actions-left,
  .topbar__actions-right {
    display: flex;
    align-items: center;
    gap: var(--actions-gap);
    flex: 0 0 auto;
  }

  .topbar__button-grid {
    display: flex;
    align-items: center;
    gap: var(--actions-gap);
    width: auto;
    max-width: calc(100vw - var(--safe-left-offset) - var(--safe-right-offset) - 12px);
  }

  .topbar__button-grid .line-picker__actions {
    display: flex;
    align-items: center;
    gap: var(--actions-gap);
    flex: 0 0 auto;
  }

  .topbar__button-grid .line-picker__actions.is-hidden {
    display: none;
  }

  .topbar__button-grid .line-picker {
    width: var(--line-picker-width, max-content);
    justify-self: start;
    max-width: 88px;
  }

  .stop-search__input,
  .line-selector__search-input {
    font-size: 16px;
  }

  .line-picker__button,
  .favorites__button {
    justify-content: center;
  }

  .line-picker__button {
    width: var(--line-picker-width, max-content);
    max-width: 88px;
    padding: 4px 8px;
  }

  .line-picker.is-selected,
  .line-picker.is-selected .line-picker__button {
    max-width: 70px;
  }

  .line-picker.is-selected .line-picker__button {
    padding-inline: 4px;
  }

  .favorites__button {
    width: var(--control-height);
    height: var(--control-height);
    padding: 0;
  }

  .favorites__count {
    font-size: 0.65rem;
    padding: 1px 5px;
    top: -3px;
    right: -3px;
  }

  .mode-toggle {
    width: var(--control-height);
    height: var(--control-height);
    padding: 0;
    min-width: var(--control-height);
  }

  .stop-search__toggle {
    width: var(--control-height);
    height: var(--control-height);
    padding: 0;
  }

  .line-picker__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: max-content;
    max-width: 80vw;
    margin-top: 0;
  }

  .favorites__panel {
    position: absolute;
    width: min(260px, 80vw);
    margin-top: 0;
    right: 0;
  }

  .stop-search__panel {
    left: 50%;
    right: auto;
    width: min(320px, 85vw);
    max-width: 85vw;
  }

  .stop-line-label__badges {
    max-width: min(240px, 80vw);
  }

  .stop-line-label--pos-top .stop-line-label__badges {
    transform:
      translate(calc(-50% + var(--stop-label-shift-x)),
        calc(-100% - 14px - var(--stop-label-shift))) scale(1);
  }

  .stop-line-label--pos-bottom .stop-line-label__badges {
    transform:
      translate(calc(-50% + var(--stop-label-shift-x)),
        calc(0% + 14px + var(--stop-label-shift))) scale(1);
  }

  .stop-line-label--pos-left .stop-line-label__badges {
    transform: translate(calc(-100% - 14px - var(--stop-label-shift)), -50%) scale(1);
  }

  .stop-line-label--pos-right .stop-line-label__badges {
    transform: translate(calc(0% + 14px + var(--stop-label-shift)), -50%) scale(1);
  }

  .stop-line-label--pos-top-right .stop-line-label__badges,
  .stop-line-label--pos-top-left .stop-line-label__badges,
  .stop-line-label--pos-bottom-right .stop-line-label__badges,
  .stop-line-label--pos-bottom-left .stop-line-label__badges {
    transform-origin: center;
  }

  .leaflet-control-zoom a {
    width: var(--tap-target-size);
    height: var(--tap-target-size);
    line-height: var(--tap-target-size);
    font-size: 1.2rem;
  }

  .stops__panel {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .site-footer {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.78rem;
  }

  .site-footer__toggle {
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--blue-900);
    color: var(--white);
    box-shadow: 0 12px 28px rgba(4, 20, 55, 0.18);
    cursor: pointer;
    line-height: 0;
    outline: none;
    overflow: hidden;
  }

  .site-footer__toggle-icon {
    width: 20px;
    height: 20px;
  }

  .site-footer__toggle:focus-visible {
    box-shadow:
      0 12px 28px rgba(4, 20, 55, 0.18),
      0 0 0 3px rgba(27, 122, 230, 0.24);
  }

  .site-footer__column {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    width: 84px;
    padding: 7px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(11, 77, 181, 0.2);
    box-shadow: 0 12px 28px rgba(4, 20, 55, 0.18);
  }

  .site-footer.is-open .site-footer__column {
    display: flex;
  }

  .site-footer__languages .lang-picker__panel {
    left: calc(100% + 8px);
    bottom: 0;
    transform: none;
  }

  body.is-night .site-footer__toggle,
  body.is-night .site-footer__column {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    color: #eef3ff;
  }

  body.is-night .site-footer__toggle {
    background: var(--blue-900);
    color: var(--white);
  }

  body.is-night .site-footer__column {
    background: rgba(12, 20, 36, 0.94);
  }
}

@media (max-width: 360px) {
  .topbar {
    --actions-gap: 1px;
  }

  .topbar__main {
    padding: 3px;
  }

  .brand__logo {
    width: 24px;
    height: 24px;
  }

  .line-picker.is-selected,
  .line-picker.is-selected .line-picker__button {
    max-width: 56px;
  }

}

.live-bus-marker-icon {
  background: transparent;
  border: none;
}

.live-bus-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.live-bus-marker__bus {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 56px;
}

.live-bus-marker__image {
  display: block;
  width: 46px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.live-bus-marker__badge {
  position: absolute;
  top: 14px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) scale(0.82);
  transform-origin: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Tram popup text styling */
.popup--tram {
  font-family: "Rotis II Sans Pro", "Fira Sans Condensed", sans-serif;
}

.popup--tram .popup__title {
  font-family: "Rotis II Sans Pro", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.popup--tram .popup__section-title {
  font-family: "Rotis II Sans Pro", sans-serif;
  font-weight: 800;
}

.popup--tram .popup__bus-dest {
  font-family: "Rotis II Sans Pro", sans-serif;
}

.popup--tram .popup__bus-min {
  color: #ec7406;
}

.popup--tram .popup__bus-time {
  color: #ec7406;
}

.popup--tram .popup__bus-distance {
  color: #ec7406;
}

/* Tram popup cards fall back to light orange only when a line color is unavailable. */
.popup--tram .popup__bus-item:not(.has-line-color) {
  background: #fff8f2;
  border-color: rgba(236, 116, 6, 0.2);
}

/* Tram popup buttons - light orange */
.popup--tram .popup__action-btn {
  background: #fff8f2;
  border-color: rgba(236, 116, 6, 0.3);
  color: #b85a00;
}

.popup--tram .popup__action-btn:hover {
  background: #ffefe0;
}

.popup--tram .popup__fav-btn {
  background: #fff8f2;
  border-color: rgba(236, 116, 6, 0.25);
}

.popup--tram .popup__fav-btn:hover {
  background: #ffefe0;
}

.popup--tram .popup__fav-btn .popup__fav-icon {
  stroke: #ec7406;
  fill: transparent;
}

.popup--tram .popup__fav-btn.is-active .popup__fav-icon {
  fill: #ec7406;
}

/* Tram stops in favorites list - light orange */
.favorites__item--tram .favorites__item-btn {
  background: #fff8f2;
  border-color: rgba(236, 116, 6, 0.2);
}

.favorites__item--tram .favorites__item-btn:hover {
  background: #ffefe0;
}

.favorites__item--tram .favorites__item-remove {
  background: #fff8f2;
  border-color: rgba(236, 116, 6, 0.2);
}

.favorites__item--tram .favorites__item-remove:hover {
  background: #ffefe0;
}

/* Tram line info popup styling */
.line-info--tram {
  font-family: "Rotis II Sans Pro", "Fira Sans Condensed", sans-serif;
}

.line-info--tram .line-info__title {
  font-family: "Rotis II Sans Pro", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: #000 !important;
}

/* Hide TIPO/meta for tram lines */
.line-info--tram .line-info__row:first-child {
  display: none;
}

.line-info--tram .line-info__meta {
  display: none !important;
}

.line-info--tram .line-info__hint {
  display: none !important;
}

/* Square line badge for tram in header */
.line-info--tram .line-info__badge {
  border-radius: 15% !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  font-family: "Rotis II Sans Pro", sans-serif !important;
  font-weight: 800 !important;
  font-size: 1.1rem !important;
}

/* Square badges for connecting tram lines in stops */
.line-info--tram .line-info__stop-badge {
  border-radius: 15% !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  font-family: "Rotis II Sans Pro", sans-serif !important;
  font-weight: 800 !important;
  font-size: 0.75rem !important;
  padding: 0 !important;
}

/* Stop names - bold not italic */
.line-info--tram .line-info__stop-text {
  font-style: normal !important;
  font-weight: 700 !important;
  font-family: "Rotis II Sans Pro", sans-serif !important;
  transform: none !important;
  display: block;
}

/* Light orange backgrounds for tram line info PARADAS section */
.line-info--tram .line-info__stops {
  background: #fff8f2;
  border-color: rgba(236, 116, 6, 0.2);
}

.line-info--tram .line-info__stops-header {
  background: #fff8f2;
}

.line-info--tram .line-info__stops-body {
  background: #fff8f2 !important;
  border-color: rgba(236, 116, 6, 0.2) !important;
}

.line-info--tram .line-info__stops-list {
  background: #fff8f2;
}

.line-info--tram .line-info__stop {
  background: transparent !important;
  width: 100%;
}

.line-info--tram .line-info__stop:hover {
  background: transparent !important;
}

.line-info--tram .line-info__stop-row {
  background: #fff8f2;
  align-items: stretch;
}

/* Ida/Vuelta toggle container - light orange background */
.line-info--tram .line-info__route-toggle {
  background: #fff8f2 !important;
  border-color: rgba(236, 116, 6, 0.2) !important;
}

/* Ida/Vuelta toggle buttons - light orange styling */
.line-info--tram .line-info__route-btn {
  background: #fff8f2 !important;
  border: 1px solid rgba(236, 116, 6, 0.2) !important;
  color: #b85a00 !important;
  font-family: "Rotis II Sans Pro", sans-serif !important;
  font-weight: 700 !important;
}

.line-info--tram .line-info__route-btn:hover {
  background: #fff8f2 !important;
}

.line-info--tram .line-info__route-btn.is-active {
  background: #ec7406 !important;
  color: #fff !important;
}

.line-info--tram .line-info__link,
.line-info--tram .line-info__map-btn {
  background: #fff8f2 !important;
  border-color: rgba(236, 116, 6, 0.25) !important;
  color: #b85a00 !important;
}

.line-info--tram .line-info__link:hover,
.line-info--tram .line-info__map-btn:hover {
  background: #ffefe0 !important;
}

/* Fix favorite button at bottom - uses .line-info__favorite-btn.popup__fav-btn */
.line-info--tram .line-info__favorite-btn,
.line-info--tram .line-info__favorite-btn.popup__fav-btn,
.line-info--tram .popup__fav-btn {
  background: #fff8f2 !important;
  border: 1px solid rgba(236, 116, 6, 0.25) !important;
}

.line-info--tram .line-info__favorite-btn:hover,
.line-info--tram .line-info__favorite-btn.popup__fav-btn:hover,
.line-info--tram .popup__fav-btn:hover {
  background: #ffefe0 !important;
}

.line-info--tram .line-info__favorite-btn .popup__fav-icon,
.line-info--tram .popup__fav-btn .popup__fav-icon,
.line-info--tram .line-info__favorite-btn svg,
.line-info--tram .popup__fav-btn svg {
  stroke: #ec7406 !important;
  fill: transparent !important;
}

.line-info--tram .line-info__favorite-btn.is-active .popup__fav-icon,
.line-info--tram .popup__fav-btn.is-active .popup__fav-icon,
.line-info--tram .line-info__favorite-btn.is-active svg,
.line-info--tram .popup__fav-btn.is-active svg {
  fill: #ec7406 !important;
}

/* Share button */
.line-info--tram .line-info__share-btn {
  background: #fff8f2 !important;
  border-color: rgba(236, 116, 6, 0.25) !important;
  color: #b85a00 !important;
}

.line-info--tram .line-info__share-btn:hover {
  background: #ffefe0 !important;
}

body.is-night .line-info--tram .line-info__title {
  color: #eef3ff !important;
}

body.is-night .line-info--tram .line-info__body,
body.is-night .line-info--tram .line-info__label {
  color: rgba(238, 243, 255, 0.82) !important;
}

body.is-night .line-info--tram .line-info__stops,
body.is-night .line-info--tram .line-info__stops-header,
body.is-night .line-info--tram .line-info__stops-body,
body.is-night .line-info--tram .line-info__stops-list {
  background: rgba(18, 30, 56, 0.88) !important;
  border-color: rgba(236, 116, 6, 0.22) !important;
}

body.is-night .line-info--tram .line-info__stops-list::before {
  background: rgba(255, 222, 196, 0.22) !important;
}

body.is-night .line-info--tram .line-info__stops-list li::before {
  background: rgba(255, 222, 196, 0.78) !important;
}

body.is-night .line-info--tram .line-info__stop,
body.is-night .line-info--tram .line-info__stop-text,
body.is-night .line-info--tram .line-info__stops-list li {
  color: #eef3ff !important;
}

body.is-night .line-info--tram .line-info__stop-row {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body.is-night .line-info--tram .line-info__stop:hover,
body.is-night .line-info--tram .line-info__stop:hover .line-info__stop-row {
  background: rgba(255, 255, 255, 0.1) !important;
}

body.is-night .line-info--tram .line-info__route-toggle {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(236, 116, 6, 0.24) !important;
}

body.is-night .line-info--tram .line-info__route-btn {
  background: transparent !important;
  border-color: transparent !important;
  color: rgba(255, 237, 219, 0.88) !important;
}

body.is-night .line-info--tram .line-info__route-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

body.is-night .line-info--tram .line-info__route-btn.is-active {
  background: #ec7406 !important;
  color: #fff7ef !important;
}

body.is-night .line-info--tram .line-info__link,
body.is-night .line-info--tram .line-info__map-btn,
body.is-night .line-info--tram .line-info__share-btn,
body.is-night .line-info--tram .line-info__favorite-btn,
body.is-night .line-info--tram .line-info__favorite-btn.popup__fav-btn,
body.is-night .line-info--tram .popup__fav-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(236, 116, 6, 0.24) !important;
  color: #ffd9b3 !important;
}

body.is-night .line-info--tram .line-info__link:hover,
body.is-night .line-info--tram .line-info__map-btn:hover,
body.is-night .line-info--tram .line-info__share-btn:hover,
body.is-night .line-info--tram .line-info__favorite-btn:hover,
body.is-night .line-info--tram .line-info__favorite-btn.popup__fav-btn:hover,
body.is-night .line-info--tram .popup__fav-btn:hover {
  background: rgba(236, 116, 6, 0.16) !important;
}
