/* UniPulse TfL widget polish */
.tfl-section {
  padding-top: 56px;
  padding-bottom: 56px;
}

.tfl-section .section-title {
  padding-bottom: 24px;
}

.tfl-widget {
  width: 100%;
}

.tfl-widget-station-search .tube-search {
  display: flex;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.tfl-widget-station-search .tube-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--default-color, #444), transparent 78%);
  border-radius: 10px;
  background: var(--surface-color, #fff);
}

.tfl-widget-station-search .tube-btn {
  min-height: 48px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--hts-primary, #152D75);
  color: #fff;
  font-weight: 600;
}

.tfl-widget-service-board {
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--default-color, #444), transparent 88%);
  border-radius: 14px;
  background: var(--surface-color, #fff);
}

.tube-service-board-list {
  display: grid;
  gap: 12px;
}

.tube-service-board-item {
  padding: 14px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--default-color, #444), transparent 90%);
}
.tube-service-board-item:last-child { border-bottom: 0; }

.lines-board__head {
  margin-bottom: 22px;
}

.lines-board__head .hint {
  color: var(--hts-secondary, #CD1719);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.lines-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tfl-line-card {
  display: block;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--default-color, #444), transparent 88%);
  border-top: 4px solid var(--hts-primary, #152D75);
  border-radius: 12px;
  background: var(--surface-color, #fff);
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}

.tfl-line-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.07);
}

.tfl-line-card__head,
.tfl-line-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tfl-line-card__foot {
  margin-top: 12px;
  color: color-mix(in srgb, var(--default-color, #444), transparent 32%);
  font-size: .82rem;
}

.tube-line-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.tube-line-status-pill.is-good { background: #e9f7ef; color: #176b3a; }
.tube-line-status-pill.is-warn { background: #fff4d6; color: #805b00; }
.tube-line-status-pill.is-bad { background: #fdeaea; color: #9b1c1c; }
.tube-line-status-pill.is-unknown { background: #eef1f4; color: #59636e; }

.tfl-widget-popular-stations .tube-card {
  border: 1px solid color-mix(in srgb, var(--default-color, #444), transparent 88%);
  border-radius: 12px;
  background: var(--surface-color, #fff);
  transition: transform .16s ease, box-shadow .16s ease;
}
.tfl-widget-popular-stations a:hover .tube-card {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.06) !important;
}

@media (max-width: 991.98px) {
  .lines-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
  .tfl-section { padding-top: 40px; padding-bottom: 40px; }
  .tfl-widget-station-search .tube-search { flex-direction: column; }
  .tfl-widget-station-search .tube-btn { width: 100%; }
  .lines-quick-grid { grid-template-columns: 1fr; }
  .tfl-line-card__head { align-items: flex-start; }
  .tube-line-status-pill { white-space: normal; text-align: right; }
}


/* ==========================================================
   TfL Station Search v2
   eigenes Autocomplete statt Browser-Datalist
   ========================================================== */

.tfl-widget-station-search {
  position: relative;
  z-index: 20;
}

.tfl-widget-station-search .tube-search {
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
}

.tfl-widget-station-search .tube-search__field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.tfl-widget-station-search .tube-input {
  width: 100%;
  min-height: 50px;
  padding: 10px 48px 10px 44px;
  border: 2px solid #1c1c1c;
  border-radius: 11px;
  background: var(--surface-color, #fff);
  color: var(--default-color, #222);
  font-size: 1rem;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.tfl-widget-station-search .tube-input:focus {
  border-color: var(--hts-primary, #152D75);
  box-shadow: 0 0 0 3px rgba(var(--hts-primary-rgb, 21,45,117), .10);
}

.tfl-widget-station-search .tube-search__icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1.05rem;
  pointer-events: none;
}

.tfl-widget-station-search .tube-search__clear {
  position: absolute;
  top: 50%;
  right: 13px;
  z-index: 3;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  line-height: 1;
}

.tfl-widget-station-search .tube-search__clear:hover {
  background: rgba(0,0,0,.05);
  color: var(--hts-primary, #152D75);
}

.tfl-widget-station-search .tube-btn {
  min-width: 96px;
  min-height: 50px;
  padding: 10px 20px;
  border: 0;
  border-radius: 11px;
  background: var(--hts-primary, #152D75);
  color: #fff;
  font-weight: 700;
}

.tfl-widget-station-search .tube-search-results {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(15,23,42,.16);
}

.tfl-widget-station-search .tube-search-result {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background: transparent;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.tfl-widget-station-search .tube-search-result:last-child {
  border-bottom: 0;
}

.tfl-widget-station-search .tube-search-result:hover,
.tfl-widget-station-search .tube-search-result.is-active {
  background: #f3f6fb;
}

.tfl-widget-station-search .tube-search-result__main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.tfl-widget-station-search .tube-search-result__name {
  font-size: .98rem;
  line-height: 1.2;
  color: #172033;
}

.tfl-widget-station-search .tube-search-result__lines {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tfl-widget-station-search .tube-search-line {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8edf5;
  color: #273449;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.1;
}

.tfl-widget-station-search .tube-search-result__arrow {
  flex: 0 0 auto;
  color: var(--hts-primary, #152D75);
  font-size: 1rem;
}

.tfl-widget-station-search .tube-search-results__empty {
  padding: 15px 16px;
  color: #64748b;
  font-size: .92rem;
}

@media (max-width: 575.98px) {
  .tfl-widget-station-search .tube-search {
    gap: 8px;
  }

  .tfl-widget-station-search .tube-input {
    min-height: 48px;
    padding-left: 40px;
    font-size: 16px; /* verhindert iOS-Autozoom */
  }

  .tfl-widget-station-search .tube-btn {
    min-width: 86px;
    min-height: 48px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .tfl-widget-station-search .tube-search-results {
    max-height: min(420px, 55vh);
  }

  .tfl-widget-station-search .tube-search-result {
    min-height: 64px;
    padding: 12px 13px;
  }

  .tfl-widget-station-search .tube-search-result__name {
    font-size: .95rem;
  }

  .tfl-widget-station-search .tube-search-line {
    font-size: .68rem;
  }
}



/* ==========================================================
   TfL Station Search v3
   - eigener Autocomplete
   - keine technischen Slugs sichtbar
   - Trefferpanel liegt im normalen Seitenfluss
   - dadurch nie mehr von der nächsten Section abgeschnitten
   ========================================================== */

.tfl-section--station-search {
  position: relative;
  z-index: 3;
  overflow: visible !important;
}

.tfl-section--station-search .container,
.tfl-section--station-search .tfl-widget {
  overflow: visible !important;
}

.tfl-widget-station-search {
  position: relative;
  z-index: 4;
}

.tfl-widget-station-search .tube-search {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
}

.tfl-widget-station-search .tube-search__field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.tfl-widget-station-search .tube-search__control {
  position: relative;
}

.tfl-widget-station-search .tube-input {
  width: 100%;
  min-height: 50px;
  padding: 10px 48px 10px 44px;
  border: 2px solid #1c1c1c;
  border-radius: 11px;
  background: var(--surface-color, #fff);
  color: var(--default-color, #222);
  font-size: 1rem;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.tfl-widget-station-search .tube-input:focus {
  border-color: var(--hts-primary, #152D75);
  box-shadow: 0 0 0 3px rgba(var(--hts-primary-rgb, 21,45,117), .10);
}

.tfl-widget-station-search .tube-search__icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1.05rem;
  pointer-events: none;
}

.tfl-widget-station-search .tube-search__clear {
  position: absolute;
  top: 50%;
  right: 13px;
  z-index: 3;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  line-height: 1;
}

.tfl-widget-station-search .tube-search__clear:hover {
  background: rgba(0,0,0,.05);
  color: var(--hts-primary, #152D75);
}

.tfl-widget-station-search .tube-btn {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 50px;
  padding: 10px 20px;
  border: 0;
  border-radius: 11px;
  background: var(--hts-primary, #152D75);
  color: #fff;
  font-weight: 700;
}

.tfl-widget-station-search .tube-search-results {
  position: relative;
  z-index: 10;
  width: 100%;
  max-height: 430px;
  margin-top: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(15,23,42,.16);
}

.tfl-widget-station-search .tube-search-result {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background: transparent;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.tfl-widget-station-search .tube-search-result:hover,
.tfl-widget-station-search .tube-search-result.is-active {
  background: #f3f7fc;
}

.tfl-widget-station-search .tube-search-result__main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.tfl-widget-station-search .tube-search-result__name {
  font-size: 1rem;
  line-height: 1.2;
  color: #172033;
}

.tfl-widget-station-search .tube-search-result__lines {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tfl-widget-station-search .tube-search-line {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8edf5;
  color: #273449;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.1;
}

.tfl-widget-station-search .tube-search-result__arrow {
  flex: 0 0 auto;
  color: var(--hts-primary, #152D75);
  font-size: 1rem;
}

.tfl-widget-station-search .tube-search-results__empty {
  padding: 17px 16px;
  color: #64748b;
  font-size: .92rem;
}

.tfl-widget-station-search .tube-search-results__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 15px;
  border-top: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.98);
  box-shadow: 0 -5px 12px rgba(255,255,255,.92);
}

.tfl-widget-station-search .tube-search-results__more,
.tfl-widget-station-search .tube-search-results__all {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--hts-primary, #152D75);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}

.tfl-widget-station-search .tube-search-results__more:hover,
.tfl-widget-station-search .tube-search-results__all:hover {
  text-decoration: underline;
}

.tfl-widget-station-search .tube-search-results__roundel {
  position: relative;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 5px solid #df1b2f;
  border-radius: 50%;
}

.tfl-widget-station-search .tube-search-results__roundel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -7px;
  width: 29px;
  height: 7px;
  transform: translateY(-50%);
  background: var(--hts-primary, #152D75);
}

@media (max-width: 575.98px) {
  .tfl-widget-station-search .tube-search {
    gap: 8px;
  }

  .tfl-widget-station-search .tube-input {
    min-height: 48px;
    padding-left: 40px;
    font-size: 16px; /* verhindert iOS-Autozoom */
  }

  .tfl-widget-station-search .tube-btn {
    min-width: 86px;
    min-height: 48px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .tfl-widget-station-search .tube-search-results {
    max-height: min(420px, 62vh);
  }

  .tfl-widget-station-search .tube-search-result {
    min-height: 64px;
    padding: 11px 13px;
  }

  .tfl-widget-station-search .tube-search-result__name {
    font-size: .95rem;
  }

  .tfl-widget-station-search .tube-search-line {
    font-size: .68rem;
  }

  .tfl-widget-station-search .tube-search-results__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 11px 13px;
  }

  .tfl-widget-station-search .tube-search-results__all {
    padding-left: 34px;
  }
}
