:root {
    color-scheme: light;
    --bg: #edf6fb;
    --surface: #ffffff;
    --surface-soft: #f5faff;
    --ink: #0b1220;
    --muted: #607386;
    --line: #dbe8ef;
    --blue: #1677c9;
    --blue-dark: #0d4d85;
    --green: #218365;
    --amber: #d18416;
    --shadow: 0 18px 50px rgba(31, 58, 84, .12);
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
    background: var(--bg);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background-color: var(--bg);
    background:
        linear-gradient(140deg, rgba(142, 202, 255, .25), transparent 38%),
        linear-gradient(180deg, #f9fcff 0%, var(--bg) 100%);
    color: var(--ink);
}

button,
input,
select {
    font: inherit;
}

input,
select,
textarea {
    font-size: 16px;
}

:focus,
:focus-visible {
    outline: 0;
    outline-width: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 0;
    outline-width: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.simple-shell {
    width: min(100%, 460px);
    margin: 0 auto;
    padding: calc(14px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.simple-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 2px 14px;
}

.simple-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.simple-brand .brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.simple-brand svg {
    width: 46px;
    height: 46px;
}

.mark-background {
    fill: var(--blue);
}

.mark-star {
    fill: #ffffff;
}

.simple-brand strong {
    display: block;
    min-width: 0;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.simple-brand strong span {
    color: var(--blue);
}

.language-switcher {
    position: relative;
    flex: 0 0 auto;
}

.language-switcher::after {
    position: absolute;
    top: 50%;
    right: 11px;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--blue-dark);
    border-bottom: 2px solid var(--blue-dark);
    content: "";
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.language-switcher select {
    width: clamp(160px, 42vw, 178px);
    height: 38px;
    min-height: 38px;
    padding: 0 36px 0 10px;
    border: 1px solid rgba(198, 222, 236, .92);
    border-radius: var(--radius);
    appearance: none;
    color: var(--ink);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 24px rgba(76, 117, 146, .14);
    font: inherit;
    font-size: 16px;
    font-weight: 850;
    line-height: 38px;
}

.simple-card {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid rgba(219, 232, 239, .96);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
}

.dashboard-grid,
.dashboard-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
}

.dashboard-grid > .simple-card,
.dashboard-side > .simple-card {
    margin-bottom: 0;
    min-width: 0;
}

.simple-flash {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #bde7d7;
    border-radius: var(--radius);
    background: #effaf5;
    color: var(--green);
    font-size: 14px;
    font-weight: 750;
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    white-space: nowrap;
}

input,
select {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdff;
    color: var(--ink);
    font-weight: 400;
}

input::placeholder {
    color: var(--muted);
    font-weight: 400;
}

select {
    padding-right: 44px;
    appearance: none;
    background:
        #fbfdff
        url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m5.5 7.5 4.5 4.5 4.5-4.5' fill='none' stroke='%230d4d85' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        no-repeat right 14px center / 13px 13px;
    cursor: pointer;
}

.address-row {
    display: grid;
    gap: 10px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
}

.button.primary {
    width: 100%;
    color: #fff;
    background: var(--blue);
    box-shadow: 0 14px 28px rgba(22, 119, 201, .22);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 25px;
    line-height: 1.08;
}

h2 {
    font-size: 20px;
    line-height: 1.15;
}

.condition-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--blue-dark);
    background: #e7f3ff;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.condition-chip.sunny {
    color: var(--green);
    background: #e9f6ef;
}

.forecast-current {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 16px;
}

.forecast-current strong {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 72px;
    line-height: .9;
    white-space: nowrap;
}

.forecast-current-metrics {
    display: grid;
    flex: 0 0 auto;
    gap: 5px;
    min-width: 120px;
    justify-items: end;
}

.forecast-current-metrics span {
    display: block;
    color: var(--muted);
    text-align: right;
}

.forecast-current-metrics small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .06em;
    line-height: 1.1;
    text-transform: uppercase;
}

.forecast-current-metrics b {
    display: block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
}

.weather-risk {
    display: grid;
    gap: 8px;
    margin: -2px 0 15px;
}

.risk-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.risk-head strong {
    color: var(--risk-color);
    font-size: 13px;
}

.risk-meter {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2c9f63 0%, #efc84a 48%, #d9483f 100%);
    box-shadow: inset 0 0 0 1px rgba(11, 18, 32, .08);
}

.risk-meter span {
    position: absolute;
    top: 50%;
    left: var(--risk);
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 999px;
    background: var(--risk-color);
    box-shadow: 0 7px 15px rgba(11, 18, 32, .2);
    transform: translate(-50%, -50%);
}

.risk-low {
    --risk-color: #218365;
}

.risk-moderate {
    --risk-color: #c98a12;
}

.risk-high {
    --risk-color: #c93f36;
}

.chart-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.chart-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.chart-meta span::before {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    content: "";
}

.temperature-key::before {
    background: linear-gradient(180deg, #ff7a33, #ffd166);
}

.rain-key::before {
    background: linear-gradient(180deg, #1784d8, #8ecaff);
}

.chart-scroll {
    margin: 0 -4px;
    padding: 0 4px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-color: rgba(22, 119, 201, .4) transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.chart-scroll::-webkit-scrollbar {
    height: 7px;
}

.chart-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chart-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(22, 119, 201, .32);
}

.chart-track {
    position: relative;
    min-width: 720px;
}

.chart-plot {
    position: relative;
}

.mini-chart {
    display: grid;
    align-items: end;
    grid-template-columns: repeat(24, minmax(11px, 1fr));
    gap: 6px;
    height: 150px;
    padding: 14px 8px 9px;
    border-radius: var(--radius);
    background:
        repeating-linear-gradient(to top, transparent 0 32px, rgba(96, 115, 134, .1) 32px 33px),
        linear-gradient(180deg, #f9fcff, #eef7fd);
}

.chart-point {
    position: relative;
    display: block;
    height: var(--temp);
    min-height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px 999px 2px 2px;
    background: linear-gradient(180deg, #f46a2f, #ffd166);
    cursor: pointer;
    transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}

.chart-point::after {
    position: absolute;
    right: 1px;
    bottom: 0;
    left: 1px;
    height: var(--rain);
    min-height: 5px;
    border-radius: inherit;
    background: linear-gradient(180deg, #1388d9, #8ecaff);
    content: "";
}

.chart-point:hover,
.chart-point.is-active {
    outline: 0;
    filter: saturate(1.12);
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px rgba(11, 18, 32, .12), 0 10px 18px rgba(22, 119, 201, .18);
}

.chart-point:focus-visible {
    outline: 0;
    filter: saturate(1.12);
    transform: translateY(-2px);
}

.chart-axis {
    position: relative;
    height: 32px;
    margin: 7px 8px 0;
    color: var(--muted);
}

.chart-axis span {
    position: absolute;
    left: var(--tick);
    display: grid;
    gap: 1px;
    min-width: 52px;
    font-size: 10px;
    line-height: 1.15;
    transform: translateX(-50%);
}

.chart-axis span.is-start {
    transform: translateX(0);
}

.chart-axis span.is-end {
    text-align: right;
    transform: translateX(-100%);
}

.chart-axis strong {
    color: var(--ink);
    font-size: 10px;
}

.chart-axis small {
    font-size: 10px;
}

.chart-tooltip {
    position: fixed;
    z-index: 50;
    max-width: min(260px, calc(100vw - 42px));
    padding: 7px 9px;
    border: 1px solid rgba(11, 18, 32, .08);
    border-radius: var(--radius);
    background: rgba(11, 18, 32, .92);
    box-shadow: 0 14px 28px rgba(11, 18, 32, .18);
    color: #fff;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -100%) translateY(4px);
    transition: opacity .16s ease, transform .16s ease;
    text-align: center;
    white-space: normal;
}

.chart-tooltip.is-visible {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(0);
}

.source-line {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.subscribe-form {
    display: grid;
    gap: 10px;
}

.subscribe-card {
    padding: 16px;
}

.subscribe-card .section-heading {
    margin-bottom: 12px;
}

.subscribe-card label {
    gap: 8px;
    font-size: 13px;
}

.subscribe-card input,
.subscribe-card select,
.subscribe-card .value-row span {
    min-height: 46px;
    font-size: 16px;
}

.subscribe-card .button {
    min-height: 46px;
    font-size: 15px;
}

.subscribe-form[aria-busy="true"] .button.primary {
    cursor: progress;
    opacity: .82;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .18), transparent 32%, rgba(255, 255, 255, .24) 64%, transparent),
        var(--blue);
    background-size: 220% 100%, auto;
    animation: button-loading 1s ease-in-out infinite;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.value-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 8px;
}

.value-row span {
    display: grid;
    min-height: 46px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--blue-dark);
    font-weight: 400;
}

.subscription-list {
    display: grid;
    gap: 10px;
    max-height: 336px;
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
}

.subscriptions-card[aria-busy="true"] {
    position: relative;
    opacity: .72;
}

.subscriptions-card.is-hidden {
    display: none;
}

.subscriptions-card[aria-busy="true"]::after {
    position: absolute;
    top: 0;
    left: 12px;
    width: 38%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    content: "";
    animation: subscription-loading 1s ease-in-out infinite;
}

.subscription-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdff;
}

.subscription-row.is-new {
    animation: subscription-pop .52s ease;
}

.subscription-row.local-subscription {
    border-color: rgba(22, 119, 201, .25);
    background: linear-gradient(180deg, #fbfdff, #f4fbff);
}

.subscription-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.subscription-list strong {
    font-size: 15px;
}

.subscription-list span,
.subscription-list small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.icon-button {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.icon-button.danger:hover,
.icon-button.danger:focus-visible {
    border-color: #ffc8c8;
    color: #b42318;
    background: #fff5f5;
}

.action-status {
    position: fixed;
    z-index: 60;
    max-width: min(280px, calc(100vw - 24px));
    padding: 10px 12px;
    border: 1px solid #75d99f;
    border-radius: 10px;
    background: #dcfae6;
    color: #05603a;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .18), 0 0 0 1px rgba(255, 255, 255, .74) inset;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    pointer-events: none;
    animation: action-status-enter .18s ease-out;
}

.action-status.error {
    border-color: #fecaca;
    background: #fff5f5;
    color: #b42318;
}

.action-status.is-leaving {
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity .18s ease, transform .18s ease;
}

.empty-subscriptions.is-hidden {
    display: none;
}

@media (min-width: 680px) {
    .simple-shell {
        width: min(100%, 760px);
        padding: 18px 14px 18px;
    }

    .simple-header {
        padding-bottom: 12px;
    }

    .address-row {
        grid-template-columns: minmax(0, 1fr) 180px;
    }

    .simple-card {
        padding: 16px;
    }

    .dashboard-side,
    .forecast-card {
        min-width: 0;
    }

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

    .forecast-current {
        gap: 14px;
        margin-bottom: 12px;
    }

    .forecast-current strong {
        font-size: 64px;
    }

    .forecast-current-metrics {
        gap: 6px;
        min-width: 104px;
    }

    .forecast-current-metrics b {
        font-size: 13px;
    }

    .weather-risk {
        margin-bottom: 12px;
    }

    .chart-track {
        min-width: 100%;
    }

    .mini-chart {
        grid-template-columns: repeat(24, minmax(8px, 1fr));
        gap: 5px;
        height: 128px;
        padding: 13px 8px 8px;
    }

    .chart-axis {
        height: 28px;
        margin-top: 6px;
    }

    .subscribe-card {
        padding: 16px;
    }

    .dashboard-side .form-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .subscribe-card input,
    .subscribe-card select,
    .subscribe-card .value-row span {
        min-height: 46px;
        font-size: 16px;
    }

    .subscribe-card .button {
        min-height: 46px;
    }

    .subscription-list {
        max-height: 204px;
    }
}

@media (min-width: 900px) {
    .simple-shell {
        width: min(100%, 920px);
        padding-top: 24px;
    }

    .dashboard-grid,
    .dashboard-side {
        gap: 14px;
    }

    .simple-card {
        padding: 20px;
    }

    .forecast-current strong {
        font-size: 82px;
    }

    .forecast-current-metrics {
        min-width: 104px;
    }

    .forecast-current-metrics b {
        font-size: 14px;
    }

    .mini-chart {
        grid-template-columns: repeat(24, minmax(11px, 1fr));
        gap: 6px;
        height: 150px;
        padding: 14px 8px 9px;
    }

    .subscribe-card {
        padding: 20px;
    }

    .dashboard-side .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .subscribe-card input,
    .subscribe-card select,
    .subscribe-card .value-row span {
        min-height: 46px;
        font-size: 16px;
    }

    .subscribe-card .button {
        min-height: 46px;
    }

    .subscription-list {
        max-height: 336px;
    }
}

@media (max-width: 520px) {
    body {
        background: var(--bg);
    }

    .language-switcher::after {
        right: 9px;
    }

    .language-switcher select {
        width: 148px;
        padding-right: 30px;
        padding-left: 8px;
        font-size: 15px;
    }

    .forecast-current {
        gap: 10px;
    }

    .forecast-current strong {
        font-size: 56px;
    }

    .forecast-current-metrics {
        min-width: 96px;
    }
}

@media (max-width: 390px) {
    .language-switcher::after {
        right: 8px;
    }

    .language-switcher select {
        width: 140px;
        padding-right: 28px;
        padding-left: 7px;
        font-size: 14px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .forecast-current {
        gap: 8px;
    }

    .forecast-current strong {
        font-size: 52px;
    }

    .forecast-current-metrics {
        min-width: 88px;
    }

    .chart-track {
        min-width: 100%;
    }

    .mini-chart {
        grid-template-columns: repeat(24, minmax(8px, 1fr));
        gap: 4px;
        height: 150px;
    }

    .chart-point {
        min-height: 20px;
    }

    .chart-point::after {
        min-height: 5px;
    }
}

@keyframes subscription-loading {
    0% {
        transform: translateX(0);
        opacity: .35;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(150%);
        opacity: .35;
    }
}

@keyframes subscription-pop {
    0% {
        border-color: rgba(22, 119, 201, .58);
        box-shadow: 0 0 0 0 rgba(22, 119, 201, .2);
        transform: translateY(-3px);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(22, 119, 201, 0);
        transform: translateY(0);
    }
}

@keyframes action-status-enter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes button-loading {
    0% {
        background-position: 120% 0, 0 0;
    }

    100% {
        background-position: -120% 0, 0 0;
    }
}

@media (max-width: 480px) {
    .chart-track {
        min-width: 100%;
    }

    .mini-chart {
        grid-template-columns: repeat(24, minmax(8px, 1fr));
        gap: 4px;
        height: 150px;
    }
}
