body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #fbf7ee;
    color: #2b2b2b;
    padding: 2rem 1rem;
}

/*
 * Centered via margin auto rather than a flex row on <body>: <body>'s actual flex item is the
 * Compose HTML #root mount div, not .app itself, and #root has no explicit width. That leaves the
 * flex algorithm to size #root by shrink-to-fit, which pulls in .app's own content (season wedge
 * count, legend item count, month labels) as the sizing input — so a location with fewer/shorter
 * season labels (e.g. equatorial Wet/Dry vs four-season Winter/Spring/Summer/Autumn) shrink-wraps
 * the whole chart smaller instead of always filling the available width up to max-width.
 */
.app {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.app-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.app-header h1 {
    margin: 0;
}

.settings-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: white;
    color: #2b2b2b;
    cursor: pointer;
}

.current-location {
    font-weight: 600;
    margin: 0.25rem 0 0.75rem;
}

.temp-metric-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.temp-metric-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    background: white;
    color: #2b2b2b;
    cursor: pointer;
}

.temp-metric-option.active {
    background: #333;
    color: white;
    border-color: #333;
}

.settings {
    text-align: left;
    max-width: 420px;
    margin: 0 auto;
}

.settings h2 {
    text-align: center;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5ddcc;
}

.settings-label {
    font-weight: 500;
}

.settings-toggle {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    background: white;
    color: #2b2b2b;
    cursor: pointer;
}

.toggle-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

.settings-back {
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
    border: none;
    background: #333;
    color: white;
    cursor: pointer;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.search-bar input {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 260px;
}

.search-bar button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 4px;
    border: none;
    background: #333;
    color: white;
    cursor: pointer;
}

.location-picker ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.error {
    color: #b3261e;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.climate-circle {
    position: relative;
    display: flex;
    justify-content: center;
}

.climate-circle-svg {
    max-width: 100%;
    height: auto;
}

.climate-tooltip {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    /* Offsets the box up and to the right of the cursor's tracked left/top (set via JS on hover)
       so it doesn't sit directly under the pointer. */
    transform: translate(16px, -100%);
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.climate-tooltip.visible {
    display: block;
}

.climate-tooltip-month {
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.app-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5ddcc;
    font-size: 0.85rem;
}

.app-footer a {
    color: #666;
}

.sources {
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
}

.sources h2 {
    text-align: center;
}

.source-entry {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5ddcc;
}

.source-entry h3 {
    margin-bottom: 0.25rem;
}

.source-entry p {
    margin-top: 0;
    color: #555;
}
