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

:root {
  --color-primary: #1a73e8;
  --color-bg: #f5f5f5;
  --color-card: #ffffff;
  --color-text: #333333;
  --color-text-secondary: #666666;
  --color-border: #e0e0e0;
  --color-green: #34a853;
  --color-yellow: #f9ab00;
  --color-red: #ea4335;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* Header */
header {
  text-align: center;
  padding: 20px 0 12px;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.update-time {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* Route Cards */
.route-card {
  background: var(--color-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--color-border);
}

.route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.route-id {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}

.route-dest {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: right;
  max-width: 60%;
}

/* ETA items */
.eta-list {
  list-style: none;
}

.eta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.eta-time {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.eta-countdown {
  font-size: 16px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 16px;
  font-variant-numeric: tabular-nums;
}

.eta-countdown.soon {
  background: #fce8e6;
  color: var(--color-red);
}

.eta-countdown.medium {
  background: #fef7e0;
  color: var(--color-yellow);
}

.eta-countdown.far {
  background: #e6f4ea;
  color: var(--color-green);
}

.eta-seq {
  font-size: 12px;
  color: var(--color-text-secondary);
  min-width: 40px;
}

/* Remark */
.eta-remark {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-left: 8px;
}

/* No data / Loading / Error */
.no-data,
.loading {
  text-align: center;
  padding: 40px 16px;
  color: var(--color-text-secondary);
  font-size: 16px;
}

.error-message {
  text-align: center;
  padding: 40px 16px;
  color: var(--color-red);
  font-size: 15px;
}

.error-message button {
  margin-top: 12px;
  padding: 8px 20px;
  font-size: 14px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* Refresh button */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: rgba(245, 245, 245, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
}

.refresh-button {
  padding: 10px 32px;
  font-size: 15px;
  font-weight: 600;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-appearance: none;
}

.refresh-button:active {
  opacity: 0.8;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
