: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);
  --control-height: 38px;
  --actions-gap: 10px;
}

* {
  box-sizing: border-box;
}

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;
}

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

.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: 16px;
  left: 16px;
  right: auto;
  width: max-content;
  max-width: calc(100% - 32px);
  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);
  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);
}

.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-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;
  row-gap: 10px;
}

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

.topbar__button-grid {
  display: grid;
  grid-template-columns: var(--line-picker-width, max-content) var(--line-picker-width, max-content);
  column-gap: var(--actions-gap);
  row-gap: var(--actions-gap);
  align-items: center;
  justify-content: start;
}

.topbar__button-grid .line-picker {
  align-self: end;
}

.topbar__actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--line-picker-width, max-content) var(--line-picker-width, max-content);
  column-gap: var(--actions-gap);
  align-items: center;
  justify-content: start;
}

.topbar__actions-left,
.topbar__actions-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--line-picker-width, max-content);
}

.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;
  right: 0;
  top: calc(100% + 8px);
  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;
}

.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__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: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 550;
}

.lang-picker {
  position: relative;
}

.site-footer {
  position: fixed;
  left: 16px;
  bottom: 16px;
  transform: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 10px 12px;
  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 a {
  color: var(--blue-700);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  white-space: pre-line;
}

.site-footer > * {
  width: 100%;
  padding: 6px 0;
}

.site-footer > a {
  display: block;
  width: 100%;
}

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

.site-footer__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 12px;
}

.site-footer__row > * {
  justify-self: center;
}

.site-footer__row a {
  width: auto;
}

.site-footer__row--icons {
  column-gap: 10px;
}

.site-footer__row--icons .site-footer__divider--vertical {
  height: 20px;
}

.site-footer__row--privacy {
  grid-template-columns: auto auto;
  column-gap: 8px;
}

.site-footer__privacy-center {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  background-color: transparent;
  color: var(--blue-900);
  font-size: 14px;
  line-height: 1;
  text-align: center;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
}

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

#ezPrivacyCenter {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--blue-700) !important;
}

.site-footer__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  line-height: 0;
  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 > * + * {
  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;
}

.site-footer__row .site-footer__divider--vertical {
  padding: 0;
  display: inline-block;
  height: 32px;
}

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;
  display: inline-flex;
  justify-content: center;
  width: auto;
}

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

.site-footer__languages .lang-flag {
  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;
  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);
  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: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 2;
  align-self: end;
  width: var(--line-picker-width, max-content);
}

.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;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.line-picker__action:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

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

.line-picker__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  padding-right: 30px;
  width: var(--line-picker-width, max-content);
  min-width: 0;
}

.line-picker__value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  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: absolute;
  right: 12px;
}

.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: 72px;
  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 {
  font-size: 1rem;
  line-height: 1;
}

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

.locate-toggle__icon {
  font-size: 1rem;
  line-height: 1;
}

.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(--white);
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 0.8rem;
  min-width: 40px;
  text-align: center;
  letter-spacing: 0.3px;
}

.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: 40px;
  height: 40px;
  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);
}

.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;
  fill: currentColor;
}

.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% + 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;
}

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

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

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

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

.favorites__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;
  flex: 1;
  text-align: left;
  display: grid;
  gap: 2px;
}

.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__item-remove {
  border: none;
  background: rgba(11, 77, 181, 0.12);
  color: var(--blue-900);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
}

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

.loading {
  position: absolute;
  inset: auto 20px 20px auto;
  background: rgba(10, 42, 102, 0.9);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow);
  z-index: 600;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.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;
}

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

.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 {
  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);
}

/* Ezoic privacy center */
#ezPrivacyCenter {
  background: rgba(255, 255, 255, 0.95);
  color: var(--blue-900);
  border: 1px solid rgba(11, 77, 181, 0.2);
  box-shadow: var(--shadow);
}

.ez-switch-view-btn.ez_twentytwentytwo_corners {
  background-color: var(--blue-700) !important;
}

#ez-cookie-dialog-wrapper #ez-cookie-dialog.ez_banner #ez-accept-all {
  background: var(--blue-700) !important;
  color: var(--white) !important;
  border: none !important;
}

#ez-cookie-dialog-wrapper #ez-cookie-dialog #ez-accept-necessary {
  background: var(--blue-700) !important;
  color: var(--white) !important;
  border: none !important;
}

#ez-cookie-dialog-wrapper #ez-cookie-dialog.ez_banner {
  background: var(--white) !important;
  border-top: 5px solid var(--blue-700) !important;
}

#ez-cookie-dialog-wrapper #ez-cookie-dialog a {
  color: var(--blue-700) !important;
  text-decoration: none !important;
}

body.is-night #ezPrivacyCenter {
  background: transparent !important;
  background-color: transparent !important;
  color: #eef3ff !important;
  border: none !important;
  box-shadow: none !important;
}

body.is-night #ez-accept-all {
  background: var(--blue-700) !important;
  color: #eef3ff !important;
  border: none !important;
}

.user-location-icon {
  background: transparent;
  border: none;
  color: var(--blue-700);
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(4, 20, 55, 0.35));
}

.user-location-icon__glyph {
  display: block;
  line-height: 1;
}

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

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

.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__lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.popup__line-badge {
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 3px 8px;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.popup__fav-btn {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-700);
  width: 34px;
  height: 34px;
  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;
}

.popup__tad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.popup__actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.popup__action-btn {
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.popup__tad-btn {
  text-decoration: none;
  border: 1px solid rgba(11, 77, 181, 0.2);
  background: var(--ice-100);
  color: var(--blue-900);
  padding: 6px 10px;
  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-status {
  font-size: 0.85rem;
  color: rgba(10, 42, 102, 0.7);
}

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

.popup__buses-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.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-badge {
  background: var(--line-color, var(--blue-700));
  color: var(--white);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.8rem;
  min-width: 44px;
  text-align: center;
  letter-spacing: 0.4px;
  border: none;
  cursor: pointer;
  font: inherit;
}

.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-time {
  white-space: nowrap;
}

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;
}

body.is-night .popup__meta {
  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__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__action-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #eef3ff;
}

body.is-night .popup__tad-btn {
  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;
}

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

.line-info__card {
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow);
  border: 1px solid rgba(11, 77, 181, 0.18);
  position: relative;
}

.line-info__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: rgba(10, 42, 102, 0.7);
}

.line-info__header {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.line-info__badge {
  justify-self: start;
  padding: 6px 12px;
  font-size: 0.9rem;
}

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

.line-info__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);
}

.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__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;
}

.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;
}

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

.line-info__stops-body {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.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: 9px;
  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: 6px;
  top: 0.8em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-700);
  transform: translateY(-50%);
}

.line-info__stop-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.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 {
  padding: 2px 6px;
  font-size: 0.65rem;
  letter-spacing: 0.3px;
  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 {
  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;
}

.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__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__tad-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #eef3ff;
  border-color: rgba(255, 255, 255, 0.12);
}

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__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: 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 .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);
}

@media (max-width: 720px) {
  .topbar {
    top: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    padding: 12px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

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

  .brand__title {
    font-size: 1.6rem;
  }

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

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

  .loading {
    right: 12px;
    bottom: 12px;
  }

  .floating-lang {
    left: 12px;
    bottom: 12px;
  }

  .site-footer {
    bottom: 12px;
  }
}

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

  .topbar__controls {
    column-gap: var(--actions-gap);
    row-gap: 8px;
  }

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

  .line-picker__button {
    width: 100%;
    padding: 6px 8px;
  }

  .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;
    left: auto;
  }

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

  .site-footer {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
}

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