:root {
  --bg: #0f1115;
  --card: #171a21;
  --accent: #ff6a00;
  --text: #f2f2f2;
  --muted: #9aa0ab;
  --border: #2a2e38;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  background: #1f232c;
  border-radius: 10px;
  padding: 4px;
}

.tab-btn {
  flex: 1 1 40%;
  padding: 9px 6px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-btn.active {
  background: var(--accent);
  color: #1a1200;
}

.tab-panel {
  display: none;
}

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

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

select {
  width: 100%;
  padding: 12px 14px;
  background: #1f232c;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  appearance: none;
}

select:focus {
  outline: 2px solid var(--accent);
}

.result {
  margin-top: 20px;
  padding: 20px;
  background: #1f232c;
  border-radius: 12px;
  text-align: center;
  min-height: 60px;
}

.result .big-time {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.result .wait {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.result .none {
  color: var(--muted);
  font-size: 1rem;
}

details {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

summary {
  cursor: pointer;
  color: var(--text);
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list li {
  background: #1f232c;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.chip-list li.past {
  opacity: 0.35;
}

.station-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.station-block summary {
  padding: 12px 14px;
  font-weight: 600;
  background: #1f232c;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.station-block summary::-webkit-details-marker {
  display: none;
}

.station-block summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.1rem;
}

.station-block[open] summary::after {
  content: "\2212";
}

.station-block .chip-list {
  padding: 12px 14px;
  margin: 0;
}

.leg-summary {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.route-list {
  margin-top: 14px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
}

.route-list .stop {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.route-list .stop:last-child {
  border-bottom: none;
}

.route-list .stop.endpoint {
  color: var(--text);
  font-weight: 600;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge.partial {
  background: rgba(255, 106, 0, 0.15);
  color: var(--accent);
  border: 1px solid rgba(255, 106, 0, 0.4);
}

.badge.guaranteed {
  background: rgba(80, 200, 120, 0.15);
  color: #6fe0a0;
  border: 1px solid rgba(80, 200, 120, 0.4);
}

.star-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0 0 8px;
  line-height: 1;
}

.star-btn.active {
  color: var(--accent);
}

.field-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.field-row .field {
  flex: 1;
  margin-bottom: 0;
}

.mode-toggle {
  display: flex;
  gap: 6px;
  background: #1f232c;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.mode-btn {
  flex: 1;
  padding: 8px 6px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-btn.active {
  background: var(--accent);
  color: #1a1200;
}

.day-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.day-btn {
  flex: 1;
  padding: 6px 6px;
  background: #1f232c;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.day-btn.active {
  background: rgba(255, 106, 0, 0.15);
  color: var(--accent);
  border-color: rgba(255, 106, 0, 0.4);
}

input[type="time"] {
  width: 100%;
  padding: 12px 14px;
  background: #1f232c;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  color-scheme: dark;
}

input[type="time"]:focus {
  outline: 2px solid var(--accent);
}

.install-btn[hidden] {
  display: none;
}

.install-btn {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 11px 14px;
  background: var(--accent);
  color: #1a1200;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.install-hint {
  position: relative;
  margin-bottom: 16px;
  padding: 12px 34px 12px 14px;
  background: #1f232c;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

.install-hint-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
}

footer {
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}
