/* Modern London Tube Run Generator Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* London Tube Font with font-display optimization */
@font-face {
  font-family: 'LondonTube';
  src: url('london-tube-font (1)/LondonTube-MABx.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Ensure text remains visible during font load */
}

/* ========================================
   ENHANCED HISTORICAL INTERFACE STYLES
   ======================================== */

/* Historical Interface Container */
.historical-interface {
  --period-color: #c41230;
  --period-bg: #ffffff;
  --period-text: #333333;
  transition: all 0.3s ease;
}

/* Historical Intro Card */
.historical-intro-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.intro-header h2 {
  color: white;
  margin-bottom: 1rem;
  font-size: 2.2em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.intro-description {
  font-size: 1.1em;
  line-height: 1.6;
  opacity: 0.95;
  margin: 0;
}

/* Interactive Timeline Container */
.historical-timeline-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Timeline Styles */
.historical-timeline {
  width: 100%;
}

.timeline-title {
  text-align: center;
  font-size: 1.8em;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.timeline-icon {
  font-size: 1.2em;
}

.timeline-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-style: italic;
}

.timeline-container {
  overflow-x: auto;
  padding: 1rem 0;
}

.timeline-track {
  display: flex;
  gap: 1rem;
  min-width: fit-content;
  padding: 0 1rem;
  position: relative;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
  z-index: 0;
}

/* Timeline Period Cards */
.timeline-period {
  min-width: 200px;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.timeline-period:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.timeline-period.selected {
  border-color: var(--primary-color);
  background: linear-gradient(145deg, #fff, #f8f9fa);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(196, 18, 48, 0.2);
}

.timeline-period.before-selected,
.timeline-period.after-selected {
  opacity: 0.7;
  transform: scale(0.98);
}

.timeline-marker {
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
}

.timeline-year {
  display: block;
  font-weight: bold;
  font-size: 1.1em;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.timeline-icon-marker {
  font-size: 1.5em;
  display: block;
  margin-bottom: 0.5rem;
}

.timeline-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95em;
  color: var(--text-primary);
  line-height: 1.2;
}

.timeline-content p {
  margin: 0 0 0.75rem 0;
  font-size: 0.85em;
  color: var(--text-secondary);
  line-height: 1.3;
}

.timeline-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75em;
  color: var(--text-muted);
}

.stat-icon {
  font-size: 1em;
}

/* Period Information Display */
.historical-period-info {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.enhanced-period-info {
  background: linear-gradient(145deg, var(--period-bg), rgba(255, 255, 255, 0.9));
  border: 2px solid var(--period-color);
  border-radius: 16px;
  overflow: hidden;
}

.period-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, var(--period-color), rgba(0, 0, 0, 0.1));
  color: white;
}

.period-icon-large {
  font-size: 3em;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.period-title-section h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8em;
  color: white;
}

.period-title-section h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2em;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

.period-era {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
}

.period-description {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.period-description p {
  margin: 0;
  font-size: 1.1em;
  line-height: 1.6;
  color: var(--period-text);
}

/* Period Stats Grid */
.period-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
  font-size: 1.5em;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-card .stat-label {
  display: block;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-card .stat-value {
  display: block;
  font-weight: bold;
  font-size: 1.1em;
  color: var(--period-color);
}

/* Period Details */
.period-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

.period-section h5 {
  margin: 0 0 1rem 0;
  color: var(--period-color);
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.period-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.period-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--period-text);
  line-height: 1.4;
  position: relative;
  padding-left: 1.5rem;
}

.period-list li::before {
  content: '•';
  color: var(--period-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.facts-list li::before {
  content: '💡';
  font-size: 0.9em;
}

.period-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.period-line-badge {
  background: var(--period-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.85em;
  font-weight: 500;
}

/* Historical Controls Card */
.historical-controls-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.historical-controls-card h3 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Historical Generate Button */
.historical-generate-section {
  text-align: center;
  margin-top: 2rem;
}

.historical-generate-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 16px;
  padding: 1.5rem 3rem;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(196, 18, 48, 0.3);
  position: relative;
  overflow: hidden;
}

.historical-generate-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(196, 18, 48, 0.4);
}

.historical-generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.historical-generate-btn .btn-icon {
  font-size: 1.3em;
}

.btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.btn-main {
  font-size: 1em;
  line-height: 1.2;
}

.btn-sub {
  font-size: 0.85em;
  opacity: 0.9;
  font-weight: 400;
}

/* Enhanced Historical Route Results */
.historical-results-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.enhanced-historical-route {
  background: linear-gradient(145deg, var(--period-bg), rgba(255, 255, 255, 0.9));
  transition: all 0.3s ease;
}

/* Historical Route Header */
.historical-route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--period-color), rgba(0, 0, 0, 0.1));
  color: white;
}

.route-era-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.era-icon {
  font-size: 2.5em;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.era-info h3 {
  margin: 0 0 0.25rem 0;
  color: white;
  font-size: 1.5em;
}

.era-year {
  display: block;
  font-size: 0.9em;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.era-subtitle {
  display: block;
  font-size: 1em;
  opacity: 0.8;
  font-weight: 400;
}

.route-time-machine {
  text-align: center;
}

.time-machine-visual {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.time-icon {
  font-size: 1.5em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Route Presentation */
.route-presentation {
  padding: 2rem;
}

.route-title {
  text-align: center;
  color: var(--period-color);
  margin-bottom: 2rem;
  font-size: 1.4em;
}

.route-stations-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.station-card {
  background: white;
  border: 2px solid var(--period-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.station-icon {
  font-size: 1.5em;
  display: block;
  margin-bottom: 0.5rem;
}

.station-name {
  display: block;
  font-weight: bold;
  color: var(--period-text);
  margin-bottom: 0.5rem;
  font-size: 1.1em;
}

.station-label {
  display: block;
  font-size: 0.85em;
  color: var(--period-color);
  text-transform: uppercase;
  font-weight: 600;
}

.route-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--period-color);
}

.arrow-line {
  width: 100px;
  height: 2px;
  background: var(--period-color);
  position: relative;
}

.arrow-distance {
  background: var(--period-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9em;
  font-weight: 600;
}

.arrow-head {
  font-size: 1.5em;
  font-weight: bold;
}

/* Historical Context Cards */
.route-historical-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.context-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
}

.context-card h5 {
  margin: 0 0 1rem 0;
  color: var(--period-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.context-description {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--period-text);
}

.context-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.context-stat {
  font-size: 0.9em;
  color: var(--text-secondary);
}

.transport-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transport-fact {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--period-text);
}

/* Educational Content */
.educational-content {
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.education-section {
  margin-bottom: 2rem;
}

.education-section h5 {
  color: var(--period-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2em;
}

.key-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.key-event-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.event-bullet {
  color: var(--period-color);
  font-weight: bold;
  font-size: 1.2em;
}

.event-text {
  flex: 1;
  line-height: 1.4;
  color: var(--period-text);
}

/* Facts Carousel */
.facts-carousel {
  position: relative;
  min-height: 120px;
  margin-bottom: 1rem;
}

.fact-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.fact-card.active {
  opacity: 1;
  transform: translateX(0);
}

.fact-icon {
  font-size: 1.5em;
}

.fact-text {
  flex: 1;
  margin: 0;
  line-height: 1.5;
  color: var(--period-text);
}

.facts-navigation {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.fact-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--period-color);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fact-nav-dot.active {
  background: var(--period-color);
}

/* Network Comparison */
.network-comparison {
  background: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.network-comparison h5 {
  color: var(--period-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2em;
  text-align: center;
  justify-content: center;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.comparison-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.comparison-card.historical {
  border-color: var(--period-color);
  background: linear-gradient(145deg, var(--period-bg), white);
}

.comparison-card.modern {
  border-color: var(--secondary-color);
  background: linear-gradient(145deg, #f0f8ff, white);
}

.comparison-card h6 {
  margin: 0 0 1rem 0;
  font-size: 1.1em;
  color: var(--text-primary);
}

.comparison-stats {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
}

.comparison-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--period-color);
  display: block;
}

.comparison-card.modern .stat-number {
  color: var(--secondary-color);
}

.stat-label {
  font-size: 0.85em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* Route Actions */
.route-actions {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.route-actions .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--period-color);
  color: white;
}

.btn-secondary {
  background: var(--text-muted);
  color: white;
}

.btn-accent {
  background: var(--secondary-color);
  color: white;
}

.route-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Historical Save Card */
.historical-save-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  margin-top: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.save-card-header {
  background: linear-gradient(135deg, var(--success-color), #20b936);
  color: white;
  padding: 2rem;
}

.save-card-header h3 {
  margin: 0 0 0.5rem 0;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.save-card-header p {
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
}

.save-card-content {
  padding: 2rem;
}

.save-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.save-detail {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9em;
}

.save-actions {
  text-align: center;
}

/* Period Theme Variations */
.theme-victorian {
  --period-color: #8B4513;
  --period-bg: #F5DEB3;
  --period-text: #4A2C2A;
}

.theme-victorian-late {
  --period-color: #2E8B57;
  --period-bg: #F0F8FF;
  --period-text: #2F4F4F;
}

.theme-edwardian {
  --period-color: #4169E1;
  --period-bg: #E6E6FA;
  --period-text: #191970;
}

.theme-art-deco {
  --period-color: #DC143C;
  --period-bg: #FFF8DC;
  --period-text: #8B0000;
}

.theme-wartime {
  --period-color: #556B2F;
  --period-bg: #F5F5DC;
  --period-text: #2F4F2F;
}

.theme-modern {
  --period-color: #4169E1;
  --period-bg: #F0F8FF;
  --period-text: #000080;
}

.theme-jubilee {
  --period-color: #868686;
  --period-bg: #F5F5F5;
  --period-text: #2F2F2F;
}

.theme-millennium {
  --period-color: #4B0082;
  --period-bg: #E6E6FA;
  --period-text: #2F2F4F;
}

.theme-overground {
  --period-color: #EE7C0E;
  --period-bg: #FFF8DC;
  --period-text: #8B4513;
}

.theme-elizabeth {
  --period-color: #6950A1;
  --period-bg: #F0F8FF;
  --period-text: #4B0082;
}

/* Educational Tooltips */
.educational-tooltip {
  position: fixed;
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  z-index: 10000;
  transition: all 0.3s ease;
  transform-origin: center bottom;
}

.educational-tooltip.hidden {
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  pointer-events: none;
}

.educational-tooltip.tooltip-above {
  transform-origin: center top;
}

.tooltip-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tooltip-title {
  margin: 0;
  font-size: 1.1em;
  font-weight: 600;
}

.tooltip-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.tooltip-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tooltip-content {
  padding: 1.5rem;
}

.tooltip-description {
  margin: 0 0 1rem 0;
  line-height: 1.5;
  color: var(--text-primary);
}

.tooltip-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tooltip-section {
  border-left: 3px solid var(--primary-color);
  padding-left: 1rem;
}

.tooltip-section h5 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9em;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tooltip-section p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.4;
  color: var(--text-secondary);
}

.tooltip-arrow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--primary-color);
}

.educational-tooltip.tooltip-above .tooltip-arrow {
  bottom: auto;
  top: -8px;
  border-top: none;
  border-bottom: 8px solid var(--primary-color);
}

/* Tooltip Trigger Styles */
.has-tooltip {
  position: relative;
  cursor: pointer;
  border-bottom: 1px dotted var(--primary-color);
  transition: all 0.2s ease;
}

.has-tooltip:hover {
  color: var(--primary-color);
  border-bottom-style: solid;
}

.has-tooltip::after {
  content: '?';
  position: absolute;
  top: -2px;
  right: -12px;
  width: 14px;
  height: 14px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.has-tooltip:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Special tooltip styling for period line badges */
.period-line-badge.has-tooltip {
  border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
}

.period-line-badge.has-tooltip:hover {
  border-bottom-style: solid;
}

.period-line-badge.has-tooltip::after {
  background: rgba(255, 255, 255, 0.9);
  color: var(--period-color);
}

/* Timeline period tooltips */
.timeline-period-name.has-tooltip {
  border-bottom: 1px dotted var(--text-secondary);
}

.timeline-period-name.has-tooltip:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Station name tooltips */
.station-name.has-tooltip {
  border-bottom: 1px dotted var(--period-color);
}

.station-name.has-tooltip:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Era information tooltips */
.period-era.has-tooltip,
.era-info.has-tooltip {
  border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
}

.period-era.has-tooltip:hover,
.era-info.has-tooltip:hover {
  border-bottom-style: solid;
}

/* Responsive Design for Historical Interface */
@media (max-width: 768px) {
  .historical-intro-card,
  .historical-timeline-container,
  .historical-period-info,
  .historical-controls-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .educational-tooltip {
    max-width: 300px;
    left: 10px !important;
    right: 10px !important;
    width: calc(100vw - 20px);
  }
  
  .tooltip-header {
    padding: 0.75rem 1rem;
  }
  
  .tooltip-content {
    padding: 1rem;
  }
  
  .tooltip-title {
    font-size: 1em;
  }
  
  .timeline-track {
    gap: 0.75rem;
  }
  
  .timeline-period {
    min-width: 160px;
    padding: 0.75rem;
  }
  
  .period-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .period-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .period-details {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  
  .route-stations-display {
    flex-direction: column;
    gap: 1rem;
  }
  
  .route-arrow {
    transform: rotate(90deg);
  }
  
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .route-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .intro-header h2 {
    font-size: 1.8em;
  }
  
  .timeline-period {
    min-width: 140px;
  }
  
  .period-icon-large {
    width: 60px;
    height: 60px;
    font-size: 2em;
  }
  
  .period-title-section h3 {
    font-size: 1.4em;
  }
  
  .historical-generate-btn {
    padding: 1rem 2rem;
    font-size: 1em;
  }
  
  .btn-text {
    align-items: center;
    text-align: center;
  }
}

/* ========================================
   ACCESSIBILITY STYLES
   ======================================== */

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

/* Focus styles for keyboard navigation */
*:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* High contrast support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-muted: #000000;
    --bg-overlay: rgba(255, 255, 255, 1);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Form help text styling */
.form-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

/* Consent fieldset styling */
.consent-fieldset {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.consent-fieldset legend {
  font-weight: 600;
  padding: 0 0.5rem;
  color: var(--text-primary);
}

/* ========================================
   ORIGINAL CSS CONTINUES
   ======================================== */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #c41230;
  --primary-light: #e14a5a;
  --primary-dark: #a10e27;
  --secondary-color: #667eea;
  --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Text Colors */
  --text-primary: #333333;
  --text-secondary: #555555;
  --text-muted: #888888;
  --text-light: #ffffff;
  --text-on-dark: #ffffff;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-dark: rgba(0, 0, 0, 0.8);
  --bg-overlay: rgba(255, 255, 255, 0.95);
  
  /* Border Colors */
  --border-color: #e0e0e0;
  --border-light: #f0f0f0;
  
  /* Status Colors */
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --info-color: #17a2b8;
  
  /* Pub Mode Colors */
  --pub-primary: #8B4513;
  --pub-secondary: #D2691E;
  --pub-accent: #F4A460;
  
  /* Tube Station Design System Colors */
  --oxblood-red: #8B0000;
  --tile-white: #FFFFFF;
  --tile-grout: #E5E5E5;
  --station-green: #007229;
  --platform-yellow: #FFD320;
  --tube-blue: #0019A8;
  
  /* Tube Station Material Variables */
  --station-oxblood-rgb: 139, 0, 0;
  --station-green-rgb: 0, 114, 41;
  --station-yellow-rgb: 255, 211, 32;
  --station-blue-rgb: 0, 25, 168;
  --tile-grout-rgb: 229, 229, 229;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: var(--background-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(196, 18, 48, 0.3);
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: visible;
}

header .container {
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.roundel {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'LondonTube', 'Inter', sans-serif;
    font-weight: bold;
    color: #c41230;
    font-size: 12px;
    text-align: center;
    line-height: 1;
}

h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    font-family: 'LondonTube', 'Inter', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

h2 {
    color: #c41230;
    font-weight: 600;
    font-family: 'LondonTube', 'Inter', sans-serif;
}

h3 {
    color: #555;
    font-weight: 600;
}

.auth-info {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navigation */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.nav-tab {
    background: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.nav-tab.active {
    background: #c41230;
    color: white;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
}

.glass-card {
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

/* Form Controls */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

input, select, textarea {
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #c41230;
    box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.1);
}

/* Line Toggles */
.line-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.line-group {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
}

.line-group h3 {
    margin: 0 0 1rem 0;
    color: #c41230;
    font-weight: 600;
}

.line-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.line-checkbox:hover {
    background: rgba(196, 18, 48, 0.05);
}

.line-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.line-checkbox label {
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.line-block {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Line Colors */
.line-Bakerloo { background-color: #894e24; }
.line-Central { background-color: #e41f1f; }
.line-Circle { background-color: #ffce00; }
.line-District { background-color: #007229; }
.line-HammersmithandCity { background-color: #d799af; }
.line-Jubilee { background-color: #6a7278; }
.line-Metropolitan { background-color: #751056; }
.line-Northern { background-color: #000000; }
.line-Piccadilly { background-color: #0019a8; }
.line-Victoria { background-color: #0098d4; }
.line-WaterlooandCity { background-color: #76d0bd; }
.line-DLR { background-color: #00A4A7; }
.line-Elizabeth { background-color: #8E44AD; }
.line-Tramlink { background-color: #0099CC; }
.line-Liberty { background-color: rgb(93, 96, 97); }
.line-Lioness { background-color: rgb(250,166,26); }
.line-Mildmay { background-color: rgb(0,119,173); }
.line-Suffragette { background-color: rgb(91,189,114); }
.line-Windrush { background-color: rgb(237,27,0); }
.line-C2C { background-color: #0073CF; }
.line-ChilternRailways { background-color: #8A1538; }
.line-GreatNorthern { background-color: #005587; }
.line-GreatWestern { background-color: #8E0000; }
.line-GreaterAnglia { background-color: #0072CE; }
.line-HeathrowConnect { background-color: #FFA500; }
.line-HeathrowExpress { background-color: #FFCC00; }
.line-LondonMidland { background-color: #4D4D4D; }
.line-Southeastern { background-color: #E10600; }
.line-Southern { background-color: #D10000; }
.line-Thameslink { background-color: #006699; }
.line-Weaver { background-color: #006699; }
.line-SouthWestern { background-color: #006699; }

/* Base style for line indicators (zone toggles) */
.line-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.2s ease;
}

.line-indicator:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Zone indicators - styled like line indicators */
.line-indicator.zone-1 { background-color: #FFD700; color: #000; } /* Gold */
.line-indicator.zone-2 { background-color: #FF6B35; color: #fff; } /* Orange */
.line-indicator.zone-3 { background-color: #F7931E; color: #fff; } /* Orange-red */
.line-indicator.zone-4 { background-color: #7B68EE; color: #fff; } /* Medium slate blue */
.line-indicator.zone-5 { background-color: #32CD32; color: #000; } /* Lime green */
.line-indicator.zone-6 { background-color: #8A2BE2; color: #fff; } /* Blue violet */
.line-indicator.zone-7 { background-color: #FF1493; color: #fff; } /* Deep pink */
.line-indicator.zone-8 { background-color: #00CED1; color: #000; } /* Dark turquoise */
.line-indicator.zone-9 { background-color: #FFB6C1; color: #000; } /* Light pink */

/* Progress Mosaic Layout */
.progress-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

/* Stat Card Base */
.stat-card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 16px 16px 0 0;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Card Sizes */
.stat-card.large-card {
  grid-column: span 2;
  grid-row: span 2;
}

.stat-card.wide-card {
  grid-column: span 4;
}

.stat-card h3 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Enhanced Statistics Grid (for detailed stats inside cards) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Progress Section Improvements */
.progress-section {
  background: var(--bg-overlay);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Progress Cards */
.progress-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 12px 12px 0 0;
}

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

.progress-card h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Progress bars */
.progress-bar {
  background: var(--bg-secondary);
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin: 0.5rem 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 8px;
  transition: width 0.6s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Achievement styles */
.achievement {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-light);
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(196, 18, 48, 0.3);
  transition: all 0.3s ease;
  border: none;
}

.achievement:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 18, 48, 0.4);
}

/* Line progress badges */
.line-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  margin: 0.2rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid;
  transition: all 0.2s ease;
}

.line-badge:hover {
  transform: scale(1.05);
}

/* New Card Content Styles */

/* Network Overview Card */
.network-stats {
  text-align: center;
}

.big-stat {
  margin-bottom: 1.5rem;
}

.big-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.big-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mini-stat {
  text-align: center;
}

.mini-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mini-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.overview-progress {
  margin-top: 1rem;
}

.progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.mini-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  margin: 0 1rem;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* Zone Analysis */
.zone-stats {
  text-align: center;
}

.zone-progress {
  margin-bottom: 1rem;
}

.zone-count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.zone-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.zone-badge {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.zone-badge.visited {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-light);
  transform: scale(1.05);
}

.zone-badge.unvisited {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}

.zone-info {
  margin-top: 1rem;
}

.zone-stat {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.25rem 0;
}

/* Historical Analysis */
.historical-stats .stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-item-simple {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.heritage-info {
  margin-top: 1rem;
}

.heritage-item {
  display: flex;
  justify-content: space-between;
  margin: 0.5rem 0;
  font-size: 0.85rem;
}

.heritage-label {
  color: var(--text-secondary);
}

.heritage-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Route Complexity */
.complexity-chart {
  margin-bottom: 1rem;
}

.complexity-bar {
  display: flex;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.complexity-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.complexity-segment:hover {
  filter: brightness(1.1);
}

.complexity-legend {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.complexity-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.summary-stat {
  text-align: center;
}

.summary-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Recent Activity */
.recent-activity {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.activity-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.activity-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-route {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  margin-right: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-distance {
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 600;
  background: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.9rem;
}

.stat-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.stat-section:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-section .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.2s ease;
}

.stat-section .stat-item:last-child {
  border-bottom: none;
}

.stat-section .stat-item:hover {
  background-color: var(--bg-secondary);
  border-radius: 6px;
  margin: 0 -0.25rem;
  padding: 0.5rem 0.25rem;
}

.stat-section .stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-section .stat-value {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-color);
  background: var(--bg-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  min-width: 60px;
  text-align: center;
}

/* Content areas */
.content-area {
  background: var(--bg-overlay);
  border-radius: 16px;
  padding: 2rem;
  margin: 1.5rem 0;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Tab content styling */
.tab-content {
  min-height: 60vh;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .progress-mosaic {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stat-card.large-card {
    grid-column: span 2;
    grid-row: span 1;
  }
  
  .stat-card.wide-card {
    grid-column: span 3;
  }
}

@media (max-width: 768px) {
  .progress-mosaic {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-card.large-card,
  .stat-card.wide-card {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-section {
    padding: 1rem;
  }
  
  .progress-card {
    padding: 1rem;
  }
  
  .content-area {
    padding: 1.5rem;
    margin: 1rem 0;
  }
  
  .achievement {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .stat-section h4 {
    font-size: 0.95rem;
  }
  
  .stat-section .stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .stat-section .stat-value {
    align-self: flex-end;
  }
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #c41230, #a10e27);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(196, 18, 48, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 18, 48, 0.4);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    width: auto;
    margin: 0;
}

/* Results */
.results-box {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.station-result {
    padding: 1rem;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.station-result:last-child {
    border-bottom: none;
}

.station-result h2 {
    margin: 0 0 1rem 0;
    color: #c41230;
    font-size: 1.8rem;
}

.station-lines {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.route-arrow {
    font-size: 2rem;
    color: #c41230;
    margin: 1rem 0;
}

.generation-status {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left: 4px solid #c41230;
}

.generation-status h4 {
    margin: 0 0 1rem 0;
    color: #c41230;
}

#statusText {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#distanceInfo, #ruleExplanation {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Map */
.map-container {
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

/* Progress */
.progress-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.progress-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c41230, #a10e27);
    transition: width 0.5s ease;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #555;
}

.stat-value {
    font-weight: 600;
    color: #c41230;
}

/* Achievements */
.achievement {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    margin: 0.25rem;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Run History */
.run-history {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.run-item {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #c41230;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.run-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.run-date {
    font-weight: 600;
    color: #c41230;
}

.run-source {
    font-size: 0.9rem;
    color: #666;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 12px;
}

.run-details {
    font-size: 0.9rem;
    color: #555;
}

.run-details strong {
    color: #333;
}

/* Authentication */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-toggle {
    text-align: center;
    margin: 1rem 0;
}

.auth-toggle button {
    background: none;
    border: none;
    color: #c41230;
    text-decoration: underline;
    cursor: pointer;
    font-size: 1rem;
}

.message {
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: #666;
}

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

.text-muted {
    color: #666;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .header-content {
        flex-direction: column;
    }

    .auth-info {
        position: static;
        margin-top: 1rem;
        margin-bottom: 1rem;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        z-index: 10;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .line-toggles {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-tab {
        width: 100%;
        max-width: 200px;
    }
    
    .progress-section {
        grid-template-columns: 1fr;
    }
    
    .station-result h2 {
        font-size: 1.4rem;
    }
    
    .run-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }

    .card {
        padding: 1rem;
        border-radius: 15px;
    }

    .auth-container {
        margin: 1rem auto;
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .roundel {
        width: 50px;
        height: 50px;
        font-size: 10px;
    }

    header {
        padding: 1rem 0;
    }

    .auth-info {
        padding: 8px 12px !important;
        font-size: 14px;
        margin-bottom: 0.5rem;
    }

    #logoutBtn {
        font-size: 14px !important;
        padding: 6px 12px !important;
    }
}

/* Dark mode support - both manual toggle and system preference */
@media (prefers-color-scheme: dark) {
  body:not([data-dark-mode="false"]) {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  }
  
  body:not([data-dark-mode="false"]) .card, 
  body:not([data-dark-mode="false"]) .auth-container, 
  body:not([data-dark-mode="false"]) .progress-card {
    background: rgba(44, 62, 80, 0.9);
    color: white;
  }
  
  body:not([data-dark-mode="false"]) .glass-card {
    background: #374151;
    border: 1px solid #4b5563;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  }
  
  body:not([data-dark-mode="false"]) input, 
  body:not([data-dark-mode="false"]) select, 
  body:not([data-dark-mode="false"]) textarea {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  body:not([data-dark-mode="false"]) input::placeholder {
    color: rgba(255, 255, 255, 0.6);
  }
  
  body:not([data-dark-mode="false"]) .line-group {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  body:not([data-dark-mode="false"]) .run-history {
    background: rgba(255, 255, 255, 0.05);
  }
  
  body:not([data-dark-mode="false"]) .run-item {
    background: rgba(255, 255, 255, 0.1);
    color: white;
  }
  
  body:not([data-dark-mode="false"]) .line-progress-item {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
  }
  
  body:not([data-dark-mode="false"]) .line-header:hover {
    background-color: rgba(255,255,255,0.05);
  }
  
  body:not([data-dark-mode="false"]) .station-section {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.1);
  }
  
  body:not([data-dark-mode="false"]) .theme-controls {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  body:not([data-dark-mode="false"]) .line-theme-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
  }
}

/* Manual dark mode toggle styles */
body[data-dark-mode="true"] {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body[data-dark-mode="true"] .card, 
body[data-dark-mode="true"] .auth-container, 
body[data-dark-mode="true"] .progress-card {
  background: rgba(44, 62, 80, 0.9);
  color: white;
}

body[data-dark-mode="true"] .glass-card {
  background: #374151;
  border: 1px solid #4b5563;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
}

body[data-dark-mode="true"] input, 
body[data-dark-mode="true"] select, 
body[data-dark-mode="true"] textarea {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

body[data-dark-mode="true"] input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

body[data-dark-mode="true"] .line-group {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-dark-mode="true"] .run-history {
  background: rgba(255, 255, 255, 0.05);
}

body[data-dark-mode="true"] .run-item {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

body[data-dark-mode="true"] .line-progress-item {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

body[data-dark-mode="true"] .line-header:hover {
  background-color: rgba(255,255,255,0.05);
}

body[data-dark-mode="true"] .station-section {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.1);
}

body[data-dark-mode="true"] .theme-controls {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-dark-mode="true"] .line-theme-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: white;
}

body[data-dark-mode="true"] .line-theme-card.locked {
  opacity: 0.4;
}

/* Consent Checkboxes */
.consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .consent-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
  }
  
  .consent-checkbox a {
    color: #c41230;
    text-decoration: underline;
  }

  /* Account Settings */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
  }
  
  .settings-section:last-child {
    border-bottom: none;
  }
  
  .account-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
  }
  
  .info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
  }
  
  .info-item:last-child {
    border-bottom: none;
  }
  
  .info-item label {
    font-weight: 600;
    color: #555;
  }
  
  .data-rights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
  }
  
  .right-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #c41230;
  }
  
  .right-item h4 {
    margin: 0 0 0.5rem 0;
    color: #c41230;
    font-size: 1rem;
  }
  
  .right-item p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #666;
  }

  /* Export buttons styling */
  .export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .export-buttons .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  .export-buttons .btn:nth-child(1) {
    background: #0066cc;
  }

  .export-buttons .btn:nth-child(2) {
    background: #28a745;
  }

  .export-buttons .btn:nth-child(3) {
    background: #6c757d;
  }

  .export-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  }

  /* Strava Integration Styling */
  .strava-connection {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
  }

  .strava-state {
    transition: all 0.3s ease;
  }

  .connection-status {
    text-align: center;
  }

  .connection-status.connected {
    text-align: left;
  }

  .strava-btn {
    background: linear-gradient(45deg, #fc4c02, #ff6b35);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
  }

  .strava-btn:hover {
    background: linear-gradient(45deg, #e03d00, #ff5722);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(252, 76, 2, 0.3);
  }

  .strava-icon {
    font-size: 1.2em;
  }

  .strava-actions {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
  }

  .sync-status {
    background: rgba(40, 167, 69, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin-top: 1rem;
  }

  .sync-status p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
  }

  .sync-status strong {
    color: #28a745;
  }

  /* Strava Match Indicators */
  .strava-match-indicator {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
  }

  .strava-match-indicator.matched {
    border-radius: 6px;
  }

  .strava-match-indicator.unmatched {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
  }

  .match-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
  }

  .confidence-score {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.1rem 0.4rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
  }

  .match-details {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
  }

  .manual-match-btn {
    background: #fc4c02;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
  }

  .manual-match-btn:hover {
    background: #e03d00;
    transform: translateY(-1px);
  }

  .strava-details-btn, .strava-unmatch-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: all 0.2s ease;
  }

  .strava-details-btn:hover {
    background: rgba(0, 123, 255, 0.1);
  }

  .strava-unmatch-btn:hover {
    background: rgba(220, 53, 69, 0.1);
  }

  .run-item.strava-matched {
    border-left: 3px solid #fc4c02;
  }

  .run-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
  }

  /* Strava Comparison Modal */
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal.hidden {
    display: none;
  }

  .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
  }

  .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    z-index: 1001;
  }

  .strava-modal {
    width: 1200px;
    max-width: 95vw;
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #fc4c02, #ff6b35);
    color: white;
  }

  .modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
  }

  .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
  }

  .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .modal-body {
    padding: 1.5rem;
    max-height: calc(95vh - 80px);
    overflow-y: auto;
  }

  .comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
  }

  .confidence-display {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .confidence-badge {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
  }

  .match-type {
    background: #6c757d;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
  }

  .comparison-actions {
    display: flex;
    gap: 0.75rem;
  }

  .comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .comparison-section h3 {
    margin: 0 0 1rem 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .data-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
  }

  .tuberun-data .data-card {
    border-left: 4px solid #c41230;
  }

  .strava-data .data-card {
    border-left: 4px solid #fc4c02;
  }

  .data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
  }

  .data-row:last-child {
    border-bottom: none;
  }

  .data-label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
  }

  .data-value {
    text-align: right;
    color: #333;
    word-break: break-word;
  }

  .comparison-maps {
    margin: 2rem 0;
  }

  .comparison-maps h3 {
    margin: 0 0 1rem 0;
    color: #333;
  }

  .maps-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .map-section h4 {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 1rem;
  }

  .comparison-map {
    height: 300px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
  }

  .match-analysis {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
  }

  .match-analysis h3 {
    margin: 0 0 1rem 0;
    color: #333;
  }

  .analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .analysis-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .analysis-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
  }

  .analysis-value {
    font-size: 1.1rem;
    color: #333;
  }

  /* Responsive design */
  @media (max-width: 768px) {
    .comparison-grid,
    .maps-container {
      grid-template-columns: 1fr;
    }
    
    .strava-modal {
      width: 95vw;
      margin: 1rem;
    }
    
    .comparison-header {
      flex-direction: column;
      gap: 1rem;
    }
  }

  /* Manual Match Modal */
  .manual-match-modal {
    width: 900px;
    max-width: 95vw;
  }

  .match-search-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .run-info h3 {
    margin: 0 0 1rem 0;
    color: #c41230;
  }

  .run-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }

  .detail-item {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-weight: 600;
    color: #333;
  }

  .search-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
  }

  .search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
  }

  .search-filter {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    min-width: 200px;
  }

  .activities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
  }

  .activities-header h3 {
    margin: 0;
    color: #fc4c02;
  }

  .count-badge {
    background: #fc4c02;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
  }

  .activities-grid {
    display: grid;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
  }

  .activity-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
  }

  .activity-item:hover {
    border-color: #fc4c02;
    box-shadow: 0 2px 8px rgba(252, 76, 2, 0.15);
    transform: translateY(-1px);
  }

  .activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
  }

  .activity-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    line-height: 1.2;
  }

  .activity-date {
    font-size: 0.8rem;
    color: #666;
  }

  .activity-confidence {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .activity-confidence.medium {
    background: #ffc107;
    color: #333;
  }

  .activity-confidence.low {
    background: #dc3545;
  }

  .activity-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .activity-stat {
    text-align: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
  }

  .stat-label {
    font-size: 0.7rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
  }

  .stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
  }

  .activity-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .match-btn {
    background: #fc4c02;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .match-btn:hover {
    background: #e03d00;
    transform: translateY(-1px);
  }

  .preview-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .preview-btn:hover {
    background: #5a6268;
  }

  .no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
  }

  .no-results p {
    margin: 0.5rem 0;
  }

  /* Scrollbar styling for activities list */
  .activities-grid::-webkit-scrollbar {
    width: 6px;
  }

  .activities-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  .activities-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }

  .activities-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }

  /* Historical Routes Styling */
  .historical-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #8b4513, #a0522d);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
  }

  .historical-badge h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .year-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .network-context {
    background: #f8f4e6;
    border: 1px solid #e6d8c5;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid #8b4513;
  }

  .network-context h4 {
    margin: 0 0 0.5rem 0;
    color: #8b4513;
    font-size: 1rem;
  }

  .network-context p {
    margin: 0;
    color: #5d4e37;
    font-style: italic;
    line-height: 1.4;
  }

  .historical-line-group {
    opacity: 0.8;
    transition: opacity 0.3s ease;
  }

  .historical-line-group.available {
    opacity: 1;
  }

  .historical-line-group.unavailable {
    opacity: 0.4;
    pointer-events: none;
  }

  .historical-line-group.unavailable h3 {
    color: #999;
  }

  .historical-line-group.unavailable .line-checkbox {
    color: #999;
  }

  .historical-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid #ffc107;
  }

  .historical-warning h4 {
    margin: 0 0 0.5rem 0;
    color: #856404;
  }

  .historical-warning p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
  }

  .run-item.historical {
    border-left: 4px solid #8b4513;
    background: linear-gradient(135deg, #faf8f3, #ffffff);
  }

  .run-item.historical .run-date {
    color: #8b4513;
  }

  .historical-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #8b4513;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
  }

  .network-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
  }

  .network-stat {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }

  .network-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 0.25rem;
  }

  .network-stat-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
  }

  /* Dark mode historical routes */
  body[data-dark-mode="true"] .historical-badge {
    background: linear-gradient(135deg, #5d4e37, #6b5b3f);
  }

  body[data-dark-mode="true"] .network-context {
    background: rgba(139, 69, 19, 0.1);
    border-color: rgba(139, 69, 19, 0.3);
    color: white;
  }

  body[data-dark-mode="true"] .network-context h4,
  body[data-dark-mode="true"] .network-context p {
    color: rgba(255, 255, 255, 0.9);
  }

  body[data-dark-mode="true"] .historical-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
  }

  body[data-dark-mode="true"] .network-stat {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
  }

  body[data-dark-mode="true"] .network-stat-value {
    color: #d4a574;
  }

  body[data-dark-mode="true"] .network-stat-label {
    color: rgba(255, 255, 255, 0.7);
  }

  /* Theme Controls */
  .theme-controls {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
  }

  .theme-option {
    margin-bottom: 2rem;
  }

  .theme-option:last-child {
    margin-bottom: 0;
  }

  .theme-option h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
  }

  .theme-option p {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9rem;
  }

  /* Dark/Light Mode Toggle */
  .theme-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .toggle-switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 34px;
    cursor: pointer;
  }

  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  .toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-radius: 34px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
  }

  .toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
  }

  .toggle-slider:before {
    content: "";
    position: absolute;
    height: 26px;
    width: 26px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    left: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }

  .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(36px);
  }

  .toggle-icon {
    font-size: 14px;
    z-index: 1;
    transition: opacity 0.3s ease;
  }

  .toggle-switch input:checked + .toggle-slider .toggle-icon.light {
    opacity: 0.5;
  }

  .toggle-switch input:not(:checked) + .toggle-slider .toggle-icon.dark {
    opacity: 0.5;
  }

  .theme-status {
    font-weight: 600;
    color: #333;
  }

  /* Line Themes Grid */
  .line-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .line-theme-card {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .line-theme-card.unlocked {
    cursor: pointer;
  }

  .line-theme-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .line-theme-card.active {
    border-color: #c41230;
    box-shadow: 0 0 0 2px rgba(196, 18, 48, 0.2);
  }

  .line-theme-card:hover:not(.locked) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }

  .line-theme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
  }

  .line-theme-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
  }

  .line-theme-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
  }

  .line-theme-status.unlocked {
    background: #28a745;
    color: white;
  }

  .line-theme-status.locked {
    background: #6c757d;
    color: white;
  }

  .line-theme-preview {
    height: 40px;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    display: flex;
    overflow: hidden;
  }

  .line-theme-color {
    flex: 1;
    height: 100%;
  }

  .line-theme-progress {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
  }

  .line-theme-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.7;
  }

  .current-theme {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
  }

  /* Line-specific theme colors */
  .theme-central {
    --primary-color: #dc241f;
    --primary-rgb: 220, 36, 31;
  }

  .theme-circle {
    --primary-color: #ffcd00;
    --primary-rgb: 255, 205, 0;
  }

  .theme-district {
    --primary-color: #007229;
    --primary-rgb: 0, 114, 41;
  }

  .theme-elizabeth {
    --primary-color: #6950a1;
    --primary-rgb: 105, 80, 161;
  }

  .theme-hammersmith {
    --primary-color: #f491a8;
    --primary-rgb: 244, 145, 168;
  }

  .theme-jubilee {
    --primary-color: #868f98;
    --primary-rgb: 134, 143, 152;
  }

  .theme-metropolitan {
    --primary-color: #91005a;
    --primary-rgb: 145, 0, 90;
  }

  .theme-northern {
    --primary-color: #000000;
    --primary-rgb: 0, 0, 0;
  }

  .theme-piccadilly {
    --primary-color: #0019a8;
    --primary-rgb: 0, 25, 168;
  }

  .theme-victoria {
    --primary-color: #0098d8;
    --primary-rgb: 0, 152, 216;
  }

  .theme-waterloo {
    --primary-color: #87ceeb;
    --primary-rgb: 135, 206, 235;
  }

  /* Apply line theme colors - Support both class and data attribute approaches */
  [data-theme^="theme-"]:not([data-theme="theme-default"]),
  body[class*="theme-"]:not(.theme-default) {
    --tuberun-primary: var(--primary-color);
    --tuberun-primary-rgb: var(--primary-rgb);
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .card,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .glass-card,
  body[class*="theme-"]:not(.theme-default) .card,
  body[class*="theme-"]:not(.theme-default) .glass-card {
    border-left: 4px solid var(--primary-color);
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .btn:not(.btn-small),
  body[class*="theme-"]:not(.theme-default) .btn:not(.btn-small) {
    background: var(--primary-color);
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .nav-tab.active,
  body[class*="theme-"]:not(.theme-default) .nav-tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .run-item.strava-matched,
  body[class*="theme-"]:not(.theme-default) .run-item.strava-matched {
    border-left-color: var(--primary-color);
  }

  /* === PLATFORM AESTHETICS INTEGRATION === */
  
  /* Platform Panel Colors - Main content areas styled as platform panels */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .content-section,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .main-content,
  body[class*="theme-"]:not(.theme-default) .content-section,
  body[class*="theme-"]:not(.theme-default) .main-content {
    background: linear-gradient(135deg, 
      rgba(var(--primary-rgb), 0.02) 0%, 
      rgba(var(--primary-rgb), 0.05) 100%);
    border-top: 3px solid var(--primary-color);
  }

  /* Station Sign Backgrounds - Navigation and headers */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .nav-container,
  body[class*="theme-"]:not(.theme-default) .nav-container {
    background: linear-gradient(90deg, 
      var(--primary-color) 0%, 
      var(--primary-color) 100%);
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.3);
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .page-header h1,
  body[class*="theme-"]:not(.theme-default) .page-header h1 {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 3px 6px rgba(var(--primary-rgb), 0.4);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  }

  /* Platform Edge Indicators - Card borders and dividers */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .card::before,
  body[class*="theme-"]:not(.theme-default) .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
      var(--primary-color) 0%, 
      rgba(var(--primary-rgb), 0.8) 50%, 
      var(--primary-color) 100%);
    border-radius: 4px 4px 0 0;
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
      var(--primary-color) 0%, 
      rgba(var(--primary-rgb), 0.8) 50%, 
      var(--primary-color) 100%);
    border-radius: 8px 8px 0 0;
  }

  /* Themed Tile Accents - Subtle background patterns */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .controls-grid,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .line-toggles {
    background: 
      radial-gradient(circle at 20% 20%, rgba(var(--primary-rgb), 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(var(--primary-rgb), 0.1) 0%, transparent 50%);
    border-radius: 12px;
    padding: 1rem;
  }

  /* Platform Bench Effect - Enhanced form inputs */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) input[type="text"],
  [data-theme^="theme-"]:not([data-theme="theme-default"]) input[type="number"],
  [data-theme^="theme-"]:not([data-theme="theme-default"]) input[type="email"],
  [data-theme^="theme-"]:not([data-theme="theme-default"]) select,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) textarea {
    border: 2px solid rgba(var(--primary-rgb), 0.2);
    background: rgba(var(--primary-rgb), 0.02);
    transition: all 0.3s ease;
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) input:focus,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) select:focus,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) textarea:focus {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  }

  /* Station Announcements - Progress indicators and status */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .progress-bar-fill {
    background: linear-gradient(90deg, 
      var(--primary-color), 
      rgba(var(--primary-rgb), 0.8));
    box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.4);
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .line-progress-fill {
    background: linear-gradient(90deg, 
      var(--primary-color), 
      rgba(var(--primary-rgb), 0.9)) !important;
  }

  /* Roundel Integration - Logo and branding elements */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .tuberun-logo::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.4);
  }

  /* === SECTION-SPECIFIC PLATFORM THEMES === */

  /* Route Generator → Central Line Theme */
  .nav-tab[data-section="generate"].active,
  [data-current-section="generate"] {
    --section-primary: #dc241f;
    --section-rgb: 220, 36, 31;
  }

  /* Historical Routes → Metropolitan Line Theme (Vintage) */
  .nav-tab[data-section="historical"].active,
  [data-current-section="historical"] {
    --section-primary: #91005a;
    --section-rgb: 145, 0, 90;
  }

  [data-current-section="historical"] .page-header {
    background: linear-gradient(135deg, 
      rgba(145, 0, 90, 0.1) 0%, 
      rgba(145, 0, 90, 0.05) 100%);
    border: 2px solid rgba(145, 0, 90, 0.2);
    position: relative;
  }

  [data-current-section="historical"] .page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(145, 0, 90, 0.05) 10px,
        rgba(145, 0, 90, 0.05) 20px
      );
    border-radius: 8px;
    pointer-events: none;
  }

  /* Run Log → Northern Line Theme */
  .nav-tab[data-section="history"].active,
  [data-current-section="history"] {
    --section-primary: #000000;
    --section-rgb: 0, 0, 0;
  }

  [data-current-section="history"] .run-item {
    border-left: 4px solid #000000;
    background: linear-gradient(90deg, 
      rgba(0, 0, 0, 0.02) 0%, 
      transparent 50%);
  }

  /* Progress → Circle Line Theme (Complete loops) */
  .nav-tab[data-section="progress"].active,
  [data-current-section="progress"] {
    --section-primary: #ffcd00;
    --section-rgb: 255, 205, 0;
  }

  [data-current-section="progress"] .line-progress-item.completed {
    background: linear-gradient(135deg, 
      rgba(255, 205, 0, 0.1) 0%, 
      rgba(255, 205, 0, 0.05) 100%);
    border-left-color: #ffcd00;
  }

  [data-current-section="progress"] .line-progress-item.completed::after {
    content: '●';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #ffcd00;
    font-size: 1.5rem;
  }

  /* Leaderboard → Jubilee Line Theme (Modern) */
  .nav-tab[data-section="leaderboard"].active,
  [data-current-section="leaderboard"] {
    --section-primary: #868f98;
    --section-rgb: 134, 143, 152;
  }

  [data-current-section="leaderboard"] .card {
    background: linear-gradient(135deg, 
      rgba(134, 143, 152, 0.02) 0%, 
      rgba(134, 143, 152, 0.08) 100%);
    border: 1px solid rgba(134, 143, 152, 0.2);
  }

  /* Account → District Line Theme (Traditional) */
  .nav-tab[data-section="account"].active,
  [data-current-section="account"] {
    --section-primary: #007229;
    --section-rgb: 0, 114, 41;
  }

  [data-current-section="account"] .theme-controls {
    border: 2px solid rgba(0, 114, 41, 0.2);
    background: linear-gradient(135deg, 
      rgba(0, 114, 41, 0.02) 0%, 
      rgba(0, 114, 41, 0.05) 100%);
  }

  /* === ENHANCED PLATFORM VISUAL ELEMENTS === */

  /* Platform Tiles Pattern */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) body::before,
  body[class*="theme-"]:not(.theme-default)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      repeating-linear-gradient(
        0deg,
        transparent,
        transparent 100px,
        rgba(var(--primary-rgb), 0.01) 100px,
        rgba(var(--primary-rgb), 0.01) 102px
      ),
      repeating-linear-gradient(
        90deg,
        transparent,
        transparent 100px,
        rgba(var(--primary-rgb), 0.01) 100px,
        rgba(var(--primary-rgb), 0.01) 102px
      );
    pointer-events: none;
    z-index: -1;
  }

  /* Station Name Plates */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .nav-tab,
  body[class*="theme-"]:not(.theme-default) .nav-tab {
    position: relative;
    overflow: hidden;
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .nav-tab.active::before,
  body[class*="theme-"]:not(.theme-default) .nav-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    box-shadow: 0 3px 6px rgba(var(--primary-rgb), 0.4);
  }

  /* Platform Edge Warning */
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .line-progress-item,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .run-item {
    position: relative;
  }

  [data-theme^="theme-"]:not([data-theme="theme-default"]) .line-progress-item::before,
  [data-theme^="theme-"]:not([data-theme="theme-default"]) .run-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, 
      var(--primary-color) 0%, 
      rgba(var(--primary-rgb), 0.5) 100%);
    border-radius: 0 2px 2px 0;
  }

  /* === ACCESSIBILITY ENHANCEMENTS === */

  /* High contrast mode support */
  @media (prefers-contrast: high) {
    [data-theme^="theme-"]:not([data-theme="theme-default"]) {
      --primary-color: var(--primary-color);
      filter: contrast(1.2);
    }
  }

  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    [data-theme^="theme-"]:not([data-theme="theme-default"]) * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* Dark mode platform adjustments */
  body:not([data-dark-mode="false"]) [data-theme^="theme-"]:not([data-theme="theme-default"]) .nav-container {
    background: linear-gradient(90deg, 
      rgba(var(--primary-rgb), 0.8) 0%, 
      rgba(var(--primary-rgb), 0.9) 100%);
  }

  body:not([data-dark-mode="false"]) [data-theme^="theme-"]:not([data-theme="theme-default"]) .content-section,
  body:not([data-dark-mode="false"]) [data-theme^="theme-"]:not([data-theme="theme-default"]) .main-content {
    background: linear-gradient(135deg, 
      rgba(var(--primary-rgb), 0.05) 0%, 
      rgba(var(--primary-rgb), 0.1) 100%);
  }

  /* === LINE-SPECIFIC PERSONALITY THEMES === */

  /* Central Line - Bold and Direct */
  [data-theme="theme-central"],
  body.theme-central {
    --theme-personality: 'central';
  }

  [data-theme="theme-central"] .card,
  [data-theme="theme-central"] .glass-card,
  body.theme-central .card,
  body.theme-central .glass-card {
    box-shadow: 0 4px 8px rgba(220, 36, 31, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  [data-theme="theme-central"] .btn:not(.btn-small):hover {
    background: linear-gradient(135deg, #dc241f 0%, #a01b17 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(220, 36, 31, 0.4);
  }

  /* Northern Line - Minimalist and Modern */
  [data-theme="theme-northern"],
  body.theme-northern {
    --theme-personality: 'northern';
  }

  [data-theme="theme-northern"] .card,
  [data-theme="theme-northern"] .glass-card,
  body.theme-northern .card,
  body.theme-northern .glass-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #000000;
    color: #000000;
  }

  [data-theme="theme-northern"] .page-header h1 {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #000000;
  }

  /* Circle Line - Continuous Flow */
  [data-theme="theme-circle"],
  body.theme-circle {
    --theme-personality: 'circle';
  }

  [data-theme="theme-circle"] body::before,
  body.theme-circle::before {
    background: 
      radial-gradient(circle at 25% 25%, rgba(255, 205, 0, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 75% 75%, rgba(255, 205, 0, 0.1) 0%, transparent 50%),
      repeating-conic-gradient(from 0deg at 50% 50%, 
        transparent 0deg, transparent 15deg,
        rgba(255, 205, 0, 0.02) 15deg, rgba(255, 205, 0, 0.02) 30deg);
  }

  [data-theme="theme-circle"] .line-progress-item,
  [data-theme="theme-circle"] .run-item {
    border-radius: 20px;
    overflow: hidden;
  }

  [data-theme="theme-circle"] .line-progress-item::before,
  [data-theme="theme-circle"] .run-item::before {
    border-radius: 20px 0 0 20px;
  }

  /* District Line - Traditional and Reliable */
  [data-theme="theme-district"] {
    --theme-personality: 'district';
  }

  [data-theme="theme-district"] .card,
  [data-theme="theme-district"] .glass-card {
    background: 
      linear-gradient(135deg, #ffffff 0%, #f8fff8 100%);
    border: 2px solid rgba(0, 114, 41, 0.2);
    box-shadow: 0 2px 4px rgba(0, 114, 41, 0.1);
  }

  [data-theme="theme-district"] .nav-container {
    background: linear-gradient(90deg, #007229 0%, #005a1f 100%);
    border-bottom: 3px solid #ffffff;
  }

  /* Metropolitan Line - Heritage and Vintage */
  [data-theme="theme-metropolitan"] {
    --theme-personality: 'metropolitan';
  }

  [data-theme="theme-metropolitan"] body::before {
    background: 
      repeating-linear-gradient(45deg, 
        transparent, transparent 20px,
        rgba(145, 0, 90, 0.02) 20px, rgba(145, 0, 90, 0.02) 40px),
      repeating-linear-gradient(-45deg, 
        transparent, transparent 20px,
        rgba(145, 0, 90, 0.01) 20px, rgba(145, 0, 90, 0.01) 40px);
  }

  [data-theme="theme-metropolitan"] .card,
  [data-theme="theme-metropolitan"] .glass-card {
    background: linear-gradient(135deg, #fefefe 0%, #fbf7fb 100%);
    border: 1px solid rgba(145, 0, 90, 0.3);
    position: relative;
  }

  [data-theme="theme-metropolitan"] .card::after,
  [data-theme="theme-metropolitan"] .glass-card::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #91005a 0%, #b8006e 100%);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(145, 0, 90, 0.3);
  }

  /* Jubilee Line - Sleek and Contemporary */
  [data-theme="theme-jubilee"] {
    --theme-personality: 'jubilee';
  }

  [data-theme="theme-jubilee"] .card,
  [data-theme="theme-jubilee"] .glass-card {
    background: linear-gradient(135deg, #fdfdfd 0%, #f5f6f7 100%);
    border: 1px solid rgba(134, 143, 152, 0.3);
    backdrop-filter: blur(10px);
  }

  [data-theme="theme-jubilee"] .nav-container {
    background: linear-gradient(90deg, 
      rgba(134, 143, 152, 0.95) 0%, 
      rgba(134, 143, 152, 1) 100%);
    backdrop-filter: blur(20px);
  }

  [data-theme="theme-jubilee"] .btn:not(.btn-small) {
    background: linear-gradient(135deg, #868f98 0%, #6b7480 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(134, 143, 152, 0.4);
  }

  /* Victoria Line - Clean and Efficient */
  [data-theme="theme-victoria"] {
    --theme-personality: 'victoria';
  }

  [data-theme="theme-victoria"] .card,
  [data-theme="theme-victoria"] .glass-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0faff 100%);
    border-left: 6px solid #0098d8;
    box-shadow: 0 3px 6px rgba(0, 152, 216, 0.2);
  }

  [data-theme="theme-victoria"] .line-progress-item::before,
  [data-theme="theme-victoria"] .run-item::before {
    width: 6px;
    background: linear-gradient(180deg, #0098d8 0%, #0076a8 100%);
  }

  /* Piccadilly Line - Deep and Sophisticated */
  [data-theme="theme-piccadilly"] {
    --theme-personality: 'piccadilly';
  }

  [data-theme="theme-piccadilly"] .card,
  [data-theme="theme-piccadilly"] .glass-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f3ff 100%);
    border: 2px solid rgba(0, 25, 168, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 25, 168, 0.1);
  }

  [data-theme="theme-piccadilly"] .nav-container {
    background: linear-gradient(90deg, #0019a8 0%, #001785 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  }

  /* Hammersmith & City Line - Industrial Heritage */
  [data-theme="theme-hammersmith"] {
    --theme-personality: 'hammersmith';
  }

  [data-theme="theme-hammersmith"] .card,
  [data-theme="theme-hammersmith"] .glass-card {
    background: linear-gradient(135deg, #ffffff 0%, #fefbfc 100%);
    border: 1px solid rgba(244, 145, 168, 0.4);
  }

  [data-theme="theme-hammersmith"] body::before {
    background: 
      repeating-linear-gradient(0deg,
        transparent, transparent 50px,
        rgba(244, 145, 168, 0.02) 50px, rgba(244, 145, 168, 0.02) 52px);
  }

  /* Waterloo & City Line - Compact and Focused */
  [data-theme="theme-waterloo"] {
    --theme-personality: 'waterloo';
  }

  [data-theme="theme-waterloo"] .card,
  [data-theme="theme-waterloo"] .glass-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0feff 100%);
    border-radius: 6px;
    border: 1px solid rgba(135, 206, 235, 0.3);
  }

  [data-theme="theme-waterloo"] .btn:not(.btn-small) {
    background: linear-gradient(135deg, #87ceeb 0%, #5fb3d4 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  }

  /* Elizabeth Line - Modern Luxury */
  [data-theme="theme-elizabeth"] {
    --theme-personality: 'elizabeth';
  }

  [data-theme="theme-elizabeth"] .card,
  [data-theme="theme-elizabeth"] .glass-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f6ff 100%);
    border: 2px solid rgba(105, 80, 161, 0.2);
    box-shadow: 0 4px 8px rgba(105, 80, 161, 0.15);
  }

  [data-theme="theme-elizabeth"] .nav-container {
    background: linear-gradient(90deg, #6950a1 0%, #553d82 100%);
    box-shadow: 0 4px 8px rgba(105, 80, 161, 0.4);
  }

  [data-theme="theme-elizabeth"] .page-header h1 {
    background: linear-gradient(135deg, #6950a1 0%, #553d82 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(105, 80, 161, 0.4);
  }

  .consent-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
  }
  
  .consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .consent-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
  }

  /* Enhanced Run Editing Styles - Add to your style.css */

/* Form enhancements */
.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
  }
  
  .form-actions .btn {
    margin: 0;
  }
  
  #notesCounter {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
  }
  
  textarea {
    resize: vertical;
    min-height: 80px;
  }
  
  /* Enhanced run history */
  .run-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid #c41230;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
  }
  
  .run-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-1px);
  }
  
  .run-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
  }
  
  .run-date-source {
    flex: 1;
  }
  
  .run-date {
    font-weight: 600;
    color: #c41230;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .run-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .run-source {
    font-size: 0.85rem;
    color: #666;
    padding: 0.25rem 0.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
  }
  
  .run-difficulty {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .run-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  
  .edit-run-btn, .delete-run-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
  }
  
  .edit-run-btn {
    background: #e7f3ff;
    color: #0066cc;
  }
  
  .edit-run-btn:hover {
    background: #cce7ff;
    transform: scale(1.05);
  }
  
  .delete-run-btn {
    background: #ffebee;
    color: #d32f2f;
  }
  
  .delete-run-btn:hover {
    background: #ffcdd2;
    transform: scale(1.05);
  }
  
  .run-details {
    color: #555;
  }
  
  .run-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .stat {
    font-size: 0.9rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #c41230;
  }
  
  .stat strong {
    color: #333;
    display: inline-block;
    min-width: 80px;
  }
  
  .run-notes {
    background: #f0f8ff;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #4a90e2;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 1rem;
  }
  
  .run-notes strong {
    color: #4a90e2;
    margin-bottom: 0.5rem;
    display: block;
  }
  
  /* Pace highlighting */
  .stat:has([title*="pace"]), 
  .stat:contains("Pace") {
    background: #e8f5e8;
    border-left-color: #28a745;
  }
  
  /* Form validation states */
  .control-group input:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
  }
  
  .control-group input:valid {
    border-color: #28a745;
  }
  
  /* Loading states */
  .run-item.loading {
    opacity: 0.6;
    pointer-events: none;
  }
  
  .run-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #c41230;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Enhanced form styling */
  .control-group select,
  .control-group textarea {
    transition: all 0.2s ease;
  }
  
  .control-group select:focus,
  .control-group textarea:focus {
    border-color: #c41230;
    box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.1);
    outline: none;
  }
  
  /* Difficulty badges */
  .difficulty-easy {
    background: #d4edda !important;
    color: #155724 !important;
    border-color: #c3e6cb !important;
  }
  
  .difficulty-medium {
    background: #fff3cd !important;
    color: #856404 !important;
    border-color: #ffeaa7 !important;
  }
  
  .difficulty-hard {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
  }
  
  /* Responsive adjustments */
  @media (max-width: 768px) {
    .run-header {
      flex-direction: column;
      gap: 1rem;
    }
    
    .run-actions {
      align-self: flex-end;
    }
    
    .run-stats {
      grid-template-columns: 1fr;
    }
    
    .form-actions {
      flex-direction: column;
      align-items: stretch;
    }
    
    .run-meta {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
    }
  }
  
  /* Enhanced animations */
  .run-item.fade-in {
    animation: fadeInUp 0.4s ease-out;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Edit mode highlighting */
  .run-item.editing {
    border-left-color: #ffc107;
    background: #fffbf0;
  }
  
  .run-item.editing .run-date {
    color: #ffc107;
  }
  
  /* Statistics enhancement */
  .pace-highlight {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    font-weight: 600;
  }
  
  .duration-highlight {
    background: linear-gradient(135deg, #007bff, #6610f2) !important;
    color: white !important;
    font-weight: 600;
  }
  
  /* Better visual hierarchy */
  .run-details h4 {
    color: #c41230;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  /* Form improvements */
  .controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
  }
  
  .control-group small {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: block;
  }
  
  /* Success/error states */
  .run-item.success {
    border-left-color: #28a745;
    background: #f8fff9;
  }
  
  .run-item.error {
    border-left-color: #dc3545;
    background: #fff8f8;
  }

  .line-progress-container {
    max-width: 100%;
  }
  
  .line-progress-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #dee2e6;
  }
  
  .summary-stat {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #c41230;
    margin-bottom: 0.25rem;
  }
  
  .stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
  }
  
  .line-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .line-progress-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
  }
  
  .line-progress-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-1px);
  }
  
  .line-progress-item.completed {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f8fff9, #ffffff);
  }
  
  .line-progress-item.started {
    border-left: 4px solid #ffc107;
    background: linear-gradient(135deg, #fffbf0, #ffffff);
  }
  
  .line-progress-item.unstarted {
    border-left: 4px solid #6c757d;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
  }
  
  .line-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .line-header:hover {
    background-color: rgba(0,0,0,0.02);
  }
  
  .line-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0; /* Allow text truncation */
  }
  
  .line-progress-item .line-indicator {
    width: 12px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }
  
  .line-details {
    flex: 1;
    min-width: 0;
  }
  
  .line-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.25rem;
  }
  
  .line-stats {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .line-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 2;
    max-width: 300px;
  }
  
  .line-progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .line-progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, currentColor, currentColor);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  
  .line-percentage {
    font-weight: 600;
    color: #333;
    min-width: 45px;
    text-align: right;
    font-size: 0.9rem;
  }
  
  .line-toggle {
    padding: 0.5rem;
    color: #666;
  }
  
  .toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
  }
  
  .line-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid #f0f0f0;
    background: rgba(0,0,0,0.01);
  }
  
  .station-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .station-section {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
  }
  
  .section-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .section-title.visited {
    color: #28a745;
  }
  
  .section-title.unvisited {
    color: #6c757d;
  }
  
  .station-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .station-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
  }
  
  .station-tag.visited {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
  }
  
  .station-tag.unvisited {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
  }
  
  .station-tag.more {
    background: #e2e3e5;
    color: #495057;
    border: 1px solid #ced4da;
    font-style: italic;
  }
  
  .station-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .line-achievements {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-radius: 8px;
    border-left: 4px solid #ffc107;
  }
  
  .achievement {
    font-weight: 600;
    color: #856404;
    text-align: center;
    font-size: 0.9rem;
  }
  
  .unstarted-message {
    font-style: italic;
    color: #6c757d;
    text-align: center;
    font-size: 0.9rem;
  }
  
  /* Animations */
  @keyframes slideDown {
    from {
      opacity: 0;
      max-height: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      max-height: 1000px;
      transform: translateY(0);
    }
  }
  
  .line-content.expanding {
    animation: slideDown 0.3s ease-out;
  }
  
  /* Progress indicators */
  .line-progress-item.completed .line-percentage {
    color: #28a745;
    font-weight: bold;
  }
  
  .line-progress-item.started .line-percentage {
    color: #ffc107;
    font-weight: bold;
  }
  
  .line-progress-item.unstarted .line-percentage {
    color: #6c757d;
  }
  
  /* Special styling for completed lines */
  .line-progress-item.completed .line-name::after {
    content: " 🎉";
    font-size: 0.8rem;
  }
  
  /* Mobile responsive */
  @media (max-width: 768px) {
    .line-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
      padding: 1rem;
    }
    
    .line-progress-bar-container {
      width: 100%;
      max-width: none;
    }
    
    .line-info {
      width: 100%;
    }
    
    .station-list {
      gap: 0.25rem;
    }
    
    .station-tag {
      font-size: 0.75rem;
      padding: 0.2rem 0.5rem;
    }
    
    .line-progress-summary {
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 0.75rem;
    }
    
    .summary-stat {
      padding: 0.75rem;
    }
    
    .stat-number {
      font-size: 1.5rem;
    }
  }

/* Route Export Section */
.route-export-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.route-export-section h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.route-export-section p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.export-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.export-buttons .btn {
  min-width: 120px;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.export-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.export-buttons .btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.export-status {
  min-height: 20px;
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.export-status.loading {
  color: var(--info-color);
}

.export-status.success {
  color: var(--success-color);
}

.export-status.error {
  color: var(--error-color);
}

.export-status .loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--info-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Route Preferences */
.route-preferences {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.route-preferences h5 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
}

.preference-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preference-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.preference-checkbox:hover {
  color: var(--text-primary);
}

.preference-checkbox input[type="checkbox"] {
  margin-right: 0.5rem;
  transform: scale(1.1);
  accent-color: var(--primary-color);
}

.preference-checkbox .checkmark {
  margin-left: 0.25rem;
}

/* Mode Switcher Styles */
.mode-switcher {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.mode-btn.active {
  background: white;
  color: var(--primary-color);
  border-color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Pub Mode Styling */
.pub-mode .roundel {
  background: var(--pub-primary) !important;
  border-color: var(--pub-secondary) !important;
}

.pub-mode .btn:not(.btn-secondary):not(.btn-small) {
  background: var(--pub-primary) !important;
  border-color: var(--pub-secondary) !important;
}

.pub-mode .btn:not(.btn-secondary):not(.btn-small):hover {
  background: var(--pub-secondary) !important;
}

.pub-mode .mode-btn.active {
  color: var(--pub-primary) !important;
}

/* Area Toggles for Pub Mode */
.area-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.area-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.area-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.area-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.pub-mode .area-toggle input[type="checkbox"] {
  accent-color: var(--pub-primary);
}

.area-toggle span {
  font-weight: 500;
  color: var(--text-primary);
}

/* Coming Soon Placeholder */
.coming-soon {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-style: italic;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .export-buttons {
    flex-direction: column;
  }
  
  .export-buttons .btn {
    width: 100%;
    min-width: auto;
  }
  
  .preference-controls {
    gap: 0.75rem;
  }
  
  .mode-switcher {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .mode-btn {
    width: 100%;
    text-align: center;
  }
  
  .area-toggles {
    grid-template-columns: 1fr;
  }
}

/* Network Progress Map Styles */
.map-legend {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.map-legend h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.legend-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.legend-marker.visited {
  background-color: var(--success-color);
}

.legend-marker.unvisited {
  background-color: var(--text-muted);
}

.legend-line {
  width: 20px;
  height: 4px;
  border-radius: 2px;
}

.legend-line.completed {
  background-color: var(--success-color);
}

.legend-line.partial {
  background: linear-gradient(90deg, var(--success-color) 0%, var(--warning-color) 50%, var(--text-muted) 100%);
}

.legend-line.unstarted {
  background-color: var(--text-muted);
}

/* Progress Map Container */
#progressMapContainer {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Leaflet popup customization for progress map */
.progress-station-popup {
  font-size: 0.9rem;
}

.progress-station-popup .station-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.progress-station-popup .station-lines {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.progress-station-popup .station-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.progress-station-popup .station-status.visited {
  background-color: var(--success-color);
  color: white;
}

.progress-station-popup .station-status.unvisited {
  background-color: var(--text-muted);
  color: white;
}

/* Leaderboard Settings Styles */
.leaderboard-settings {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.setting-group {
  margin-bottom: 2rem;
}

.participation-controls {
  margin-bottom: 1.5rem;
}

.toggle-setting {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.toggle-switch-small {
  position: relative;
  width: 40px;
  height: 20px;
  background-color: var(--text-muted);
  border-radius: 20px;
  transition: background-color 0.3s;
}

.slider-small {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-setting input:checked + .toggle-switch-small {
  background-color: var(--primary-color);
}

.toggle-setting input:checked + .toggle-switch-small .slider-small {
  transform: translateX(20px);
}

.setting-label {
  font-weight: 500;
  color: var(--text-primary);
}

.leaderboard-options {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.display-name-section {
  margin-bottom: 1.5rem;
}

.display-name-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.display-name-section input {
  width: 100%;
  max-width: 300px;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
}

.privacy-options {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.privacy-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.category-selection {
  margin: 1.5rem 0;
}

.category-selection h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.category-selection p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.category-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-checkbox:hover {
  border-color: var(--primary-color);
  background: var(--bg-primary);
}

.category-checkbox input:checked + .checkmark + .category-info {
  opacity: 1;
}

.category-info {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.category-info strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.category-info small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.leaderboard-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.current-rankings {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.current-rankings h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

/* Responsive leaderboard settings */
@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
  
  .leaderboard-actions {
    flex-direction: column;
  }
  
  .leaderboard-actions button {
    width: 100%;
  }
}

/* Map lazy loading and performance improvements */
.map-container {
  position: relative;
  min-height: 400px;
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
}

.map-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, var(--bg-secondary) 25%, transparent 25%), 
              linear-gradient(-45deg, var(--bg-secondary) 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, var(--bg-secondary) 75%), 
              linear-gradient(-45deg, transparent 75%, var(--bg-secondary) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  z-index: 1000;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Optimize map container for performance */
.map-container[data-loaded="true"] .map-loading {
  display: none;
}

/* Performance optimizations for touch devices */
@media (hover: none) and (pointer: coarse) {
  .map-container {
    touch-action: pan-x pan-y;
  }
}

/* Improve contrast for map controls on mobile */
@media (max-width: 768px) {
  .leaflet-control-container {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  }
  
  .leaflet-control-zoom a {
    width: 35px !important;
    height: 35px !important;
    line-height: 35px !important;
    font-size: 20px !important;
  }
}

/* Global error handling styles */
.global-error {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease-out;
}

.global-error.info {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.global-error.warning {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: #212529;
}

.error-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  gap: 1rem;
}

.error-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.error-message {
  flex: 1;
  font-weight: 500;
  line-height: 1.4;
}

.error-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: inherit;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.error-close:hover {
  background: rgba(255,255,255,0.3);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Ensure body content doesn't hide behind error banner */
.global-error + * {
  margin-top: 0;
}

/* Enhanced message styles for better error display */
.message {
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid;
  background: var(--bg-secondary);
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.message.error {
  background: rgba(220, 53, 69, 0.1);
  border-left-color: #dc3545;
  color: #721c24;
}

.message.success {
  background: rgba(40, 167, 69, 0.1);
  border-left-color: #28a745;
  color: #155724;
}

.message.warning {
  background: rgba(255, 193, 7, 0.1);
  border-left-color: #ffc107;
  color: #856404;
}

.message.info {
  background: rgba(23, 162, 184, 0.1);
  border-left-color: #17a2b8;
  color: #0c5460;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading states with better error handling */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-style: italic;
  position: relative;
}

.loading.error {
  color: #dc3545;
  font-style: normal;
}

.loading.error::before {
  content: '⚠️ ';
  margin-right: 0.5rem;
}

/* Mobile-first touch targets and improvements */
@media (max-width: 768px) {
  /* Improve button touch targets - minimum 44px for accessibility */
  .btn {
    min-height: 48px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    margin: 8px 4px !important;
    letter-spacing: 0.5px;
  }
  
  .btn-small {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
  }
  
  .btn-large {
    min-height: 56px !important;
    padding: 16px 24px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
  }
  
  /* Enhanced nav tabs for touch */
  .nav-tab {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    margin: 0 2px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  /* Mode switcher buttons */
  .mode-btn {
    min-height: 50px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    border-radius: 25px !important;
    margin: 0 4px !important;
  }
  
  /* Form inputs with better touch targets */
  input[type="text"], 
  input[type="email"], 
  input[type="password"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    border-radius: 8px !important;
    margin: 8px 0 !important;
  }
  
  /* Checkbox and radio improvements */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 0 8px 0 0 !important;
  }
  
  /* Better spacing for checkbox labels */
  .preference-checkbox,
  .consent-checkbox,
  .category-checkbox {
    padding: 12px 8px !important;
    margin: 8px 0 !important;
    min-height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  }
  
  /* Auth toggle buttons */
  .auth-toggle button {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 16px !important;
    background: none !important;
    border: none !important;
    color: var(--primary-color) !important;
    text-decoration: underline !important;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(196, 18, 48, 0.1);
  }
  
  /* Line and zone toggles */
  .line-toggle,
  .zone-toggle,
  .area-toggle {
    min-height: 48px !important;
    padding: 12px 16px !important;
    margin: 4px !important;
    border-radius: 8px !important;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  }
  
  /* Station items in results */
  .station-item {
    padding: 16px !important;
    margin: 8px 0 !important;
    border-radius: 12px !important;
    min-height: 60px;
  }
  
  /* Export buttons container */
  .export-buttons {
    display: flex;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 16px 0 !important;
  }
  
  .export-buttons .btn {
    width: 100% !important;
    justify-content: center;
  }
  
  /* Controls grid for mobile */
  .controls-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin: 16px 0 !important;
  }
  
  /* Control groups with better spacing */
  .control-group {
    margin: 16px 0 !important;
  }
  
  .control-group label {
    font-size: 16px !important;
    font-weight: 500 !important;
    margin-bottom: 8px !important;
    display: block !important;
  }
  
  /* Settings sections */
  .settings-section {
    margin: 24px 0 !important;
    padding: 20px !important;
  }
  
  /* Better modal sizing */
  .modal-content {
    margin: 20px !important;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
  }
  
  /* Header improvements */
  .header-content {
    flex-direction: column !important;
    text-align: center !important;
    gap: 16px !important;
  }
  
  .mode-switcher {
    order: -1;
    margin-bottom: 16px !important;
  }
  
  /* Auth info repositioning */
  .auth-info {
    padding: 12px 20px !important;
    text-align: center !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  /* Improve list items in progress/settings */
  .stat-card {
    margin: 16px 0 !important;
    padding: 20px !important;
  }
  
  /* Progress mosaic on mobile */
  .progress-mosaic {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  /* Run history improvements */
  .run-item {
    padding: 16px !important;
    margin: 12px 0 !important;
    border-radius: 12px !important;
  }
  
  /* Better spacing for forms */
  .auth-form {
    padding: 24px 20px !important;
  }
  
  /* Ensure text is readable */
  body {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }
  
  /* Remove hover effects on touch devices */
  .btn:hover,
  .nav-tab:hover,
  .line-toggle:hover {
    transform: none !important;
  }
  
  /* Add active states for better feedback */
  .btn:active,
  .nav-tab:active,
  .line-toggle:active,
  button:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }
  
  /* Mobile menu styles */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
  }
  
  .mobile-menu {
    background: var(--bg-primary);
    border-radius: 16px;
    margin: 20px;
    max-width: 300px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
  }
  
  .mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
  }
  
  .mobile-menu-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
  }
  
  .mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
  }
  
  .mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.1);
  }
  
  .mobile-menu-content {
    padding: 10px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
  }
  
  .mobile-menu-item {
    display: block;
    width: 100%;
    padding: 16px 20px;
    margin: 4px 0;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
  }
  
  .mobile-menu-item:hover,
  .mobile-menu-item.active {
    background: var(--primary-color);
    color: white;
  }
  
  @keyframes slideUp {
    from {
      transform: translateY(100px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  
  /* Small screen optimizations */
  @media (max-width: 480px) {
    .nav-tabs {
      overflow-x: auto;
      padding: 0 10px;
      margin: 0 -10px;
    }
    
    .nav-tab {
      flex-shrink: 0;
      white-space: nowrap;
      min-width: 120px !important;
    }
    
    .container {
      padding: 10px !important;
    }
    
    .card {
      margin: 10px 0 !important;
      padding: 16px !important;
    }
    
    .modal-content {
      margin: 10px !important;
      border-radius: 12px !important;
    }
  }
}

/* Mobile map controls */
.mobile-map-controls {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px;
}

.mobile-zoom-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-zoom-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: white;
  border-radius: 8px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.mobile-zoom-btn:active {
  transform: scale(0.95);
  background: #f0f0f0;
}

.mobile-map-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-map-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: white;
  border-radius: 8px;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.mobile-map-btn:active {
  transform: scale(0.95);
  background: #f0f0f0;
}

/* Map fullscreen mode */
.map-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: white;
  transition: all 0.3s ease;
}

.map-fullscreen .map-container {
  height: 100vh !important;
  border-radius: 0 !important;
}

/* Mobile popup styles */
.mobile-popup-content {
  position: relative;
  padding-right: 30px;
}

.popup-close-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Optimize leaflet controls on mobile */
@media (max-width: 768px) {
  .leaflet-control-container .leaflet-top,
  .leaflet-control-container .leaflet-bottom {
    margin: 10px;
  }
  
  .leaflet-control-zoom {
    display: none; /* Hide default zoom control on mobile */
  }
  
  .leaflet-popup {
    max-width: calc(100vw - 40px) !important;
  }
  
  .leaflet-popup-content {
    margin: 15px 20px 15px 15px !important;
    line-height: 1.6;
    font-size: 16px;
  }
  
  .leaflet-popup-close-button {
    padding: 8px !important;
    font-size: 20px !important;
  }
  
  /* Improve attribution on mobile */
  .leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    max-width: 200px;
    line-height: 1.2;
  }
  
  /* Touch-friendly marker interactions */
  .leaflet-marker-icon {
    cursor: pointer !important;
  }
  
  .leaflet-interactive {
    cursor: pointer !important;
  }
}

/* ========================================
   UTILITY CLASSES FOR MAINTAINABILITY
   ======================================== */

/* Button Style Utilities */
.btn-danger {
  background: var(--error-color) !important;
}

.btn-success {
  background: var(--success-color) !important;
}

.btn-info {
  background: var(--info-color) !important;
}

.btn-secondary {
  background: #6c757d !important;
}

.btn-warning {
  background: var(--warning-color) !important;
}

.btn-purple {
  background: #6f42c1 !important;
}

.btn-orange {
  background: #fc4c02 !important;
}

/* Spacing Utilities */
.ml-1 {
  margin-left: 1rem !important;
}

.ml-2 {
  margin-left: 2rem !important;
}

.mt-1 {
  margin-top: 1rem !important;
}

.hidden {
  display: none !important;
}

/* Map Container Utilities */
.map-container-large {
  height: 500px;
  width: 100%;
  margin-top: 1rem;
}

/* ========================================
   ENHANCED RESPONSIVE DESIGN
   ======================================== */

/* Mobile-first approach with better breakpoints */
@media (max-width: 576px) {
  /* Extra small devices (phones) */
  .container {
    padding: 0 0.75rem;
  }
  
  .nav-tabs {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .nav-tab {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
  }
  
  .mode-switcher {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  
  .mode-btn {
    width: 100%;
    justify-content: center;
  }
  
  .control-group {
    margin-bottom: 1rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
  }
  
  .map-container {
    height: 250px;
    margin: 1rem -0.75rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .auth-form {
    padding: 1rem;
  }
  
  .roundel {
    font-size: 1rem;
    padding: 0.5rem;
  }
  
  h1 {
    font-size: 1.25rem;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  /* Small devices (tablets) */
  .container {
    padding: 0 1rem;
  }
  
  .nav-tabs {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-tab {
    min-width: 120px;
    text-align: center;
  }
  
  .form-row {
    gap: 1rem;
  }
  
  .form-row > * {
    flex: 1;
    min-width: 200px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .map-container {
    height: 350px;
  }
  
  .mode-switcher {
    gap: 0.75rem;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  /* Medium devices (desktops) */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .nav-tabs {
    justify-content: center;
  }
  
  .form-row {
    gap: 1.5rem;
  }
}

@media (min-width: 993px) {
  /* Large devices */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices */
  .btn, .nav-tab, .mode-btn {
    min-height: 44px; /* Minimum touch target size */
    padding: 0.75rem 1rem;
  }
  
  .nav-tab {
    margin-bottom: 0.25rem;
  }
  
  input, select, textarea {
    min-height: 44px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .map-container {
    touch-action: pan-x pan-y;
  }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .roundel {
    text-rendering: optimizeLegibility;
  }
  
  .nav-tab, .btn {
    text-rendering: optimizeLegibility;
  }
}

/* Dark mode improvements */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-color: #404040;
  }
  
  .auth-container, .tab-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
  }
  
  input, select, textarea {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus improvements for accessibility */
@media (prefers-reduced-motion: no-preference) {
  .btn:focus, .nav-tab:focus, input:focus, select:focus, textarea:focus {
    transition: all 0.2s ease;
  }
}

/* ========================================
   ENHANCED ROUTE GENERATOR FORM
   ======================================== */

/* Route Form Cards */
.route-form-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.route-form-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.route-card-header {
  background: linear-gradient(90deg, var(--primary-color) 0%, #003688 100%);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.route-card-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.route-icon {
  font-size: 1.25rem;
}

.route-card-content {
  padding: 1.5rem;
}

/* Distance Controls */
.distance-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.distance-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.distance-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.distance-input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.distance-input {
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.distance-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(220, 36, 31, 0.1);
}

.distance-reference {
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Enhanced Line Toggles */
.enhanced-line-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.enhanced-line-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.enhanced-line-toggle:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enhanced-line-toggle.selected {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.line-color-indicator {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.line-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.line-selection-indicator {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  transition: all 0.2s ease;
}

.enhanced-line-toggle.selected .line-selection-indicator {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.enhanced-line-toggle.selected .line-selection-indicator::after {
  content: '✓';
}

/* Enhanced Zone Toggles */
.enhanced-zone-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.enhanced-zone-toggle {
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.enhanced-zone-toggle:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enhanced-zone-toggle.selected {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zone-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.zone-number {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  background: var(--secondary-color);
}

.zone-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
  flex: 1;
}

.zone-areas {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Enhanced Borough/County Toggles */
.enhanced-borough-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.enhanced-borough-group {
  margin-bottom: 1.5rem;
}

.enhanced-borough-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.enhanced-borough-group-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.enhanced-borough-group-actions {
  display: flex;
  gap: 0.5rem;
}

.borough-group-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.borough-group-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.enhanced-borough-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.enhanced-borough-toggle {
  padding: 0.875rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.enhanced-borough-toggle:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enhanced-borough-toggle.selected {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.enhanced-borough-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.enhanced-borough-indicator {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.enhanced-borough-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
  flex: 1;
  line-height: 1.2;
}

.enhanced-borough-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 12px;
  font-weight: 500;
}

.enhanced-borough-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.25rem;
}

/* Enhanced Postcode Toggles */
.enhanced-postcode-toggles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.enhanced-postcode-group {
  margin-bottom: 1.5rem;
}

.enhanced-postcode-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.enhanced-postcode-group-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.enhanced-postcode-group-actions {
  display: flex;
  gap: 0.5rem;
}

.postcode-group-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.postcode-group-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.enhanced-postcode-areas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.enhanced-postcode-area-toggle {
  padding: 0.875rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.enhanced-postcode-area-toggle:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enhanced-postcode-area-toggle.selected {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.enhanced-postcode-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.enhanced-postcode-indicator {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.enhanced-postcode-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 1;
}

.enhanced-postcode-type {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.enhanced-postcode-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.enhanced-postcode-districts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.enhanced-postcode-district-toggle {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-size: 0.85rem;
}

.enhanced-postcode-district-toggle:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.enhanced-postcode-district-toggle.selected {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  font-weight: 600;
}

/* Selection Summary */
.selection-summary {
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.selection-summary p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Generate Section */
.generate-section {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.generate-roundel {
  position: relative;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 25px rgba(220, 36, 31, 0.3);
}

.generate-roundel:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(220, 36, 31, 0.4);
}

.generate-roundel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.roundel-inner {
  position: absolute;
  inset: 0.5rem;
  background: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.generate-icon {
  font-size: 1.5rem;
}

.generate-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}

/* Enhanced Generation Status */
.enhanced-generation-status {
  margin-top: 1.5rem;
}

.status-card {
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  overflow: hidden;
  animation: pulse 2s infinite;
}

.status-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.status-icon {
  font-size: 1.25rem;
}

.status-content {
  padding: 1.5rem;
}

.status-main {
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.status-distance {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.status-explanation {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.status-progress {
  padding: 0 1.5rem 1.5rem;
}

.progress-bar {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  animation: pulse 2s infinite;
  width: 100%;
}

/* TfL Line Colors */
.line-bakerloo { background-color: #B36305; }
.line-central { background-color: #E32017; }
.line-circle { background-color: #FFD300; }
.line-district { background-color: #00782A; }
.line-hammersmith { background-color: #F3A9BB; }
.line-jubilee { background-color: #A0A5A9; }
.line-metropolitan { background-color: #9B0056; }
.line-northern { background-color: #000000; }
.line-piccadilly { background-color: #003688; }
.line-victoria { background-color: #0098D4; }
.line-waterloo { background-color: #95CDBA; }
.line-elizabeth { background-color: #7156A5; }
.line-dlr { background-color: #00A4A7; }
.line-overground { background-color: #EE7C0E; }
.line-tram { background-color: #84B817; }

/* Enhanced UI Components for Route Generator */
.enhanced-line-group {
  margin-bottom: 1.5rem;
}

.enhanced-group-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.enhanced-group-header {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.select-all-buttons {
  display: flex;
  gap: 0.5rem;
}

.select-all-btn {
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-all-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.select-all-btn.deselect {
  color: #dc2626;
  border-color: #fca5a5;
}

.select-all-btn.deselect:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.enhanced-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.enhanced-line-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
}

.enhanced-line-button:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enhanced-line-button.selected {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.enhanced-line-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.enhanced-line-name {
  font-weight: 500;
  color: #374151;
}

.enhanced-zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.enhanced-zone-button {
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
}

.enhanced-zone-button:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enhanced-zone-button.selected {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.enhanced-zone-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.enhanced-zone-number {
  color: white;
  font-weight: bold;
  font-size: 1rem;
}

.enhanced-zone-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.enhanced-zone-number {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.enhanced-zone-label {
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.enhanced-zone-areas {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.3;
}

/* Progress Tab Visual Enhancements - Safe, non-breaking improvements */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card h3 .card-icon {
  margin-right: 0.5rem;
  font-size: 1.2em;
}

/* Route Preferences Styles */
.preference-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preference-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
}

.preference-checkbox {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  background: #e5e7eb;
  border-radius: 14px;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.preference-checkbox:checked + .toggle-switch {
  background: #E32017;
}

.preference-checkbox:checked + .toggle-switch .toggle-slider {
  transform: translateX(20px);
}

.preference-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preference-title {
  font-weight: 500;
  color: #374151;
  font-size: 1rem;
}

.preference-description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.visited-stations-info {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 8px;
  border: 1px solid #0ea5e9;
}

.info-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-icon {
  font-size: 1rem;
}

.visited-stations-info.hidden {
  display: none;
}

/* Responsive adjustments for enhanced form */
@media (max-width: 768px) {
  .distance-inputs-grid {
    grid-template-columns: 1fr;
  }
  
  .enhanced-line-toggles {
    grid-template-columns: 1fr;
  }
  
  .enhanced-lines-grid {
    grid-template-columns: 1fr;
  }
  
  .enhanced-zone-toggles {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .enhanced-zones-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .generate-roundel {
    width: 6rem;
    height: 6rem;
  }
  
  .generate-text {
    font-size: 0.625rem;
  }
}

@media (max-width: 480px) {
  .enhanced-zone-toggles {
    grid-template-columns: 1fr;
  }
  
  .enhanced-zones-grid {
    grid-template-columns: 1fr;
  }
  
  .enhanced-lines-grid {
    grid-template-columns: 1fr;
  }
  
  .route-card-content {
    padding: 1rem;
  }
}

/* ========================================
   ROUTE STORY STYLES
   ======================================== */

.route-story {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  border-left: 4px solid #0066cc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 120px; /* Prevent layout shift */
  contain: layout; /* Optimize for layout changes */
}

.route-story:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.route-story h3 {
  color: #1a1a1a;
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.route-story p {
  color: #444;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  font-size: 1rem;
}

.story-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.story-meta small {
  color: #666;
  font-size: 0.85rem;
  font-style: italic;
}

.loading {
  color: #0066cc;
  font-style: italic;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Mobile responsiveness for route story */
@media (max-width: 768px) {
  .route-story {
    padding: 1rem;
    margin: 0.5rem 0;
  }
  
  .route-story h3 {
    font-size: 1.1rem;
  }
  
  .route-story p {
    font-size: 0.95rem;
  }
}

/* ========================================
   ROUTE NEAR ME STYLES
   ======================================== */

/* Simple Near Me Toggle Controls */
.near-me-controls {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(0, 94, 165, 0.05);
  margin: 1rem 0;
}

.near-me-toggle {
  font-weight: 500;
  color: var(--primary-color);
}

.near-me-settings {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  border: 1px solid rgba(0, 94, 165, 0.2);
}

.near-me-setting {
  margin-bottom: 1rem;
}

.near-me-setting:last-child {
  margin-bottom: 0;
}

.near-me-setting label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.near-me-setting input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  outline: none;
  -webkit-appearance: none;
}

.near-me-setting input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.near-me-setting input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
}

/* Legacy styles for backwards compatibility */
.near-me-main {
  text-align: center;
  margin-bottom: 1.5rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border-radius: 12px;
  min-height: 60px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 94, 165, 0.2);
}

.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 94, 165, 0.3);
}

.location-status {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(0, 94, 165, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.location-icon {
  font-size: 1.2rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.advanced-settings {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.settings-toggle {
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.settings-toggle:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.settings-panel {
  margin-top: 1rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.travel-options,
.return-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-weight: normal !important;
  margin-bottom: 0 !important;
}

.radio-option:hover,
.checkbox-option:hover {
  background: rgba(0, 94, 165, 0.05);
}

.radio-option input,
.checkbox-option input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.travel-time-slider {
  margin-top: 1rem;
}

.travel-time-slider label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: normal;
}

.travel-time-slider input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  -webkit-appearance: none;
}

.travel-time-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 94, 165, 0.3);
}

.travel-time-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 94, 165, 0.3);
}

.preview-panel {
  margin-top: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.preview-panel h4 {
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  font-size: 1rem;
}

.preview-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.preview-stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: rgba(0, 94, 165, 0.05);
  border-radius: 6px;
  min-width: 80px;
}

.preview-stats .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.preview-stats .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.25rem;
}

.preview-message {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

.results-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.route-result {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.route-result h3 {
  margin: 0 0 1.5rem 0;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.route-summary {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.route-stations h4,
.access-info h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.route-stations p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.journey-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.journey-step:last-child {
  border-bottom: none;
}

.journey-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.journey-time {
  margin-left: auto;
  font-weight: 600;
  color: var(--primary-color);
  flex-shrink: 0;
}

.total-commitment {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 94, 165, 0.1);
  border-radius: 8px;
  text-align: center;
  color: var(--primary-color);
}

.route-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.error-message {
  text-align: center;
  padding: 2rem;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.error-message h3 {
  color: #dc3545;
  margin: 0 0 1rem 0;
}

.error-message p {
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .route-actions {
    flex-direction: column;
  }
  
  .route-actions .btn {
    width: 100%;
  }
  
  .preview-stats {
    justify-content: center;
  }
  
  .travel-options,
  .return-options {
    gap: 0.25rem;
  }
  
  .radio-option,
  .checkbox-option {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
  
  .route-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    min-height: 50px;
  }
  
  .settings-panel {
    padding: 1rem;
  }
  
  .route-result {
    padding: 1rem;
  }
  
  .preview-stats .stat-item {
    min-width: 70px;
    padding: 0.5rem;
  }
  
  .preview-stats .stat-value {
    font-size: 1.2rem;
  }
}

/* ========================================
   LAYOUT SHIFT PREVENTION
   ======================================== */

/* Prevent layout shifts in results section */
#resultsSection {
  min-height: 200px; /* Reserve space */
  contain: layout; /* Optimize layout changes */
}

/* Prevent shifts in route info */
#routeInfo {
  min-height: 60px; /* Reserve space for route info */
}

/* Prevent shifts in route stations */
#routeStations {
  min-height: 100px; /* Reserve space for stations */
}

/* Loading states should maintain layout */
.loading {
  display: inline-block;
  min-height: 1em;
  width: 100%;
}

/* Status messages should maintain layout */
.status-main {
  min-height: 1.5em;
}

/* Prevent map container shifts */
.map-container {
  min-height: 300px; /* Reserve space for map */
  contain: layout;
}

/* ==========================================================================
   Borough Progress Styles (mirrors line progress structure)
   ========================================================================== */

.borough-progress-container {
  max-width: 100%;
}

.borough-progress-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  border: 1px solid #dee2e6;
}

.borough-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.borough-progress-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.borough-progress-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.borough-progress-item.completed {
  border-color: #28a745;
  background: linear-gradient(135deg, #fff, #f8fff8);
}

.borough-progress-item.started {
  border-color: #007bff;
  background: linear-gradient(135deg, #fff, #f8fbff);
}

.borough-progress-item.unstarted {
  opacity: 0.7;
}

.borough-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.borough-header:hover {
  background-color: rgba(0,0,0,0.02);
}

.borough-info {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.borough-indicator {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  margin-right: 1rem;
  flex-shrink: 0;
}

.borough-details {
  min-width: 0;
  flex: 1;
}

.borough-name {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.borough-stats {
  font-size: 0.875rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.borough-progress-bar-container {
  display: flex;
  align-items: center;
  margin: 0 1rem;
  min-width: 120px;
}

.borough-progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  flex: 1;
  margin-right: 0.5rem;
}

.borough-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, currentColor, currentColor) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  opacity: 1 !important;
}

.borough-percentage {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  min-width: 40px;
  text-align: right;
}

.borough-toggle {
  margin-left: 1rem;
  color: #666;
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.borough-content {
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
}

.station-grid {
  padding: 1rem;
}

.station-section {
  margin-bottom: 1.5rem;
}

.station-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  border-radius: 6px;
}

.section-title.visited {
  color: #155724;
  background: #d4edda;
}

.section-title.unvisited {
  color: #856404;
  background: #fff3cd;
}

.station-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.station-tag {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.station-tag.visited {
  background: #28a745;
  color: white;
}

.station-tag.unvisited {
  background: #6c757d;
  color: white;
  opacity: 0.8;
}

.station-tag.more {
  background: #ffc107;
  color: #333;
  font-style: italic;
}

.borough-achievements {
  padding: 1rem;
  border-top: 1px solid #e9ecef;
}

.achievement {
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
}

.unstarted-message {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  color: #666;
  border-radius: 8px;
  text-align: center;
  font-style: italic;
}

/* Dark mode styles for borough progress */
body:not([data-dark-mode="false"]) .borough-progress-container,
body[data-dark-mode="true"] .borough-progress-container {
  color: #e9ecef;
}

body:not([data-dark-mode="false"]) .borough-progress-summary,
body[data-dark-mode="true"] .borough-progress-summary {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border-color: rgba(255,255,255,0.1);
}

body:not([data-dark-mode="false"]) .borough-progress-item,
body[data-dark-mode="true"] .borough-progress-item {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

body:not([data-dark-mode="false"]) .borough-header:hover,
body[data-dark-mode="true"] .borough-header:hover {
  background-color: rgba(255,255,255,0.05);
}

body:not([data-dark-mode="false"]) .borough-content,
body[data-dark-mode="true"] .borough-content {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.1);
}

body:not([data-dark-mode="false"]) .borough-name,
body[data-dark-mode="true"] .borough-name {
  color: #e9ecef;
}

body:not([data-dark-mode="false"]) .borough-stats,
body[data-dark-mode="true"] .borough-stats {
  color: #adb5bd;
}

body:not([data-dark-mode="false"]) .borough-percentage,
body[data-dark-mode="true"] .borough-percentage {
  color: #e9ecef;
}

/* ===============================================
   TUBE STATION PLATFORM AESTHETICS
   =============================================== */

/* Platform Panel - extends .card with tube station aesthetics */
.platform-panel {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid #0019a5;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 
    0 4px 12px rgba(0, 25, 165, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.platform-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0019a5 0%, #c41230 50%, #0019a5 100%);
}

.platform-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ffcd00 0%, #0019a5 100%);
}

/* Station Sign - for section headers */
.station-sign {
  background: #0019a5;
  color: white !important;
  padding: 1rem 2.5rem 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  position: relative;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.1rem;
  box-shadow: 
    0 3px 8px rgba(0, 25, 165, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.station-sign::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #ffcd00;
}

.station-sign::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6" fill="%23ffcd00"/></svg>') no-repeat center;
  background-size: contain;
}

/* Ticket Machine - for form containers */
.ticket-machine {
  background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
  border: 3px solid #bdc3c7;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  position: relative;
}

.ticket-machine::before {
  content: 'TICKET MACHINE';
  position: absolute;
  top: -12px;
  left: 1rem;
  background: #e74c3c;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.ticket-machine input,
.ticket-machine select,
.ticket-machine textarea {
  background: #ecf0f1;
  border: 2px solid #95a5a6;
  border-radius: 8px;
  padding: 1rem;
  font-size: 1rem;
  color: #2c3e50;
  transition: all 0.3s ease;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.ticket-machine input:focus,
.ticket-machine select:focus,
.ticket-machine textarea:focus {
  border-color: #0019a5;
  box-shadow: 0 0 0 3px rgba(0, 25, 165, 0.2);
  background: white;
}

.ticket-machine label {
  color: #ecf0f1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  display: block;
}

/* Departure Board - for action buttons/results */
.departure-board {
  background: #1a1a1a;
  border: 4px solid #333;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.departure-board::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ffcd00 0%, transparent 100%);
}

.departure-board .btn {
  background: linear-gradient(145deg, #0019a5 0%, #001f7a 100%);
  color: #ffcd00;
  border: 2px solid #ffcd00;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.departure-board .btn:hover {
  background: linear-gradient(145deg, #ffcd00 0%, #ffd700 100%);
  color: #0019a5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 205, 0, 0.3);
}

.departure-board .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  transition: left 0.5s ease;
}

.departure-board .btn:hover::before {
  left: 100%;
}

/* Platform Navigation Tabs - tube platform signs aesthetic */
.nav-tabs.platform-style {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 2rem 0;
  flex-wrap: wrap;
  background: #0019a5;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 25, 165, 0.3);
}

.nav-tabs.platform-style .nav-tab {
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.nav-tabs.platform-style .nav-tab.active {
  background: #ffcd00;
  color: #0019a5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-tabs.platform-style .nav-tab:not(.active):hover {
  background: rgba(255, 205, 0, 0.2);
  color: white;
}

/* Platform Edge Styling */
.platform-edge {
  height: 4px;
  background: repeating-linear-gradient(
    45deg,
    #ffcd00 0px,
    #ffcd00 10px,
    #0019a5 10px,
    #0019a5 20px
  );
  margin: 1rem 0;
  border-radius: 2px;
}

/* Tube Map Line Indicators */
.line-indicator {
  width: 6px;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 3px 0 0 3px;
}

.line-indicator.central { background: #dc241f; }
.line-indicator.circle { background: #ffcd00; }
.line-indicator.district { background: #00a166; }
.line-indicator.hammersmith { background: #f491a8; }
.line-indicator.jubilee { background: #868f98; }
.line-indicator.metropolitan { background: #751056; }
.line-indicator.northern { background: #000; }
.line-indicator.piccadilly { background: #0019a5; }
.line-indicator.victoria { background: #0098d8; }
.line-indicator.waterloo { background: #76d0bd; }
.line-indicator.bakerloo { background: #ae6118; }

/* Station Information Display */
.station-info-display {
  background: #1a1a1a;
  color: #ffcd00;
  padding: 1rem;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  margin: 1rem 0;
  border: 2px solid #333;
  position: relative;
}

.station-info-display::before {
  content: 'LIVE DEPARTURES';
  position: absolute;
  top: -10px;
  left: 1rem;
  background: #e74c3c;
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 4px;
  letter-spacing: 1px;
}

/* Platform Accessibility Features */
.platform-panel.accessible {
  border-left: 6px solid #0098d8;
}

.platform-panel.accessible::before {
  background: linear-gradient(90deg, #0098d8 0%, #0019a5 50%, #c41230 100%);
}

/* Mind the Gap Warning */
.mind-the-gap {
  background: #e74c3c;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  position: relative;
  animation: mindTheGapPulse 2s infinite;
}

@keyframes mindTheGapPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.mind-the-gap::before {
  content: '⚠️';
  margin-right: 0.5rem;
}

/* Dark Mode Platform Aesthetics */
body[data-dark-mode="true"] .platform-panel {
  background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
  border-color: #0098d8;
  color: #ecf0f1;
}

body[data-dark-mode="true"] .station-sign {
  background: #34495e;
  border-left: 4px solid #0098d8;
}

body[data-dark-mode="true"] .ticket-machine {
  background: linear-gradient(145deg, #1a252f 0%, #2c3e50 100%);
  border-color: #34495e;
}

body[data-dark-mode="true"] .ticket-machine input,
body[data-dark-mode="true"] .ticket-machine select,
body[data-dark-mode="true"] .ticket-machine textarea {
  background: #34495e;
  border-color: #4a5f7a;
  color: #ecf0f1;
}

body[data-dark-mode="true"] .ticket-machine label {
  color: #bdc3c7;
}

body[data-dark-mode="true"] .departure-board {
  background: #0f1419;
  border-color: #2c3e50;
}

body[data-dark-mode="true"] .nav-tabs.platform-style {
  background: #2c3e50;
}

body[data-dark-mode="true"] .nav-tabs.platform-style .nav-tab {
  color: rgba(236, 240, 241, 0.7);
}

body[data-dark-mode="true"] .nav-tabs.platform-style .nav-tab.active {
  background: #0098d8;
  color: white;
}

/* Responsive Platform Design */
@media (max-width: 768px) {
  .platform-panel {
    padding: 1rem;
    border-radius: 8px;
  }
  
  .station-sign {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  .ticket-machine {
    padding: 1.5rem 1rem;
  }
  
  .departure-board .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .nav-tabs.platform-style {
    padding: 0.25rem;
  }
  
  .nav-tabs.platform-style .nav-tab {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .platform-panel {
    margin-bottom: 1rem;
  }
  
  .ticket-machine::before {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  .station-sign::after {
    width: 18px;
    height: 18px;
  }
  
  .nav-tabs.platform-style .nav-tab {
    padding: 0.5rem 0.75rem;
    letter-spacing: 0.5px;
  }
}

/* Platform Panel Animation Effects */
.platform-panel.arrive {
  animation: platformArrive 0.6s ease-out forwards;
}

@keyframes platformArrive {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.departure-board.updating::before {
  animation: departureUpdate 1s infinite;
}

@keyframes departureUpdate {
  0%, 100% {
    background: linear-gradient(90deg, #ffcd00 0%, transparent 100%);
  }
  50% {
    background: linear-gradient(90deg, #e74c3c 0%, transparent 100%);
  }
}

/* ========================================
   TUBE STATION DESIGN SYSTEM EXTENSIONS
   ======================================== */

/* Tube Station Tile Pattern Generators */
.tile-pattern-oxblood {
  background: #8B0000;
  background-image: 
    /* 7 horizontal white lines */
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 39px,
      white 39px,
      white 41px
    ),
    /* First row of bricks */
    repeating-linear-gradient(
      90deg,
      #A52A2A 0px,
      #A52A2A 79px,
      white 79px,
      white 81px,
      #8B0000 81px,
      #8B0000 160px,
      white 160px,
      white 162px
    ),
    /* Second row of bricks - offset by half brick width */
    repeating-linear-gradient(
      90deg,
      #8B0000 0px,
      #8B0000 79px,
      white 79px,
      white 81px,
      #A52A2A 81px,
      #A52A2A 160px,
      white 160px,
      white 162px
    );
  background-size: 162px 280px, 162px 80px, 162px 80px;
  background-position: 0 0, 0 0px, 81px 40px;
  position: relative;
  box-shadow: 
    inset 0 0 30px rgba(0,0,0,0.4);
  padding: 40px 0;
  height: 280px;
}

.tile-pattern-oxblood::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(139, 0, 0, 0.1);
  pointer-events: none;
}

/* Station Header Styling for Main Title */
.tile-pattern-oxblood .header-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 20px;
}

.tile-pattern-oxblood .header-content h1#auth-heading,
.tile-pattern-oxblood .header-content h1#app-heading {
  background: var(--tube-blue);
  color: white !important;
  padding: 20px 40px;
  border-radius: 12px;
  margin: 20px auto;
  display: inline-block;
  font-family: 'LondonTube', 'Inter', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 1.8rem;
  box-shadow: 
    0 6px 20px rgba(0, 25, 165, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  border: 3px solid white;
  position: relative;
}

.tile-pattern-oxblood .header-content h1#auth-heading::before,
.tile-pattern-oxblood .header-content h1#app-heading::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 80%;
  background: var(--platform-yellow);
  border-radius: 3px;
}

.tile-pattern-oxblood .header-content h1#auth-heading::after,
.tile-pattern-oxblood .header-content h1#app-heading::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 80%;
  background: var(--platform-yellow);
  border-radius: 3px;
}

.tile-pattern-oxblood .roundel {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 15;
}

/* Fix logout section being hidden behind tiles */
.tile-pattern-oxblood .auth-info {
  position: relative;
  z-index: 20;
}

.tile-pattern-oxblood .mode-switcher {
  position: relative;
  z-index: 20;
}

.tile-pattern-white-subway {
  background: var(--tile-white);
  background-image: 
    linear-gradient(90deg, var(--tile-grout) 1px, transparent 1px),
    linear-gradient(180deg, var(--tile-grout) 1px, transparent 1px);
  background-size: 12px 6px;
  position: relative;
}

.tile-pattern-white-subway::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 5px,
      var(--tile-grout) 5px,
      var(--tile-grout) 6px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 11px,
      var(--tile-grout) 11px,
      var(--tile-grout) 12px
    );
  opacity: 0.6;
}

.tile-pattern-green-platform {
  background: var(--station-green);
  background-image: 
    linear-gradient(90deg, var(--tile-grout) 1px, transparent 1px),
    linear-gradient(180deg, var(--tile-grout) 1px, transparent 1px);
  background-size: 8px 8px;
  position: relative;
}

.tile-pattern-green-platform::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 7px,
      var(--tile-grout) 7px,
      var(--tile-grout) 8px
    ),
    repeating-linear-gradient(
      90deg,
      var(--station-green) 0px,
      var(--station-green) 16px,
      rgba(0, 114, 41, 0.9) 16px,
      rgba(0, 114, 41, 0.9) 20px
    );
  opacity: 0.7;
}

/* Station Themed Elements */
.station-themed {
  --theme-primary: var(--oxblood-red);
  --theme-secondary: var(--station-green);
  --theme-accent: var(--platform-yellow);
  --theme-text: var(--tile-white);
}

.station-oxblood-theme {
  --theme-primary: var(--oxblood-red);
  --theme-rgb: var(--station-oxblood-rgb);
}

.station-green-theme {
  --theme-primary: var(--station-green);
  --theme-rgb: var(--station-green-rgb);
}

.station-yellow-theme {
  --theme-primary: var(--platform-yellow);
  --theme-rgb: var(--station-yellow-rgb);
}

.station-blue-theme {
  --theme-primary: var(--tube-blue);
  --theme-rgb: var(--station-blue-rgb);
}

/* Station Sign Styling */
.station-sign {
  background: var(--tube-blue);
  color: var(--tile-white) !important;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: 'LondonTube', 'Inter', sans-serif;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 25, 168, 0.3);
  border: 2px solid var(--tile-white);
}

.station-sign.large {
  padding: 1rem 2rem;
  font-size: 1.2em;
}

.station-sign.small {
  padding: 0.25rem 0.5rem;
  font-size: 0.9em;
}

/* Platform Edge Styling */
.platform-edge {
  background: linear-gradient(90deg, 
    var(--platform-yellow) 0%, 
    var(--platform-yellow) 90%, 
    var(--tube-blue) 90%, 
    var(--tube-blue) 100%);
  height: 4px;
  width: 100%;
  margin: 0.5rem 0;
}

/* Station Material Textures */
.station-material-oxblood {
  background: var(--oxblood-red);
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(0,0,0,0.1) 1px, transparent 1px);
  background-size: 4px 4px;
}

.station-material-ceramic {
  background: var(--tile-white);
  background-image: 
    linear-gradient(45deg, var(--tile-grout) 25%, transparent 25%),
    linear-gradient(-45deg, var(--tile-grout) 25%, transparent 25%);
  background-size: 2px 2px;
}

.station-material-platform {
  background: var(--station-green);
  background-image: 
    linear-gradient(90deg, rgba(255,255,255,0.1) 50%, transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,0.1) 50%, transparent 50%);
  background-size: 20px 20px;
}

/* Contextual Station Styling Classes */
.station-context {
  border-left: 4px solid var(--oxblood-red);
  background: linear-gradient(135deg, 
    rgba(139, 0, 0, 0.05) 0%, 
    rgba(255, 255, 255, 0.98) 100%);
}

.station-context.green {
  border-left-color: var(--station-green);
  background: linear-gradient(135deg, 
    rgba(0, 114, 41, 0.05) 0%, 
    rgba(255, 255, 255, 0.98) 100%);
}

.station-context.yellow {
  border-left-color: var(--platform-yellow);
  background: linear-gradient(135deg, 
    rgba(255, 211, 32, 0.05) 0%, 
    rgba(255, 255, 255, 0.98) 100%);
}

.station-context.blue {
  border-left-color: var(--tube-blue);
  background: linear-gradient(135deg, 
    rgba(0, 25, 168, 0.05) 0%, 
    rgba(255, 255, 255, 0.98) 100%);
}

/* ========================================
   TUBE STATION UI INTERACTIVE FEATURES
   ======================================== */

/* Platform Active States */
.nav-tab.platform-active {
  background: linear-gradient(135deg, var(--tube-blue), #004499);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 25, 168, 0.4);
  border: 2px solid var(--platform-yellow);
}

.nav-tab.platform-active:after {
  content: "🚇";
  margin-left: 8px;
}

/* Tube Station Notification Styles */
.tube-station-notification {
  font-family: 'LondonTube', 'Inter', sans-serif;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.tube-station-notification .notification-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.tube-station-notification .notification-icon {
  font-size: 24px;
  animation: pulse 2s infinite;
}

.tube-station-notification .notification-text {
  flex: 1;
  line-height: 1.4;
}

/* Announcement Overlay Styles */
.announcement-overlay {
  font-family: 'LondonTube', 'Inter', sans-serif;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.announcement-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.announcement-icon {
  animation: announce 1.5s ease-in-out;
}

/* Departure Board Styles */
.departure-board {
  background: var(--bg-primary);
  border: 2px solid var(--tube-blue);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'LondonTube', monospace;
}

.departure-board h3 {
  background: var(--tube-blue);
  color: white;
  margin: -1rem -1rem 1rem -1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px 6px 0 0;
  font-size: 1.1em;
  text-align: center;
}

.departure-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border-color);
  align-items: center;
}

.departure-row:last-child {
  border-bottom: none;
}

.departure-destination {
  font-weight: 600;
  color: var(--text-primary);
}

.departure-line {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  text-align: center;
  font-size: 0.85em;
  font-weight: 600;
  color: white;
  background: var(--tube-blue);
}

.departure-time {
  font-weight: 700;
  color: var(--success-color);
  text-align: center;
}

.departure-platform {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9em;
}

/* Station Sign Enhancements */
.main-station-sign {
  background: var(--tube-blue);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  text-align: center;
  font-family: 'LondonTube', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.2em;
  margin: 1rem 0;
  border: 3px solid var(--platform-yellow);
  box-shadow: 0 4px 16px rgba(0, 25, 168, 0.3);
  animation: stationGlow 3s infinite alternate;
}

/* Keyboard Navigation Indicators */
.keyboard-shortcut-hint {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85em;
  font-family: monospace;
  z-index: 999;
  backdrop-filter: blur(10px);
}

.keyboard-shortcut-hint .shortcut {
  background: var(--tube-blue);
  color: white;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  margin: 0 0.2rem;
  font-weight: 600;
}

/* Platform Switching Animations */
@keyframes platformSwitch {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    transform: translateX(0);
    opacity: 0.7;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes stationGlow {
  0% {
    box-shadow: 0 4px 16px rgba(0, 25, 168, 0.3);
  }
  100% {
    box-shadow: 0 6px 20px rgba(0, 25, 168, 0.5);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes announce {
  0%, 100% {
    transform: scale(1);
  }
  25%, 75% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes announceSlideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Enhanced Generate Button for Station UI */
.generate-button.station-enhanced {
  background: linear-gradient(135deg, var(--tube-blue), #004499);
  border: 2px solid var(--platform-yellow);
  color: white;
  position: relative;
  overflow: hidden;
}

.generate-button.station-enhanced:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.generate-button.station-enhanced:hover:before {
  left: 100%;
}

.generate-button.station-enhanced:disabled {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* Platform Status Indicators */
.platform-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 0.5rem;
}

.platform-status.active {
  background: var(--success-color);
  color: white;
}

.platform-status.boarding {
  background: var(--warning-color);
  color: white;
  animation: pulse 1.5s infinite;
}

.platform-status.departed {
  background: var(--text-muted);
  color: white;
}

/* Responsive Design for Station UI */
@media (max-width: 768px) {
  .tube-station-notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .announcement-overlay {
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }
  
  .main-station-sign {
    font-size: 1em;
    padding: 0.75rem 1rem;
  }
  
  .departure-board {
    font-size: 0.9em;
  }
  
  .departure-row {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.5rem;
  }
  
  .departure-platform {
    display: none;
  }
  
  .keyboard-shortcut-hint {
    display: none; /* Hide on mobile */
  }
}

/* Dark Mode Support for Station UI */
.theme-dark .tube-station-notification {
  background: rgba(26, 26, 26, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .announcement-overlay {
  background: rgba(26, 26, 26, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .departure-board {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.theme-dark .main-station-sign {
  box-shadow: 0 4px 16px rgba(0, 25, 168, 0.5);
}

/* Station UI Variables */
:root {
  --station-primary: var(--tube-blue);
  --station-secondary: var(--platform-yellow);
  --station-accent: var(--oxblood-red);
  --station-text: var(--text-primary);
  --station-bg: var(--bg-primary);
}
 