*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #fff;
  color: #1a1a1a;
  overflow-x: hidden;
  overflow-y: auto;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #1a3a5c;
  color: #fff;
  flex-shrink: 0;
}

.top-left {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.clock {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
}

.location-name {
  font-size: 22px;
  font-weight: 400;
  opacity: 0.85;
}

.updated {
  font-size: 16px;
  opacity: 0.8;
}

.alerts-bar {
  display: none;
  padding: 10px 24px;
  background: #fff3cd;
  border-bottom: 2px solid #ffc107;
  font-size: 18px;
  font-weight: 600;
  color: #664d03;
  flex-shrink: 0;
}

.alerts-bar.visible { display: block; }

.alert-item { margin-bottom: 4px; }
.alert-item:last-child { margin-bottom: 0; }

.columns {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.column {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.column + .column {
  border-left: 3px solid #e0e0e0;
}

.column-header {
  padding: 14px 24px;
  font-size: 32px;
  font-weight: 700;
  background: #f0f4f8;
  border-bottom: 2px solid #d0d8e0;
  flex-shrink: 0;
}

.departures {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dep-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
  flex: 0 0 auto;
  min-height: 96px;
}

.dep-row:nth-child(even) {
  background: #f8f9fa;
}

.dep-row.cancelled {
  opacity: 0.55;
}

.route-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 52px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
}

.dep-time-block {
  flex-shrink: 0;
  min-width: 5ch;
}

.dep-scheduled-time {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.dep-row.cancelled .dep-scheduled-time {
  text-decoration: line-through;
}

.dep-est-time {
  font-size: 20px;
  color: #e65100;
  font-weight: 600;
  line-height: 1.4;
}

.dep-headsign {
  font-size: 24px;
  color: #555;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dep-status {
  flex-shrink: 0;
  min-width: 130px;
  text-align: right;
}

.dep-status-main {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.dep-status-sub {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.status-on-time {
  color: #2e7d32;
}

.status-off-schedule {
  color: #e65100;
}

.status-cancelled {
  color: #d32f2f;
}

.status-date {
  color: #555;
}

.empty-msg,
.loading {
  padding: 40px 24px;
  text-align: center;
  font-size: 28px;
  color: #888;
}

.error-banner {
  display: none;
  padding: 10px 24px;
  background: #f8d7da;
  border-bottom: 2px solid #f5c6cb;
  font-size: 18px;
  font-weight: 600;
  color: #721c24;
  flex-shrink: 0;
}

.error-banner.visible { display: block; }

.hidden { display: none !important; }

@media (max-width: 1080px) and (min-width: 769px) {
  .columns.two-columns .dep-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 14px;
    min-height: 110px;
  }

  .columns.two-columns .dep-headsign {
    flex: 1 1 100%;
    order: 4;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .columns.two-columns .dep-status {
    margin-left: auto;
    min-width: 110px;
    white-space: nowrap;
  }

  .columns.two-columns .dep-scheduled-time {
    font-size: 28px;
  }

  .columns.two-columns .dep-headsign {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .columns {
    flex-direction: column;
  }

  .column + .column {
    border-left: none;
    border-top: 3px solid #e0e0e0;
  }

  .top-bar {
    padding: 10px 18px;
  }

  .top-left {
    gap: 14px;
  }

  .clock {
    font-size: 28px;
  }

  .location-name {
    font-size: 20px;
  }

  .updated {
    font-size: 15px;
  }

  .column-header {
    padding: 12px 18px;
    font-size: 28px;
  }

  .dep-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 16px 18px;
    min-height: 110px;
  }

  .route-badge {
    min-width: 52px;
    height: 44px;
    font-size: 24px;
    padding: 0 10px;
    border-radius: 9px;
  }

  .dep-scheduled-time {
    font-size: 30px;
  }

  .dep-time-block {
    min-width: 5ch;
  }

  .dep-est-time {
    font-size: 18px;
  }

  .dep-headsign {
    flex: 1 1 100%;
    order: 4;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 22px;
  }

  .dep-status {
    margin-left: auto;
    min-width: 96px;
    white-space: nowrap;
  }

  .dep-status-main {
    font-size: 24px;
  }

  .dep-status-sub {
    font-size: 16px;
  }

  .alerts-bar {
    padding: 10px 18px;
    font-size: 16px;
  }

  .error-banner {
    padding: 10px 18px;
    font-size: 16px;
  }

  .empty-msg,
  .loading {
    font-size: 24px;
    padding: 28px 18px;
  }
}
