.geo-card-value-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 2.4rem;
    font-weight: 700;
    color: #0b2540;
    margin-bottom: 2px;
}
.geo-card-value {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    white-space: nowrap;
}
.geo-card-unit {
    font-size: 0.95em;
    white-space: nowrap;
}
/* Fundo verde contínuo para o grid */
.ipma-alerts-grid-bg {
    background: #19c419;
    border-radius: 0;
    z-index: 0;
}

/* Linhas pretas do grid */
.ipma-alerts-grid-lines {
    z-index: 2;
}
.ipma-alerts-grid-hline {
    position: absolute;
    left: 0;
    height: 2px;
    background: #111;
    width: 100%;
}
.ipma-alerts-grid-vline {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #111;
}
/* Linhas verticais contínuas (grid) para o gráfico de avisos IPMA */
.ipma-alerts-grid-vlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
.ipma-alerts-bar-vline {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #222;
    z-index: 2;
}
.ipma-alerts-bar-vline-main {
    background: #000;
    width: 4px;
}
/* Linha preta horizontal contínua para o gráfico de avisos IPMA */
.ipma-alerts-bar-line {
    position: absolute;
    left: 36px; /* alinhado com início das barras, após ícone */
    right: 0;
    bottom: 2px; /* junto à base das barras */
    height: 3px;
    background: #111;
    border-radius: 2px;
    z-index: 0;
}
.alert-banner-card {
    background-color: #27ae60 !important;
    border: none;
    border-radius: 12px;
    padding: 15px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: visible;
    min-height: 80px;
}

.alert-banner-card img, 
.alert-banner-card svg {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0;
    filter: brightness(0) invert(1) !important;
    display: block !important;
    opacity: 1 !important;
}

.alert-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center;
    color: white !important;
}

.alert-label {
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    color: white !important;
}

.alert-status {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 500;
    color: white !important;
}

/* Forçar cores específicas via classes para bater o JavaScript se necessário */
.alert-banner-card[style*="background: rgb(39, 174, 96)"],
.alert-banner-card[style*="background: #27ae60"] { background-color: #27ae60 !important; }
.alert-banner-card[style*="background: rgb(241, 196, 15)"],
.alert-banner-card[style*="background: #f4c430"] { background-color: #f4c430 !important; }
.alert-banner-card[style*="background: rgb(230, 126, 34)"],
.alert-banner-card[style*="background: #e67e22"] { background-color: #e67e22 !important; }
.alert-banner-card[style*="background: rgb(231, 76, 60)"],
.alert-banner-card[style*="background: #e74c3c"] { background-color: #e74c3c !important; }

/* Estilo para o mini-popup de detalhes */
.alert-popup {
    position: fixed;
    z-index: 100000;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    max-width: 350px;
    width: 90%;
    display: none;
    border-top: 5px solid #27ae60;
    pointer-events: auto;
    transition: none; /* Evitar conflitos com animações antigas se estivermos a calcular via JS */
}

.alert-popup-close {
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    font-size: 1.5rem;
    color: #999;
}

.alert-popup h4 {
    margin: 0 0 10px 0;
    color: #1a2a3a;
    font-size: 1.2rem;
}

.alert-popup p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
}

.alert-popup .time-range {
    display: inline-block;
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    color: #0b4f8a;
    margin: 10px 0;
}

.alert-popup .risk-note {
    font-style: italic;
    font-size: 0.85rem;
    color: #777;
    margin-top: 10px;
    display: block;
}

.alert-info {
    display: flex;
    flex-direction: column;
}

.alert-label {
    font-weight: 800;
    color: #ffffff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-status {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 1px;
    color: #ffffff;
}

.alert-banner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(11, 79, 138, 0.1);
}
.ipma-alerts-grid-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    position: relative;
}
.ipma-alerts-grid-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ipma-alerts-grid-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex: 0 0 20px;
    margin-right: 2px;
}
.ipma-alerts-grid-cell {
    width: 28px;
    height: 32px;
    border-radius: 0;
    display: inline-block;
    margin: 0 !important;
    border: none !important;
    border-right: 1px solid #222 !important;
    box-sizing: border-box;
    background-clip: padding-box;
}
.ipma-alerts-grid-cell.hour-sep {
    border-right: 2.5px solid #000 !important;
}
.ipma-alerts-grid-hours {
    display: flex;
    align-items: flex-end;
    margin-left: 36px;
    margin-bottom: 2px;
    gap: 2px;
}
.ipma-alerts-grid-hour-label {
    width: 28px;
    text-align: center;
    font-size: 0.98rem;
    color: #0b4f8a;
    font-weight: 600;
}
.ipma-alerts-grid-hour-label-main {
    font-size: 1.05em;
    font-weight: 600;
    color: #0070c0;
    display: inline-block;
    width: 22px;
    text-align: center;
}
.ipma-alerts-grid-hour-label-sub {
    font-size: 0.85em;
    color: #b0b0b0;
    display: inline-block;
    width: 22px;
    text-align: center;
}
.ipma-alerts-grid-dates {
    display: grid;
    grid-template-columns: repeat(36, 1fr);
    margin-left: 36px;
    margin-top: 2px;
}
.ipma-alerts-grid-date-label {
    width: 56px;
    text-align: center;
    font-size: 0.98rem;
    color: #0b4f8a;
    font-weight: 600;
}
@media (max-width: 900px) {
    .ipma-alerts-grid-icon { width: 18px; font-size: 1rem; }
    .ipma-alerts-grid-cell { width: 14px; height: 16px; margin: 0; }
    .ipma-alerts-grid-hour-label { width: 14px; font-size: 0.8rem; }
    .ipma-alerts-grid-date-label { width: 28px; font-size: 0.8rem; }
}
.geo-parametros-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 24px 0 0 0;
    grid-auto-rows: 1fr;
    align-items: stretch;
}
.geo-card {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(11, 79, 138, 0.07);
    border: 1.5px solid var(--stroke);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-height: 140px;
    align-self: stretch;
    height: 100%;
    transition: box-shadow 0.2s;
}
#card-precip {
    min-height: 160px;
}
#card-precip .geo-card-value-wrap {
    min-height: 60px;
}
#precip-subtitle,
#precip-badge {
    white-space: nowrap;
}
#precip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.geo-card-title {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: #444;
    font-weight: 600;
    gap: 10px;
    width: 100%;
}
.uv-card,
#card-qualidade-ar {
    min-height: 220px;
    justify-content: space-between;
}
.uv-card {
    border-color: #f5c542;
}
.uv-card-summary {
    margin-top: 10px;
}
.iqa-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.iqa-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e6eaf0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    max-width: calc(50% - 8px);
}
.uv-card-header {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}
.uv-card-value-main {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 8px;
}
.uv-card-value-large {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    color: #0b2540;
}
.uv-card-unit-large {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1c40f;
    margin-bottom: 0.1rem;
}
.uv-card-status-row {
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
}
.uv-category-label {
    background: #fde3a7;
    color: #8c6d1f;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.uv-card.uv-low {
    border-color: #2f855a;
}
.uv-card.uv-low .uv-category-label {
    background: #d1fae5;
    color: #166534;
}
.uv-card.uv-moderate {
    border-color: #d69e2e;
}
.uv-card.uv-moderate .uv-category-label {
    background: #fef3c7;
    color: #92400e;
}
.uv-card.uv-high {
    border-color: #f97316;
}
.uv-card.uv-high .uv-category-label {
    background: #fff7ed;
    color: #c2410b;
}
.uv-card.uv-very-high {
    border-color: #dc2626;
}
.uv-card.uv-very-high .uv-category-label {
    background: #fee2e2;
    color: #991b1b;
}
.uv-card.uv-extreme {
    border-color: #7c2d12;
}
.uv-card.uv-extreme .uv-category-label {
    background: #ede9fe;
    color: #4c1d95;
}
.uv-card.uv-unknown {
    border-color: #f5c542;
}
.uv-card.uv-unknown .uv-category-label {
    background: #fde3a7;
    color: #8c6d1f;
}
.iqa-geo-card-value-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    width: 100%;
}
.uv-card-value-wrap .geo-card-value {
    font-size: 3rem;
}
.info-section {
    background: #ffffff;
    padding: 60px 0 80px;
    margin-top: 40px;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.info-container {
    width: 100%;
    max-width: none;
    padding: 0 20px;
    box-sizing: border-box;
}
.info-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1500px;
    margin: 0 auto;
}
@media (max-width: 1100px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}
@media (max-width: 650px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
@media (max-width: 650px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}
.info-card {
    padding: 30px 20px;
    background: #f8fafc;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 2px solid transparent;
}
.info-card:hover {
    transform: translateY(-8px);
    border-color: #ff9a1a;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.clickable-title {
    pointer-events: none;
}
.read-more {
    margin-top: auto;
    font-size: 0.85rem;
    color: #0b4f8a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-top: 15px;
}
.read-more::after {
    content: "→";
    transition: transform 0.2s ease;
}
.info-card:hover .read-more::after {
    transform: translateX(4px);
}
.info-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 24, 39, 0.9);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
    animation: modalFade 0.3s ease-out;
}
@keyframes modalFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-content h2 {
    background: #0b2540;
    color: #fff;
    margin: 0;
    padding: 25px 40px;
    font-size: 1.6rem;
}
.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}
.public-alerts-panel {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.public-alerts-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.public-alerts-panel-label {
    margin: 0 0 6px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0f172a;
    opacity: 0.75;
}
.public-alerts-panel-title {
    margin: 0;
    font-size: 1.55rem;
    color: #0f172a;
    line-height: 1.15;
}
.public-alerts-panel-subtitle {
    margin: 10px 0 0;
    color: #475569;
    max-width: 560px;
    line-height: 1.6;
}
.public-alerts-panel-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}
.public-alerts-panel-summary-badge span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.public-alerts-modal-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}
.public-alerts-summary-list {
    display: grid;
    gap: 14px;
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 2px;
}
.public-alerts-summary-card {
    width: 100%;
    text-align: left;
    border-radius: 18px;
    background: #ffffff;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid rgba(15, 23, 42, 0.08);
    appearance: none;
}
.public-alerts-summary-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.18);
}
.public-alerts-summary-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}
.public-alerts-summary-card-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.05);
    font-size: 1.5rem;
}
.public-alerts-summary-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.public-alerts-summary-card-subtitle {
    margin-top: 4px;
    font-size: 0.9rem;
    color: #64748b;
}
.public-alerts-summary-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.public-alerts-severity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    min-width: 90px;
}
.public-alerts-severity-badge.severity-information {
    color: #166534;
    background: #ecfdf5;
}
.public-alerts-severity-badge.severity-attention {
    color: #78350f;
    background: #fef3c7;
}
.public-alerts-severity-badge.severity-danger {
    color: #9a3412;
    background: #ffedd5;
}
.public-alerts-severity-badge.severity-emergency {
    color: #7f1d1d;
    background: #fee2e2;
}
.public-alerts-summary-start,
.public-alerts-summary-state {
    font-size: 0.88rem;
    color: #475569;
}
.public-alerts-details-panel {
    border-radius: 24px;
    background: #f8fafc;
    color: #0f172a;
    padding: 26px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.06);
}
.public-alerts-details-empty {
    color: #475569;
    display: grid;
    gap: 12px;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px 18px;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    border-radius: 20px;
    min-height: 260px;
    background: #ffffff;
}
.public-alerts-details-empty strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: #0f172a;
}
.public-alerts-details-content {
    display: grid;
    gap: 18px;
}
.public-alerts-details-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.public-alerts-details-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    font-size: 0.78rem;
    margin-bottom: 10px;
    display: inline-block;
}
.public-alerts-details-content h3 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.2;
    color: #0f172a;
}
.public-alerts-details-state {
    padding: 12px 16px;
    border-radius: 16px;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 700;
    min-width: 140px;
    text-align: center;
}
.public-alerts-detail-row {
    display: grid;
    gap: 8px;
    color: #334155;
}
.public-alerts-detail-row span {
    font-size: 0.88rem;
    color: #64748b;
}
.public-alerts-detail-row strong,
.public-alerts-detail-row div {
    color: #0f172a;
    font-size: 0.98rem;
    line-height: 1.6;
}
.public-alerts-detail-message div {
    white-space: pre-wrap;
}
@media (max-width: 940px) {
    .public-alerts-modal-grid {
        grid-template-columns: 1fr;
    }
    .public-alerts-details-panel {
        min-height: auto;
    }
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}
.close-modal:hover {
    color: #ff9a1a;
}
.emergency-list.full .emergency-item {
    margin-bottom: 15px;
}
.emergency-preview {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.9rem;
    color: #4b6a8a;
    margin-bottom: 15px;
}
.info-card h3 {
    margin-top: 0;
    color: #0b2540;
    font-size: 1.5rem;
    border-bottom: 3px solid #ff9a1a;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
}
.info-card p, .info-card address {
    color: #4b6a8a;
    line-height: 1.6;
    font-style: normal;
}
.emergency-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.emergency-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 5px solid #ff7b00;
}
.emergency-item .label {
    font-weight: 700;
    color: #0b2540;
    min-width: 0;
    word-break: break-word;
}
.emergency-item .value {
    color: #ff7b00;
    font-weight: 800;
    font-size: 1.2rem;
    text-decoration: none;
    text-align: right;
    min-width: 0;
}
@media (max-width: 720px) {
    .emergency-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .emergency-item .value {
        text-align: left;
    }
}
.map-link {
    display: inline-block;
    margin-top: 20px;
    color: #0b4f8a;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid #0b4f8a;
}

.uv-legend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}
#card-qualidade-ar {
    min-height: 190px;
}
.iqa-category-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #dff6ff;
    color: #0b4f8a;
    margin-top: 4px;
}
.iqa-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.iqa-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e6eaf0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.iqa-category-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #dff6ff;
    color: #0b4f8a;
    margin-top: 4px;
}
.iqa-unknown {
    background: #f3f4f6;
    color: #475569;
    border-color: #d6dbe8;
}
.iqa-very-good { background: #e8f8f5; color: #0f7b60; border-color: #c7f1e8; }
.iqa-good { background: #f3f6ff; color: #1f4d8a; border-color: #dbe5ff; }
.iqa-medium { background: #fff7e5; color: #8a5d11; border-color: #f4e5c5; }
.iqa-poor { background: #fff1f0; color: #9d2d2d; border-color: #f6d4d2; }
.iqa-bad { background: #fbecee; color: #941b2d; border-color: #f5d2da; }
.uv-legend-item {
    background: #ffffff;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(15, 32, 71, 0.06);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.uv-legend-band {
    display: inline-flex;
    margin-bottom: 6px;
    font-size: 0.82rem;
    padding: 0;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
    gap: 8px;
    background: transparent;
    color: inherit;
}
.uv-low .uv-legend-band,
.uv-moderate .uv-legend-band,
.uv-high .uv-legend-band,
.uv-very-high .uv-legend-band,
.uv-extreme .uv-legend-band {
    background: transparent;
    color: inherit;
}
.uv-legend-item strong {
    font-size: 0.95rem;
    color: #1f2b3d;
}
.uv-legend-item p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.35;
}
.uv-card-note {
    margin: 12px 0 0;
    font-size: 0.88rem;
    color: #4b5563;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}
.btn-uv-expand {
    display: inline-flex;
    margin: 12px 0 0;
    background: transparent;
    color: #0b4f8a;
    border: none;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    align-self: flex-start;
}
.btn-uv-expand:hover {
    color: #0d5aa5;
    text-decoration: none;
}
.uv-card-summary {
    font-size: 0.95rem;
    color: #475569;
    width: 100%;
}
.geo-card-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0b2540;
    margin-bottom: 0;
}
.geo-card-meta {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.4;
    margin-top: 6px;
}
#card-temp .geo-card-value {
    color: #000000;
}
#card-temp .geo-card-meta {
    font-size: 0.82rem;
    color: #64748b;
}
#card-temp .geo-card-meta strong {
    font-weight: 600;
    color: #000000;
}
#card-temp .geo-card-unit {
    font-size: 1.1rem;
    color: #f5b021 !important;
    font-weight: 600;
}
#card-vento .geo-card-value {
    color: #000000;
}
#card-vento .geo-card-meta {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
    margin-top: 6px;
}
#card-vento .geo-card-meta strong,
#card-vento .geo-card-meta #val-vento-gust {
    color: #000000;
}
#card-vento .geo-card-unit {
    font-size: 1.1rem;
    color: #f5b021 !important;
    font-weight: 600;
}
.geo-card-unit {
    font-size: 1.1rem;
    color: var(--accent-warm);
    font-weight: 600;
}
.geo-card-value-group {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.uv-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 10px;
}
.uv-modal-item {
    background: #ffffff;
    border: 1px solid #e6eaf0;
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 3px 8px rgba(15, 32, 71, 0.08);
}
.uv-modal-item.uv-low {
    background: #e6ffed;
    border-color: #2f855a;
}
.uv-modal-item.uv-moderate {
    background: #fff8db;
    border-color: #d69e2e;
}
.uv-modal-item.uv-high {
    background: #fff3e0;
    border-color: #dd6b20;
}
.uv-modal-item.uv-very-high {
    background: #ffe6e6;
    border-color: #c53030;
}
.uv-modal-item.uv-extreme {
    background: #f4ecff;
    border-color: #6b46c1;
}
.uv-modal-item .uv-legend-band {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.uv-legend-number {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px !important;
    height: 36px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.12) !important;
    line-height: 1 !important;
    background: transparent !important;
}
.uv-modal-item.uv-low .uv-legend-number { background: #2f855a !important; }
.uv-modal-item.uv-moderate .uv-legend-number { background: #d69e2e !important; }
.uv-modal-item.uv-high .uv-legend-number { background: #dd6b20 !important; }
.uv-modal-item.uv-very-high .uv-legend-number { background: #c53030 !important; }
.uv-modal-item.uv-extreme .uv-legend-number { background: #6b46c1 !important; }
.uv-modal-item strong {
    display: block;
    font-size: 1rem;
    color: #1f2b3d;
    margin-bottom: 8px;
}
.uv-modal-item.uv-low strong { color: #1f4d2f; }
.uv-modal-item.uv-moderate strong { color: #5c4715; }
.uv-modal-item.uv-high strong { color: #7b4514; }
.uv-modal-item.uv-very-high strong { color: #7a2724; }
.uv-modal-item.uv-extreme strong { color: #4c2a6b; }
.uv-modal-item.iqa-very-good {
    background: #e6ffed;
    border-color: #2f855a;
}
.uv-modal-item.iqa-good {
    background: #e8f0ff;
    border-color: #3182ce;
}
.uv-modal-item.iqa-medium {
    background: #fff8db;
    border-color: #d69e2e;
}
.uv-modal-item.iqa-poor {
    background: #fff3e0;
    border-color: #dd6b20;
}
.uv-modal-item.iqa-bad {
    background: #ffe6e6;
    border-color: #c53030;
}
.uv-modal-item.iqa-good strong { color: #1e3a8a; }
.uv-modal-item.iqa-poor strong { color: #7b4514; }
.uv-modal-item.iqa-bad strong { color: #7a2724; }
.uv-modal-item.iqa-very-good .uv-legend-number { background: #2f855a !important; }
.uv-modal-item.iqa-good .uv-legend-number { background: #3182ce !important; }
.uv-modal-item.iqa-medium .uv-legend-number { background: #d69e2e !important; }
.uv-modal-item.iqa-poor .uv-legend-number { background: #dd6b20 !important; }
.uv-modal-item.iqa-bad .uv-legend-number { background: #c53030 !important; }
.uv-modal-item.full-width { grid-column: span 2; }
#modal-IQA .uv-legend-number {
    white-space: nowrap;
}
#modal-IQA .pir-modal-content {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}
@media (max-width: 768px) {
    #modal-IQA .uv-modal-grid {
        grid-template-columns: 1fr;
    }
    #modal-IQA .uv-modal-item {
        width: 100%;
    }

    /* Ocorrências Ativas: layout em cartões no telemóvel */
    #occurrences-panel table {
        min-width: 0 !important;
        width: 100%;
        border: none;
        border-collapse: separate;
    }

    #occurrences-panel thead {
        display: none;
    }

    #occurrences-panel tbody,
    #occurrences-panel tr {
        display: block;
        width: 100%;
    }

    #occurrences-panel tr {
        margin-bottom: 16px;
        background: #ffffff;
        border-radius: 18px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
        overflow: hidden;
    }

    #occurrences-panel td {
        display: block;
        width: 100%;
        padding: 14px 16px !important;
        border-bottom: 1px solid #f1f5f9;
        white-space: normal !important;
        word-break: break-word;
    }

    #occurrences-panel tr td:last-child {
        border-bottom: none;
    }

    #occurrences-panel td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 8px;
        font-size: 0.74rem;
        font-weight: 700;
        color: #64748b;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }
}
.uv-modal-item p {
    margin: 0;
    font-size: 0.94rem;
    color: #475569;
    line-height: 1.5;
}
/* Bussola Dinâmica */
.wind-compass-container {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    margin-right: 10px;
}
.geo-card-value-group {
    display: flex;
    align-items: center;
    justify-content: center;
}
.wind-compass {
    width: 100%;
    height: 100%;
    border: 1.8px solid #b7cbe1;
    border-radius: 50%;
    position: relative;
    background: #fff;
}
.wind-compass-inner span {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 800;
    color: #555;
    z-index: 5;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.compass-n { top: -14px; left: 50%; transform: translateX(-50%); }
.compass-e { right: -13px; top: 50%; transform: translateY(-50%); }
.compass-s { bottom: -14px; left: 50%; transform: translateX(-50%); }
.compass-w { left: -14px; top: 50%; transform: translateY(-50%); }

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 35px;
    background: #2c3e50;
    transform: translate(-50%, -50%) rotate(0deg);
    border-radius: 2px;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    pointer-events: none;
    transform-origin: center center;
}
.compass-needle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: #e74c3c;
    border-radius: 2px 2px 0 0;
}
.compass-needle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 7px solid #e74c3c;
    margin-top: -5px;
}

.geo-card-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0b2540;
    margin-bottom: 0;
}
.geo-card-meta {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.4;
    margin-top: 6px;
}
.uv-legend {
    font-size: 0.82rem;
    color: #4a5568;
    line-height: 1.4;
    margin-top: 10px;
}
.uv-legend strong {
    font-weight: 700;
}
.uv-legend ul {
    margin: 8px 0 0 0;
    padding-left: 16px;
}
.uv-legend li {
    margin-bottom: 4px;
}
.geo-card-unit {
    font-size: 1.1rem;
    color: var(--accent-warm);
    font-weight: 600;
}
@media (max-width: 900px) {
    .geo-parametros-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .uv-legend-grid {
        grid-template-columns: 1fr;
    }
    .geo-card {
        padding: 10px 12px;
        min-height: 70px;
    }
    .geo-card-value {
        font-size: 1.4rem;
    }
}
.geo-card-time {
    font-size: 0.98rem;
    color: #0b4f8a;
    font-weight: 500;
    margin-top: 2px;
}
@media (max-width: 900px) {
    .geo-parametros-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .geo-card {
        padding: 12px 16px;
    }
    .geo-card-title {
        font-size: 1rem;
    }
    .geo-card-value {
        font-size: 1.6rem;
    }
    .geo-card-unit {
        font-size: 0.9rem;
    }
}
:root {
    --bg: #0f2f4d;
    --ink: #0f1d2d;
    --card: #f8fbff;
    --stroke: #b7cbe1;
    --accent: #0b4f8a;
    --accent-soft: #dceaf8;
    --accent-warm: #ff8a00;
    --site-header-height: 99px;
    --dashboard-tabs-height: 53px;
    --dashboard-chrome-height: 152px;
}

* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

html.modal-open,
body.modal-open {
    overflow: hidden !important;
    touch-action: none;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 138, 0, 0.25) 0%, rgba(255, 138, 0, 0) 34%),
        radial-gradient(circle at 52% 48%, rgba(255, 132, 0, 0.13) 0%, rgba(255, 132, 0, 0) 42%),
        radial-gradient(circle at 86% 26%, rgba(255, 128, 0, 0.14) 0%, rgba(255, 128, 0, 0) 34%),
        radial-gradient(circle at 76% 78%, rgba(14, 99, 168, 0.3) 0%, rgba(14, 99, 168, 0) 36%),
        linear-gradient(145deg, #081827 0%, #0d2740 42%, #0a2238 100%);
    color: var(--ink);
    min-height: 100vh;
    position: relative;
    padding-top: var(--dashboard-chrome-height, 152px);
}

h1,
h2,
h3,
h4,
h5,
h6,
.section-title-icon,
.geo-card-title,
.site-title,
.site-subtitle,
.info-card h3,
.stat-card h2,
.pir-panel-head strong,
.public-alerts-panel-title,
.public-alerts-summary-card-title,
.tomorrow-risk-panel h3 {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* Aumentado de 30 para 1000 para garantir que nada passe por cima */
    backdrop-filter: blur(8px);
    background: linear-gradient(135deg, rgba(8, 24, 39, 1), rgba(13, 39, 64, 1)); /* Fundo 100% opaco para esconder o conteúdo */
    border-bottom: none;
}

.site-header-inner {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 12px 30px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}


.site-header-logos {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    flex: 0 0 auto;
}

.site-header-logo-wrap + .site-header-logo-wrap {
    margin-left: 0;
}

.site-header-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.site-header-logo {
    width: auto;
    height: 74px;
    object-fit: contain;
    display: block;
}

.site-header-brand {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: max(2.5vw, calc((100vw - 1120px) / 2));
}

.site-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: #9dc3e7;
}

.site-title {
    margin: 4px 0 0;
    color: #f7fbff;
    font-size: clamp(18px, 2.2vw, 28px);
    line-height: 1.1;
}

.site-subtitle {
    margin: 4px 0 0;
    color: #c9dff5;
    font-size: 13px;
}

.site-header-actions {
    display: flex;
    margin-left: 20px;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.site-header-clock {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #dceaf8;
    background: rgba(11, 79, 138, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(205, 224, 246, 0.2);
    min-width: 90px;
    letter-spacing: 2px;
    margin-left: 10px;
}

.header-btn {
    display: inline-block;
    text-decoration: none;
    background: linear-gradient(120deg, #0b4f8a, #1467ad);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
}

.header-btn-secondary {
    background: linear-gradient(135deg, #ff7b00, #ff9a1a);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(158deg, rgba(255, 137, 0, 0.12) 0%, rgba(255, 137, 0, 0) 34%),
        linear-gradient(24deg, rgba(255, 120, 0, 0.1) 16%, rgba(255, 120, 0, 0) 42%),
        linear-gradient(118deg, rgba(20, 92, 150, 0.22), rgba(20, 92, 150, 0));
    pointer-events: none;
    z-index: 0;
}

.dashboard-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 70px 20px 0; /* Removido o padding inferior extra */
    position: relative;
    z-index: 2;
}

.info-section {
    background: #ffffff;
    padding: 40px 0 60px;
    margin-top: 40px;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.info-container {
    width: 100%;
    max-width: none;
    padding: 0 20px;
    box-sizing: border-box;
}
.info-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1500px;
    margin: 0 auto;
}
.site-footer {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: #0a2236;
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 40px 20px;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-sizing: border-box;
    margin-top: 0;
}

/* Navegação por Tabs Refinada */
.dashboard-tabs {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    padding: 0 5%;
    position: absolute;
    top: var(--site-header-height, 99px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10;
    margin: 0;
}
.tabs-list {
    display: flex;
    justify-content: center; /* Centralizado para melhor aspeto */
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}
.tab-item {
    position: relative;
    padding: 15px 25px;
    transition: all 0.3s;
}
.tab-item a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab-item i {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}
.tab-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.tab-item:hover a {
    color: #fff;
}
.tab-item.active {
    background: rgba(255, 255, 255, 0.2);
}
.tab-item.active a {
    color: #fff;
    font-weight: 600;
}
.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #27ae60; /* Verde mais vibrante e elegante */
    box-shadow: 0 -2px 10px rgba(39, 174, 96, 0.5);
}

@media (max-width: 900px) {
    .dashboard-tabs {
        padding: 0;
    }
    .tabs-list {
        justify-content: flex-start;
        overflow-x: auto;
        gap: 0;
    }
    .tab-item {
        padding: 12px 15px;
    }
    .tab-item a {
        font-size: 0.9rem;
        white-space: nowrap;
    }
}

.bg-shape {
    position: fixed;
    border-radius: 999px;
    filter: blur(12px);
    z-index: 1;
}

.bg-shape-a {
    width: 700px;
    height: 260px;
    background: linear-gradient(90deg, rgba(9, 64, 107, 0.35), rgba(255, 132, 0, 0.42), rgba(20, 98, 160, 0.3));
    top: -40px;
    left: -120px;
    transform: rotate(-18deg);
}

.bg-shape-b {
    width: 760px;
    height: 280px;
    background: linear-gradient(90deg, rgba(23, 96, 154, 0.28), rgba(255, 138, 0, 0.45), rgba(12, 71, 120, 0.32));
    bottom: -70px;
    right: -180px;
    transform: rotate(14deg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.stat-card,
.panel {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    box-shadow: 0 10px 36px rgba(2, 11, 22, 0.34);
}

.stat-card {
    padding: 16px;
}

.stat-card p {
    margin: 0;
    color: #456483;
}

.stat-card-link {
    color: inherit;
    text-decoration: none;
}

.stat-card-link:hover,
.stat-card-link:focus-visible {
    text-decoration: underline;
}

.stat-card h2 {
    margin: 10px 0 6px;
}

.risk-pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
}

.risk-low {
    background: #dff6df;
    color: #1f6d1f;
}

.risk-moderate {
    background: #fff1c9;
    color: #7b5a00;
}

.risk-high {
    background: #ffe2bd;
    color: #8a4300;
}

.risk-very-high {
    background: #ffd2d2;
    color: #8f1b1b;
}

.risk-max {
    background: #7f1515;
    color: #fff;
}

.risk-unknown {
    background: #e5e9ef;
    color: #4a5870;
}

.stat-card span {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
}

.stat-card .stat-meta-line {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: block;
    margin-top: 0;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #a8c6e3;
    background: linear-gradient(145deg, #f4f9ff, #e1eefb);
    box-shadow: 0 9px 18px rgba(16, 44, 73, 0.22);
    font-size: 13px;
    color: #173955;
    line-height: 1.3;
    font-weight: 800;
    z-index: 6;
    pointer-events: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(8px) scale(0.96);
    transition: max-height 0.25s ease, opacity 0.22s ease, transform 0.22s ease, box-shadow 0.2s ease;
}

.stat-card.has-hover-details {
    position: relative;
    overflow: visible;
    cursor: pointer;
}

.stat-card.has-hover-details:hover .stat-meta-line,
.stat-card.has-hover-details:focus-visible .stat-meta-line,
.stat-card.has-hover-details.is-expanded .stat-meta-line {
    max-height: 70px;
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 12px 22px rgba(16, 44, 73, 0.28);
}

.stat-card.has-hover-details:hover .temp-detail-pop,
.stat-card.has-hover-details:focus-visible .temp-detail-pop,
.stat-card.has-hover-details.is-expanded .temp-detail-pop {
    max-height: 188px;
}

.temp-detail-pop {
    padding: 8px 8px 10px;
    background: linear-gradient(150deg, #eff5fc, #dae8f7);
}

.temp-detail-pop span,
.temp-detail-pop strong {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.temp-detail-title {
    margin: 0;
    background: linear-gradient(140deg, #2d343f, #1f2834);
    color: #fff;
    border-radius: 7px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 6px;
}

.temp-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.temp-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.temp-detail-label {
    color: #2b4a68;
    font-size: 11px;
    font-weight: 700;
}

.temp-detail-value {
    color: #1b3149;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.temp-thermo {
    width: 15px;
    height: 64px;
    position: relative;
    border: 1px solid #9cb4ce;
    border-radius: 9px;
    background: linear-gradient(180deg, #f6fbff, #e5eef8);
    overflow: hidden;
}

.temp-thermo::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid #8ea9c5;
    background: #dce9f8;
}

.temp-thermo-fill {
    --level: 0%;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--level);
    border-radius: 8px 8px 4px 4px;
    transition: height 0.28s ease;
}

.temp-thermo-warm {
    background: linear-gradient(180deg, #d79a09, #b77900);
}

.temp-thermo-warm::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #b77900;
    border: 1px solid #8f5f02;
}

.temp-thermo-cool {
    background: linear-gradient(180deg, #4c9ef4, #2f78ca);
}

.temp-thermo-cool::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #2f78ca;
    border: 1px solid #285e9b;
}

.temp-thermo-hot {
    background: linear-gradient(180deg, #f06f6f, #cf4d4d);
}

.temp-thermo-hot::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #cf4d4d;
    border: 1px solid #a63b3b;
}

.stat-card.has-hover-details:hover,
.stat-card.has-hover-details:focus-visible,
.stat-card.has-hover-details.is-expanded {
    z-index: 8;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.content-grid > .panel {
    border-radius: 8px;
}

.content-grid > .panel > h3 {
    margin: 0 0 10px;
    color: #12385d;
    font-size: 23px;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.forecast-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
}

.hourly-grid {
    margin-top: 14px;
}

.warnings-grid {
    margin-top: 14px;
}

.panel {
    padding: 18px;
}

.section-title-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-shell .panel h3,
.dashboard-shell .panel .section-title-icon {
    color: #12385d;
}

.realtime-panel {
    position: relative;
    overflow: visible;
}

.state-popup-anchor {
    position: relative;
    display: inline-block;
    margin: 0 0 12px;
}

.state-popup-chip {
    border: 1px solid #b7cbe1;
    border-radius: 999px;
    background: linear-gradient(135deg, #f7fbff, #e6f0fb);
    color: #1d4467;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 11px;
    cursor: pointer;
}

.state-popup-chip:hover,
.state-popup-chip:focus-visible {
    outline: none;
    border-color: #8cb2d6;
    box-shadow: 0 0 0 2px rgba(19, 90, 148, 0.14);
}

.state-leaflet-popup {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    width: min(360px, 86vw);
    z-index: 18;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.state-popup-anchor:hover .state-leaflet-popup,
.state-popup-anchor:focus-within .state-leaflet-popup {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.state-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(8, 26, 44, 0.28);
    border: 1px solid #b9cde2;
    background: #ffffff;
    overflow: hidden;
}

.state-leaflet-popup .leaflet-popup-content {
    margin: 0;
    width: auto;
}

.pir-panel-box {
    background: #f4f4f4;
}

.pir-panel-head {
    background: #3a3a3a;
    color: #fff;
    text-align: center;
    padding: 6px 8px;
    display: grid;
    gap: 2px;
}

.pir-panel-head strong {
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
}

.pir-panel-head span {
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
}

.pir-panel-graphic {
    padding: 8px;
    background: #efefef;
}

.pir-panel-graphic img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 136px;
    object-fit: contain;
}

.pir-panel-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 12px;
}

.pir-panel-table th,
.pir-panel-table td {
    border-top: 1px solid #d6dce5;
    padding: 4px 6px;
}

.pir-panel-table thead th {
    background: #f0f7ff;
    color: #0e2f4e;
    text-align: center;
    font-weight: 800;
    border-top: 1px solid #8cb5db;
    border-bottom: 1px solid #8cb5db;
}

.pir-panel-table thead th:first-child {
    text-align: left;
}

.pir-panel-table tbody td:first-child {
    color: #122538;
    font-weight: 400;
    width: 56%;
}

.pir-panel-table tbody td:nth-child(2),
.pir-panel-table tbody td:nth-child(3) {
    text-align: center;
    font-weight: 700;
    color: #0f2f4d;
}

.pir-panel-table tbody tr:first-child td:nth-child(2) {
    background: #0d8ed8;
    color: #fff;
}

.pir-panel-table tbody tr:first-child td:nth-child(3) {
    background: #f0a100;
    color: #fff;
}

.pir-panel-table td[colspan="2"] {
    text-align: center;
    font-weight: 700;
}

.pir-panel-footnote {
    margin: 0;
    padding: 7px 8px;
    background: #f6f9fc;
    color: #44607f;
    font-size: 11px;
    border-top: 1px solid #d6dce5;
    text-align: center;
}

.pir-panel-source {
    margin: 0;
    padding: 6px 8px;
    background: #eef4fb;
    color: #2c5aa0;
    font-size: 10px;
    border-top: 1px solid #d6dce5;
    text-align: center;
}

.pir-panel-source a {
    color: #2c5aa0;
    text-decoration: none;
    font-weight: 500;
}

.pir-panel-source a:hover {
    text-decoration: underline;
}


.state-leaflet-popup .leaflet-popup-tip-container {
    width: 30px;
    height: 15px;
    margin-left: 16px;
}

.state-leaflet-popup .leaflet-popup-tip {
    width: 14px;
    height: 14px;
    margin: -7px auto 0;
    border: 1px solid #b9cde2;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    background: #ffffff;
}

.status-risk-highlight {
    margin: 0 0 14px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #bcd0e5;
    background: linear-gradient(140deg, #f4f9ff, #ebf3fc);
}

.status-risk-highlight p {
    margin: 0 0 8px;
    color: #476482;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.status-risk-highlight h4 {
    margin: 0;
}

.status-risk-highlight span {
    display: block;
    margin-top: 8px;
    color: #4c6582;
    font-size: 13px;
    font-weight: 700;
}

.status-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.status-quick-grid > div {
    border: 1px solid #c7d6e8;
    border-radius: 10px;
    background: #f3f8ff;
    padding: 8px;
    text-align: center;
}

.status-quick-grid span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5a7493;
}

.status-quick-grid strong {
    display: block;
    margin-top: 4px;
    color: #183149;
    font-size: 13px;
}

.status-live-list {
    margin: 0;
    padding: 0 0 0 18px;
    display: grid;
    gap: 5px;
    color: #2a425e;
    font-size: 13px;
}

.status-live-list strong {
    color: #15273a;
}

.risk-link {
    display: block;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin: 12px auto 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #f39a2d;
    background: linear-gradient(135deg, #ff8a00, #ffb347);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 38, 64, 0.12);
}

.risk-link:hover {
    background: linear-gradient(135deg, #ff9a1a, #ffc35c);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 38, 64, 0.15);
}

.inline-actions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.geo-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 14%, rgba(25, 115, 185, 0.16) 0%, rgba(25, 115, 185, 0) 38%),
        radial-gradient(circle at 12% 82%, rgba(255, 157, 43, 0.2) 0%, rgba(255, 157, 43, 0) 44%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border-color: #abc5e1;
}

.geo-panel h3 {
    margin: 0 0 10px;
    color: #12385d;
    font-size: 23px;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.geo-panel p {
    margin: 0;
    color: #2b4563;
    font-size: 15px;
}

.geo-panel p + p {
    margin-top: 12px;
}

.inline-actions a {
    text-decoration: none;
    color: #0d4f87;
    background: linear-gradient(180deg, #d3e1ef, #c4d4e5);
    border-radius: 6px;
    border: 1px solid #9eb7d2;
    padding: 12px 12px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 3px 10px rgba(13, 44, 74, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.inline-actions a:hover,
.inline-actions a:focus-visible {
    background: linear-gradient(180deg, #deebf7, #d0e2f4);
    border-color: #7ca5cf;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 8px 18px rgba(12, 55, 98, 0.14);
    outline: none;
}


.forecast-highlight {
    margin: 0 0 6px;
    font-size: 17px;
}

.tomorrow-risk-panel {
    position: relative;
    overflow: visible;
    display: grid;
    gap: 8px;
    background:
        radial-gradient(circle at 88% 16%, rgba(255, 132, 0, 0.16) 0%, rgba(255, 132, 0, 0) 34%),
        radial-gradient(circle at 16% 90%, rgba(11, 79, 138, 0.12) 0%, rgba(11, 79, 138, 0) 40%),
        linear-gradient(180deg, #fbfdff 0%, #eef5fc 100%);
    border: 1px solid #b9cfe3;
    box-shadow: 0 12px 28px rgba(8, 24, 39, 0.1);
}

.tomorrow-risk-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: transparent;
}

.tomorrow-risk-panel h3 {
    margin: 0 0 12px;
    color: #12385d;
    font-size: 20px;
}

.tomorrow-risk-panel .forecast-highlight {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(11, 79, 138, 0.08);
    color: #1d4467;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tomorrow-risk-panel .risk-line {
    margin: 0;
}

.tomorrow-risk-panel .risk-pill {
    font-size: 20px;
    padding: 10px 14px;
    box-shadow: 0 8px 18px rgba(10, 31, 55, 0.12);
}

.tomorrow-risk-intro {
    margin: 0;
    color: #3d5876;
    font-size: 13px;
}

.tomorrow-risk-panel .muted {
    font-size: 13px;
    color: #49617d;
}

.risk-line {
    margin: 0 0 8px;
}

.muted {
    margin: 0;
    color: #4c6582;
    font-size: 14px;
}

.daily-list {
    display: grid;
    gap: 8px;
}

.daily-ipma-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
    padding-bottom: 0;
}

.daily-card {
    border-radius: 10px;
    border: 1px solid #c9d7ea;
    background: linear-gradient(180deg, #fbfdff, #f1f6fc);
    padding: 12px;
    min-height: 134px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.daily-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.daily-date {
    margin: 0;
    color: #1d3c5a;
    font-weight: 700;
    line-height: 1.15;
    font-size: 16px;
}

.daily-rain-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e4f1ff;
    border: 1px solid #bdd2ea;
    color: #0a4b84;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.daily-card.daily-rain-low {
    border-color: #c2d7ec;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 3px 10px rgba(19, 74, 122, 0.06);
}

.daily-card.daily-rain-moderate {
    border-color: #e6c88f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 3px 10px rgba(145, 95, 16, 0.08);
}

.daily-card.daily-rain-high {
    border-color: #dea0a0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 3px 10px rgba(132, 31, 31, 0.09);
}

.daily-rain-pill.daily-rain-low {
    background: #e4f1ff;
    border-color: #bdd2ea;
    color: #0a4b84;
}

.daily-rain-pill.daily-rain-moderate {
    background: #ffe5c0;
    border-color: #edbf7c;
    color: #8a4a00;
}

.daily-rain-pill.daily-rain-high {
    background: #ffdede;
    border-color: #e5a3a3;
    color: #912626;
}

.daily-condition {
    margin: 10px 0 12px;
    min-height: 38px;
    color: #24394f;
    font-size: 14px;
    line-height: 1.25;
}

.daily-temp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.daily-temp {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.daily-temp strong {
    font-size: 13px;
}

.daily-temp-min {
    background: #dcecfb;
    color: #0a4b84;
}

.daily-temp-max {
    background: #ffe1ba;
    color: #8a4300;
}

@media (max-width: 1080px) {
    .daily-ipma-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .daily-ipma-list {
        grid-template-columns: 1fr;
    }
}

.daily-list p {
    margin: 0;
}

.hourly-cards-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.hourly-cards {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(176px, 176px);
    gap: 10px;
    padding-bottom: 6px;
}

.hourly-card {
    background: #f2f7fd;
    border: 1px solid #c4d3e6;
    border-radius: 6px;
    overflow: hidden;
}

.hourly-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: linear-gradient(135deg, #0b4f8a, #1a76b6);
    color: #fff;
}

.hourly-hour {
    font-size: 14px;
    letter-spacing: 0.04em;
}

.hourly-risk {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
}

.hourly-weather-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1;
    cursor: help;
}

.hourly-weather-icon:hover::after,
.hourly-weather-icon:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(15, 29, 45, 0.95);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(8, 24, 39, 0.22);
    z-index: 5;
    pointer-events: none;
}

.hourly-weather-icon:hover::before,
.hourly-weather-icon:focus-visible::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 2px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15, 29, 45, 0.95);
    z-index: 5;
    pointer-events: none;
}

.warning-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.warning-item {
    border: 1px solid #c7d5e8;
    border-radius: 12px;
    padding: 12px;
    background: #f8fbff;
}

.warning-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.warning-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.warning-time {
    margin: 8px 0 0;
    color: #355270;
    font-size: 14px;
}

.local-level-normal {
    background: #e4f4e4;
    color: #1f6d1f;
}

.local-level-moderate {
    background: #ffe2b5;
    color: #8a4a00;
}

.local-level-high {
    background: #ffcf97;
    color: #8a3600;
}

.local-level-extreme {
    background: #ffd2d2;
    color: #8f1b1b;
}

.hourly-condition {
    margin: 8px 8px 6px;
    min-height: 34px;
    font-size: 13px;
    color: #223850;
}

.hourly-metrics {
    padding: 0 8px 8px;
}

.hourly-metrics p {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 4px 0;
    border-top: 1px dashed #c7d5e8;
    font-size: 12px;
}

.hourly-metrics p:first-child {
    border-top: 0;
}

.hourly-metrics span {
    color: #4a6582;
}

.hourly-metrics strong {
    color: #16283b;
}

.hourly-alert-strip {
    height: 8px;
    border-radius: 0 0 10px 10px;
}

.hourly-alert-strip.local-level-normal {
    background: #32c95b !important;
}

.hourly-alert-strip.local-level-moderate {
    background: #f1c40f !important;
}

.hourly-alert-strip.local-level-high {
    background: #e67e22 !important;
}

.hourly-alert-strip.local-level-extreme {
    background: #e74c3c !important;
}

.reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.5s ease forwards;
}

.reveal:nth-child(2) {
    animation-delay: 0.06s;
}

.reveal:nth-child(3) {
    animation-delay: 0.12s;
}

.reveal:nth-child(4) {
    animation-delay: 0.18s;
}

@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    body {
        padding-top: 0; /* Remove o espaço no topo */
    }

    .dashboard-shell {
        padding-top: 10px; /* Pequeno respiro para o conteúdo não colar ao header */
    }

    .site-header {
        position: relative; 
        margin-top: 0; /* Garante que o header cola ao topo do browser */
        border-radius: 0; /* Remove arredondamentos se existirem para preencher tudo */
    }

    .site-header-inner {
        flex-direction: column;
        align-items: center; /* Centrar no telemóvel para ficar mais arrumado */
        text-align: center;
        gap: 8px;
    }

    .site-header-logos {
        justify-content: center;
    }

    .site-header-logo {
        height: 50px; /* Reduzi o tamanho dos logos no telemóvel */
    }

    .site-header-brand {
        margin-left: 0;
        width: 100%;
    }

    .site-title {
        font-size: 1.2rem; /* Título mais pequeno para não ocupar tanto espaço */
    }

    .site-header-clock {
        align-self: center; /* Relógio centrado */
        margin: 5px 0;
    }

    .site-header-actions {
        width: 100%;
        justify-content: center;
    }

    .site-header-actions .header-btn {
        flex: 1;
        text-align: center;
        padding: 8px; /* Botão mais compacto */
    }

    .content-grid,
    .forecast-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pir-5days-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .pir-modal-content {
        margin: 10vh auto !important; /* Aumentado de 5vh para 10vh para garantir que não fica por baixo do header em mobile */
        padding: 15px !important;
        width: 95% !important;
    }

    .pir-legend {
        grid-template-columns: repeat(2, 1fr) !important; /* Volta a 2 colunas como na imagem */
        gap: 15px 10px !important;
        text-align: left !important;
    }

    .legend-item {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }

    .legend-item-status-wrap {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
}

@media (max-width: 580px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* Seleciona os contentores de valor dentro dos cards da estação */
.panel [id^="val-"] {
    display: inline-block;
    margin-right: 4px; /* Espaço entre o número e a unidade */
}

/* Garante que a unidade não quebre para a linha de baixo */
.panel .unit-label {
    display: inline-block;
    font-size: 0.9rem; /* Ajusta conforme o teu gosto */
    vertical-align: baseline;
}

.alert-banners-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 15px;
    margin-top: 15px;
    width: 100%;
}

.alert-banner-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 16px 12px; 
    border-radius: 14px;
    border: 1px solid var(--stroke);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 108px;
    transition: background-color 0.3s ease;
}

.alert-banner-card.no-icon {
    padding-left: 16px;
    padding-right: 16px;
    min-height: 75px;
}

.alert-banner-card.no-icon .alert-info {
    gap: 4px;
}

.alert-banner-card.no-icon .alert-label {
    font-size: 0.92rem;
    line-height: 1.1;
    white-space: normal;
}

.alert-banner-card.no-icon .alert-status {
    font-size: 0.85rem;
    margin-top: 2px;
}

#alert-criterios {
    background-color: #f3f4f6 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    gap: 12px;
}

#alert-criterios .alert-label,
#alert-criterios .alert-status {
    color: #0f172a !important;
}

#alert-criterios .alert-label {
    font-size: 0.78rem;
    line-height: 1.05;
    letter-spacing: 0.35px;
}

#alert-criterios .alert-status {
    font-size: 0.75rem;
    line-height: 1.1;
}

body.warning-day-tomorrow .alert-banner-card.today-only {
    display: none !important;
}

body.warning-day-today .alert-banner-card.today-only {
    display: flex !important;
}

/* Estilo para imagens e para o novo ícone SVG de inundação */
.alert-banner-card img, 
.alert-svg-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    margin-right: 15px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    color: #333; /* Cor do ícone quando está tudo OK */
}

/* ESTADOS DE CORES (Forçados) */
.alert-banner-card.alert-green  { background-color: #27ae60 !important; border-color: #27ae60 !important; }
.alert-banner-card.alert-yellow { background-color: #f3cf62 !important; border-color: #f3cf62 !important; }
.alert-banner-card.alert-orange { background-color: #e67e22 !important; border-color: #e67e22 !important; }
.alert-banner-card.alert-red    { background-color: #e74c3c !important; border-color: #e74c3c !important; }


/* Texto e ícones em preto para melhor leitura */
.alert-banner-card .alert-label,
.alert-banner-card .alert-status {
    color: #000000 !important;
}

.alert-banner-card img,
.alert-banner-card .alert-svg-icon {
    filter: brightness(0) saturate(100%) !important;
    opacity: 1 !important;
}

.public-alerts-banner {
    background: #b91c1c;
    color: #ffffff;
    border: 1px solid #7f1d1d;
    border-radius: 0 0 18px 18px;
    padding: 18px 20px;
    margin: 0;
    position: relative;
    top: auto;
    left: 0;
    z-index: 5;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 100%;
    transform: none;
}

.public-alerts-banner .public-alerts-banner-icon {
    background: #ffffff;
    color: #b91c1c;
}

.public-alerts-banner-button {
    background: #ffffff;
    color: #b91c1c;
    border: 1px solid #ffffff;
}

.public-alerts-banner-button:hover {
    background: rgba(255,255,255,0.9);
}

.public-alerts-banner-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.public-alerts-banner-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: #fff6f6;
    color: #b91c1c;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.public-alerts-banner-button {
    margin-left: auto;
    background: #b91c1c;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease;
}

.public-alerts-banner-button:hover {
    background: #991b1b;
}

.public-alerts-banner-close {
    margin-left: 12px;
    background: transparent;
    border: none;
    color: #7f1d1d;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.public-alerts-banner-close:hover {
    background: rgba(255,255,255,0.18);
    color: #661111;
}

@media (max-width: 900px) { 
    .alert-banners-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 8px;
    } 

    .alert-banner-card {
        padding: 10px 8px;
        min-height: 70px;
        border-radius: 10px;
    }

    .alert-banner-card img, 
    .alert-svg-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        margin-right: 8px;
    }

    .alert-label {
        font-size: 13px;
        line-height: 1.1;
    }

    .alert-status {
        font-size: 12px;
        line-height: 1.1;
    }
}

@media (max-width: 480px) {
    .alert-banners-grid {
        grid-template-columns: 1fr;
    }

    .alert-banner-card {
        padding: 12px;
    }
}

/* Modal PIR 5 Dias */
.pir-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.pir-modal-content {
    background: #ffffff !important;
    margin: 150px auto 50px auto; /* Aumentado de 120px para 150px para descer o quadro e não esconder atrás do header/tabs */
    padding: 30px;
    border-radius: 20px;
    width: 95%;
    max-width: 1600px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    color: #333 !important;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.pir-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 30px; 
}

.pir-modal-header h2 {
    margin: 0;
    color: #1a2a3a;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-pir-modal {
    color: #1a2a3a;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-pir-modal:hover {
    color: #e74c3c;
}

.pir-5days-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    align-items: stretch;
}

.pir-day-card {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.pir-day-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    border-color: #d1d8dd;
}

.pir-day-card h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
}

.pir-day-card .pir-gauge {
    width: 280px; /* Aumentado de 200px para 280px */
    max-width: 100%;
    height: auto;
    margin: 0 auto 15px auto;
    display: block;
}

.pir-day-card .risk-label {
    font-weight: 800;
    font-size: 1.4rem; /* Aumentado de 1.2rem */
    color: #1a2a3a;
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
}


.btn-pir-expand {
    background: #003366; /* Azul IPMA */
    color: white;
    border: none;
    padding: 8px 16px; /* Reduzido de 10px 24px */
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Reduzido de 10px */
    margin: 15px 0; /* Adicionada margem vertical para não colar em cima nem em baixo */
    transition: all 0.2s;
    font-size: 0.85rem; /* Reduzido de 0.95rem */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-pir-expand:hover {
    background: #004080;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-pir-expand i {
    font-size: 1.1rem;
}

/* Ajustes para ecrãs pequenos */
@media (max-width: 1100px) {
    .pir-5days-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pir-legend {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px 40px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    font-size: 0.95rem;
    color: #1a2a3a;
    font-weight: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    width: auto;
    height: auto;
}

/* Responsive hardening: keeps the current desktop look and adapts edge sizes. */
img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.panel,
.stat-card,
.geo-card,
.info-card,
.daily-card,
.hourly-card,
.alert-banner-card {
    min-width: 0;
}

.dashboard-shell,
.site-header-inner,
.tabs-list,
.panel,
.geo-card,
.alert-info,
.modal-content,
.pir-modal-content {
    min-width: 0;
}

.pir-panel-table {
    width: 100%;
}

.pir-panel-actions .btn-pir-expand,
.btn-pir-expand,
.btn-uv-expand,
.header-btn,
.public-alerts-banner-button {
    max-width: 100%;
}

@media (orientation: portrait) and (min-width: 700px) and (min-height: 1000px) {
    body {
        padding-top: 0;
    }

    .site-header {
        position: relative;
    }

    .dashboard-tabs {
        position: relative;
        top: auto;
    }

    .dashboard-shell {
        width: min(980px, calc(100% - 48px));
        padding-top: 24px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .alert-banners-grid,
    .info-grid,
    .daily-ipma-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 901px) and (max-width: 1300px) and (max-height: 850px) {
    body {
        padding-top: var(--dashboard-chrome-height, 122px);
    }

    .site-header-inner {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .site-header-logo {
        height: 58px;
    }

    .site-kicker {
        font-size: 10px;
    }

    .site-title {
        font-size: 24px;
        line-height: 1.05;
    }

    .site-subtitle {
        font-size: 12px;
    }

    .header-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .site-header-clock {
        padding: 7px 10px;
        font-size: 14px;
        min-width: 84px;
    }

    .dashboard-tabs {
        top: var(--site-header-height, 82px);
    }

    .tab-item {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .dashboard-shell {
        padding-top: 36px;
    }
}

@media (max-width: 900px) {
    .dashboard-tabs {
        position: relative;
        top: auto;
    }

    .dashboard-shell {
        width: 100%;
        padding: 12px;
    }

    .panel {
        padding: 14px;
        border-radius: 12px;
    }

    .panel,
    .geo-card,
    .info-card,
    .modal-body,
    .pir-panel-table,
    .public-alerts-details-panel {
        overflow-wrap: anywhere;
    }

    .site-header-inner {
        padding: 12px 14px;
    }

    .site-header-actions {
        margin-left: 0;
    }

    .geo-panel h3,
    .tomorrow-risk-panel h3 {
        font-size: 19px;
    }

    .geo-parametros-cards {
        gap: 12px;
    }

    .geo-card {
        border-radius: 14px;
        min-height: 118px;
        padding: 12px;
    }

    .geo-card-value-wrap {
        font-size: 2rem;
    }

    .pir-panel-actions {
        flex-wrap: wrap !important;
    }

    .pir-panel-actions .btn-pir-expand,
    .btn-pir-expand {
        white-space: normal !important;
        text-align: center;
    }

    .public-alerts-banner {
        border-radius: 0;
        padding: 14px;
    }

    .public-alerts-banner-inner {
        align-items: flex-start;
        gap: 12px;
    }

    .public-alerts-banner-button {
        margin-left: 0;
    }

    .modal-content,
    .pir-modal-content {
        width: min(96vw, 900px) !important;
        max-height: 92vh;
        border-radius: 16px;
        overflow-y: auto;
    }

    .modal-content h2 {
        padding: 18px 46px 18px 20px;
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 20px;
        max-height: 72vh;
    }

    .pir-panel-graphic img {
        max-height: 230px;
        object-fit: contain;
    }
}

@media (max-width: 700px) {
    .site-header-logos {
        flex-wrap: wrap;
        gap: 10px;
    }

    .site-header-logo {
        height: 44px;
    }

    .site-title {
        font-size: 1.08rem;
    }

    .site-subtitle {
        font-size: 12px;
    }

    .site-header-actions {
        flex-direction: column;
        gap: 8px;
    }

    .site-header-actions .header-btn {
        width: 100%;
    }

    .dashboard-tabs {
        overflow-x: auto;
    }

    .tabs-list {
        width: max-content;
        min-width: 100%;
    }

    .tab-item {
        flex: 0 0 auto;
    }

    .content-grid,
    .forecast-grid,
    .daily-ipma-list,
    .public-alerts-modal-grid,
    .uv-modal-grid {
        grid-template-columns: 1fr !important;
    }

    .geo-parametros-cards {
        grid-template-columns: 1fr;
    }

    .alert-banners-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .alert-banner-card {
        min-height: 72px;
    }

    .warning-day-selector {
        width: 100%;
    }

    .warning-day-selector .day-btn {
        flex: 1 1 0;
    }

    .iqa-chip {
        max-width: 100%;
    }

    .hourly-cards {
        grid-auto-columns: minmax(158px, 74vw);
    }

    #occurrences-panel > div:first-child,
    #occurrences-panel > div:last-child,
    #occurrences-panel > div:nth-last-child(2) {
        align-items: flex-start !important;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .dashboard-shell {
        padding: 10px;
    }

    .panel {
        padding: 12px;
    }

    .stats-grid,
    .alert-banners-grid,
    .info-grid,
    .pir-legend {
        grid-template-columns: 1fr !important;
    }

    .geo-card-title {
        font-size: 1rem;
    }

    .geo-card-value-wrap {
        font-size: 1.75rem;
        flex-wrap: wrap;
    }

    #card-precip .geo-card-value-wrap {
        min-height: 0;
    }

    #precip-subtitle,
    #precip-badge {
        white-space: normal;
    }

    .alert-banner-card {
        padding: 10px;
    }

    .alert-banner-card img,
    .alert-svg-icon {
        margin-right: 0;
    }

    #alert-criterios .alert-label {
        font-size: 0.74rem;
    }

    .public-alerts-banner-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px;
        font-size: 1.2rem;
    }

    .public-alerts-banner-button {
        width: 100%;
    }

    .modal-content,
    .pir-modal-content {
        width: 96vw !important;
        border-radius: 12px;
    }

    .modal-body {
        padding: 16px;
    }

    .pir-modal-header {
        gap: 10px;
    }

    .pir-modal-header h2 {
        font-size: 1.1rem;
        line-height: 1.2;
    }
}

@media (max-width: 380px) {
    .site-header-logo {
        height: 38px;
    }

    .site-title {
        font-size: 1rem;
    }

    .tab-item {
        padding: 10px 12px;
    }

    .tab-item a {
        font-size: 0.82rem;
    }

    .hourly-cards {
        grid-auto-columns: minmax(148px, 82vw);
    }
}

.legend-icon-box.legend-status-green,
.legend-icon-box.legend-status-red,
.legend-icon-box.legend-status-gray {
    border: none;
}

.legend-icon-box img {
    filter: none !important;
    width: auto;
    height: auto;
}

.legend-icon-box i {
    color: #1f2937;
}

