/* Layout Principal - Fundo Claro */
body.map-page { 
    margin: 0; 
    padding: 0; 
    overflow: hidden; 
    height: 100vh; 
    width: 100vw;
    background: #f4f7f6; 
}

.header {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999 !important; 
}

.map-app-wrapper {
    position: absolute;
    top: 70px; /* Altura do header */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Área que será printada para o PDF */
.map-main { 
    flex: 1; 
    position: relative; 
    height: 100%; 
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
}


/* Item da legenda esmaecido quando não houver alerta ativo para ele */
/* Efeito de transição e opacidade na legenda */
.l-item {
    transition: opacity 0.3s ease-in-out;
}

.l-item.legend-faded {
    opacity: 0.20; /* Fica bem discreto em segundo plano */
}



/* -------------------------------------
   BARRA SUPERIOR (TOP BAR)
-------------------------------------- */
.map-top-bar {
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 2px solid #1e293b;
    z-index: 1000;
}

.map-info-title {
    display: flex;
    flex-direction: column;
}

.produto-nome {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.z-time {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #ff0000;
    letter-spacing: 0.5px;
}

.btn-export {
    background: #003366;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
}
.btn-export:hover { background: #004587; }

/* -------------------------------------
   ÁREA DO MAPA
-------------------------------------- */
#mapa-previsao { 
    flex: 1; 
    width: 100%;
    min-height: 400px;
    z-index: 1; 
    background-color: #e5e7eb; 
}

/* Loading */
.loading-alert {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(255,255,255,0.95);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #003366;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
}

/* -------------------------------------
   LEGENDA ESTILO PIVOTAL WEATHER
-------------------------------------- */
.pivotal-legend-container {
    background: #ffffff;
    z-index: 1000;
    position: relative;
    padding-bottom: 5px;
    font-family: 'Inter', sans-serif;
    border-top: 1px solid #94a3b8;
}

.pivotal-legend-title {
    text-align: right;
    padding: 3px 15px;
    font-size: 12px;
    font-weight: 800;
    color: #000;
    background: #f8fafc;
}

.pivotal-legend-grid {
    display: flex;
    width: 100%;
    border-top: 2px solid #000; /* Linha preta forte do topo da legenda */
}

.pivotal-col {
    flex: 1;
    border-right: 1px solid #cbd5e1;
}
.pivotal-col:last-child {
    border-right: none;
}

.col-header {
    background-color: #003366;
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    padding: 6px 0;
    text-transform: uppercase;
}

.col-items {
    padding: 8px 12px;
    background-color: #ffffff;
    height: 100%;
}

.l-item {
    display: flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 5px;
}

.l-item .box {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.3);
}

/* -------------------------------------
   STYLING DOS POPUPS (AO CLICAR NO MAPA)
-------------------------------------- */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
    padding: 0;
}
.leaflet-popup-content {
    margin: 12px;
    font-family: 'Inter', sans-serif;
}
.popup-title {
    font-weight: 800;
    font-size: 14px;
    color: #0f172a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
    margin-bottom: 8px;
}
.popup-alert-item {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.popup-color-box {
    width: 14px;
    height: 14px;
    border: 1px solid #000;
    margin-right: 8px;
    border-radius: 2px;
}
.popup-no-alert {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .pivotal-legend-grid { flex-wrap: wrap; }
    .pivotal-col { min-width: 50%; border-bottom: 1px solid #cbd5e1; }
    .map-top-bar { flex-direction: column; gap: 10px; align-items: flex-start;}
}


/* Layout Principal - Fundo Claro */
body.map-page { 
    margin: 0; padding: 0; 
    overflow: hidden; height: 100vh; width: 100vw;
    background: #f4f7f6; 
}

.header { position: fixed; top: 0; left: 0; width: 100%; z-index: 9999 !important; }

.map-app-wrapper {
    position: absolute; top: 70px; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
}

.map-main { 
    flex: 1; position: relative; height: 100%; width: 100%;
    display: flex; flex-direction: column; background: #fff;
}

.map-top-bar {
    background: #ffffff; display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; border-bottom: 2px solid #1e293b; z-index: 1000;
}

.map-info-title { display: flex; flex-direction: column; }
.produto-nome { font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 800; color: #0f172a; }
.z-time { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; color: #e11d48; }

.btn-export {
    background: #0f172a; color: #fff; border: none; padding: 8px 15px; border-radius: 6px;
    font-family: 'Inter', sans-serif; font-weight: 700; cursor: pointer; transition: 0.2s; font-size: 13px;
}
.btn-export:hover { background: #1e293b; }

#mapa-previsao { flex: 1; width: 100%; z-index: 1; background-color: #cbd5e1; }

.loading-alert {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999;
    background: rgba(15, 23, 42, 0.9); padding: 12px 25px; border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700; color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); border: 1px solid #334155;
}

/* LEGENDA MULTI-RISCO (COMPORTA O SCROLL) */
.pivotal-legend-container {
    background: #ffffff; z-index: 1000; position: relative;
    font-family: 'Inter', sans-serif; border-top: 1px solid #94a3b8;
    max-height: 220px; /* Limita altura para caber os 32 indices */
    display: flex; flex-direction: column;
}

.pivotal-legend-title {
    text-align: center; padding: 4px 15px; font-size: 11px; font-weight: 800;
    color: #475569; background: #f1f5f9; text-transform: uppercase; letter-spacing: 1px;
}

.pivotal-legend-grid {
    display: flex; width: 100%; flex: 1; overflow: hidden;
    border-top: 2px solid #0f172a; 
}

.pivotal-col { flex: 1; border-right: 1px solid #cbd5e1; display: flex; flex-direction: column; }
.pivotal-col:last-child { border-right: none; }

.col-header {
    background-color: #0f172a; color: #ffffff; text-align: center;
    font-weight: 700; font-size: 11px; padding: 6px 0; text-transform: uppercase;
}

/* Scroll interno para caber muitos itens */
.scrollable-leg {
    padding: 8px 10px; background-color: #ffffff;
    overflow-y: auto; flex: 1; scrollbar-width: thin;
}

.l-item {
    display: flex; align-items: center; font-size: 10px; font-weight: 700;
    color: #334155; margin-bottom: 5px;
}

.l-item .box {
    width: 12px; height: 12px; display: inline-block; margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.4); flex-shrink: 0;
}

/* POPUPS DO MAPA */
.leaflet-popup-content-wrapper { border-radius: 4px; padding: 0; }
.leaflet-popup-content { margin: 12px; font-family: 'Inter', sans-serif; }
.popup-title { font-weight: 800; font-size: 13px; color: #0f172a; border-bottom: 2px solid #e2e8f0; padding-bottom: 5px; margin-bottom: 8px; }
.popup-alert-item { font-size: 11px; font-weight: 700; color: #1e293b; display: flex; align-items: center; margin-bottom: 6px; }
.popup-color-box { width: 12px; height: 12px; border: 1px solid #000; margin-right: 6px; border-radius: 2px; }
.popup-no-alert { font-size: 11px; color: #64748b; font-weight: 600; }

@media (max-width: 768px) {
    .pivotal-legend-container { max-height: 40vh; }
    .pivotal-legend-grid { flex-wrap: wrap; overflow-y: auto; }
    .pivotal-col { min-width: 50%; border-bottom: 1px solid #cbd5e1; flex: none; }
    .scrollable-leg { overflow-y: visible; }
}


/* Layout Principal - Fundo Claro e Reset Total */
* { box-sizing: border-box; }
body.map-page { 
    margin: 0; padding: 0; overflow: hidden; 
    height: 100vh; width: 100vw; background: #f4f7f6; 
}

.header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 9999 !important; 
}

.map-app-wrapper {
    position: absolute; top: 70px; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
}

.map-main { 
    flex: 1; position: relative; height: 100%; width: 100%;
    display: flex; flex-direction: column; background: #fff;
}

/* BARRA SUPERIOR E LOGO */
.map-top-bar {
    background: #ffffff; display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; border-bottom: 2px solid #1e293b; z-index: 1000;
}

.map-top-left {
    display: flex; align-items: center; gap: 15px;
}

.gpem-logo {
    max-height: 38px; width: auto;
    border-right: 2px solid #e2e8f0; padding-right: 15px;
}

.map-info-title { display: flex; flex-direction: column; }

.produto-nome { font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 800; color: #0f172a; }

.z-time { 
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; 
    color: #e11d48; line-height: 1.2; margin-top: 3px;
}
.gerado-text { font-size: 10px; color: #64748b; font-weight: 600; display: block; margin-top: 2px; }

.btn-export {
    background: #0f172a; color: #fff; border: none; padding: 8px 15px; border-radius: 6px;
    font-family: 'Inter', sans-serif; font-weight: 700; cursor: pointer; transition: 0.2s; font-size: 13px;
}
.btn-export:hover { background: #1e293b; }

/* ÁREA DO MAPA E AVISOS */
#mapa-previsao { flex: 1; width: 100%; z-index: 1; background-color: #cbd5e1; }

.loading-alert {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999;
    background: rgba(15, 23, 42, 0.9); padding: 12px 25px; border-radius: 8px;
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700; color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); border: 1px solid #334155;
    text-align: center; width: 80%; max-width: 400px;
}

/* LEGENDA MULTI-RISCO */
.pivotal-legend-container {
    background: #ffffff; z-index: 1000; position: relative;
    font-family: 'Inter', sans-serif; border-top: 1px solid #94a3b8;
    max-height: 220px; display: flex; flex-direction: column;
}

.pivotal-legend-title {
    text-align: center; padding: 4px 15px; font-size: 11px; font-weight: 800;
    color: #475569; background: #f1f5f9; text-transform: uppercase; letter-spacing: 1px;
}

.pivotal-legend-grid {
    display: flex; width: 100%; flex: 1; overflow: hidden;
    border-top: 2px solid #0f172a; 
}

.pivotal-col { flex: 1; border-right: 1px solid #cbd5e1; display: flex; flex-direction: column; }
.pivotal-col:last-child { border-right: none; }

.col-header {
    background-color: #0f172a; color: #ffffff; text-align: center;
    font-weight: 700; font-size: 11px; padding: 6px 0; text-transform: uppercase;
}

.scrollable-leg {
    padding: 8px 10px; background-color: #ffffff;
    overflow-y: auto; flex: 1; scrollbar-width: thin;
}

.l-item {
    display: flex; align-items: center; font-size: 10px; font-weight: 700;
    color: #334155; margin-bottom: 5px;
}

.l-item .box {
    width: 12px; height: 12px; display: inline-block; margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.4); flex-shrink: 0;
}

/* POPUPS DO MAPA */
.leaflet-popup-content-wrapper { border-radius: 4px; padding: 0; }
.leaflet-popup-content { margin: 12px; font-family: 'Inter', sans-serif; }
.popup-title { font-weight: 800; font-size: 13px; color: #0f172a; border-bottom: 2px solid #e2e8f0; padding-bottom: 5px; margin-bottom: 8px; }
.popup-alert-item { font-size: 11px; font-weight: 700; color: #1e293b; display: flex; align-items: center; margin-bottom: 6px; }
.popup-color-box { width: 12px; height: 12px; border: 1px solid #000; margin-right: 6px; border-radius: 2px; }
.popup-no-alert { font-size: 11px; color: #64748b; font-weight: 600; }

/* ==============================================
   RESPONSIVIDADE E ADAPTAÇÃO PARA MOBILE
   ============================================== */
@media (max-width: 992px) {
    .pivotal-legend-container { max-height: 40vh; }
    .pivotal-legend-grid { flex-wrap: wrap; overflow-y: auto; }
    .pivotal-col { min-width: 50%; flex: auto; border-bottom: 1px solid #cbd5e1; }
    .pivotal-col:nth-child(even) { border-right: none; }
    .scrollable-leg { overflow-y: visible; }
}

@media (max-width: 600px) {
    .map-top-bar { 
        flex-direction: column; align-items: flex-start; 
        gap: 12px; padding: 12px 15px; 
    }
    .map-top-left { width: 100%; }
    .gpem-logo { max-height: 28px; padding-right: 10px; gap: 10px; }
    .produto-nome { font-size: 13px; }
    .z-time { font-size: 11px; }
    .gerado-text { font-size: 9px; }
    
    .btn-export { width: 100%; text-align: center; font-size: 14px; padding: 10px; }
    
    .pivotal-col { min-width: 100%; border-right: none !important; }
}


* { box-sizing: border-box; }
body.map-page { margin: 0; padding: 0; overflow: hidden; height: 100vh; width: 100vw; background: #f4f7f6; }

.header { position: fixed; top: 0; left: 0; width: 100%; z-index: 9999; }

.map-app-wrapper { position: absolute; top: 70px; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; }

.map-main { flex: 1; display: flex; flex-direction: column; background: #fff; position: relative; }

/* BARRA SUPERIOR */
.map-top-bar {
    background: #fff; display: flex; align-items: center; padding: 10px 20px;
    border-bottom: 2px solid #1e293b; z-index: 1000;
}

.map-top-left { display: flex; align-items: center; gap: 15px; }

.gpem-logo { max-height: 40px; width: auto; border-right: 2px solid #e2e8f0; padding-right: 15px; }

.produto-nome { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 800; color: #0f172a; display: block; }

.z-time { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; color: #e11d48; margin-top: 2px; display: block; }
.gerado-text { font-size: 10px; color: #64748b; font-weight: 600; }

/* MAPA */
#mapa-previsao { flex: 1; width: 100%; z-index: 1; }

.loading-alert {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%); z-index: 2000;
    background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 30px; font-size: 12px; font-weight: 700;
}

/* LEGENDA RESPONSIVA */
.pivotal-legend-container { border-top: 1px solid #cbd5e1; background: #fff; }
.pivotal-legend-title { text-align: center; font-size: 10px; font-weight: 800; padding: 5px; background: #f8fafc; color: #64748b; text-transform: uppercase; }
.pivotal-legend-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; border-top: 2px solid #0f172a; }

.pivotal-col { flex: 1; min-width: 180px; border-right: 1px solid #e2e8f0; }
.col-header { background: #0f172a; color: #fff; font-size: 10px; font-weight: 700; text-align: center; padding: 6px; }
.scrollable-leg { padding: 10px; max-height: 150px; overflow-y: auto; }
.l-item { display: flex; align-items: center; font-size: 10px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.l-item .box { width: 12px; height: 12px; margin-right: 8px; border: 1px solid rgba(0,0,0,0.2); }

/* MOBILE */
@media (max-width: 768px) {
    .pivotal-legend-grid { flex-wrap: wrap; height: 30vh; overflow-y: auto; }
    .pivotal-col { min-width: 50%; border-bottom: 1px solid #e2e8f0; }
    .gpem-logo { max-height: 30px; }
    .produto-nome { font-size: 13px; }
}



* { box-sizing: border-box; }
body.map-page { margin: 0; padding: 0; overflow: hidden; height: 100vh; width: 100vw; background: #f4f7f6; }

.header { position: fixed; top: 0; left: 0; width: 100%; z-index: 9999; }

/* AQUI FOI ALTERADO: top: 110px para empurrar tudo mais para baixo */
.map-app-wrapper { position: absolute; top: 110px; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; }

.map-main { flex: 1; display: flex; flex-direction: column; background: #fff; position: relative; }

/* BARRA SUPERIOR */
.map-top-bar {
    background: #fff; display: flex; align-items: center; padding: 10px 20px;
    border-bottom: 2px solid #1e293b; z-index: 1000;
}

.map-top-left { display: flex; align-items: center; gap: 15px; }

.gpem-logo { max-height: 40px; width: auto; border-right: 2px solid #e2e8f0; padding-right: 15px; }

.produto-nome { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 800; color: #0f172a; display: block; }

.z-time { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; color: #e11d48; margin-top: 2px; display: block; }
.gerado-text { font-size: 10px; color: #64748b; font-weight: 600; }

/* MAPA */
#mapa-previsao { flex: 1; width: 100%; z-index: 1; }

.loading-alert {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%); z-index: 2000;
    background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 30px; font-size: 12px; font-weight: 700;
}

/* LEGENDA RESPONSIVA */
.pivotal-legend-container { border-top: 1px solid #cbd5e1; background: #fff; }
.pivotal-legend-title { text-align: center; font-size: 10px; font-weight: 800; padding: 5px; background: #f8fafc; color: #64748b; text-transform: uppercase; }
.pivotal-legend-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; border-top: 2px solid #0f172a; }

.pivotal-col { flex: 1; min-width: 180px; border-right: 1px solid #e2e8f0; }
.col-header { background: #0f172a; color: #fff; font-size: 10px; font-weight: 700; text-align: center; padding: 6px; }
.scrollable-leg { padding: 10px; max-height: 150px; overflow-y: auto; }
.l-item { display: flex; align-items: center; font-size: 10px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.l-item .box { width: 12px; height: 12px; margin-right: 8px; border: 1px solid rgba(0,0,0,0.2); }

/* MOBILE */
@media (max-width: 768px) {
    .pivotal-legend-grid { flex-wrap: wrap; height: 30vh; overflow-y: auto; }
    .pivotal-col { min-width: 50%; border-bottom: 1px solid #e2e8f0; }
    .gpem-logo { max-height: 30px; }
    .produto-nome { font-size: 13px; }
}



* { box-sizing: border-box; }
body.map-page { margin: 0; padding: 0; overflow: hidden; height: 100vh; width: 100vw; background: #f4f7f6; }

.header { position: fixed; top: 0; left: 0; width: 100%; z-index: 9999; }

/* Mantido o Topo Mais Baixo Que Você Pediu */
.map-app-wrapper { position: absolute; top: 110px; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; }

.map-main { flex: 1; display: flex; flex-direction: column; background: #fff; position: relative; }

/* BARRA SUPERIOR */
.map-top-bar {
    background: #fff; display: flex; align-items: center; padding: 10px 20px;
    border-bottom: 2px solid #1e293b; z-index: 1000;
}

.map-top-left { display: flex; align-items: center; gap: 15px; }
.gpem-logo { max-height: 40px; width: auto; border-right: 2px solid #e2e8f0; padding-right: 15px; }
.produto-nome { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 800; color: #0f172a; display: block; }
.z-time { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; color: #e11d48; margin-top: 2px; display: block; }
.gerado-text { font-size: 10px; color: #64748b; font-weight: 600; }

/* MAPA */
#mapa-previsao { flex: 1; width: 100%; z-index: 1; }

.loading-alert {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%); z-index: 2000;
    background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 30px; font-size: 12px; font-weight: 700;
}

/* LEGENDA RESPONSIVA E ROLÁVEL NO CELULAR */
.pivotal-legend-container { 
    border-top: 1px solid #cbd5e1; 
    background: #fff; 
    display: flex; 
    flex-direction: column;
}
.pivotal-legend-title { 
    text-align: center; font-size: 10px; font-weight: 800; padding: 5px; 
    background: #f8fafc; color: #64748b; text-transform: uppercase; 
}
.pivotal-legend-grid { 
    display: flex; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    border-top: 2px solid #0f172a; 
}

.pivotal-col { flex: 1; min-width: 180px; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column;}
.col-header { background: #0f172a; color: #fff; font-size: 10px; font-weight: 700; text-align: center; padding: 6px; }
.scrollable-leg { padding: 10px; flex: 1;}
.l-item { display: flex; align-items: center; font-size: 10px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.l-item .box { width: 12px; height: 12px; margin-right: 8px; border: 1px solid rgba(0,0,0,0.2); flex-shrink: 0;}

/* POPUPS DO MAPA */
.leaflet-popup-content-wrapper { border-radius: 4px; padding: 0; }
.leaflet-popup-content { margin: 12px; font-family: 'Inter', sans-serif; }
.popup-title { font-weight: 800; font-size: 13px; color: #0f172a; border-bottom: 2px solid #e2e8f0; padding-bottom: 5px; margin-bottom: 8px; }
.popup-alert-item { font-size: 11px; font-weight: 700; color: #1e293b; display: flex; align-items: center; margin-bottom: 6px; }
.popup-color-box { width: 12px; height: 12px; border: 1px solid #000; margin-right: 6px; border-radius: 2px; }
.popup-no-alert { font-size: 11px; color: #64748b; font-weight: 600; }

/* MOBILE E TABLETS */
@media (max-width: 900px) {
    /* Essa é a mágica: Limitamos a altura e deixamos o usuário rolar com o dedo */
    .pivotal-legend-container {
        max-height: 45vh;
        overflow-y: auto;
    }
    .pivotal-legend-grid { 
        flex-wrap: wrap; 
        overflow-x: hidden;
    }
    .pivotal-col { 
        min-width: 50%; 
        border-bottom: 1px solid #e2e8f0; 
    }
    .gpem-logo { max-height: 30px; }
    .produto-nome { font-size: 13px; }
}

@media (max-width: 500px) {
    .pivotal-col { min-width: 100%; } /* Uma coluna embaixo da outra em celulares finos */
}