/* =========================================================
   PriceToWorth Stock Screeners
   ========================================================= */
.stock-screeners-hero {
    direction: ltr;
    text-align: left;
    padding: 34px 0 24px;
    background: linear-gradient(135deg, #f4f8fc 0%, #ffffff 70%);
    border-bottom: 1px solid #e5edf5;
}
.stock-screeners-hero--compact { padding: 26px 0 20px; }
.stock-screeners-hero__eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #0d5f91;
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.stock-screeners-hero h1 { margin: 0 0 10px; color: #0d2f45; font-size: 2rem; font-weight: 850; }
.stock-screeners-hero p { max-width: 920px; margin: 0; color: #637386; line-height: 1.75; }
.stock-screeners-breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; color: #6c7b8d; font-size: .86rem; }
.stock-screeners-breadcrumb a { color: #0d5f91; font-weight: 800; text-decoration: none; }
.stock-screeners-grid-wrap { padding-top: 24px; padding-bottom: 36px; }
.stock-screeners-section-head { margin-bottom: 18px; }
.stock-screeners-section-head h2 { margin: 0 0 6px; color: #0d2f45; font-size: 1.4rem; font-weight: 850; }
.stock-screeners-section-head p { margin: 0; color: #68788b; }
.stock-screener-card, .home-stock-screener-card {
    height: 100%;
    border: 1px solid #e2e9f1;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(13, 47, 69, .06);
}
.stock-screener-card { padding: 20px; }
.stock-screener-card__top, .home-stock-screener-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stock-screener-card__label, .home-stock-screener-card__top span {
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf5fb;
    color: #49677f;
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.stock-screener-card__count, .home-stock-screener-card__top em { color: #52677c; font-size: .82rem; font-style: normal; font-weight: 800; }
.stock-screener-card h3, .home-stock-screener-card h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 850; }
.stock-screener-card h3 a, .home-stock-screener-card h3 a { color: #163a5a; text-decoration: none; }
.stock-screener-card p, .home-stock-screener-card p { margin: 0; color: #657486; line-height: 1.65; }
.stock-screener-card__badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.stock-screener-card__badges span { border: 1px solid #e3eaf2; border-radius: 999px; padding: 3px 8px; color: #435a70; background: #fbfcfe; font-size: .76rem; font-weight: 750; }
.stock-screener-card__cta { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; color: #0d5f91; font-size: .88rem; font-weight: 850; text-decoration: none; }
.stock-screener-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; padding-top: 24px; padding-bottom: 36px; }
.stock-screener-sidebar__box { border: 1px solid #e1e8f0; border-radius: 16px; padding: 16px; background: #fff; box-shadow: 0 8px 24px rgba(13,47,69,.05); position: sticky; top: 18px; }
.stock-screener-sidebar__box h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 850; color: #0d2f45; }
.stock-screener-links { display: grid; gap: 7px; }
.stock-screener-links a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; border: 1px solid #e5ebf2; border-radius: 10px; padding: 8px 10px; color: #263d52; background: #fbfcfe; text-decoration: none; font-size: .84rem; font-weight: 800; }
.stock-screener-links a.is-active { border-color: #0d5f91; color: #fff; background: #0d5f91; }
.stock-screener-links em { font-style: normal; font-size: .75rem; opacity: .8; }
.stock-screener-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; gap: 10px; align-items: end; margin-bottom: 14px; border: 1px solid #e1e8f0; border-radius: 14px; padding: 14px; background: #fff; }
.stock-screener-filters label { display: block; margin-bottom: 5px; color: #52687e; font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.stock-screener-filters input, .stock-screener-filters select { width: 100%; min-height: 38px; border: 1px solid #dce5ee; border-radius: 9px; padding: 6px 9px; color: #24384c; background: #fff; }
.stock-screener-filters button, .stock-screener-filters__reset { min-height: 38px; border: 0; border-radius: 9px; padding: 8px 14px; font-weight: 850; text-decoration: none; }
.stock-screener-filters button { color: #fff; background: linear-gradient(135deg, #0d5f91, #163a5a); }
.stock-screener-filters__reset { display: inline-flex; align-items: center; color: #52687e; background: #edf3f8; }
.stock-screener-summary { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 12px; color: #617386; }
.stock-screener-summary strong { color: #0d2f45; font-size: 1.1rem; }
.stock-screener-table-wrap { overflow-x: auto; border: 1px solid #e2e9f1; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(13,47,69,.05); }
.stock-screener-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.stock-screener-table th { background: #f3f7fb; color: #345169; font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.stock-screener-table th, .stock-screener-table td { padding: 11px 12px; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: middle; }
.stock-screener-table tbody tr:hover { background: #fbfdff; }
.stock-screener-company a { color: #163a5a; font-weight: 850; text-decoration: none; }
.stock-screener-company small { display: block; margin-top: 3px; color: #6c7d8e; font-size: .78rem; }
.stock-screener-empty { text-align: center !important; color: #6b7c8e; padding: 28px !important; }
.stock-screener-mobile-list { display: none; }
.home-stock-screeners { direction: ltr; text-align: left; }
.home-stock-screeners__header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.home-stock-screeners__title { margin: 0 0 6px; color: #0d2f45; font-size: 1.5rem; font-weight: 850; }
.home-stock-screeners__intro { max-width: 760px; margin: 0; color: #667487; line-height: 1.65; }
.home-stock-screeners__all { color: #0d5f91; font-size: .88rem; font-weight: 850; text-decoration: none; white-space: nowrap; }
.home-stock-screener-card { padding: 18px; }
@media (max-width: 991.98px) {
    .stock-screener-layout { grid-template-columns: 1fr; }
    .stock-screener-sidebar__box { position: static; }
    .stock-screener-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-screener-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767.98px) {
    .stock-screeners-hero h1 { font-size: 1.45rem; }
    .stock-screeners-hero p { font-size: .92rem; }
    .stock-screener-links { grid-template-columns: 1fr; }
    .stock-screener-filters { grid-template-columns: 1fr; }
    .stock-screener-table-wrap { display: none; }
    .stock-screener-mobile-list { display: grid; gap: 12px; }
    .stock-screener-mobile-card { border: 1px solid #e2e9f1; border-radius: 14px; padding: 14px; background: #fff; box-shadow: 0 6px 18px rgba(13,47,69,.045); }
    .stock-screener-mobile-card h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 850; }
    .stock-screener-mobile-card h3 a { color: #163a5a; text-decoration: none; }
    .stock-screener-mobile-card p { margin: 0 0 12px; color: #6c7d8e; }
    .stock-screener-mobile-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0; }
    .stock-screener-mobile-card dt { color: #6c7d8e; font-size: .72rem; font-weight: 850; text-transform: uppercase; }
    .stock-screener-mobile-card dd { margin: 2px 0 0; color: #21364a; font-weight: 850; }
    .home-stock-screeners__header { display: block; }
    .home-stock-screeners__all { display: inline-flex; margin-top: 10px; }
}

/* =========================================================
   Screener readability enhancements: dropdown filters + value tones
   ========================================================= */
.stock-screener-filters select {
    cursor: pointer;
}

.stock-screener-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: #62758a;
    font-size: .78rem;
}

.screener-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    min-width: 54px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 850;
    line-height: 1.15;
    white-space: nowrap;
}

.screener-value--positive {
    color: #126437;
    background: #e8f7ef;
    border-color: #bde7cf;
}

.screener-value--negative {
    color: #a52121;
    background: #fdecec;
    border-color: #f3c1c1;
}

.screener-value--warning {
    color: #8a5200;
    background: #fff4df;
    border-color: #f4d49e;
}

.screener-value--neutral {
    color: #4f6071;
    background: #eef3f7;
    border-color: #dbe5ed;
}

.screener-value--info {
    color: #0d5f91;
    background: #eaf5fb;
    border-color: #c8e3f2;
}

.screener-value--muted {
    color: #778596;
    background: #f4f6f8;
    border-color: #e3e8ee;
}

.stock-screener-cell-note {
    display: block;
    margin-top: 4px;
    color: #68788a;
    font-size: .72rem;
    font-weight: 750;
}

.stock-screener-table td:nth-child(4),
.stock-screener-table td:nth-child(5),
.stock-screener-table td:nth-child(6),
.stock-screener-table td:nth-child(7),
.stock-screener-table td:nth-child(8),
.stock-screener-table td:nth-child(9) {
    white-space: nowrap;
}

.stock-screener-mobile-card .screener-value {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .stock-screener-legend {
        gap: 6px;
        font-size: .74rem;
    }

    .screener-value {
        min-height: 24px;
        padding: 4px 8px;
        font-size: .78rem;
    }
}

/* =========================================================
   Screener v3: professional financial color semantics + aligned metric cells
   ========================================================= */
.stock-screener-table td.stock-screener-metric-cell {
    vertical-align: top;
    padding-top: 14px;
}

.stock-screener-cell-stack {
    display: inline-grid;
    grid-template-rows: 26px auto;
    align-items: start;
    justify-items: start;
    gap: 4px;
    min-height: 44px;
}

.stock-screener-cell-stack > .screener-value {
    align-self: start;
}

.screener-value {
    min-height: 26px;
    line-height: 1.15;
    box-sizing: border-box;
}

.screener-value--strong-positive {
    color: #064e2e;
    background: #d8f3e4;
    border-color: #8bd3ab;
}

.screener-value--positive {
    color: #126437;
    background: #e8f7ef;
    border-color: #bde7cf;
}

.screener-value--negative {
    color: #a52121;
    background: #fdecec;
    border-color: #f3c1c1;
}

.screener-value--strong-negative {
    color: #7f1d1d;
    background: #fee2e2;
    border-color: #ef9a9a;
}

.screener-value--warning {
    color: #8a5200;
    background: #fff4df;
    border-color: #f4d49e;
}

.screener-value--strong-warning {
    color: #7c3f00;
    background: #ffedd5;
    border-color: #fdba74;
}

.screener-value--neutral {
    color: #4f6071;
    background: #eef3f7;
    border-color: #dbe5ed;
}

.screener-value--info {
    color: #0d5f91;
    background: #eaf5fb;
    border-color: #c8e3f2;
}

.screener-value--muted {
    color: #778596;
    background: #f4f6f8;
    border-color: #e3e8ee;
}

.stock-screener-cell-note {
    display: block;
    margin-top: 0;
    font-size: .72rem;
    font-weight: 850;
    line-height: 1.15;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.stock-screener-cell-note--strong-positive {
    color: #064e2e;
    text-decoration-color: #8bd3ab;
}

.stock-screener-cell-note--positive {
    color: #126437;
    text-decoration-color: #bde7cf;
}

.stock-screener-cell-note--negative {
    color: #a52121;
    text-decoration-color: #f3c1c1;
}

.stock-screener-cell-note--strong-negative {
    color: #7f1d1d;
    text-decoration-color: #ef9a9a;
}

.stock-screener-cell-note--warning,
.stock-screener-cell-note--strong-warning {
    color: #8a5200;
    text-decoration-color: #f4d49e;
}

.stock-screener-cell-note--neutral {
    color: #4f6071;
    text-decoration-color: #dbe5ed;
}

.stock-screener-cell-note--info {
    color: #0d5f91;
    text-decoration-color: #c8e3f2;
}

.stock-screener-cell-note--muted {
    color: #778596;
    text-decoration-color: #e3e8ee;
}

@media (max-width: 767.98px) {
    .stock-screener-cell-stack {
        grid-template-rows: 24px auto;
        min-height: 40px;
        gap: 3px;
    }

    .stock-screener-cell-note {
        font-size: .7rem;
    }
}

/* =========================================================
   Screener v4: table spacing, centered metric columns, and
   independent numeric-vs-label Fair Value coloring
   ========================================================= */
.stock-screener-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stock-screener-table {
    min-width: 1220px;
    table-layout: fixed;
}

.stock-screener-table th,
.stock-screener-table td {
    padding-left: 14px;
    padding-right: 14px;
}

.stock-screener-table th:first-child,
.stock-screener-table td:first-child {
    width: 270px;
    min-width: 270px;
    text-align: left;
}

.stock-screener-table th:nth-child(2),
.stock-screener-table td:nth-child(2) {
    width: 88px;
    min-width: 88px;
}

.stock-screener-table th:nth-child(3),
.stock-screener-table td:nth-child(3) {
    width: 96px;
    min-width: 96px;
}

.stock-screener-table th:nth-child(4),
.stock-screener-table td:nth-child(4) {
    width: 138px;
    min-width: 138px;
}

.stock-screener-table th:nth-child(5),
.stock-screener-table td:nth-child(5) {
    width: 160px;
    min-width: 160px;
}

.stock-screener-table th:nth-child(6),
.stock-screener-table td:nth-child(6) {
    width: 160px;
    min-width: 160px;
}

.stock-screener-table th:nth-child(7),
.stock-screener-table td:nth-child(7) {
    width: 90px;
    min-width: 90px;
}

.stock-screener-table th:nth-child(8),
.stock-screener-table td:nth-child(8) {
    width: 132px;
    min-width: 132px;
}

.stock-screener-table th:nth-child(9),
.stock-screener-table td:nth-child(9) {
    width: 126px;
    min-width: 126px;
}

.stock-screener-table th:not(:first-child),
.stock-screener-table td:not(:first-child) {
    text-align: center;
}

.stock-screener-table td.stock-screener-metric-cell {
    vertical-align: middle;
    padding-top: 13px;
    padding-bottom: 13px;
}

.stock-screener-metric-cell {
    overflow: visible;
}

.stock-screener-metric-cell .screener-value {
    max-width: 100%;
}

.stock-screener-cell-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    min-height: 44px;
    vertical-align: middle;
}

.stock-screener-cell-stack > .screener-value {
    align-self: center;
}

.screener-value {
    max-width: 100%;
    white-space: nowrap;
    text-align: center;
}

.stock-screener-cell-note {
    max-width: 100%;
    text-align: center;
    white-space: normal;
}

.stock-screener-mobile-card .stock-screener-cell-stack {
    align-items: flex-start;
    min-height: 0;
}

.stock-screener-mobile-card .stock-screener-cell-note {
    text-align: left;
}
