/* ============================================================
   Financials — Current Snapshot
   Scoped desktop compactness + responsive mobile layout
   ============================================================ */

/* ---------- Desktop / general ---------- */

.fin-current-snapshot {
    box-sizing: border-box;
}

.fin-current-snapshot-grid {
    align-items: stretch;
}

/* Remove duplicated vertical bulk inside outer Current Snapshot */
.fin-current-snapshot .fin-current-fundamentals,
.fin-current-snapshot .fin-current-valuation {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 11px 12px !important;
    height: 100%;
    box-sizing: border-box;
}

/* Compact only the NEW metric cards */
.fin-current-snapshot .fin-current-metric,
.fin-current-snapshot .fin-valuation-metric {
    min-height: 66px !important;
    padding: 9px 10px !important;
    box-sizing: border-box;
}

/* Values */
.fin-current-snapshot .fin-current-metric > div:nth-child(2),
.fin-current-snapshot .fin-valuation-metric > div:nth-child(2) {
    font-size: 16px !important;
    line-height: 1.15 !important;
}

/* Slightly tighter grids */
.fin-current-fundamentals-grid,
.fin-current-valuation-grid {
    gap: 7px !important;
}


/* ============================================================
   Tablet
   ============================================================ */

@media (max-width: 1100px) {

    .fin-current-snapshot-grid {
        grid-template-columns: 1fr !important;
    }

    .fin-current-fundamentals-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .fin-current-valuation-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}


/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 700px) {

    .fin-current-snapshot {
        padding: 8px !important;
        margin-top: 8px !important;
        margin-bottom: 12px !important;
        border-radius: 14px !important;
    }

    /* Outer snapshot must stack */
    .fin-current-snapshot-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* Prevent all children from forcing horizontal overflow */
    .fin-current-snapshot,
    .fin-current-snapshot * {
        min-width: 0;
        box-sizing: border-box;
    }

    /* Fundamentals: 2 columns on phone */
    .fin-current-fundamentals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    /* Valuation: 2 columns on phone */
    .fin-current-valuation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .fin-current-snapshot .fin-current-fundamentals,
    .fin-current-snapshot .fin-current-valuation {
        padding: 9px !important;
        border-radius: 14px !important;
    }

    .fin-current-snapshot .fin-current-metric,
    .fin-current-snapshot .fin-valuation-metric {
        min-height: 72px !important;
        padding: 9px !important;
        border-radius: 11px !important;
        overflow: hidden;
    }

    /* Labels */
    .fin-current-snapshot .fin-current-metric > div:first-child,
    .fin-current-snapshot .fin-valuation-metric > div:first-child {
        font-size: 9px !important;
        line-height: 1.2 !important;
        overflow-wrap: anywhere;
    }

    /* Main metric values */
    .fin-current-snapshot .fin-current-metric > div:nth-child(2),
    .fin-current-snapshot .fin-valuation-metric > div:nth-child(2) {
        font-size: 17px !important;
        line-height: 1.12 !important;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    /* Hints */
    .fin-current-snapshot .fin-current-metric > div:nth-child(3),
    .fin-current-snapshot .fin-valuation-metric > div:nth-child(3) {
        font-size: 9px !important;
        line-height: 1.25 !important;
    }

    /* Panel headers: allow date / quality to wrap instead of crushing title */
    .fin-current-fundamentals > div:first-child,
    .fin-current-valuation > div:first-child {
        flex-wrap: wrap !important;
    }
}


/* Very narrow phones */
@media (max-width: 390px) {

    .fin-current-fundamentals-grid,
    .fin-current-valuation-grid {
        grid-template-columns: 1fr !important;
    }

    .fin-current-snapshot .fin-current-metric,
    .fin-current-snapshot .fin-valuation-metric {
        min-height: 62px !important;
    }
}
