:root {
    --bg: #f3f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafb;

    --navy: #102a3a;
    --navy-2: #173f55;
    --text: #17252e;
    --muted: #667985;
    --border: #dce5ea;

    --blue: #2877a6;
    --blue-soft: #eaf4fa;

    --warning: #b97818;
    --warning-bg: #fff7e8;

    --danger: #ae4038;
    --danger-bg: #fff0ee;

    --success: #3e7359;
    --success-bg: #edf7f1;

    --shadow:
        0 8px 24px rgba(17, 42, 58, 0.07);

    --radius: 16px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);
    background: var(--bg);
    line-height: 1.45;
}

button,
input,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}


/* TOPO */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;

    min-height: 68px;
    padding:
        max(12px, env(safe-area-inset-top))
        18px
        12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    background: var(--navy);
    color: white;

    border-bottom:
        1px solid rgba(255, 255, 255, .08);
}

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

.brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background:
        linear-gradient(
            145deg,
            #5ca9ce 0%,
            #286c91 100%
        );

    box-shadow:
        inset 0 0 0 1px
        rgba(255, 255, 255, .16);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-name {
    font-size: 17px;
    line-height: 1.1;
    font-weight: 760;
    letter-spacing: -.025em;
}

.brand-city {
    margin-top: 3px;

    color:
        rgba(255, 255, 255, .65);

    font-size: 11px;
}

.snapshot {
    max-width: 125px;

    color:
        rgba(255, 255, 255, .68);

    font-size: 10px;
    line-height: 1.3;
    text-align: right;
}


/* ESTRUTURA */

.page {
    width: 100%;
    max-width: 760px;

    margin: 0 auto;

    padding:
        18px
        14px
        calc(
            38px +
            env(safe-area-inset-bottom)
        );
}

.card,
.hero-card,
.sources-card,
.location-block,
.alert-card {
    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.card {
    margin-top: 14px;
    padding: 18px;
}


/* LOCALIDADE */

.location-block {
    padding: 16px;
}

.location-block label {
    display: block;

    margin-bottom: 7px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 750;

    text-transform: uppercase;
    letter-spacing: .07em;
}

.location-block select {
    width: 100%;
    min-height: 48px;

    padding: 0 42px 0 14px;

    color: var(--navy);
    background: var(--surface-soft);

    border:
        1px solid var(--border);

    border-radius: 11px;

    font-size: 16px;
    font-weight: 650;

    outline: none;
}

.location-block select:focus {
    border-color: var(--blue);

    box-shadow:
        0 0 0 3px
        rgba(40, 119, 166, .10);
}

.location-reference {
    margin-top: 9px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.45;
}

.location-reference:empty {
    display: none;
}


/* ALERTA */

.alert-card {
    margin-top: 14px;
    padding: 17px 18px;

    background: var(--warning-bg);
    border-color: #efd9ae;

    box-shadow: none;
}

.alert-label {
    color: var(--warning);

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .09em;
}

.alert-title {
    margin-top: 5px;

    color: var(--navy);

    font-size: 17px;
    font-weight: 760;
    line-height: 1.25;
}

.alert-meta {
    margin-top: 5px;

    color: var(--muted);

    font-size: 12px;
}


/* HERO */

.hero-card {
    position: relative;
    overflow: hidden;

    margin-top: 14px;
    padding: 21px 18px 18px;

    color: white;

    background:
        linear-gradient(
            145deg,
            var(--navy) 0%,
            var(--navy-2) 100%
        );

    border-color:
        rgba(255, 255, 255, .05);
}

.hero-card::after {
    content: "";

    position: absolute;
    width: 180px;
    height: 180px;
    right: -75px;
    top: -80px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, .035);

    pointer-events: none;
}

.hero-kicker {
    color:
        rgba(255, 255, 255, .58);

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .10em;
}

.hero-card h1 {
    margin: 5px 0 0;

    font-size: 29px;
    line-height: 1.12;
    letter-spacing: -.04em;
}

.hero-summary {
    max-width: 560px;

    margin-top: 8px;

    color:
        rgba(255, 255, 255, .72);

    font-size: 13px;
}

.clima-highlight {
    max-width: 620px;

    margin-top: 15px;

    font-size: 23px;
    font-weight: 780;
    line-height: 1.14;
    letter-spacing: -.035em;
}

.clima-attention {
    margin-top: 16px;
    padding: 13px 14px;

    background:
        rgba(255, 255, 255, .08);

    border:
        1px solid
        rgba(255, 255, 255, .10);

    border-radius: 12px;
}

.clima-attention > strong,
.clima-limitations > strong {
    display: block;

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .06em;
}

.clima-attention ul {
    margin:
        8px
        0
        0
        17px;

    padding: 0;
}

.clima-attention li {
    margin-top: 5px;

    color:
        rgba(255, 255, 255, .82);

    font-size: 12px;
    line-height: 1.4;
}

.clima-limitations {
    margin-top: 10px;
    padding: 11px 13px;

    color:
        rgba(255, 255, 255, .68);

    background:
        rgba(255, 255, 255, .045);

    border-radius: 10px;

    font-size: 11px;
    line-height: 1.4;
}

.clima-limitations > div {
    margin-top: 5px;
}

.hero-details-label {
    margin-top: 21px;

    color:
        rgba(255, 255, 255, .52);

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .09em;
}

.hero-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    margin-top: 19px;
}

.hero-stat {
    min-width: 0;
    padding: 13px;

    background:
        rgba(255, 255, 255, .07);

    border:
        1px solid
        rgba(255, 255, 255, .08);

    border-radius: 12px;
}

.hero-stat > span {
    display: block;

    color:
        rgba(255, 255, 255, .58);

    font-size: 10px;
}

.hero-stat strong {
    display: block;

    margin-top: 4px;

    font-size: 21px;
    line-height: 1.1;

    letter-spacing: -.035em;
}

.hero-stat small {
    display: block;

    margin-top: 5px;

    color:
        rgba(255, 255, 255, .55);

    font-size: 9px;
    line-height: 1.25;
}

.source-line {
    margin-top: 14px;

    color:
        rgba(255, 255, 255, .52);

    font-size: 10px;
}


/* CABEÇALHOS */

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;

    margin-bottom: 15px;
}

.section-kicker {
    color: var(--blue);

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .09em;
}

.section-head h2 {
    margin: 3px 0 0;

    color: var(--navy);

    font-size: 19px;
    line-height: 1.2;

    letter-spacing: -.025em;
}

.source-badge {
    flex: 0 0 auto;

    padding: 5px 8px;

    color: var(--blue);

    background: var(--blue-soft);

    border-radius: 999px;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .05em;
}


/* CHUVA OBSERVADA */

.rain-current {
    display: grid;
    gap: 8px;
}

.rain-reading {
    min-height: 64px;

    padding: 12px 13px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    background: var(--surface-soft);

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.rain-reading > div {
    min-width: 0;
}

.rain-reading strong {
    display: block;

    color: var(--navy);

    font-size: 21px;
    letter-spacing: -.035em;
}

.rain-reading span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 11px;
}

.rain-reading small {
    flex: 0 0 auto;

    color: var(--muted);

    font-size: 9px;
    text-align: right;
}

.rain-history {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 7px;

    margin-top: 10px;
}

.history-stat {
    padding: 10px 7px;

    text-align: center;

    background: var(--blue-soft);

    border-radius: 10px;
}

.history-stat span {
    display: block;

    color: var(--muted);

    font-size: 9px;
}

.history-stat strong {
    display: block;

    margin-top: 3px;

    color: var(--navy);

    font-size: 13px;
}


/* NOTAS */

.note {
    margin-top: 13px;

    padding-top: 12px;

    color: var(--muted);

    border-top:
        1px solid var(--border);

    font-size: 10px;
    line-height: 1.5;
}


/* MODELOS */

.model-table-wrap {
    width: 100%;
    overflow-x: auto;

    margin:
        0 -4px;

    padding:
        0 4px 5px;

    -webkit-overflow-scrolling: touch;
}

.model-table {
    width: 100%;
    min-width: 650px;

    border-collapse: collapse;

    font-size: 11px;
}

.model-table th {
    padding: 9px 8px;

    color: var(--muted);

    background: var(--surface-soft);

    border-bottom:
        1px solid var(--border);

    font-size: 9px;
    font-weight: 750;

    text-align: right;
    white-space: nowrap;
}

.model-table th:first-child {
    text-align: left;
}

.model-table td {
    padding: 10px 8px;

    border-bottom:
        1px solid var(--border);

    text-align: right;
    white-space: nowrap;
}

.model-table tr:last-child td {
    border-bottom: 0;
}

.model-table td:first-child {
    text-align: left;
}

.model-name {
    color: var(--navy);
    font-weight: 750;
}


/* RIOS */

.river-summary {
    margin-bottom: 14px;
    padding: 13px 14px;

    color: var(--text);

    background: var(--surface-soft);

    border:
        1px solid var(--border);

    border-radius: 12px;

    font-size: 12px;
    line-height: 1.5;
}

.river-list {
    display: grid;
    gap: 9px;
}

.river-row {
    display: grid;
    grid-template-columns: 1fr;

    gap: 12px;

    padding: 14px;

    background: var(--surface-soft);

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.river-main strong {
    display: block;

    color: var(--navy);

    font-size: 14px;
}

.river-main span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}

.river-measures {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 7px;
}

.river-measures > div {
    min-width: 0;

    padding: 9px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 9px;
}

.river-measures span {
    display: block;

    min-height: 24px;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.2;
}

.river-measures strong {
    display: block;

    margin-top: 4px;

    color: var(--navy);

    font-size: 14px;
    line-height: 1.1;
}

.river-meta {
    padding-top: 9px;

    border-top:
        1px solid var(--border);
}

.river-meta strong {
    display: block;

    color: var(--navy);

    font-size: 11px;
}

.river-meta span,
.river-meta small {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 9px;
}

/* INMET */

.inmet-list {
    display: grid;
    gap: 8px;
}

.inmet-row {
    display: grid;
    grid-template-columns:
        88px minmax(0, 1fr) auto;

    align-items: center;
    gap: 10px;

    padding: 11px 12px;

    background: var(--surface-soft);

    border:
        1px solid var(--border);

    border-radius: 12px;
}

.inmet-row > div:first-child strong {
    display: block;

    color: var(--navy);

    font-size: 11px;
}

.inmet-row > div:first-child span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 9px;

    text-transform: capitalize;
}

.inmet-summary {
    color: var(--text);

    font-size: 11px;
    line-height: 1.35;
}

.inmet-temp {
    color: var(--navy);

    font-size: 11px;
    font-weight: 750;

    white-space: nowrap;
}


/* FONTES */

.sources-card {
    margin-top: 14px;
    padding: 17px 18px;

    box-shadow: none;
}

.sources-card > strong {
    display: block;

    margin-bottom: 10px;

    color: var(--navy);

    font-size: 13px;
}

.source-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 16px;

    padding: 8px 0;

    border-bottom:
        1px solid var(--border);
}

.source-item:last-child {
    border-bottom: 0;
}

.source-item strong {
    flex: 0 0 auto;

    color: var(--navy);

    font-size: 10px;
}

.source-item span {
    color: var(--muted);

    font-size: 9px;
    text-align: right;
}


/* TELAS UM POUCO MAIORES */

@media (min-width: 620px) {

    .topbar {
        padding-left: 24px;
        padding-right: 24px;
    }

    .page {
        padding:
            24px
            20px
            54px;
    }

    .location-block,
    .card {
        padding: 21px;
    }

    .hero-card {
        padding: 25px 22px 21px;
    }

    .hero-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .hero-card h1 {
        font-size: 34px;
    }

    .river-row {
        grid-template-columns:
            minmax(0, 1.3fr)
            minmax(100px, .5fr)
            110px;

        align-items: center;
    }

    .river-trend {
        grid-column: auto;

        padding-top: 0;

        border-top: 0;

        text-align: right;
    }
}


/* CELULARES ESTREITOS */

@media (max-width: 380px) {

    .topbar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero-stat strong {
        font-size: 18px;
    }

    .rain-history {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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

    .inmet-temp {
        grid-column: 2;
    }
}
