/* =========================================================
   1) LAYOUT GENERALE
   ========================================================= */

.screener-main-container {
    --screener-col-height: 858px;
    display: grid;
    grid-template-columns: 240px 1fr 460px;
    gap: 14px;
    padding: 1px;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
    align-items: start;
}

/* I tre contenitori principali terminano tutti alla stessa altezza, con
   scroll interno nelle rispettive aree se il contenuto è più lungo. */
.screener-left-panel,
.screener-content-area,
.screener-details-container {
    height: var(--screener-col-height);
}

.screener-left-panel,
.screener-details-container,
.screener-summary-container,
.screener-table-container {
    box-sizing: border-box;
    min-width: 0;
}

.screener-content-area {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
    min-width: 0;
}


/* =========================================================
   2) CARD E BOX
   ========================================================= */

.screener-panel-box,
.screener-card {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.screener-left-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

/* La seconda box ("Componi la tua Formula") riempie lo spazio verticale
   rimanente nel pannello sinistro, con scroll interno sulle metriche. */
.screener-left-panel > .screener-panel-box:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}


/* =========================================================
   3) TITOLI SEZIONE
   ========================================================= */

.screener-section-title {
    display: block;
    width: 100%;
    margin: 0 0 7px 0;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    border-radius: 8px;
    box-sizing: border-box;
    position: relative;
}

.screener-title-info-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.15s;
}
.screener-title-info-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}

.screener-subsection-title {
    margin: 5px 0 3px 0;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 700;
    color: #0f5c4d;
    text-transform: uppercase;
    letter-spacing: 0.015em;
    text-align: center;
}

.vish-title     { background: #0f5c4d; }
.compose-title  { background: #5a2d82; }
.formula-header-title { background: #355f52; }


/* =========================================================
   4) PULSANTI FORMULE VISH
   ========================================================= */

.screener-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.screener-btn {
    width: 100%;
    min-height: 20px;
    padding: 3px 8px;
    border: 1px solid #0f5c4d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 9px;
    line-height: 1.00;
    font-weight: 600;
    background: #0f5c4d;
    color: #ffffff;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.screener-btn:hover,
.screener-btn.active {
    background: #5a2d82;
    border-color: #5a2d82;
    color: #ffffff;
}


/* =========================================================
   5) AREA METRICHE E BOTTONI
   ========================================================= */

.metric-category {
    margin-bottom: 4px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

.metric-btn {
    width: 100%;
    min-height: 19px;
    padding: 2px 6px;
    border: 1px solid #cfd8d5;
    background: #f7fbfa;
    color: #0f5c4d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.metric-btn:hover,
.metric-btn.active {
    background: #5a2d82;
    border-color: #5a2d82;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(90, 45, 130, 0.25);
}

.metric-btn:disabled {
    cursor: not-allowed;
    background: #f1f3f5;
    border-color: #e1e5e8;
    color: #a3acb3;
    opacity: 0.85;
}
.metric-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #f1f3f5;
    border-color: #e1e5e8;
    color: #a3acb3;
}

.metrics-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.metrics-scroll-area::-webkit-scrollbar { width: 6px; }
.metrics-scroll-area::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    border-radius: 10px;
}


/* =========================================================
   6) AREA CENTRALE E TABELLA
   ========================================================= */

.screener-table-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.screener-table-wrapper {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
}

/* ── Contenitore del banner Premium: centrato sopra le righe fantasma,
   senza scurire/coprire la tabella sottostante (le righe skeleton restano
   visibili normalmente, sfocate/grigie di per sé). ────────────────────── */
.screener-table-overlay {
    position: absolute;
    inset: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
    z-index: 5;
}
.screener-table-overlay .screener-paywall-box {
    pointer-events: auto;
}
.screener-table-overlay.hidden {
    display: none;
}

/* ── Righe fantasma (skeleton loader) per simulare una classifica piena ──── */
.screener-skeleton-row td {
    padding: 6px 8px;
}
.screener-skeleton-bar {
    display: inline-block;
    height: 10px;
    border-radius: 4px;
    width: 100%;
    background: linear-gradient(90deg, #e9e9f0 25%, #f4f4f9 37%, #e9e9f0 63%);
    background-size: 400% 100%;
    animation: screener-skeleton-shimmer 1.6s ease-in-out infinite;
}
@keyframes screener-skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.screener-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.screener-table th,
.screener-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    font-size: 12px;
    line-height: 1.1;
}

.screener-table th {
    background: #f8f8fb;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

.screener-table tbody tr:hover {
    background: #faf8fd;
    cursor: pointer;
}

.screener-table-wrapper::-webkit-scrollbar { width: 8px; height: 8px; }
.screener-table-wrapper::-webkit-scrollbar-thumb { background: #c8c8c8; border-radius: 10px; }
.screener-table-wrapper::-webkit-scrollbar-track { background: #f2f2f2; }

.table-placeholder {
    color: #999;
    text-align: center;
    padding: 20px !important;
    font-size: 12px;
}

.company-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.logo-cell { text-align: center; }

.go-to-study {
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    color: #6b3fa0;
    font-weight: bold;
    transition: transform 0.18s ease, color 0.18s ease;
}

.go-to-study:hover {
    transform: translateX(3px);
    color: #3f2a70;
}

.vish-score {
    font-weight: 700;
    color: #4b2e83;
}


/* =========================================================
   7) COLONNA DESTRA
   ========================================================= */

.screener-details-container {
    width: 460px;
    min-width: 460px;
    max-width: 460px;
    height: 858px;
    top: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    align-self: start;
}

.screener-details-container .screener-section-title {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
}

#screener-details-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px 16px 14px;
    font-size: 12px;
    line-height: 1.42;
    color: #444444;
    scrollbar-width: thin;
}

#screener-details-content::-webkit-scrollbar { width: 10px; }
#screener-details-content::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 10px; }
#screener-details-content::-webkit-scrollbar-thumb { background: #c7ccd4; border-radius: 10px; }
#screener-details-content::-webkit-scrollbar-thumb:hover { background: #aeb6c2; }

#screener-details-content p { margin: 0 0 7px 0; }
#screener-details-content a { word-break: break-word; }

/* La spiegazione introduttiva dello Screener non deve ripetere titolo e
   badge area: il titolo "Lo Screener VIsH" è già nella barra del pannello;
   il testo deve iniziare direttamente da "Da dove nasce". */
#screener-details-content .spieg-header {
    display: none;
}

.details-empty-state {
    padding: 20px 12px;
    color: #888;
    font-size: 12px;
    text-align: center;
}

.analysis-loading-state,
.analysis-error-state {
    background: #ffffff;
    border: 1px solid #e7ebf0;
    border-radius: 8px;
    padding: 8px;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.3;
    color: #666;
}

.analysis-error-state { color: #b33a2b; }


/* =========================================================
   8) BARRA FORMULA
   ========================================================= */

.formula-summary-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    width: 100%;
}

.formula-summary-empty {
    font-size: 13px;
    color: #666666;
    text-align: center;
    width: 100%;
}

.formula-summary-custom-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.formula-summary-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 160px;
    height: 34px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #d9d9e2;
    background: #f8f8fb;
    box-sizing: border-box;
}

.formula-summary-slot.empty {
    justify-content: center;
    color: #8a8a8a;
}

.formula-summary-slot-text {
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 6px;
}

.formula-summary-slot-placeholder {
    font-size: 11px;
    font-weight: 600;
    color: #888888;
}

.formula-summary-remove-btn {
    border: none;
    background: transparent;
    color: #888888;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    flex: 0 0 auto;
}

.formula-summary-remove-btn:hover { color: #b42318; }

.formula-summary-run-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 5px 16px;
    border: 1px solid #5a2d82;
    border-radius: 8px;
    background: #5a2d82;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.formula-summary-run-btn:hover {
    background: #472268;
    border-color: #472268;
}

.formula-summary-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 5px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f5f5f5;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.formula-summary-clear-btn:hover {
    background: #ebebeb;
    color: #333;
}

.formula-summary-centered-name {
    width: 100%;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #0f5c4d;
    padding: 8px 0;
}

#screener-summary-content {
    font-size: 13px;
    line-height: 1.4;
    color: #444444;
}


/* =========================================================
   9) HEADER SOCIETÀ (colonna destra)
   ========================================================= */

.company-detail-header-v2 {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.company-detail-main { width: 100%; min-width: 0; }

.company-detail-name-row {
    text-align: center;
    margin-bottom: 6px;
}

.company-detail-company-name {
    font-size: 14px;
    line-height: 1.15;
}

.company-detail-symbol {
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    opacity: 0.8;
}

.company-detail-top-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 10px;
    align-items: start;
    margin-top: 8px;
}

.company-detail-left-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.company-detail-right-block {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.company-detail-logo-box {
    width: 72px;
    min-height: 72px;
    display: flex;
    align-items: flex-start;
}

.details-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.details-logo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: rgba(70,82,116,0.08);
    border: 1px dashed rgba(70,82,116,0.18);
}

.company-detail-info-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.company-detail-info-vertical p {
    margin: 0;
    line-height: 1.3;
    font-size: 11px;
    color: #2d3553;
    word-break: break-word;
}

.company-detail-website-line a {
    color: #3a4f92;
    text-decoration: none;
    word-break: break-all;
}

.company-detail-website-line a:hover { text-decoration: underline; }


/* =========================================================
   10) VIsH STAR
   ========================================================= */

.vish-star-card {
    width: 100%;
    max-width: 200px;
    background: #ffffff;
    border: 1px solid rgba(65,90,160,0.14);
    border-radius: 14px;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(18,28,45,0.05);
}

.vish-star-card-title {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #2f3f7a;
    margin-bottom: 2px;
}

.vish-star-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.vish-star-svg {
    width: 100%;
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.vish-star-grid {
    fill: none;
    stroke: rgba(67,91,147,0.18);
    stroke-width: 1;
}

.vish-star-grid.outer { stroke-width: 1.2; }

.vish-star-axis {
    stroke: rgba(67,91,147,0.12);
    stroke-width: 1;
}

.vish-star-shape {
    fill: rgba(72,126,84,0.22);
    stroke: rgba(72,126,84,0.9);
    stroke-width: 2;
}

.vish-star-center {
    fill: #ffffff;
    stroke: rgba(65,90,160,0.18);
    stroke-width: 1.2;
}

.vish-star-score-text {
    font-size: 17px;
    font-weight: 800;
    fill: #22325f;
}

.vish-star-score-subtext {
    font-size: 8px;
    font-weight: 600;
    fill: #6a7392;
}

.vish-star-label {
    font-size: 7.5px;
    font-weight: 600;
    fill: #465274;
}

.vish-star-qualitative-label {
    margin-top: 2px;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: #365a44;
}


/* =========================================================
   11) PULSANTE PROFILO
   ========================================================= */

.detail-profile-btn-row {
    margin: 8px 0 6px;
    text-align: center;
}

.profile-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border: 1px solid #0f5c4d;
    border-radius: 20px;
    background: #f2fbf8;
    color: #0f5c4d;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.profile-open-btn:hover {
    background: #0f5c4d;
    color: #fff;
}


/* =========================================================
   12) SEGNALI (3 colonne)
   ========================================================= */

.signals-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 6px 0 8px;
}

.signal-col {
    border-radius: 8px;
    padding: 6px 7px;
    font-size: 10px;
    line-height: 1.25;
}

.signal-col-warning  { background: #fff5f5; border: 1px solid #f5c5c5; }
.signal-col-positive { background: #f3fbf6; border: 1px solid #b5e0c5; }
.signal-col-study    { background: #fffbf0; border: 1px solid #f0dcaa; }

.signal-col-title {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.1;
}

.signal-list {
    margin: 0;
    padding-left: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.signal-list li { font-size: 9.5px; line-height: 1.2; }

.signal-empty {
    font-size: 9.5px;
    color: #999;
    font-style: italic;
}


/* =========================================================
   13) PULSANTI AREA + TABELLA RATIO
   ========================================================= */

.area-tabs-section {
    margin-top: 4px;
}

.area-tabs-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #355f52;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 5px;
}

.area-tabs-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}

.area-tab-btn {
    border: 1px solid #c8d5d0;
    background: #f3f8f6;
    color: #2d4a3e;
    border-radius: 6px;
    padding: 4px 2px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.18s ease;
}

.area-tab-btn:hover { background: #e4f0ea; }

.area-tab-btn.active {
    background: #355f4c;
    color: #ffffff;
    border-color: #355f4c;
}

/* Tabella ratio */

.area-ratios-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #d9ddd7;
}

.area-ratios-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: #fff;
}

.area-ratios-table th,
.area-ratios-table td {
    padding: 5px 7px;
    border-bottom: 1px solid #ecefe9;
    text-align: left;
    vertical-align: middle;
}

.area-ratios-table th {
    background: #f3f6f2;
    color: #34463b;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.area-ratios-table tr:last-child td { border-bottom: none; }

.ratio-label { color: #374151; font-size: 10.5px; text-align: left; }

.ratio-current { font-weight: 600; text-align: right; }

.ratio-avg,
.ratio-sector { color: #5a6472; font-size: 10.5px; text-align: right; }

.metric-better { color: #2e7d32; }
.metric-worse  { color: #c62828; }

/* Semaforo assoluto (soglie METRIC_THRESHOLDS) */
.metric-color-good    { color: #2d8a4e; font-weight: 600; }
.metric-color-bad     { color: #c0392b; font-weight: 600; }
.metric-color-neutral { color: inherit; font-weight: 600; }

/* Allineamento a destra celle numeriche tabella centrale */
.vish-score,
.metric-value-cell { text-align: right; }


/* =========================================================
   14) MODAL PROFILO
   ========================================================= */

.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.profile-modal-overlay.open { display: flex; }

.profile-modal-box {
    position: relative;
    width: min(680px, 92vw);
    max-height: 82vh;
    overflow-y: auto;
    background: #f9f7f3;
    border: 1px solid #d7d2c7;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.18);
    padding: 20px 22px;
    box-sizing: border-box;
}

.profile-modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #5d2d91;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.profile-modal-close-btn:hover { background: #3f1f6a; }

.profile-modal-header { margin-bottom: 12px; }

.profile-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    padding-right: 36px;
}

.profile-modal-text {
    font-size: 13px;
    line-height: 1.55;
    color: #374151;
    margin-bottom: 14px;
    min-height: 60px;
}

.profile-modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e0d8;
}

.profile-translate-btn {
    padding: 6px 14px;
    border: 1px solid #0f5c4d;
    border-radius: 20px;
    background: #f2fbf8;
    color: #0f5c4d;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}

.profile-translate-btn:hover {
    background: #0f5c4d;
    color: #fff;
}

.profile-modal-box::-webkit-scrollbar { width: 8px; }
.profile-modal-box::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 10px; }
.profile-modal-box::-webkit-scrollbar-thumb { background: #c7ccd4; border-radius: 10px; }


/* =========================================================
   15) RESPONSIVE
   ========================================================= */

@media (max-width: 1400px) {
    .screener-main-container {
        grid-template-columns: 225px 1fr 440px;
        gap: 12px;
        padding: 12px;
    }
    .screener-details-container {
        width: 440px;
        min-width: 440px;
        max-width: 440px;
    }
}

@media (max-width: 1200px) {
    .screener-main-container {
        grid-template-columns: 225px 1fr;
    }
    .screener-details-container {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 600px;
        position: relative;
        top: auto;
    }
    .signals-section {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .signals-section {
        grid-template-columns: 1fr;
    }
    .company-detail-top-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .screener-main-container {
        grid-template-columns: 1fr;
    }
    .screener-left-panel,
    .screener-content-area {
        height: auto;
    }
    .metrics-scroll-area {
        flex: none;
        max-height: none;
        overflow-y: visible;
    }
    .screener-details-container { height: 520px; }
}

/* ── Screener Paywall ───────────────────────────────────────── */
.screener-paywall-row td {
    padding: 0 !important;
    border: none !important;
}

.screener-paywall-container {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding-bottom: 24px;
}

.screener-preview-blurred {
    margin-bottom: -80px;
    pointer-events: none;
    user-select: none;
}

.screener-paywall-box {
    position: relative;
    z-index: 2;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px 40px;
    display: inline-block;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    margin-top: 16px;
    max-width: 420px;
    width: 90%;
}

.screener-paywall-box h3 {
    font-size: 16px;
    color: #2d3748;
    margin: 0 0 8px;
    font-weight: 600;
}

.screener-paywall-box p {
    font-size: 12px;
    color: #718096;
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

.screener-paywall-box .paywall-btn-primary {
    background: #4299e1; color: white;
    padding: 8px 18px; border-radius: 6px;
    font-size: 13px; font-weight: 600;
    text-decoration: none; display: inline-block;
}
.screener-paywall-box .paywall-btn-secondary {
    background: #f7fafc; color: #4a5568;
    padding: 8px 18px; border-radius: 6px;
    font-size: 13px; border: 1px solid #e2e8f0;
    text-decoration: none; display: inline-block;
}


/* =========================================================
   PANNELLO SPIEGAZIONE METRICA (colonna destra)
   ========================================================= */

.metric-explanation-panel {
    padding: 1.25rem 1.5rem 1.5rem;
    animation: fadeInPanel 0.2s ease;
}

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mep-header {
    margin-bottom: 1.1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #e8ecef;
}

.mep-category-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(90, 45, 130, 0.1);
    color: #5a2d82;
    margin-bottom: 0.4rem;
}

.mep-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.mep-section {
    margin-bottom: 0.95rem;
}

.mep-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8a9099;
    margin-bottom: 0.35rem;
}

.mep-section p {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #2d3748;
    margin: 0;
}

.mep-signals {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mep-signals li {
    font-size: 0.84rem;
    padding: 2px 0 2px 1.25rem;
    position: relative;
    line-height: 1.5;
    color: #2d3748;
}

.mep-positive li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #2d8a4e;
    font-weight: 700;
}

.mep-negative li::before {
    content: "⚠";
    position: absolute;
    left: 0;
    color: #c0392b;
    font-size: 0.75rem;
    top: 2px;
}

.mep-investor-view {
    background: rgba(90, 45, 130, 0.05);
    border-left: 3px solid #5a2d82;
    border-radius: 0 6px 6px 0;
    padding: 0.7rem 0.9rem;
}

.mep-investor-view .mep-section-label {
    color: #5a2d82;
}

.mep-placeholder {
    color: #9aa0a8;
    font-style: italic;
    font-size: 0.88rem;
    margin: 0.5rem 0 0;
}

/* Etichetta categoria metriche (nuova classe, stesso stile di screener-subsection-title) */
.metric-category-label {
    margin: 5px 0 3px 0;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 700;
    color: #0f5c4d;
    text-transform: uppercase;
    letter-spacing: 0.015em;
    text-align: center;
}

/* Griglia pulsanti metriche (alias di .metric-grid) */
.metric-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}
