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

/* Dark theme only, matching the Android app's forced dark scheme. */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #121214;
    color: #e5e5ea;
    min-height: 100vh;
    line-height: 1.5;
}

.page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

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

.app-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-logo {
    width: 44px;
    height: 44px;
}

.app-eyebrow {
    font-size: 0.8rem;
    color: #9a9aa2;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.app-store-link {
    font-size: 0.85rem;
    color: #9a9aa2;
    text-decoration: underline;
    white-space: nowrap;
}

.app-store-link:hover {
    color: #cfcfd6;
}

.panel {
    background: #1c1c20;
    border: 1px solid #2c2c32;
    border-radius: 10px;
    padding: 1.25rem;
}

.field-label {
    display: block;
    font-size: 0.85rem;
    color: #9a9aa2;
    margin-bottom: 0.4rem;
}

.zip-form-row {
    display: flex;
    gap: 0.6rem;
}

#zip-input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #3a3a42;
    background: #121214;
    color: #e5e5ea;
}

#zip-input:focus {
    outline: none;
    border-color: #5fafef;
}

.zip-form button[type="submit"] {
    padding: 0.6rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #121214;
    background: #ffc64b;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.zip-form button[type="submit"]:hover {
    background: #ffd370;
}

.field-error {
    margin-top: 0.5rem;
    color: #ff6b6b;
    font-size: 0.85rem;
}

.unit-toggle {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.unit-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 999px;
    border: 1px solid #3a3a42;
    background: transparent;
    color: #cfcfd6;
    cursor: pointer;
}

.unit-btn.active {
    background: #5fafef;
    border-color: #5fafef;
    color: #121214;
    font-weight: 600;
}

.section-heading {
    margin-bottom: 1rem;
}

.section-heading h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.section-location {
    font-size: 0.85rem;
    color: #9a9aa2;
    margin-top: 0.15rem;
}

.section-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-message {
    color: #9a9aa2;
    font-size: 0.9rem;
}

.section-message.error {
    color: #ff6b6b;
}

.retry-btn {
    align-self: flex-start;
    margin-top: 0.5rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #3a3a42;
    background: transparent;
    color: #cfcfd6;
    cursor: pointer;
}

/* ===== Forecast cards ===== */

.forecast-card {
    border: 1px solid #2c2c32;
    border-radius: 8px;
    overflow: hidden;
}

.forecast-period {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
}

.forecast-period + .forecast-period {
    border-top: 1px dashed #2c2c32;
}

.forecast-icon {
    font-size: 1.6rem;
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.forecast-text {
    flex: 1;
    min-width: 0;
}

.forecast-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.forecast-short {
    font-size: 0.82rem;
    color: #9a9aa2;
}

.forecast-precip {
    font-size: 0.78rem;
    color: #5fafef;
    margin-top: 0.15rem;
}

.forecast-temp {
    font-size: 1.3rem;
    font-weight: 600;
    flex-shrink: 0;
}

.alert-band {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 198, 75, 0.12);
}

.alert-band .alert-bar {
    width: 4px;
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
}

.alert-event {
    font-size: 0.85rem;
    font-weight: 600;
}

.alert-headline {
    font-size: 0.78rem;
    color: #9a9aa2;
}

/* ===== Hourly chart ===== */

.hourly-scroll {
    overflow-x: auto;
}

.hourly-canvas-wrap {
    min-width: 900px;
}

.hourly-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 130px;
}

.hourly-series-label {
    font-size: 0.78rem;
    color: #9a9aa2;
    margin: 0.6rem 0 0.15rem;
}

/* ===== Soil section ===== */

.soil-reading-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.soil-current-temp {
    font-size: 1.6rem;
    font-weight: 600;
}

.soil-distance {
    font-size: 0.82rem;
    color: #9a9aa2;
}

.soil-legend {
    display: flex;
    gap: 1.25rem;
    margin: 0.4rem 0 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #9a9aa2;
}

.legend-swatch {
    width: 14px;
    height: 2px;
}

.legend-swatch.measured { background: #ffc64b; }
.legend-swatch.average { background: #5fafef; border-top: 2px dashed #5fafef; height: 0; }

.soil-window-label {
    font-size: 0.82rem;
    color: #9a9aa2;
    margin: 0.75rem 0 0.25rem;
}

.soil-window-label:first-of-type {
    margin-top: 0;
}

.soil-chart-wrap canvas {
    display: block;
    width: 100%;
    height: 140px;
}

/* ===== About ===== */

.about-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.about-logo {
    width: 96px;
    height: 96px;
    margin-bottom: 0.25rem;
}

.about-link {
    color: #5fafef;
    font-size: 0.9rem;
}

.about-attribution {
    font-size: 0.78rem;
    color: #9a9aa2;
    margin-top: 0.75rem;
}
