html, body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.16), transparent 28rem),
        linear-gradient(135deg, #f7fbff 0%, #eef4f8 48%, #f8fafc 100%);
    color: #111827;
    margin: 0;
    min-height: 100%;
}

html {
    /* Skalerer ned hele grensesnittet litt – alle rem-baserte størrelser krymper. */
    font-size: 90%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --surface: #ffffff;
    --surface-strong: #f8fafc;
    --border: #cbd5e1;
    --text: #111827;
    --muted: #374151;
    --brand: #0f766e;
    --brand-strong: #115e59;
    --accent: #f97316;
    --focus: #facc15;
    --danger: #991b1b;
    --shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
}

a {
    color: #0f5fbd;
}

/* Blazor fokuserer sidetittelen etter navigering; skjul rammen på dette ikke-interaktive fokuset. */
h1:focus {
    outline: none;
}

.btn {
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    padding: 0.55rem 1rem;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-primary {
    color: #fff;
    background-color: var(--brand-strong);
    border-color: var(--brand-strong);
}

.btn:focus-visible,
.form-control:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    box-shadow: none;
}

.content {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
}

.weather-shell {
    display: grid;
    gap: 1.5rem;
    max-width: 1120px;
    margin: 0 auto;
}

.weather-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.weather-header h1 {
    font-size: clamp(1.9rem, 3.8vw, 3rem);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 0.95;
    margin: 0;
}

.eyebrow {
    color: var(--brand-strong);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 0.25rem;
    text-transform: uppercase;
}

.coordinates {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.location-search {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 0.35rem;
    margin-top: 0;
    min-width: min(100%, 18rem);
    padding: 0.8rem;
}

.location-search label {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
}

.location-search small {
    color: var(--muted);
    font-size: 0.85rem;
}

.search-row {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.form-control {
    background: #ffffff;
    border: 2px solid #94a3b8;
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    width: 100%;
}

.search-row .btn {
    border-radius: 8px;
    font-weight: 800;
    min-height: 44px;
    min-width: 5rem;
}

.current-weather {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(249, 115, 22, 0.07)),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: clamp(1rem, 4vw, 3rem);
    grid-template-columns: minmax(0, 1fr) auto minmax(18rem, 0.9fr);
    padding: clamp(1.25rem, 3vw, 2rem);
}

.temperature {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 0.95;
    margin: 0.2rem 0;
}

.current-weather-condition {
    align-content: center;
    display: grid;
    gap: 0.65rem;
    justify-items: center;
    justify-self: center;
    text-align: center;
}

.current-weather-symbol {
    align-items: center;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    height: clamp(5rem, 10vw, 7rem);
    justify-content: center;
    width: clamp(5rem, 10vw, 7rem);
}

.current-weather-symbol svg {
    height: 72%;
    width: 72%;
}

.current-weather-summary {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.current-weather dl {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.current-weather dl div {
    border-bottom: 1px solid #dbe4ee;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-bottom: 0.75rem;
}

.current-weather dl div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.current-weather dt {
    color: var(--muted);
    font-weight: 700;
}

.current-weather dd {
    font-weight: 700;
    margin: 0;
    text-align: right;
}

.view-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    width: fit-content;
}

.view-toggle button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
    min-height: 44px;
    padding: 0.6rem 1rem;
}

.view-toggle button.active {
    background: var(--brand-strong);
    color: #ffffff;
}

.view-toggle button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.forecast-list,
.daily-list {
    display: grid;
    gap: 0.65rem;
}

.temperature-chart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.chart-header {
    align-items: baseline;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.chart-header h2,
.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 850;
    margin: 0;
}

.chart-header span {
    color: var(--muted);
    font-weight: 700;
}

/* Kun selve grafen skal fylle bredden. Direkte-barn-velgeren (>) hindrer at de
   nestede ikon-SVG-ene (værsymbolene i grafen) blir strukket til full bredde. */
.temperature-chart > svg,
.daily-expanded > svg {
    display: block;
    height: auto;
    width: 100%;
}

.chart-grid-line {
    stroke: #dbe4ee;
    stroke-width: 1;
}

.chart-axis-label,
.chart-time-label {
    fill: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

/* Sentrer tidsetikettene under punktene sine, slik at den siste ikke faller utenfor høyre kant. */
.chart-time-label {
    text-anchor: middle;
}

.chart-line {
    fill: none;
    stroke: var(--brand-strong);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.chart-point {
    fill: #ffffff;
    stroke: var(--accent);
    stroke-width: 1.8;
}

/* Dagskortet er nå en beholder: en klikkbar header + et utfellbart grafpanel. */
.daily-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.daily-row-header {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(9rem, 0.9fr) 3rem minmax(0, 1.2fr) minmax(12rem, auto) 1.25rem;
    min-height: 4.75rem;
    padding: 0.85rem 1rem;
}

.daily-row-header:hover {
    background: var(--surface-strong);
}

.daily-row-header:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: -3px;
}

.expand-chevron {
    color: var(--muted);
    font-size: 0.9rem;
    justify-self: center;
    transition: transform 0.15s ease;
}

.daily-row.is-expanded .expand-chevron {
    transform: rotate(180deg);
}

.daily-expanded {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.forecast-time time {
    color: var(--brand-strong);
    font-weight: 800;
    text-transform: capitalize;
}

.weather-symbol {
    align-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    height: 3rem;
    justify-content: center;
    width: 3rem;
}

.weather-symbol svg {
    height: 2.5rem;
    width: 2.5rem;
}

.forecast-summary {
    display: grid;
    gap: 0.2rem;
}

.forecast-summary strong {
    font-size: 1rem;
}

.forecast-summary small {
    color: var(--muted);
    font-weight: 650;
}

.temperature-range {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.temperature-range div {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.temperature-range dt {
    color: var(--muted);
    font-weight: 750;
}

.temperature-range dd {
    font-weight: 850;
    margin: 0;
}

.loading-panel,
.status-panel {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    display: flex;
    min-height: 12rem;
    padding: 1.5rem;
}

.loading-panel.compact {
    min-height: 4rem;
}

.status-panel {
    border-color: #fca5a5;
    color: var(--danger);
    font-weight: 700;
}

@media (max-width: 720px) {
    .content {
        padding-bottom: 1.5rem;
        padding-top: 1rem;
    }

    .weather-shell {
        gap: 1rem;
    }

    .weather-header,
    .current-weather {
        align-items: stretch;
    }

    .weather-header {
        display: grid;
        gap: 0.85rem;
    }

    .weather-header h1 {
        font-size: clamp(2.25rem, 13vw, 3.25rem);
    }

    .location-search {
        padding: 0.85rem;
        width: 100%;
    }

    .search-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .search-row .btn {
        min-width: 4.5rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .current-weather {
        gap: 1rem;
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .current-weather-condition {
        align-items: center;
        display: flex;
        gap: 0.75rem;
        justify-self: start;
        text-align: left;
    }

    .current-weather-symbol {
        height: 4rem;
        width: 4rem;
    }

    .current-weather dl {
        border-top: 1px solid #dbe4ee;
        gap: 0;
        padding-top: 0.25rem;
    }

    .current-weather dl div {
        align-items: flex-start;
        padding: 0.65rem 0;
    }

    .current-weather dd {
        max-width: 58%;
    }

    .view-toggle {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .chart-header {
        display: grid;
        gap: 0.15rem;
    }

    .temperature-chart,
    .daily-expanded {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .temperature-chart > svg,
    .daily-expanded > svg {
        min-width: 42rem;
    }

    .daily-row-header {
        gap: 0.75rem;
        grid-template-columns: 3rem minmax(0, 1fr) auto;
        grid-template-areas:
            "time time chevron"
            "symbol summary summary"
            "temp temp temp";
        padding: 0.9rem;
    }

    .daily-row-header .forecast-time {
        grid-area: time;
    }

    .daily-row-header .weather-symbol {
        grid-area: symbol;
    }

    .daily-row-header .forecast-summary {
        grid-area: summary;
    }

    .daily-row-header .temperature-range {
        grid-area: temp;
    }

    .temperature-range {
        background: var(--surface-strong);
        border-radius: 8px;
        padding: 0.75rem;
    }

    .daily-row-header .expand-chevron {
        align-self: center;
        grid-area: chevron;
        justify-self: end;
    }

}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC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rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Det oppstod en feil."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Laster");
    }

code {
    color: #c02d76;
}
