
/* =========================================================
   DWORZEC MIELEC — TABLICA ODJAZDÓW I PRZYJAZDÓW
   Nowoczesna wersja granatowo-złota
   Desktop: czytelna tablica dworcowa
   Mobile: wygodne karty kursów
   ========================================================= */

#tablica-mielec {
  --tm-navy: #123047;
  --tm-navy-dark: #09263d;
  --tm-navy-light: #1d435c;
  --tm-gold: #ffd54a;
  --tm-gold-dark: #987000;

  --tm-text: #17212b;
  --tm-muted: #536273;
  --tm-background: #f1f4f7;
  --tm-surface: #ffffff;
  --tm-border: #c7d0d9;
  --tm-border-light: #e0e6ec;

  --tm-green: #147d48;
  --tm-red: #b42318;
  --tm-focus: #1674bd;

  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  color: var(--tm-text);
  background: var(--tm-background);
  border: 1px solid var(--tm-border-light);
  border-radius: 14px;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  box-sizing: border-box;
}

#tablica-mielec *,
#tablica-mielec *::before,
#tablica-mielec *::after {
  box-sizing: border-box;
}

#tablica-mielec button,
#tablica-mielec input {
  font: inherit;
}

#tablica-mielec button {
  cursor: pointer;
}

#tablica-mielec [hidden] {
  display: none !important;
}

/* =========================================================
   DOSTĘPNOŚĆ
   ========================================================= */

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

#tablica-mielec :focus-visible {
  outline: 3px solid var(--tm-focus);
  outline-offset: 3px;
  position: relative;
  z-index: 2;
}

/* =========================================================
   NAGŁÓWEK
   ========================================================= */

#tablica-mielec .tm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 32px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,213,74,.09), transparent 30%),
    linear-gradient(120deg, #09263d 0%, #123047 65%, #1b4058 100%);
  border-bottom: 5px solid var(--tm-gold);
}

#tablica-mielec .tm-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

#tablica-mielec .tm-logo {
  display: block;
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  object-fit: contain;
}

#tablica-mielec .tm-brand-copy {
  min-width: 0;
}

#tablica-mielec .tm-eyebrow {
  margin-bottom: 4px;
  color: var(--tm-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
}

#tablica-mielec .tm-header h1 {
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: .5px;
}

#tablica-mielec .tm-address {
  margin-top: 7px;
  color: #dbe7ef;
  font-size: 14px;
}

#tablica-mielec .tm-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  text-align: right;
}

#tablica-mielec #tm-clock {
  color: var(--tm-gold);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

#tablica-mielec #tm-date {
  margin-top: 7px;
  color: #e4edf4;
  font-size: 14px;
}

/* =========================================================
   ZAKŁADKI I WYSZUKIWARKA
   ========================================================= */

#tablica-mielec .tm-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 26px;
  background: #fff;
  border-bottom: 1px solid var(--tm-border-light);
}

#tablica-mielec .tm-tabs {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

#tablica-mielec .tm-tab {
  min-height: 48px;
  padding: 11px 26px;
  border: 2px solid var(--tm-navy);
  border-radius: 8px;
  color: var(--tm-navy);
  background: #fff;
  font-size: 15px;
  font-weight: 900;
  transition: .18s ease;
}

#tablica-mielec .tm-tab:hover {
  background: #edf2f6;
}

#tablica-mielec .tm-tab.is-active {
  color: var(--tm-navy-dark);
  background: var(--tm-gold);
  border-color: var(--tm-gold);
  box-shadow: 0 3px 8px rgba(9,38,61,.12);
}

#tablica-mielec .tm-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(440px, 100%);
  min-width: 180px;
}

#tablica-mielec .tm-search-icon {
  position: absolute;
  left: 15px;
  color: var(--tm-muted);
  font-size: 22px;
  line-height: 1;
  pointer-events: none;
}

#tablica-mielec .tm-search input {
  width: 100%;
  min-height: 48px;
  padding: 11px 15px 11px 44px;
  border: 2px solid var(--tm-border);
  border-radius: 8px;
  color: var(--tm-text);
  background: #fff;
  font-size: 15px;
}

#tablica-mielec .tm-search input::placeholder {
  color: #667485;
  opacity: 1;
}

#tablica-mielec .tm-search input:focus {
  border-color: var(--tm-focus);
}

/* =========================================================
   INFORMACJE O ROZKŁADZIE
   ========================================================= */

#tablica-mielec .tm-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 26px;
  color: var(--tm-muted);
  background: #eaf0f4;
  border-bottom: 1px solid var(--tm-border-light);
  font-size: 14px;
}

#tablica-mielec .tm-status-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--tm-text);
  font-weight: 800;
}

#tablica-mielec .tm-live-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--tm-green);
  box-shadow: 0 0 0 4px rgba(20,125,72,.12);
}

#tablica-mielec .tm-validity {
  text-align: right;
}

/* =========================================================
   FILTR DNI
   ========================================================= */

#tablica-mielec .tm-daybar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 17px 26px;
  background: #fff;
  border-bottom: 1px solid var(--tm-border-light);
}

#tablica-mielec .tm-filter-label {
  color: var(--tm-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
}

#tablica-mielec .tm-day-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#tablica-mielec .tm-day {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--tm-border);
  border-radius: 7px;
  color: var(--tm-text);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  transition: .18s ease;
}

#tablica-mielec .tm-day:hover {
  background: #edf2f6;
}

#tablica-mielec .tm-day.is-active {
  color: var(--tm-navy-dark);
  background: var(--tm-gold);
  border-color: var(--tm-gold-dark);
}

/* =========================================================
   TABELA
   ========================================================= */

#tablica-mielec .tm-panel {
  min-width: 0;
  background: #fff;
}

#tablica-mielec .tm-table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

#tablica-mielec .tm-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border-spacing: 0;
  background: #fff;
  color: var(--tm-text);
  font-size: 15px;
}

#tablica-mielec .tm-table thead th {
  padding: 16px 15px;
  color: #fff;
  background: var(--tm-navy-dark);
  border-bottom: 4px solid var(--tm-gold);
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
  white-space: nowrap;
}

#tablica-mielec .tm-table tbody td {
  padding: 15px;
  border-bottom: 1px solid var(--tm-border-light);
  vertical-align: middle;
}

#tablica-mielec .tm-table tbody tr:nth-child(even) {
  background: #f5f7f9;
}

#tablica-mielec .tm-table tbody tr:hover {
  background: #edf3f7;
}

#tablica-mielec .tm-time-col {
  width: 110px;
}

#tablica-mielec .tm-platform-col {
  width: 115px;
}

#tablica-mielec .tm-carrier-col {
  width: 180px;
}

#tablica-mielec .tm-days-col {
  width: 165px;
}

#tablica-mielec .tm-time {
  display: inline-block;
  color: var(--tm-navy-dark);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#tablica-mielec .tm-destination {
  display: block;
  color: var(--tm-text);
  font-size: 16px;
  font-weight: 900;
}

#tablica-mielec .tm-via {
  display: block;
  margin-top: 4px;
  color: var(--tm-muted);
  font-size: 13px;
  font-weight: 500;
}

#tablica-mielec .tm-platform {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid #b28a13;
  border-radius: 7px;
  color: #2e2406;
  background: var(--tm-gold);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

#tablica-mielec .tm-carrier {
  color: var(--tm-text);
  font-size: 14px;
  font-weight: 700;
}

#tablica-mielec .tm-line {
  display: inline-flex;
  align-items: center;
  margin: 6px 0 0 5px;
  padding: 4px 8px;
  color: #123047 !important;
  background: #fff !important;
  border: 1px solid #aebdca;
  border-left: 4px solid var(--tm-gold);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

#tablica-mielec .tm-days {
  color: var(--tm-muted);
  font-size: 13px;
  font-weight: 700;
}

#tablica-mielec .tm-past {
  opacity: .65;
}

#tablica-mielec .tm-past .tm-time {
  color: #64717d;
}

#tablica-mielec .tm-section-row td {
  padding: 11px 15px;
  color: var(--tm-gold);
  background: var(--tm-navy-light);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}

#tablica-mielec .tm-message {
  padding: 30px 18px !important;
  color: var(--tm-muted);
  text-align: center;
  font-size: 15px;
}

#tablica-mielec .tm-empty {
  padding: 25px 18px;
  color: var(--tm-muted);
  background: #fff;
  text-align: center;
  font-weight: 700;
}

/* =========================================================
   ZAZNACZANIE KURSU
   ========================================================= */

#tablica-mielec .tm-table tbody tr.tm-course-row {
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

#tablica-mielec .tm-table tbody tr.tm-course-row:hover {
  background-color: #e8f0f6;
}

#tablica-mielec .tm-table tbody tr.tm-course-row:focus-visible {
  outline: 3px solid var(--tm-focus);
  outline-offset: -3px;
}

#tablica-mielec .tm-table tbody tr.tm-course-row.tm-course-selected {
  background-color: #fff8dc;
  box-shadow: inset 5px 0 0 var(--tm-gold-dark);
}

/* =========================================================
   LEGENDA
   ========================================================= */

#tablica-mielec .tm-legend {
  display: block;
  width: 100%;
  margin: 0;
  padding: 17px;
  color: var(--tm-text);
  background: #fff;
  border: 1px solid #d3dce4;
  border-left: 5px solid var(--tm-gold);
  border-radius: 9px;
  overflow: hidden;
}

#tablica-mielec .tm-legend[hidden] {
  display: none !important;
}

#tablica-mielec .tm-legend-content {
  padding: 3px 5px;
}

#tablica-mielec .tm-legend-selected-title {
  margin-bottom: 12px;
  padding-bottom: 12px;
  color: var(--tm-navy-dark);
  border-bottom: 2px solid var(--tm-gold);
  font-size: 17px;
  font-weight: 900;
}

#tablica-mielec .tm-legend-heading {
  margin: 15px 0 9px;
  color: var(--tm-navy);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
}

#tablica-mielec .tm-legend-list {
  display: grid;
  grid-template-columns: minmax(70px, auto) 1fr;
  gap: 0;
  margin: 0;
  padding: 0;
}

#tablica-mielec .tm-legend-item {
  display: contents;
}

#tablica-mielec .tm-legend-code,
#tablica-mielec .tm-legend-description {
  margin: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #e7ebef;
  line-height: 1.45;
}

#tablica-mielec .tm-legend-code {
  min-width: 48px;
  color: #123047 !important;
  background: #fff !important;
  border: 1px solid #aebdca;
  border-left: 4px solid var(--tm-gold);
  border-radius: 5px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

#tablica-mielec .tm-legend-description {
  color: var(--tm-text);
  overflow-wrap: anywhere;
}

#tablica-mielec .tm-legend-empty {
  margin: 10px 0 0;
  color: var(--tm-muted);
  font-size: 14px;
}

#tablica-mielec .tm-legend-colors .tm-legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 6px 0;
  border-bottom: 1px solid #edf0f2;
}

#tablica-mielec .tm-legend-colors .tm-legend-code {
  display: none;
}

#tablica-mielec .tm-legend-colors .tm-color-swatch {
  display: block !important;
  width: 48px !important;
  min-width: 48px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  margin: 0;
  color: transparent !important;
  background-color: var(--tm-swatch-color, #0000ff) !important;
  border: 2px solid var(--tm-swatch-color, #0000ff) !important;
  border-radius: 6px !important;
  font-size: 0 !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

#tablica-mielec .tm-table tbody tr.tm-legend-row,
#tablica-mielec .tm-table tbody tr.tm-legend-row:hover {
  background: #f2f6f9 !important;
}

#tablica-mielec .tm-table tbody tr.tm-legend-row > td {
  padding: 12px 14px 17px;
  border-bottom: 2px solid #d5dce3;
}

/* =========================================================
   STOPKA I KOMUNIKATY
   ========================================================= */

#tablica-mielec .tm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 16px 25px;
  color: #e5edf3;
  background: var(--tm-navy-dark);
  border-top: 3px solid var(--tm-gold);
  font-size: 13px;
}

#tablica-mielec .tm-error {
  margin: 15px 20px;
  padding: 13px 16px;
  border: 1px solid var(--tm-red);
  border-left: 5px solid var(--tm-red);
  border-radius: 6px;
  color: #7a1710;
  background: #fff0ee;
  font-size: 14px;
  font-weight: 700;
}

/* =========================================================
   TABLETY
   ========================================================= */

@media (max-width: 850px) {
  #tablica-mielec .tm-header {
    padding: 21px;
  }

  #tablica-mielec .tm-controls {
    align-items: stretch;
    flex-direction: column;
  }

  #tablica-mielec .tm-search {
    width: 100%;
  }
}

/* =========================================================
   TELEFONY — KARTY ZAMIAST TABELI
   ========================================================= */

@media (max-width: 600px) {
  #tablica-mielec {
    border-radius: 0;
    font-size: 15px;
  }

  #tablica-mielec .tm-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 15px;
  }

  #tablica-mielec .tm-brand {
    gap: 12px;
  }

  #tablica-mielec .tm-logo {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  #tablica-mielec .tm-eyebrow {
    font-size: 10px;
    letter-spacing: 1.2px;
  }

  #tablica-mielec .tm-header h1 {
    font-size: 25px;
  }

  #tablica-mielec .tm-address {
    font-size: 12px;
  }

  #tablica-mielec .tm-clock {
    align-items: flex-start;
    text-align: left;
  }

  #tablica-mielec #tm-clock {
    font-size: 34px;
  }

  #tablica-mielec .tm-controls,
  #tablica-mielec .tm-daybar {
    padding: 14px;
  }

  #tablica-mielec .tm-tabs {
    width: 100%;
  }

  #tablica-mielec .tm-tab {
    flex: 1;
    padding: 10px 8px;
    font-size: 14px;
  }

  #tablica-mielec .tm-meta {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 15px;
  }

  #tablica-mielec .tm-validity {
    text-align: left;
  }

  #tablica-mielec .tm-daybar {
    align-items: flex-start;
    flex-direction: column;
  }

  #tablica-mielec .tm-day-buttons {
    width: 100%;
  }

  #tablica-mielec .tm-day {
    flex: 1 1 auto;
    padding: 8px 10px;
    font-size: 13px;
  }

  /* Nagłówki tabeli nie są potrzebne w widoku kart. */
  #tablica-mielec .tm-table {
    min-width: 0;
    display: block;
    width: 100%;
  }

  #tablica-mielec .tm-table thead {
    display: none;
  }

  #tablica-mielec .tm-table tbody {
    display: block;
    width: 100%;
    padding: 10px;
  }

  #tablica-mielec .tm-table tbody tr.tm-course-row {
    position: relative;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 5px 12px;
    width: 100%;
    margin-bottom: 10px;
    padding: 13px;
    border: 1px solid #d6dfe7;
    border-left: 4px solid var(--tm-navy);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(9,38,61,.06);
  }

  #tablica-mielec .tm-table tbody tr.tm-course-row:nth-child(even) {
    background: #fff;
  }

  #tablica-mielec .tm-table tbody tr.tm-course-row:hover {
    background: #f4f7f9;
  }

  #tablica-mielec .tm-table tbody tr.tm-course-row.tm-course-selected {
    background: #fff9e5;
    border-left-color: var(--tm-gold-dark);
  }

  #tablica-mielec .tm-table tbody tr.tm-course-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  /* Godzina — pierwsza kolumna. */
  #tablica-mielec .tm-table tbody tr.tm-course-row > td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: start;
    padding-top: 2px;
  }

  #tablica-mielec .tm-time {
    color: var(--tm-navy-dark);
    font-size: 21px;
    line-height: 1.2;
  }

  /* Kierunek. */
  #tablica-mielec .tm-table tbody tr.tm-course-row > td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  #tablica-mielec .tm-destination {
    font-size: 15px;
    line-height: 1.35;
  }

  #tablica-mielec .tm-via {
    font-size: 12px;
  }

  #tablica-mielec .tm-line {
    margin: 6px 0 0;
    font-size: 11px;
  }

  /* Stanowisko. */
  #tablica-mielec .tm-table tbody tr.tm-course-row > td:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    margin-top: 8px;
  }

  #tablica-mielec .tm-platform {
    min-width: 36px;
    min-height: 29px;
    padding: 4px 8px;
    font-size: 13px;
  }

  /* Przewoźnik. */
  #tablica-mielec .tm-table tbody tr.tm-course-row > td:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    padding-top: 7px;
    font-size: 12px;
  }

  #tablica-mielec .tm-carrier {
    font-size: 12px;
  }

  /* Dni kursowania. */
  #tablica-mielec .tm-table tbody tr.tm-course-row > td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    padding-top: 3px;
  }

  #tablica-mielec .tm-days {
    font-size: 11px;
  }

  /* Nagłówki sekcji. */
  #tablica-mielec .tm-table tbody tr.tm-section-row {
    display: block;
    margin: 8px 0 12px;
  }

  #tablica-mielec .tm-table tbody tr.tm-section-row td {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
  }

  /* Wiersz legendy pozostaje pełnej szerokości. */
  #tablica-mielec .tm-table tbody tr.tm-legend-row {
    display: block;
    margin: -3px 0 13px;
    padding: 0;
    background: transparent !important;
  }

  #tablica-mielec .tm-table tbody tr.tm-legend-row > td {
    display: block;
    padding: 0;
    border: 0;
  }

  #tablica-mielec .tm-legend {
    padding: 12px;
    border-radius: 8px;
  }

  #tablica-mielec .tm-legend-selected-title {
    font-size: 15px;
  }

  #tablica-mielec .tm-legend-list {
    grid-template-columns: minmax(55px, auto) 1fr;
  }

  #tablica-mielec .tm-legend-code,
  #tablica-mielec .tm-legend-description {
    padding: 7px 6px;
    font-size: 12px;
  }

  #tablica-mielec .tm-legend-colors .tm-legend-item {
    min-height: 44px;
  }

  #tablica-mielec .tm-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  #tablica-mielec .tm-message {
    display: block;
    padding: 25px 12px !important;
  }
}

/* =========================================================
   BARDZO MAŁE TELEFONY
   ========================================================= */

@media (max-width: 360px) {
  #tablica-mielec .tm-table tbody {
    padding: 7px;
  }

  #tablica-mielec .tm-table tbody tr.tm-course-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 5px 8px;
    padding: 10px;
  }

  #tablica-mielec .tm-time {
    font-size: 19px;
  }

  #tablica-mielec .tm-destination {
    font-size: 14px;
  }

  #tablica-mielec .tm-day {
    font-size: 12px;
  }
}

/* =========================================================
   OGRANICZENIE ANIMACJI
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  #tablica-mielec *,
  #tablica-mielec *::before,
  #tablica-mielec *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
