/* Base Themes Variables */
:root, [data-theme="cyber-dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #131d31;
  --bg-tertiary: #1e293b;
  --bg-card: #182235;
  --bg-card-hover: #1f2d45;
  --border-color: #2a3b53;
  --border-active: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #0284c7;
  --accent-cyan: #38bdf8;
  --header-bg: rgba(11, 15, 25, 0.95);
  --status-on-time: #10b981;
  --status-delayed: #ef4444;
  --status-warning: #f59e0b;
  --km-color: #22c55e;
  --skm-color: #facc15;
  --ic-color: #f97316;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="rail-classic"] {
  --bg-primary: #070e1c;
  --bg-secondary: #0d1b33;
  --bg-tertiary: #152747;
  --bg-card: #11223e;
  --bg-card-hover: #172d52;
  --border-color: #1e3860;
  --border-active: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-blue: #2563eb;
  --accent-cyan: #f59e0b;
  --header-bg: rgba(7, 14, 28, 0.95);
}

[data-theme="mazovia-green"] {
  --bg-primary: #05140f;
  --bg-secondary: #0a241c;
  --bg-tertiary: #10362b;
  --bg-card: #0d2e23;
  --bg-card-hover: #143e30;
  --border-color: #1a4a3b;
  --border-active: #10b981;
  --text-primary: #f0fdf4;
  --text-secondary: #a7f3d0;
  --text-muted: #6ee7b7;
  --accent-blue: #059669;
  --accent-cyan: #10b981;
  --header-bg: rgba(5, 20, 15, 0.95);
}

[data-theme="warsaw-red"] {
  --bg-primary: #140d10;
  --bg-secondary: #22141a;
  --bg-tertiary: #331c26;
  --bg-card: #291820;
  --bg-card-hover: #37202c;
  --border-color: #4a2736;
  --border-active: #ef4444;
  --text-primary: #fff1f2;
  --text-secondary: #fecdd3;
  --text-muted: #fda4af;
  --accent-blue: #dc2626;
  --accent-cyan: #ef4444;
  --header-bg: rgba(20, 13, 16, 0.95);
}

[data-theme="oled-contrast"] {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #171717;
  --bg-card: #121212;
  --bg-card-hover: #1c1c1c;
  --border-color: #383838;
  --border-active: #facc15;
  --text-primary: #ffffff;
  --text-secondary: #e5e5e5;
  --text-muted: #a3a3a3;
  --accent-blue: #eab308;
  --accent-cyan: #facc15;
  --header-bg: rgba(0, 0, 0, 0.98);
}

[data-theme="light-clean"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #cbd5e1;
  --border-active: #0284c7;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-blue: #0284c7;
  --accent-cyan: #0284c7;
  --header-bg: rgba(255, 255, 255, 0.96);
  --status-on-time: #15803d;
  --status-delayed: #dc2626;
  --status-warning: #d97706;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: 70px;
  min-height: 100vh;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--header-bg, rgba(11, 15, 25, 0.95));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px 8px;
  transition: background-color 0.25s, border-color 0.25s;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}

.version-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.version-badge:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.brand:hover {
  opacity: 0.9;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--status-on-time);
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-on-time);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; filter: drop-shadow(0 0 4px var(--status-on-time)); }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.header-btn {
  position: relative;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.header-btn:active {
  transform: scale(0.92);
}

.header-btn.rotating svg {
  animation: spin 0.8s linear infinite;
}

.notify-badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Auto-refresh timer line */
.refresh-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.refresh-bar {
  height: 100%;
  background: var(--accent-cyan);
  width: 100%;
  transition: width 1s linear;
}

/* Search & Station Selector */
.search-container {
  position: relative;
  margin-bottom: 8px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper > svg,
.search-input-wrapper .search-glass-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.station-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.station-input:focus {
  border-color: var(--accent-cyan);
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.autocomplete-dropdown.open {
  display: block;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.autocomplete-item:hover, .autocomplete-item.active {
  background-color: var(--bg-card-hover);
}

.autocomplete-item-name {
  font-weight: 500;
}

/* Quick Hubs Carousel */
.quick-stations {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.quick-stations::-webkit-scrollbar {
  display: none;
}

.station-pill {
  white-space: nowrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.station-pill.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-cyan);
}

/* Main Container */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

/* Disruptions Card */
.disruption-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.disruption-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disruption-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--status-warning);
}

.disruption-badge {
  background: var(--status-warning);
  color: #000;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.disruption-arrow {
  transition: transform 0.2s;
  color: var(--text-muted);
}

.disruption-card.open .disruption-arrow {
  transform: rotate(180deg);
}

.disruption-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  display: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.disruption-card.open .disruption-body {
  display: block;
}

.disruption-item {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.disruption-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.disruption-item-source {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.disruption-item-heading {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.disruption-item-text {
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Operator Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.station-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.current-station-heading {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-fav-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.28);
  padding: 6px 8px;
  color: #ef4444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  flex-shrink: 0;
}

.station-fav-btn svg {
  stroke: #ef4444;
  fill: none;
  transition: all 0.2s;
}

.station-fav-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.16);
  border-color: #ef4444;
  transform: scale(1.1);
}

.station-fav-btn:hover svg {
  fill: rgba(239, 68, 68, 0.3);
}

.station-fav-btn.active,
.station-fav-btn.is-fav {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.station-fav-btn.active svg,
.station-fav-btn.is-fav svg {
  fill: #ef4444;
  stroke: #ef4444;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
}

.operator-filters {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Departure Cards List */
.departures-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.departure-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, background-color 0.15s;
}

.dep-card-header {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.departure-card:active {
  transform: scale(0.99);
}

.dep-time-col {
  display: flex;
  flex-direction: column;
}

.scheduled-time {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.scheduled-time.delayed {
  color: var(--status-delayed);
}

.delay-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 3px;
  border-radius: 4px;
}

.delay-tag.on-time {
  color: var(--status-on-time);
}

.delay-tag.late {
  color: var(--status-delayed);
}

.delay-tag.departed {
  color: var(--text-muted);
}

.dep-main-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.dep-carrier-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Prominent Line Badge (S1, S2, S4, R1, R3, RL, RE...) */
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 36px;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.line-badge.skm {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #000;
  border: 1px solid #fef08a;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.35);
}

.line-badge.km {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border: 1px solid #86efac;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

.line-badge.ic {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #fff;
  border: 1px solid #fdba74;
}

.line-badge.other {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.train-number-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.train-carrier-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.countdown-bullet {
  color: var(--border-color);
  font-size: 0.75rem;
}

.countdown-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Unified Countdown Badges (Dynamic Coloring) */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.78rem;
  border-radius: 6px;
  padding: 2px 8px;
  line-height: 1.3;
  transition: all 0.25s ease-in-out;
}

/* >= 5 min: BIAŁY POGRUBIONY */
.countdown-badge.normal-white {
  color: var(--text-primary);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* < 5 min: ŻÓŁTY POGRUBIONY */
.countdown-badge.warning-yellow {
  color: #facc15;
  font-weight: 800;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.5);
  text-shadow: 0 0 6px rgba(250, 204, 21, 0.4);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.2);
}

/* < 2 min: CZERWONY POGRUBIONY (w tym odjazd teraz) */
.countdown-badge.urgent-red {
  color: #f87171;
  font-weight: 900;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.6);
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: pulseUrgent 2s infinite ease-in-out;
}

/* Odjechał: szary stonowany */
.countdown-badge.departed {
  color: var(--text-muted);
  font-weight: 500;
  font-style: italic;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

@keyframes pulseUrgent {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 8px 1px rgba(239, 68, 68, 0.55);
  }
}

.destination {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.destination-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.dest-fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: transform 0.15s ease, background-color 0.15s ease;
  line-height: 1;
  color: #ef4444;
}

.dest-fav-btn svg {
  display: block;
  stroke: #ef4444;
  transition: fill 0.2s ease, stroke 0.2s ease, transform 0.15s ease;
}

.dest-fav-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  transform: scale(1.18);
}

.dest-fav-btn:hover svg {
  fill: rgba(239, 68, 68, 0.25);
}

.dest-fav-btn:active {
  transform: scale(0.9);
}

.dest-fav-btn.is-fav svg {
  fill: #ef4444;
  stroke: #ef4444;
  filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.55));
}

.dest-fav-btn.timeline-station-fav {
  padding: 2px 4px;
  margin-left: 4px;
}

.dest-fav-btn.stop-fav-btn {
  padding: 2px 3px;
  margin-left: 6px;
}

.dep-platform-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.platform-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.track-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ========================================= */
/* VIEW 0: HOME CHOICE (GŁÓWNY WYBÓR - CENTRUM) */
/* ========================================= */
.home-choice-view {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 12px 36px;
}

.home-choice-wrapper {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.home-hero {
  text-align: center;
  padding: 8px 4px;
}

.home-hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.home-hero-title {
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.25;
}

.home-hero-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.choice-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.choice-card {
  width: 100%;
  display: grid;
  grid-template-columns: 60px 1fr 28px;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  padding: 20px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  user-select: none;
  font-family: inherit;
  color: inherit;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.choice-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.choice-card:active {
  transform: scale(0.97);
  background-color: var(--bg-tertiary);
}

.choice-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-card-icon.station-color {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(56, 189, 248, 0.25) 100%);
  color: var(--accent-cyan);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.2);
}

.choice-card-icon.route-color {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(56, 189, 248, 0.25) 100%);
  color: var(--status-on-time);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.choice-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.choice-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.choice-card-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.choice-card-pill {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.choice-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.choice-card-preview {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.choice-card-arrow {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.2s;
}

.choice-card:hover .choice-card-arrow,
.choice-card:active .choice-card-arrow {
  color: var(--accent-cyan);
  transform: translateX(4px);
}

/* Home disruptions notice pill (na górze ekranu) */
.home-disruptions-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(239, 68, 68, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  margin-bottom: 22px;
  transition: all 0.25s ease;
}

.home-disruptions-notice:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(239, 68, 68, 0.18));
  border-color: rgba(245, 158, 11, 0.7);
  transform: translateY(-1px);
}

.home-disruptions-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-disruptions-btn-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

/* Home Daily Trains Statistics Widget (na dole pod kafelkami) */
.home-stats-section {
  width: 100%;
  margin-top: 28px;
}

.home-stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

.home-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.home-stats-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-stats-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.home-stats-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

.home-stats-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.stats-op-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.stats-op-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-op-btn.active {
  background: var(--accent-cyan);
  color: #0b1120;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-box-icon {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.stat-box-num {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
  color: var(--text-primary);
}

.stat-box.stat-total .stat-box-num {
  color: #38bdf8;
}

.stat-box.stat-completed .stat-box-num {
  color: #22c55e;
}

.stat-box.stat-transit .stat-box-num {
  color: #3b82f6;
}

.stat-box.stat-upcoming .stat-box-num {
  color: #f59e0b;
}

.stat-box-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-box-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
  animation: pulseDot 1.5s infinite;
  vertical-align: middle;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Progress bar */
.stats-progress-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
}

.stats-progress-bar {
  display: flex;
  height: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.stats-bar-seg {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-bar-seg.completed {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.stats-bar-seg.transit {
  background: linear-gradient(90deg, #0284c7, #3b82f6);
}

.stats-bar-seg.upcoming {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.stats-progress-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.completed { background: #22c55e; }
.legend-dot.transit { background: #3b82f6; }
.legend-dot.upcoming { background: #f59e0b; }

/* Sub-Nav Bar (on Station & Line views) */
.sub-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.nav-back-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  touch-action: manipulation;
}

.nav-back-pill:hover,
.nav-back-pill:active {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: var(--accent-cyan);
}

.nav-switch-pill {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  touch-action: manipulation;
}

.nav-switch-pill:hover,
.nav-switch-pill:active {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  border-color: var(--accent-cyan);
}

.countdown-text.highlight-now {
  color: var(--status-on-time);
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
}

.countdown-text.departed {
  color: var(--text-muted);
  font-style: italic;
}

/* ========================================= */
/* VIEW 2: ROUTE SEARCH (TRASA A DO B)       */
/* ========================================= */
.route-form-card {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.route-inputs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.route-input-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: border-color 0.2s;
  position: relative;
}

.route-input-group:focus-within {
  border-color: var(--accent-cyan);
}

.route-input-icon {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-input-icon.from-icon {
  color: var(--accent-cyan);
}

.route-input-icon.to-icon {
  color: var(--status-on-time);
}

.route-input-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
}

.route-input-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.route-station-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  width: 100%;
}

.route-station-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
}

.route-swap-row {
  display: flex;
  justify-content: center;
  margin: -6px 0;
  z-index: 2;
}

.route-swap-btn {
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  color: var(--accent-cyan);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.route-swap-btn:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-cyan);
  transform: rotate(180deg);
}

.route-swap-btn:active {
  transform: scale(0.9) rotate(180deg);
}

.route-sample-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.route-sample-pills::-webkit-scrollbar {
  display: none;
}

.route-sample-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.route-sample-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.route-sample-pill:hover,
.route-sample-pill:active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
}

.route-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  touch-action: manipulation;
  font-family: inherit;
}

.route-submit-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
}

.route-submit-btn:active {
  transform: scale(0.98);
}

/* Route Results */
.route-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.route-results-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.route-results-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 10px;
  border-radius: 12px;
}

.route-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Connection Card */
.conn-card {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.conn-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
}

.conn-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conn-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conn-timeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.conn-point {
  display: flex;
  flex-direction: column;
}

.conn-point.to {
  text-align: right;
  align-items: flex-end;
}

.conn-time {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.conn-station-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.conn-platform-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.conn-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.conn-duration-chip {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.conn-arrow-line {
  display: flex;
  align-items: center;
  color: var(--border-color);
  width: 100%;
}

.conn-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  font-size: 0.78rem;
}

/* Empty / Loading States */
.state-container {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
}

.state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.5;
}

.state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.state-desc {
  font-size: 0.85rem;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-tertiary) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-md);
  height: 72px;
  margin-bottom: 10px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================= */
/* FAVORITES SYSTEM (HEART & COOKIES)        */
/* ========================================= */
.fav-header-btn {
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

.fav-header-btn .header-heart-icon {
  fill: #ef4444 !important;
  stroke: #ef4444 !important;
  filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.55));
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fav-header-btn:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: #ef4444 !important;
  transform: scale(1.08);
}

.fav-header-btn:hover .header-heart-icon {
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8));
}

.fav-header-badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px #ef4444;
}

.home-favs-section {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-favs-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-favs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-fav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
}

.home-fav-pill:hover, .home-fav-pill:active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  transform: translateY(-1px);
}

.home-fav-pill .fav-type-badge {
  font-size: 0.68rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.route-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.route-actions-row .route-submit-btn {
  flex: 1;
}

.route-fav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
}

.route-fav-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.route-fav-btn.active {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.route-fav-btn.active svg {
  fill: #ef4444;
  stroke: #ef4444;
  filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.4));
}

/* ========================================= */
/* FAVORITES MODAL STYLES                    */
/* ========================================= */
.fav-modal-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.fav-sub-title-text {
  font-weight: 700;
}

.fav-count-pill {
  font-size: 0.72rem;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.fav-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fav-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all 0.2s;
  cursor: pointer;
}

.fav-modal-item:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.fav-modal-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}

.fav-modal-icon {
  color: #ef4444;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-modal-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-fav-open {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-fav-open:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.btn-fav-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-fav-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.fav-modal-empty {
  text-align: center;
  padding: 28px 16px;
}

.fav-empty-heart {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.fav-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.fav-empty-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto;
}

.route-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.route-results-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 5px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.15s;
}

.map-link-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
}

/* Actions & Intermediate Stops in Connection Cards */
.conn-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  gap: 8px;
}

.conn-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  touch-action: manipulation;
}

.conn-action-pill:hover, .conn-action-pill:active {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.conn-action-pill.map-pill {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.conn-action-pill.map-pill:hover {
  background: rgba(56, 189, 248, 0.18);
}

.conn-stops-drawer {
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  margin-top: 4px;
}

/* Intermediate Stops Timeline */
.stops-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  padding-left: 14px;
}

.stops-timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 4px;
  width: 2px;
  background: rgba(255, 255, 255, 0.2);
}

.stop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  position: relative;
  gap: 8px;
  padding: 3px 0;
}

.stop-dot {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 1.5px solid var(--bg-card);
}

.stop-item.first .stop-dot, .stop-item.last .stop-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.stop-item.first .stop-name, .stop-item.last .stop-name {
  color: var(--text-primary);
  font-weight: 800;
}

.stop-name {
  color: var(--text-primary);
  font-weight: 600;
  flex: 1;
}

.stop-time {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stop-platform {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Station Board Train Stops Drawer */
.dep-bottom-row {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}

.dep-stops-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 9px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
}

.dep-stops-btn:hover, .dep-stops-btn:active {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.dep-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 4px 9px;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.15s;
}

.dep-map-btn:hover {
  background: rgba(56, 189, 248, 0.18);
}

.dep-stops-drawer {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

/* Disruptions Modal Specifics */
.disruptions-modal-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s, filter 0.2s;
}

.disruptions-modal-item.yesterday {
  opacity: 0.62;
  filter: grayscale(0.5);
  background: rgba(148, 163, 184, 0.04);
  border-left: 3px solid var(--text-muted);
}

.disruptions-modal-item.yesterday:hover {
  opacity: 0.95;
  filter: grayscale(0);
}

.disruption-item.yesterday {
  opacity: 0.62;
  filter: grayscale(0.5);
}

.disruptions-day-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}

.disruptions-day-tag.tag-today {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.disruptions-day-tag.tag-yesterday {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.disruptions-modal-item:last-child {
  margin-bottom: 0;
}

.disruptions-modal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.disruptions-modal-source {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.disruptions-modal-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.disruptions-modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.disruptions-modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  white-space: pre-line;
}

.disruptions-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.disruptions-modal-link {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.disruptions-modal-link:hover {
  text-decoration: underline;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open,
.modal-overlay.active {
  display: flex !important;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Toggle Switch */
.push-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.push-toggle-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.push-toggle-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-blue);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.push-status-text {
  font-size: 0.8rem;
  color: var(--status-warning);
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
  display: none;
}

.lines-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.lines-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.line-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.line-chip:hover {
  background: var(--bg-card-hover);
}

.line-chip.selected {
  border-color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.15);
}

.line-chip-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.line-chip-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.line-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s;
}

.btn-primary:active {
  opacity: 0.85;
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
}

/* PWA Install Banner */
.install-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 450px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 99;
  display: none;
}

.install-banner.visible {
  display: flex;
}

.install-text {
  font-size: 0.85rem;
  font-weight: 600;
}

.install-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* Minimalist App Footer */
.app-footer {
  padding: 28px 16px 44px;
  margin-top: 36px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-brand {
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-version-btn {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.footer-version-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
}

.footer-text-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.footer-text-btn:hover {
  color: #fff;
}

.footer-sep {
  opacity: 0.4;
}

.footer-map-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Settings Modal Styles */
.settings-block {
  margin-bottom: 20px;
}

.settings-block-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.settings-block-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Theme Grid & Cards */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.theme-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  touch-action: manipulation;
}

.theme-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.18);
}

.theme-swatch {
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.swatch-bubble {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Swatch Color Variations */
.cyber-dark-swatch {
  background: #0b0f19;
}
.cyber-dark-swatch .b1 { background: #0284c7; }
.cyber-dark-swatch .b2 { background: #38bdf8; }

.rail-classic-swatch {
  background: #070e1c;
}
.rail-classic-swatch .b1 { background: #1d4ed8; }
.rail-classic-swatch .b2 { background: #f59e0b; }

.mazovia-green-swatch {
  background: #05140f;
}
.mazovia-green-swatch .b1 { background: #059669; }
.mazovia-green-swatch .b2 { background: #10b981; }

.warsaw-red-swatch {
  background: #140d10;
}
.warsaw-red-swatch .b1 { background: #dc2626; }
.warsaw-red-swatch .b2 { background: #ef4444; }

.oled-contrast-swatch {
  background: #000000;
}
.oled-contrast-swatch .b1 { background: #ffffff; }
.oled-contrast-swatch .b2 { background: #facc15; }

.light-clean-swatch {
  background: #ffffff;
  border-color: #cbd5e1;
}
.light-clean-swatch .b1 { background: #0284c7; }
.light-clean-swatch .b2 { background: #38bdf8; }

.theme-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.theme-card-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Map Choice Options */
.map-choice-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.map-choice-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.map-choice-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.map-choice-info {
  flex: 1;
}

.map-choice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.map-badge-rec {
  font-size: 0.68rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 8px;
}

.map-choice-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.35;
}

/* Refresh Interval Options */
.refresh-interval-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.refresh-interval-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.refresh-interval-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.refresh-interval-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

[data-theme="light-clean"] .refresh-interval-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light-clean"] .refresh-interval-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #0284c7;
}

[data-theme="light-clean"] .refresh-interval-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

/* Changelog Items */
.changelog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.changelog-card:last-child {
  margin-bottom: 0;
}

.changelog-card.current {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.04);
}

.changelog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.changelog-ver-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.changelog-ver-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent-blue);
  padding: 2px 8px;
  border-radius: 10px;
}

.changelog-ver-badge.current {
  background: var(--accent-cyan);
  color: #000;
}

.changelog-release-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.changelog-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.changelog-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.changelog-items-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  position: relative;
  padding-left: 18px;
}

.changelog-items-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent-cyan);
  font-weight: bold;
}

/* =========================================================
   In-App Railway Track Map Modal (Leaflet OSM)
   ========================================================= */
.map-modal-content {
  max-width: 720px;
  width: 95%;
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-modal-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-card);
}

.railway-map-container {
  height: 52vh;
  min-height: 300px;
  width: 100%;
  background: #0f172a;
  z-index: 1;
}

.map-stops-summary {
  padding: 10px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  gap: 10px;
  align-items: center;
  scrollbar-width: thin;
}

.map-stop-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface, rgba(255, 255, 255, 0.05));
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.map-stop-pill.start {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  font-weight: 700;
}

.map-stop-pill.end {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  font-weight: 700;
}

.map-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

.map-track-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.start { background: #10b981; }
.legend-dot.end { background: #ef4444; }

.legend-train-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
  box-shadow: 0 0 6px #f59e0b;
}

.legend-line-thin {
  width: 18px;
  height: 3px;
  background: #64748b;
  border-radius: 2px;
  display: inline-block;
  opacity: 0.85;
}

.legend-line-bold {
  width: 18px;
  height: 5px;
  background: #0284c7;
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 5px rgba(2, 132, 199, 0.65);
}

.legend-line {
  width: 22px;
  height: 4px;
  background: #0284c7;
  border-radius: 2px;
  display: inline-block;
}

.btn-map-ext {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.2s;
}

.btn-map-ext:hover {
  background: rgba(56, 189, 248, 0.2);
}

/* Leaflet Popups & Station Markers */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45) !important;
  padding: 2px !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

.station-map-popup {
  padding: 6px 8px;
  min-width: 140px;
}

.station-map-popup-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.station-map-popup-time {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.station-map-popup-platform {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* =========================================================
   App Update Splash Screen & Animated Progress
   ========================================================= */
.update-splash-overlay {
  z-index: 9999;
  backdrop-filter: blur(16px);
  background: rgba(11, 15, 25, 0.92);
}

.update-splash-content {
  max-width: 480px;
  width: 90%;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: splashFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashFadeIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.update-splash-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.2);
}

.update-splash-icon {
  width: 42px;
  height: 42px;
}

.update-splash-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 12px;
}

.update-splash-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.update-splash-title span {
  color: var(--accent-cyan);
}

.update-splash-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 22px;
}

.update-progress-wrap {
  margin: 16px 0 24px;
  text-align: left;
}

.update-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.update-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 4px;
  transition: width 0.08s linear;
}

.update-progress-status {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.update-splash-footer {
  display: flex;
  justify-content: center;
}

.btn-update-skip {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-update-skip:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-active);
}

/* =========================================================
   Light Clean Theme Polish
   ========================================================= */
/* Core typography contrast in light theme */
[data-theme="light-clean"] .brand-title,
[data-theme="light-clean"] .choice-card-title,
[data-theme="light-clean"] .card-heading,
[data-theme="light-clean"] .conn-time,
[data-theme="light-clean"] .conn-station-name,
[data-theme="light-clean"] .dep-train-name,
[data-theme="light-clean"] .dep-time-main,
[data-theme="light-clean"] .dep-direction-main,
[data-theme="light-clean"] .destination,
[data-theme="light-clean"] .home-hero-title,
[data-theme="light-clean"] .station-display-name,
[data-theme="light-clean"] .current-station-name,
[data-theme="light-clean"] .modal-title,
[data-theme="light-clean"] .disruptions-modal-title,
[data-theme="light-clean"] .changelog-release-name,
[data-theme="light-clean"] .settings-block-title,
[data-theme="light-clean"] .theme-card-title,
[data-theme="light-clean"] .map-choice-title,
[data-theme="light-clean"] .station-map-popup-title,
[data-theme="light-clean"] .route-results-title,
[data-theme="light-clean"] .route-station-input,
[data-theme="light-clean"] .scheduled-time:not(.delayed) {
  color: #0f172a !important;
}

/* 1. Countdown Badges in Departure Cards & Connection Cards */
[data-theme="light-clean"] .countdown-badge.normal-white {
  color: #0f172a !important;
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

[data-theme="light-clean"] .countdown-badge.warning-yellow {
  color: #b45309 !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

[data-theme="light-clean"] .countdown-badge.urgent-red {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.14) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  text-shadow: none !important;
}

[data-theme="light-clean"] .countdown-badge.departed {
  color: #64748b !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

/* 2. Platform & Track Badges */
[data-theme="light-clean"] .platform-badge {
  color: #0f172a !important;
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

[data-theme="light-clean"] .track-text {
  color: #475569 !important;
  font-weight: 600 !important;
}

/* 3. Train details & badges */
[data-theme="light-clean"] .train-number-text {
  color: #334155 !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light-clean"] .line-badge.other {
  color: #0f172a !important;
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light-clean"] .countdown-bullet {
  color: #94a3b8 !important;
}

/* 4. Action Buttons & Drawers */
[data-theme="light-clean"] .dep-stops-btn,
[data-theme="light-clean"] .conn-action-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light-clean"] .dep-stops-btn:hover,
[data-theme="light-clean"] .conn-action-pill:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #0284c7 !important;
}

[data-theme="light-clean"] .dep-map-btn,
[data-theme="light-clean"] .conn-action-pill.map-pill {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #0284c7 !important;
}

[data-theme="light-clean"] .dep-map-btn:hover,
[data-theme="light-clean"] .conn-action-pill.map-pill:hover {
  background: rgba(2, 132, 199, 0.16) !important;
  color: #0369a1 !important;
}

[data-theme="light-clean"] .dep-bottom-row,
[data-theme="light-clean"] .conn-card-bottom {
  border-top-color: #e2e8f0 !important;
}

/* 5. Intermediate Stops Timeline */
[data-theme="light-clean"] .dep-stops-drawer,
[data-theme="light-clean"] .conn-stops-drawer {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light-clean"] .stops-timeline::before {
  background: #cbd5e1 !important;
}

[data-theme="light-clean"] .stop-dot {
  border-color: #ffffff !important;
}

[data-theme="light-clean"] .stop-name {
  color: #1e293b !important;
}

[data-theme="light-clean"] .stop-item.first .stop-name,
[data-theme="light-clean"] .stop-item.last .stop-name,
[data-theme="light-clean"] .stop-time {
  color: #0f172a !important;
}

[data-theme="light-clean"] .stop-platform {
  background: #e2e8f0 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1;
}

/* 6. Navigation Pills & Buttons */
[data-theme="light-clean"] .nav-back-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light-clean"] .nav-back-pill:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #0284c7 !important;
}

[data-theme="light-clean"] .nav-switch-pill {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #0284c7 !important;
}

[data-theme="light-clean"] .nav-switch-pill:hover {
  background: rgba(2, 132, 199, 0.16) !important;
  color: #0369a1 !important;
}

/* 7. Inputs, Hubs and Autocomplete */
[data-theme="light-clean"] input[type="text"],
[data-theme="light-clean"] input[type="search"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light-clean"] input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light-clean"] .station-pill,
[data-theme="light-clean"] .route-sample-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light-clean"] .station-pill:hover,
[data-theme="light-clean"] .route-sample-pill:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light-clean"] .station-pill.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

[data-theme="light-clean"] .autocomplete-dropdown {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12) !important;
}

[data-theme="light-clean"] .autocomplete-item {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light-clean"] .autocomplete-item:hover,
[data-theme="light-clean"] .autocomplete-item.active {
  background-color: #f1f5f9 !important;
}

[data-theme="light-clean"] .autocomplete-item-name {
  color: #0f172a !important;
}

/* 8. Disruption Items */
[data-theme="light-clean"] .disruption-card {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-theme="light-clean"] .disruption-item-heading {
  color: #0f172a !important;
}

[data-theme="light-clean"] .disruption-item-text {
  color: #334155 !important;
}

[data-theme="light-clean"] .disruptions-modal-item {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light-clean"] .disruptions-modal-item.yesterday {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light-clean"] .disruptions-modal-desc {
  color: #334155 !important;
}

/* 9. Cards, Hubs & Shadows */
[data-theme="light-clean"] .choice-card,
[data-theme="light-clean"] .conn-card,
[data-theme="light-clean"] .departure-card,
[data-theme="light-clean"] .modal-content,
[data-theme="light-clean"] .theme-card,
[data-theme="light-clean"] .map-choice-card,
[data-theme="light-clean"] .home-fav-pill,
[data-theme="light-clean"] .route-inputs-card {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

[data-theme="light-clean"] .choice-card-pill {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light-clean"] .choice-card-desc {
  color: #475569 !important;
}

[data-theme="light-clean"] .home-fav-pill {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light-clean"] .home-fav-pill .fav-type-badge {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

/* 10. Map Modal */
[data-theme="light-clean"] .map-stop-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light-clean"] .map-stops-summary {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light-clean"] .map-modal-actions {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light-clean"] .header-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light-clean"] .header-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light-clean"] .changelog-items-list li {
  color: #334155 !important;
}

[data-theme="light-clean"] .changelog-head {
  border-bottom-color: #e2e8f0 !important;
}

/* =========================================================
   Live Animated Train Marker & Radar Pulse (Variant B)
   ========================================================= */
.train-live-icon-container {
  background: transparent !important;
  border: none !important;
}

.live-train-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.train-pulse-ring {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  pointer-events: none;
  animation: trainPulse 2s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}

@keyframes trainPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.95;
  }
  60% {
    transform: scale(1.6);
    opacity: 0.25;
  }
  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

.live-train-marker.skm .train-pulse-ring {
  background: rgba(220, 38, 38, 0.45);
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.75);
}

.live-train-marker.km .train-pulse-ring {
  background: rgba(22, 163, 74, 0.45);
  box-shadow: 0 0 16px rgba(22, 163, 74, 0.75);
}

.train-badge-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 18px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  border: 2px solid #ffffff;
  letter-spacing: 0.3px;
  transition: transform 0.2s ease;
}

.live-train-marker:hover .train-badge-pill {
  transform: scale(1.08);
}

.live-train-marker.skm .train-badge-pill {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.live-train-marker.km .train-badge-pill {
  background: linear-gradient(135deg, #16a34a 0%, #166534 100%);
}

.train-badge-pill svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Popup for live train */
.train-live-popup {
  padding: 8px 10px;
  min-width: 220px;
  font-family: inherit;
}

.train-live-popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.train-live-popup-header.skm {
  color: #ef4444;
}

.train-live-popup-header.km {
  color: #22c55e;
}

.train-live-popup-header .live-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  animation: liveBlink 1.4s ease-in-out infinite;
}

.train-live-popup-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.train-live-popup-status {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 6px;
}

.train-live-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  line-height: 1.3;
}
.train-live-phase-badge.phase-approaching {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.train-live-phase-badge.phase-on-trip {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.train-live-phase-badge.phase-passed {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.station-map-popup-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  color: var(--text-muted);
}
.station-map-popup-tag.tag-origin {
  color: #10b981;
}
.station-map-popup-tag.tag-dest {
  color: #ef4444;
}

.train-live-popup-delay {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 700;
}

.train-live-popup-ontime {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Disruption time-ago and unified badges */
.disruptions-time-ago {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

[data-theme="light-clean"] .disruptions-time-ago {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

/* =========================================================================
   LINE SEARCH MODULE (SZUKAJ LINII SKM & KM) - v0.9
   ========================================================================= */

/* Choice Card: Line Search Icon & Pill */
.choice-card-icon.line-color {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(14, 165, 233, 0.22) 100%);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.45);
}

.choice-card-pill.line-pill {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

[data-theme="light-clean"] .choice-card-icon.line-color {
  background: #ede9fe;
  color: #4f46e5;
  border-color: #c7d2fe;
}

[data-theme="light-clean"] .choice-card-pill.line-pill {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

/* Choice Card: Train Stats Icon & Pill */
.choice-card-icon.stats-color {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(236, 72, 153, 0.22) 100%);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.45);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

.choice-card-pill.stats-pill {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

[data-theme="light-clean"] .choice-card-icon.stats-color {
  background: #fae8ff;
  color: #9333ea;
  border-color: #e9d5ff;
}

[data-theme="light-clean"] .choice-card-pill.stats-pill {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #d8b4fe;
}

/* Sub-nav right pills wrapper */
.nav-right-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Station Line Context Banner (when navigating from line to station) */
.station-line-context-banner {
  margin: 0 0 16px 0;
  display: flex;
}

.station-back-to-line-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.4);
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.station-back-to-line-btn:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
}

[data-theme="light-clean"] .station-back-to-line-btn {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #a5b4fc;
}

/* Lines View Containers */
.lines-step-box {
  animation: fadeIn 0.25s ease-out;
}

.lines-hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lines-hero-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
  margin-bottom: 8px;
}

.lines-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.lines-hero-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px 0;
  line-height: 1.45;
}

/* Operator filter segmented toggle */
.lines-op-toggle-group {
  display: flex;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
  overflow-x: auto;
}

.lines-op-pill {
  flex: 1;
  min-width: 90px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.lines-op-pill:hover {
  color: var(--text-primary);
}

.lines-op-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
}

.lines-op-pill[data-op="skm"].active {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.lines-op-pill[data-op="km"].active {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

[data-theme="light-clean"] .lines-op-toggle-group {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

[data-theme="light-clean"] .lines-op-pill.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Search input in line header */
.lines-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.lines-search-container svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.lines-filter-input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lines-filter-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

[data-theme="light-clean"] .lines-filter-input {
  background: #ffffff;
  border-color: #cbd5e1;
}

/* Grid of Line Cards */
.lines-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .lines-cards-grid {
    grid-template-columns: 1fr;
  }
}

.line-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
  user-select: none;
}

.line-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.line-card:active {
  transform: scale(0.985);
}

.line-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.line-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.line-badge-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.5px;
}

.line-badge-lg.skm {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.line-badge-lg.km {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

.line-badge-lg.re {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.line-badge-lg.rl {
  background: linear-gradient(135deg, #0d9488, #059669);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
}

.line-fast-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.line-operator-text {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.line-disruption-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.line-disruption-chip.has-alert {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.line-disruption-chip.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.line-card-route {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.35;
}

.line-card-via {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.3;
}

.line-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Back button in line steps */
.line-back-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 9px 16px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.line-back-action-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateX(-2px);
}

/* Step 2: Line Hero Card */
.line-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.line-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.line-hero-titles h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

.line-hero-titles span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.line-hero-route-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.line-hero-route-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.line-hero-via-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.line-hero-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 10px 0;
}

.line-hero-alert-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}

/* Line Hero Interactive Alerts Box (v0.93) */
.line-hero-alerts-wrap {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 14px;
}

.line-hero-alerts-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fbbf24;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.line-hero-alerts-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.line-hero-alert-entry {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.line-hero-alert-entry:hover {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(0, 0, 0, 0.35);
}

.line-hero-alert-text {
  flex: 1;
  min-width: 200px;
}

.line-hero-alert-title {
  color: #fef3c7;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
}

.line-hero-alert-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 4px;
  flex-wrap: wrap;
}

.line-hero-alert-tag {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.line-hero-alert-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-line-alert-full,
.btn-line-alert-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-line-alert-full {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f1f5f9;
}

.btn-line-alert-full:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.btn-line-alert-link {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.btn-line-alert-link:hover {
  background: rgba(245, 158, 11, 0.32);
  border-color: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
}

[data-theme="light-clean"] .line-hero-alerts-wrap {
  background: #fffbeb;
  border-color: #fde68a;
}

[data-theme="light-clean"] .line-hero-alerts-header {
  color: #b45309;
}

[data-theme="light-clean"] .line-hero-alert-entry {
  background: #ffffff;
  border-color: #fef3c7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light-clean"] .line-hero-alert-title {
  color: #78350f;
}

[data-theme="light-clean"] .line-hero-alert-sub {
  color: #6b7280;
}

[data-theme="light-clean"] .btn-line-alert-full {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light-clean"] .btn-line-alert-full:hover {
  background: #e2e8f0;
}

@media (max-width: 600px) {
  .line-hero-alert-entry {
    flex-direction: column;
    align-items: flex-start;
  }
  .line-hero-alert-btns {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Direction section heading */
.line-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.line-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.18);
  color: var(--accent-cyan);
}

.line-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

/* Directions Grid & Cards */
.line-directions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .line-directions-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.line-dir-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  user-select: none;
}

.line-dir-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.line-dir-card:active {
  transform: scale(0.985);
}

.line-dir-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.line-dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(14, 165, 233, 0.16);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.line-dir-stations-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.line-dir-name {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.line-dir-arrow-symbol {
  color: var(--accent-cyan);
  font-size: 1.2rem;
}

.line-dir-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.line-dir-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Step 3: Direction Summary Card */
.line-direction-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.summary-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-details h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.summary-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.line-stations-timeline-header {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* Timeline Layout */
.line-stations-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px 0;
  margin-bottom: 30px;
}

.timeline-station-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.timeline-station-row:hover {
  background: var(--bg-secondary);
}

.timeline-station-row:hover .timeline-station-name {
  color: var(--accent-cyan);
}

.timeline-station-row:hover .timeline-open-pill {
  border-color: var(--accent-cyan);
  color: #ffffff;
  background: var(--accent-cyan);
}

/* Track column (vertical line + dot) */
.timeline-track-col {
  width: 44px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.timeline-v-line-top,
.timeline-v-line-bottom {
  width: 3px;
  background: var(--border-color);
  flex: 1;
}

.timeline-track-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid #64748b;
  z-index: 2;
  transition: all 0.2s;
  box-shadow: 0 0 0 2px var(--bg-card);
}

.timeline-station-row.start-station .timeline-track-dot {
  background: #22c55e;
  border-color: #22c55e;
  width: 16px;
  height: 16px;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.timeline-station-row.end-station .timeline-track-dot {
  background: #ef4444;
  border-color: #ef4444;
  width: 16px;
  height: 16px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.timeline-station-row.hub-station .timeline-track-dot {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
}

/* Station Content column */
.timeline-station-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 6px;
  gap: 10px;
}

.timeline-station-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.timeline-station-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-station-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 18px;
}

.timeline-station-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
  transition: color 0.15s;
}

.timeline-tags-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.timeline-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.timeline-chip.m1 {
  background: #1e3a8a;
  color: #93c5fd;
  border: 1px solid #3b82f6;
}

.timeline-chip.m2 {
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.timeline-chip.hub {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.timeline-chip.start {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.timeline-chip.end {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.timeline-chip.airport {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.35);
}

/* Open station departures action pill */
.timeline-open-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  transition: all 0.2s;
  white-space: nowrap;
}

/* Light Theme Overrides for Line Search */
[data-theme="light-clean"] .lines-hero-banner,
[data-theme="light-clean"] .line-card,
[data-theme="light-clean"] .line-hero-card,
[data-theme="light-clean"] .line-dir-card,
[data-theme="light-clean"] .line-direction-summary-card,
[data-theme="light-clean"] .line-stations-timeline {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

[data-theme="light-clean"] .line-hero-route-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light-clean"] .timeline-station-row:hover {
  background: #f8fafc;
}

[data-theme="light-clean"] .timeline-v-line-top,
[data-theme="light-clean"] .timeline-v-line-bottom {
  background: #cbd5e1;
}

[data-theme="light-clean"] .timeline-track-dot {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px #ffffff;
}

[data-theme="light-clean"] .timeline-open-pill {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0284c7;
}

[data-theme="light-clean"] .timeline-chip.hub {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* Light Theme Overrides for Daily Train Stats */
[data-theme="light-clean"] .home-stats-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

[data-theme="light-clean"] .home-stats-title {
  color: #0f172a;
}

[data-theme="light-clean"] .stat-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light-clean"] .stat-box-label {
  color: #1e293b;
}

[data-theme="light-clean"] .stats-op-toggle {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light-clean"] .stats-op-btn {
  color: #64748b;
}

[data-theme="light-clean"] .stats-op-btn.active {
  background: #0284c7;
  color: #ffffff;
}

[data-theme="light-clean"] .stats-progress-wrap {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light-clean"] .stats-progress-bar {
  background: #e2e8f0;
}

/* =========================================================================
   DESKTOP RESPONSIVENESS & WIDE LAYOUT (v0.92) - 50-70% Wider Viewport
   ========================================================================= */

/* Stats highlight pulse on click */
@keyframes statsHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
    border-color: rgba(168, 85, 247, 0.9);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(168, 85, 247, 0);
    border-color: rgba(168, 85, 247, 0.5);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }
}

.home-stats-card.highlight-pulse {
  animation: statsHighlightPulse 1.2s ease-out;
}

@media (min-width: 768px) {
  /* Expand main container by ~62% (from 680px to 1100px) */
  main {
    max-width: 1100px;
    padding: 24px 28px 48px;
  }

  /* Home View: wider container & 3-card desktop grid */
  .home-choice-wrapper {
    max-width: 1060px;
    gap: 28px;
  }

  .choice-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .choice-card {
    height: 100%;
    padding: 22px 18px;
    grid-template-columns: 52px 1fr;
  }

  .choice-card-arrow {
    display: none;
  }

  .home-hero {
    margin-bottom: 8px;
  }

  .home-hero-title {
    font-size: 2.15rem;
  }

  .home-stats-card {
    padding: 26px 28px;
  }

  /* Line Search Directions Grid: responsive columns on wide screens */
  .line-directions-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  main {
    max-width: 1140px;
  }

  .home-choice-wrapper {
    max-width: 1100px;
  }

  .choice-cards-container {
    gap: 22px;
  }
}



/* Mobile Responsive Header (Heart button ALWAYS visible on left of notifications) */
@media (max-width: 480px) {
  header {
    padding: 10px 12px 6px;
  }
  .header-top {
    gap: 8px;
    margin-bottom: 8px;
  }
  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .header-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .fav-header-btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
  }
  .live-badge span:last-child {
    display: none; /* keep pulsing live dot, hide text 'LIVE' to save 30px */
  }
  .brand-title {
    font-size: 1.05rem;
  }
}

@media (max-width: 380px) {
  .brand .version-badge {
    display: none; /* Hide badge on narrow screens so buttons never squeeze */
  }
  .header-actions {
    gap: 4px;
  }
}
