:root {
    --bg: #111827;
    --panel: #1f2937;
    --panel-soft: #172033;
    --text: #f9fafb;
    --muted: #9ca3af;
    --border: #374151;
    --green-bg: #14532d;
    --green-text: #86efac;
    --yellow-bg: #713f12;
    --yellow-text: #fde047;
    --orange-bg: #7c2d12;
    --orange-text: #fdba74;
    --red-bg: #450a0a;
    --red-text: #fca5a5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.mobile-dashboard {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 8px 0 16px;
}

h1, h2, p { margin: 0; }

h1 {
    font-size: 1.45rem;
    line-height: 1.1;
}

h2 {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.eyebrow,
.card-label,
.meta-line,
.time-stack span {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.time-stack {
    text-align: right;
    white-space: nowrap;
}

.time-stack div {
    font-size: 1.35rem;
    font-weight: 700;
}

.hero-grid,
.station-list {
    display: grid;
    gap: 10px;
}

.status-card,
.weather-card,
.station-card,
.info-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.hidden { display: none; }

.hero-row,
.weather-card,
.section-heading,
.arrival-row,
.arrival-meta {
    display: flex;
    align-items: center;
}

.hero-row,
.weather-card,
.section-heading {
    justify-content: space-between;
    gap: 12px;
}

.status-title {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.9rem;
}

.big-value {
    margin-top: 2px;
    font-size: clamp(2rem, 11vw, 3rem);
    line-height: 1;
    font-weight: 800;
}

.status-pill {
    flex: 0 0 auto;
    min-width: 78px;
    border-radius: 999px;
    padding: 7px 10px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-ontime { background: var(--green-bg); color: var(--green-text); }
.status-delayed-yellow { background: var(--yellow-bg); color: var(--yellow-text); }
.status-delayed-orange { background: var(--orange-bg); color: var(--orange-text); }
.status-cancelled { background: var(--red-bg); color: var(--red-text); }

.weather-card {
    margin-top: 10px;
}

.weather-main {
    display: grid;
    gap: 2px;
}

#current-temp {
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1;
}

#weather-summary {
    color: var(--muted);
    font-size: 0.9rem;
}

.weather-metrics {
    display: grid;
    gap: 5px;
    text-align: right;
    color: var(--muted);
    font-size: 0.82rem;
}

.weather-metrics b {
    color: var(--text);
}

.transit-section,
.info-section {
    margin-top: 18px;
}

.section-heading {
    margin-bottom: 10px;
}

#refresh-button {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    min-height: 38px;
    padding: 0 14px;
    font: inherit;
    font-weight: 700;
}

.station-card {
    padding: 0;
    overflow: hidden;
}

.station-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--panel-soft);
    border-bottom: 1px solid var(--border);
}

.station-name {
    font-weight: 800;
    letter-spacing: 0.02em;
}

.station-subtitle {
    color: var(--muted);
    font-size: 0.8rem;
    text-align: right;
}

.arrival-row {
    gap: 11px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.7);
}

.arrival-row:last-child {
    border-bottom: 0;
}

.route-badge {
    flex: 0 0 58px;
    min-height: 34px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    padding: 4px;
    background: #263449;
    color: #dbeafe;
    font-size: 0.74rem;
    font-weight: 800;
    text-align: center;
}

.route-nctd-bus { background: #123459; color: #5eead4; }
.route-coaster { background: #0f766e; color: #ccfbf1; }
.route-surfliner { background: #1d4ed8; color: #dbeafe; }
.route-oc { background: #ea580c; color: #fff7ed; }
.route-ieoc { background: #be185d; color: #fce7f3; }

.arrival-main {
    min-width: 0;
    flex: 1;
}

.arrival-destination {
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arrival-meta {
    gap: 8px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.arrival-time {
    flex: 0 0 auto;
    text-align: right;
    font-size: 1.18rem;
    font-weight: 800;
}

.empty-state {
    padding: 14px;
    color: var(--muted);
}

.info-card {
    display: grid;
    padding: 0;
    overflow: hidden;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.7);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-row span:first-child {
    color: var(--muted);
}

.info-row b {
    text-align: right;
}

.info-row.featured b {
    font-size: 1.35rem;
}

@media (max-width: 420px) {
    .mobile-dashboard { padding: 12px; }
    .topbar { gap: 10px; }
    h1 { font-size: 1.25rem; }
    .weather-card { align-items: flex-start; }
    .weather-metrics { font-size: 0.78rem; }
    .arrival-row { padding: 11px 12px; }
    .route-badge { flex-basis: 52px; }
}
