.v2-discovery-page {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 22px 30px 42px;
}

.v2-discovery-header,
.v2-discovery-results-head,
.v2-scanner-directory-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.v2-discovery-header {
    margin-bottom: 16px;
}

.v2-discovery-header h1,
.v2-discovery-results-head h2,
.v2-scanner-directory-head h2 {
    margin: 0;
    color: var(--v2-text-primary, #f4f7fb);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.v2-discovery-header h1 {
    font-size: 28px;
}

.v2-discovery-header p,
.v2-discovery-results-head p,
.v2-scanner-directory-head p {
    margin: 6px 0 0;
    color: var(--v2-text-secondary, #94a3b8);
    font-size: 13px;
}

.v2-discovery-meta {
    color: var(--v2-text-secondary, #94a3b8);
    font-size: 12px;
    white-space: nowrap;
}

.v2-discovery-categories {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.v2-discovery-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid #263245;
    border-radius: 5px;
    background: #111927;
    color: #a9b4c5;
    font: inherit;
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
    cursor: pointer;
}

.v2-discovery-category strong {
    color: #718096;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.v2-discovery-category:hover {
    border-color: #39475c;
    color: #e5eaf1;
}

.v2-discovery-category.is-active {
    border-color: #885cf6;
    background: rgba(136, 92, 246, 0.1);
    color: #efeaff;
}

.v2-discovery-category.is-active strong {
    color: #bfaaff;
}

.v2-discovery-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--v2-border);
    overflow-x: auto;
    background: #0d1521;
}

.v2-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 0 0 auto;
}

.v2-filter-group label {
    color: #627086;
    font-size: var(--v2-font-label);
    font-weight: 650;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.v2-filter-group select {
    height: 28px;
    min-width: 108px;
    padding: 0 27px 0 9px;
    border: 1px solid #273447;
    border-radius: 4px;
    background: var(--v2-bg-elevated);
    color: #aeb9c9;
    font: inherit;
    font-size: 10px;
    outline: none;
}

.v2-filter-group select:hover,
.v2-filter-group select:focus {
    border-color: #41516a;
}

.v2-filter-reset {
    height: 28px;
    padding: 0 9px;
    border: 1px solid #2a3749;
    border-radius: 4px;
    background: transparent;
    color: #8995a7;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.v2-filter-reset:hover:not(:disabled) {
    border-color: #4a5a72;
    color: #e1e6ed;
}

.v2-filter-reset:disabled {
    opacity: 0.35;
    cursor: default;
}

.v2-discovery-results,
.v2-scanner-directory {
    border: 1px solid #232e3e;
    border-radius: 7px;
    background: #0e1623;
}

.v2-discovery-results {
    overflow: hidden;
}

.v2-discovery-results-head {
    min-height: 72px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--v2-border);
}

.v2-discovery-results-head h2,
.v2-scanner-directory-head h2 {
    font-size: 16px;
}

.v2-discovery-result-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: #7f8b9d;
    font-size: 11px;
}

.v2-discovery-result-count strong {
    color: #dbe2ec;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.v2-discovery-loading,
.v2-discovery-empty {
    padding: 64px 20px;
    color: #7f8b9d;
    font-size: 13px;
    text-align: center;
}

.v2-discovery-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.v2-discovery-table {
    width: 100%;
    min-width: 990px;
    border-collapse: collapse;
    table-layout: fixed;
}

.v2-discovery-table th {
    height: 36px;
    padding: 0 11px;
    border-bottom: 1px solid var(--v2-border);
    color: #718096;
    font-size: var(--v2-font-label);
    font-weight: 650;
    letter-spacing: 0.055em;
    text-align: left;
    text-transform: uppercase;
}

.v2-discovery-table td {
    height: 49px;
    padding: 7px 11px;
    border-bottom: 1px solid var(--v2-border);
    color: #d7dee8;
    font-size: 12px;
    vertical-align: middle;
}

.v2-discovery-table tbody tr:last-child td {
    border-bottom: 0;
}

.v2-discovery-table tbody tr[data-stock-symbol] {
    cursor: pointer;
}

.v2-discovery-table tbody tr:hover td {
    background: var(--v2-bg-hover);
}

.v2-discovery-table tbody tr[data-stock-symbol]:hover .v2-discovery-symbol {
    color: #c4b5fd;
    text-decoration-color: currentColor;
}

.v2-discovery-table .v2-rank-col {
    width: 44px;
}

.v2-discovery-table .v2-number-col {
    text-align: right;
}

.v2-discovery-table th:nth-child(2) {
    width: 190px;
}

.v2-discovery-table th:nth-child(3) {
    width: 88px;
}

.v2-discovery-table th:nth-child(4) {
    width: 88px;
}

.v2-discovery-table th:nth-child(5) {
    width: 76px;
}

.v2-discovery-table th:nth-child(6) {
    width: 110px;
}

.v2-discovery-table th:nth-child(7) {
    width: 150px;
}

.v2-discovery-table th:nth-child(8) {
    width: 145px;
}

.v2-discovery-table th:nth-child(9) {
    width: 82px;
}

.v2-discovery-rank {
    color: #657186;
    font-variant-numeric: tabular-nums;
}

.v2-discovery-symbol {
    display: inline-block;
    color: #f5f7fb;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.015em;
    text-decoration: underline;
    text-decoration-color: rgba(245, 247, 251, 0.28);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition:
        color 120ms ease,
        text-decoration-color 120ms ease;
}

.v2-discovery-classification {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #718096;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-discovery-price,
.v2-discovery-score,
.v2-discovery-relvol,
.v2-discovery-marketcap {
    font-variant-numeric: tabular-nums;
}

.v2-discovery-change {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.v2-discovery-change.is-positive {
    color: #22c55e;
}

.v2-discovery-change.is-negative {
    color: #ef4444;
}

.v2-discovery-change.is-neutral {
    color: #7f8b9d;
}

.v2-setup-label,
.v2-state-label {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-setup-label {
    color: #c9b8ff;
}

.v2-state-label {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 0 7px;
    border: 1px solid var(--v2-border-strong);
    border-radius: 4px;
    background: var(--v2-bg-elevated);
    color: #a9b4c5;
    font-size: 10px;
}

.v2-discovery-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-height: 52px;
    padding: 8px 16px;
    border-top: 1px solid var(--v2-border);
}

.v2-discovery-pagination span {
    min-width: 84px;
    color: #7f8b9d;
    font-size: 11px;
    text-align: center;
}

.v2-page-button {
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid #2a3749;
    border-radius: 4px;
    background: #111927;
    color: #b2bccb;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.v2-page-button:hover:not(:disabled) {
    border-color: #45556d;
    color: #f0f3f8;
}

.v2-page-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.v2-scanner-directory {
    margin-top: 12px;
    padding: 14px;
}

.v2-scanner-directory-head {
    margin-bottom: 14px;
}

.v2-scanner-directory-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
}

.v2-scanner-card {
    min-height: 68px;
    padding: 10px 11px;
    border: 1px solid var(--v2-border);
    border-radius: 6px;
    background: var(--v2-bg-surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.v2-scanner-card:hover {
    border-color: #3d4c62;
    background: var(--v2-bg-hover);
}

.v2-scanner-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v2-scanner-card-top span {
    color: #e4e9f0;
    font-size: 11px;
    font-weight: 650;
}

.v2-scanner-card-top strong {
    color: #9d85ef;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.v2-scanner-card p {
    margin: 5px 0 0;
    color: #7f8b9d;
    font-size: var(--v2-font-label);
    line-height: 1.3;
}

.v2-discovery-mobile-list {
    display: none;
}

.v2-discovery-mobile-card {
    padding: 13px 14px;
    border-bottom: 1px solid var(--v2-border);
    cursor: pointer;
}

.v2-discovery-mobile-card:last-child {
    border-bottom: 0;
}

.v2-mobile-card-head,
.v2-mobile-card-price,
.v2-mobile-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v2-mobile-card-head {
    margin-bottom: 5px;
}

.v2-mobile-card-rank {
    color: #657186;
    font-size: 11px;
}

.v2-mobile-card-symbol {
    flex: 1;
    color: #f4f7fb;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(244, 247, 251, 0.28);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.v2-discovery-mobile-card:hover .v2-mobile-card-symbol {
    color: #c4b5fd;
    text-decoration-color: currentColor;
}

.v2-mobile-card-price {
    justify-content: flex-start;
    margin-top: 10px;
}

.v2-mobile-card-price strong {
    color: #dbe2ec;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.v2-mobile-card-meta {
    margin-top: 9px;
    color: #8591a3;
    font-size: 10px;
}

.v2-mobile-card-setup {
    margin-top: 10px;
    color: #b6a1ff;
    font-size: 11px;
}

.v2-discovery-evidence {
    color: #aeb8c6;
    font-size: 11px;
    line-height: 1.45;
}


/*
 * Momentum discovery uses the final column for explanatory evidence.
 * Keep this scoped to Momentum so other Discovery table layouts remain
 * unchanged.
 */
.v2-discovery-table.is-momentum th:nth-child(2) {
    width: 190px;
}

.v2-discovery-table.is-momentum th:nth-child(3) {
    width: 90px;
}

.v2-discovery-table.is-momentum th:nth-child(4) {
    width: 90px;
}

.v2-discovery-table.is-momentum th:nth-child(5) {
    width: 85px;
}

.v2-discovery-table.is-momentum th:nth-child(6) {
    width: 115px;
}

.v2-discovery-table.is-momentum th:nth-child(7) {
    width: 125px;
}

.v2-discovery-table.is-momentum th:nth-child(8) {
    width: auto;
}

.v2-discovery-table.is-momentum th,
.v2-discovery-table.is-momentum td {
    padding-left: 11px;
    padding-right: 11px;
}

.v2-mobile-momentum-evidence {
    display: block;
    margin-top: 4px;
    color: #aeb8c6;
    line-height: 1.45;
}

@media (max-width: 1050px) {
    .v2-discovery-page {
        padding: 24px 20px 40px;
    }

    .v2-scanner-directory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .v2-discovery-toolbar {
        margin: 0;
        padding: 9px 10px;
    }

    .v2-filter-group select {
        min-width: 105px;
    }

    .v2-discovery-page {
        padding: 18px 12px 32px;
    }

    .v2-discovery-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        margin-bottom: 16px;
    }

    .v2-discovery-header h1 {
        font-size: 22px;
    }

    .v2-discovery-categories {
        margin-right: -12px;
        padding-right: 12px;
    }

    .v2-discovery-results-head {
        align-items: center;
        min-height: 66px;
        padding: 13px 14px;
    }

    .v2-discovery-results-head p {
        display: none;
    }

    .v2-discovery-table-wrap {
        display: none !important;
    }

    .v2-discovery-mobile-list {
        display: block;
    }

    .v2-scanner-directory {
        padding: 13px;
    }

    .v2-scanner-directory-grid {
        grid-template-columns: 1fr;
    }

    .v2-scanner-card {
        min-height: 88px;
    }

    .v2-discovery-pagination {
        justify-content: space-between;
    }
}

/* Discovery watchlist action */
.v2-discovery-symbol-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.v2-watchlist-star {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6f7a8d;
    font: inherit;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition:
        color 120ms ease,
        opacity 120ms ease,
        transform 120ms ease;
}

.v2-watchlist-star:hover {
    color: #c4b5fd;
}

.v2-watchlist-star.is-active {
    color: #a78bfa;
}

.v2-watchlist-star:disabled {
    opacity: 0.45;
    cursor: default;
}

.v2-watchlist-star:not(:disabled):active {
    transform: scale(0.9);
}

.v2-mobile-card-head .v2-watchlist-star {
    width: 20px;
    height: 20px;
}

/* Discovery methodology — lightweight editorial context below live results */
.v2-discovery-methodology {
    margin: 28px 0;
    padding: 24px 0;
    border-top: 1px solid var(--v2-border, rgba(148, 163, 184, 0.18));
    border-bottom: 1px solid var(--v2-border, rgba(148, 163, 184, 0.18));
}

.v2-discovery-methodology-copy {
    max-width: 1120px;
}

.v2-discovery-methodology h2 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.3;
}

.v2-discovery-methodology h3 {
    margin: 20px 0 8px;
    font-size: 16px;
    line-height: 1.4;
}

.v2-discovery-methodology p {
    max-width: 1050px;
    margin: 0;
    line-height: 1.65;
    color: var(--v2-text-muted, #9fb0c7);
}

@media (max-width: 768px) {
    .v2-discovery-methodology {
        margin: 22px 0;
        padding: 20px 0;
    }

    .v2-discovery-methodology h2 {
        font-size: 19px;
    }

    .v2-discovery-methodology h3 {
        margin-top: 16px;
        font-size: 15px;
    }
}


/* ==========================================================
   Custom Screener
   ========================================================== */

.v2-discovery-category-separator {
    flex: 0 0 1px;
    width: 1px;
    min-height: 28px;
    margin: 4px 2px;
    background: #2a3548;
}

.v2-custom-screener-tab {
    border-color: #3a3156;
}

.v2-custom-screener {
    margin-top: 2px;
    margin-bottom: 22px;
}

.v2-custom-screener-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
}

.v2-custom-screener-head h2 {
    margin: 0;
    color: var(--v2-text-primary, #f4f7fb);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.v2-custom-screener-head p {
    margin: 6px 0 0;
    color: var(--v2-text-secondary, #94a3b8);
    font-size: 12px;
}

.v2-custom-screener-universe {
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: #8d99aa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.v2-custom-screener-universe strong {
    color: #d9d0ff;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.v2-custom-screener-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #253146;
    border-radius: 7px;
    background: #101824;
}

.v2-screener-filter-column {
    min-width: 0;
    padding: 17px 18px 18px;
}

.v2-screener-filter-column + .v2-screener-filter-column {
    border-left: 1px solid #253146;
}

.v2-screener-filter-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.v2-screener-filter-icon {
    display: inline-flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #6547ad;
    border-radius: 6px;
    background: rgba(136, 92, 246, 0.10);
    color: #c7b8ff;
    font-size: 11px;
    font-weight: 700;
}

.v2-screener-filter-heading h3 {
    margin: 0;
    color: #e9edf4;
    font-size: 13px;
    font-weight: 650;
}

.v2-screener-filter-heading p {
    margin: 3px 0 0;
    color: #778398;
    font-size: 10px;
}

.v2-screener-shell-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v2-screener-shell-fields span {
    display: flex;
    align-items: center;
    min-height: 35px;
    padding: 0 10px;
    border: 1px solid #263246;
    border-radius: 5px;
    background: #0c1420;
    color: #98a4b6;
    font-size: 11px;
}

.v2-custom-screener-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 56px;
    margin-top: 9px;
    padding: 9px 12px;
    border: 1px solid #253146;
    border-radius: 6px;
    background: #0f1723;
}

.v2-custom-screener-status > div:first-child {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #7f8b9e;
    font-size: 11px;
}

.v2-custom-screener-status strong {
    color: #c4cbd6;
    font-weight: 550;
}

.v2-custom-screener-actions {
    display: flex;
    gap: 7px;
}

.v2-screener-button {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 5px;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
}

.v2-screener-button.is-secondary {
    border: 1px solid #303d52;
    background: #111b29;
    color: #9aa6b8;
}

.v2-screener-button.is-primary {
    border: 1px solid #7652d8;
    background: #7652d8;
    color: #fff;
}

.v2-screener-button:disabled {
    opacity: 0.55;
    cursor: default;
}

.v2-custom-screener-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 210px;
    margin-top: 9px;
    border: 1px solid #253146;
    border-radius: 7px;
    background: #0d1520;
    text-align: center;
}

.v2-custom-screener-placeholder strong {
    color: #dbe2ec;
    font-size: 13px;
}

.v2-custom-screener-placeholder span {
    margin-top: 6px;
    color: #788599;
    font-size: 11px;
}

@media (max-width: 900px) {
    .v2-custom-screener-panel {
        grid-template-columns: 1fr;
    }

    .v2-screener-filter-column + .v2-screener-filter-column {
        border-top: 1px solid #253146;
        border-left: 0;
    }
}

@media (max-width: 700px) {
    .v2-discovery-category-separator {
        display: none;
    }

    .v2-custom-screener-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .v2-screener-shell-fields {
        grid-template-columns: 1fr 1fr;
    }

    .v2-custom-screener-status {
        align-items: stretch;
        flex-direction: column;
    }

    .v2-custom-screener-actions {
        width: 100%;
    }

    .v2-screener-button {
        flex: 1;
    }
}


/* Custom Screener Live Controls */

.v2-screener-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.v2-screener-control {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.v2-screener-control > span {
    color: #8d9aae;
    font-size: 10px;
    font-weight: 550;
}

.v2-screener-control select,
.v2-screener-control input {
    width: 100%;
    min-width: 0;
    height: 35px;
    box-sizing: border-box;
    border: 1px solid #29364a;
    border-radius: 5px;
    outline: none;
    background: #0c1420;
    color: #d8dee8;
    font: inherit;
    font-size: 11px;
}

.v2-screener-control select {
    padding: 0 8px;
}

.v2-screener-control input {
    padding: 0 9px;
}

.v2-screener-control select:focus,
.v2-screener-control input:focus {
    border-color: #6d50bd;
}

.v2-screener-number-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 5px;
}

.v2-screener-number-row:has(
    [data-range-max-for]:not([hidden])
) {
    grid-template-columns:
        70px minmax(0, 1fr) minmax(0, 1fr);
}

.v2-screener-more {
    align-self: flex-start;
    border: 0;
    padding: 3px 0;
    background: transparent;
    color: #9d84ed;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.v2-screener-more:hover {
    color: #c2b2f7;
}

.v2-screener-more-grid {
    display: contents;
}

.v2-screener-active-filters {
    display: flex !important;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px !important;
}

.v2-screener-active-label {
    margin-right: 3px;
    color: #7f8b9e;
    font-size: 10px;
}

.v2-screener-chip {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 8px;
    border: 1px solid #43366a;
    border-radius: 999px;
    background: rgba(117, 78, 211, 0.10);
    color: #c9bcf2;
    font-size: 10px;
    white-space: nowrap;
}

.v2-screener-results {
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid #253146;
    border-radius: 7px;
    background: #0d1520;
}

.v2-screener-result-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid #253146;
    padding: 0 12px;
}

.v2-screener-result-tabs button {
    min-height: 43px;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0 14px;
    background: transparent;
    color: #8794a7;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.v2-screener-result-tabs button:hover {
    color: #cbd3df;
}

.v2-screener-result-tabs button.is-active {
    border-bottom-color: #8a63e8;
    color: #d6c9ff;
}

.v2-screener-results-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 15px;
    border-bottom: 1px solid #202b3d;
}

.v2-screener-results-meta strong {
    color: #d7dde7;
    font-size: 11px;
    font-weight: 600;
}

.v2-screener-results-meta span {
    color: #778499;
    font-size: 10px;
}

.v2-screener-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.v2-screener-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    table-layout: auto;
}

.v2-screener-table th {
    height: 38px;
    border-bottom: 1px solid #253146;
    padding: 0 12px;
    color: #778499;
    font-size: 9px;
    font-weight: 650;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.v2-screener-table th:first-child,
.v2-screener-table th:nth-child(2) {
    text-align: left;
}

.v2-screener-table th.is-sortable {
    cursor: pointer;
}

.v2-screener-table th.is-sortable:hover {
    color: #c5b8ee;
}

.v2-screener-table td {
    height: 43px;
    border-bottom: 1px solid #192434;
    padding: 0 12px;
    color: #b6c0ce;
    font-size: 10.5px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.v2-screener-table td:first-child,
.v2-screener-table td:nth-child(2) {
    text-align: left;
}

.v2-screener-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.018);
}

.v2-screener-symbol {
    color: #d8d0ff;
    font-weight: 700;
    text-decoration: none;
}

.v2-screener-symbol:hover {
    color: #fff;
    text-decoration: underline;
}

.v2-screener-table .is-positive {
    color: #31c77a;
}

.v2-screener-table .is-negative {
    color: #ef5965;
}

.v2-screener-message {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #8995a7;
    font-size: 11px;
    text-align: center;
}

.v2-screener-message.is-error {
    color: #d78c94;
}

.v2-screener-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 52px;
    padding: 0 14px;
    border-top: 1px solid #253146;
}

.v2-screener-pagination span {
    color: #7d899b;
    font-size: 10px;
}

.v2-screener-pagination button {
    min-height: 31px;
    border: 1px solid #303d52;
    border-radius: 5px;
    padding: 0 11px;
    background: #111b29;
    color: #aab4c3;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.v2-screener-pagination button:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (max-width: 900px) {
    .v2-screener-controls {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .v2-screener-controls {
        grid-template-columns: 1fr;
    }

    .v2-screener-number-row {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .v2-screener-number-row:has(
        [data-range-max-for]:not([hidden])
    ) {
        grid-template-columns:
            64px minmax(0, 1fr) minmax(0, 1fr);
    }

    .v2-screener-results-meta {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
    }
}

/* ==========================================================
   Custom Screener message-state fix
   ========================================================== */

/* Explicitly honor the HTML hidden state.
   Some screener components define display:flex/grid themselves. */
#v2-custom-screener [hidden] {
    display: none !important;
}

/* Loading/error feedback should not reserve a large result area. */
.v2-screener-message {
    min-height: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #202b3d;
}

/* Error stays compact and readable. */
.v2-screener-message.is-error {
    min-height: 0;
    padding: 14px 16px;
}

/* When results exist, table follows metadata immediately. */
.v2-screener-table-wrap {
    margin: 0;
}

/* ==========================================================
   Guided Custom Screener
   ========================================================== */

.v2-screener-quick {
    margin-bottom: 10px;
    padding: 13px 14px;
    border: 1px solid #253146;
    border-radius: 7px;
    background: #0f1723;
}

.v2-screener-quick-copy {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.v2-screener-quick-copy strong {
    color: #e9edf4;
    font-size: 12px;
    font-weight: 650;
}

.v2-screener-quick-copy span {
    color: #7f8b9e;
    font-size: 10px;
}

.v2-screener-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.v2-screener-quick-actions button {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #2b374b;
    border-radius: 6px;
    background: #111b29;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 120ms ease,
        background 120ms ease,
        transform 120ms ease;
}

.v2-screener-quick-actions button:hover {
    border-color: #66519e;
    background: #151f30;
}

.v2-screener-quick-actions button.is-active {
    border-color: #7652d8;
    background: rgba(118, 82, 216, 0.13);
}

.v2-screener-quick-actions strong {
    display: block;
    margin-bottom: 3px;
    color: #e7eaf0;
    font-size: 11px;
    font-weight: 650;
}

.v2-screener-quick-actions button.is-active strong {
    color: #cfc2ff;
}

.v2-screener-quick-actions span {
    display: block;
    color: #78869a;
    font-size: 9px;
    line-height: 1.35;
}

.v2-screener-quick-note {
    margin: 8px 0 0;
    color: #69778b;
    font-size: 9px;
}

@media (max-width: 900px) {
    .v2-screener-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .v2-screener-quick-copy {
        display: block;
    }

    .v2-screener-quick-copy span {
        display: block;
        margin-top: 3px;
    }

    .v2-screener-quick-actions {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Custom Screener — Readability Pass
   ========================================================== */

/* Main screener intro */
.v2-custom-screener-head h2 {
    font-size: 20px;
    line-height: 1.25;
}

.v2-custom-screener-head p {
    font-size: 13px;
    line-height: 1.45;
}

.v2-custom-screener-universe strong {
    font-size: 18px;
}

.v2-custom-screener-universe span {
    font-size: 11px;
}


/* Quick Screens */
.v2-screener-quick-copy strong {
    font-size: 13px;
}

.v2-screener-quick-copy span {
    font-size: 11px;
    line-height: 1.4;
}

.v2-screener-quick-actions strong {
    font-size: 13px;
    line-height: 1.3;
}

.v2-screener-quick-actions span {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.4;
}

.v2-screener-quick-note {
    font-size: 11px;
    line-height: 1.4;
}


/* Descriptive / Fundamental / Technical headings */
.v2-screener-filter-heading h3 {
    font-size: 14px;
    line-height: 1.3;
}

.v2-screener-filter-heading p {
    font-size: 11px;
    line-height: 1.4;
}

.v2-screener-filter-icon {
    font-size: 13px;
}


/* Field labels */
.v2-screener-control > span {
    font-size: 12px;
    line-height: 1.3;
}


/* Inputs + selects */
.v2-screener-control input,
.v2-screener-control select,
.v2-screener-range input,
.v2-screener-range select {
    font-size: 13px;
}


/* More filters */
.v2-screener-more-toggle,
[data-screener-more-toggle] {
    font-size: 11px;
}


/* Active filters */
.v2-screener-active-label {
    font-size: 11px;
}

.v2-screener-chip {
    font-size: 12px;
    line-height: 1.25;
}


/* Reset / Run */
#v2-screener-reset,
#v2-screener-run {
    font-size: 12px;
}


/* Result view tabs */
[data-screener-view] {
    font-size: 12px;
}


/* Match count / pagination status */
.v2-screener-results-meta,
.v2-screener-results-meta *,
.v2-screener-pagination,
.v2-screener-pagination * {
    font-size: 11px;
}


/* Result table */
.v2-screener-table th {
    font-size: 11px;
    line-height: 1.3;
}

.v2-screener-table td {
    font-size: 13px;
    line-height: 1.35;
}

.v2-screener-symbol {
    font-size: 13px;
    font-weight: 650;
}


/* Give larger type enough breathing room */
.v2-screener-quick-actions button {
    padding: 10px 11px;
}

.v2-screener-control input,
.v2-screener-control select {
    min-height: 38px;
}


/* ==========================================================
   Custom Screener — Readability Pass 2 + Row Hover
   ========================================================== */

/* Intro */
.v2-custom-screener-head p {
    font-size: 14px;
}

.v2-custom-screener-universe span {
    font-size: 12px;
}


/* Quick Screens */
.v2-screener-quick-copy strong {
    font-size: 14px;
}

.v2-screener-quick-copy span {
    font-size: 12px;
}

.v2-screener-quick-actions strong {
    font-size: 14px;
}

.v2-screener-quick-actions span {
    font-size: 12px;
    line-height: 1.45;
}

.v2-screener-quick-note {
    font-size: 12px;
}


/* Filter sections */
.v2-screener-filter-heading h3 {
    font-size: 15px;
}

.v2-screener-filter-heading p {
    font-size: 12px;
}

.v2-screener-control > span {
    font-size: 13px;
}


/* Inputs */
.v2-screener-control input,
.v2-screener-control select,
.v2-screener-range input,
.v2-screener-range select {
    font-size: 14px;
}

.v2-screener-control input,
.v2-screener-control select {
    min-height: 40px;
}


/* Secondary controls */
.v2-screener-more-toggle,
[data-screener-more-toggle] {
    font-size: 12px;
}

.v2-screener-active-label {
    font-size: 12px;
}

.v2-screener-chip {
    font-size: 13px;
}

#v2-screener-reset,
#v2-screener-run {
    font-size: 13px;
}


/* Result navigation */
[data-screener-view] {
    font-size: 13px;
}

.v2-screener-results-meta,
.v2-screener-results-meta *,
.v2-screener-pagination,
.v2-screener-pagination * {
    font-size: 12px;
}


/* Results table */
.v2-screener-table th {
    font-size: 12px;
    line-height: 1.35;
}

.v2-screener-table td {
    font-size: 14px;
    line-height: 1.4;
}

.v2-screener-symbol {
    font-size: 14px;
    font-weight: 650;
}


/* Match the interaction language of the other WOI tables */
.v2-screener-table tbody tr {
    transition:
        background-color 120ms ease,
        box-shadow 120ms ease;
}

.v2-screener-table tbody tr:hover {
    background-color: rgba(124, 77, 255, 0.10);
    box-shadow:
        inset 3px 0 0 rgba(151, 108, 255, 0.85);
}

.v2-screener-table tbody tr:hover td {
    background-color: transparent;
}

.v2-screener-table tbody tr:hover .v2-screener-symbol {
    color: #c8b5ff;
}


/* ==========================================================
   Custom Screener — Semantic Data Colors
   ========================================================== */

.v2-screener-table td.is-semantic-positive {
    color: #35d89a;
}

.v2-screener-table td.is-semantic-negative {
    color: #ff6474;
}

.v2-screener-table td.is-semantic-neutral {
    color: #9eabba;
}


/* Relative volume */

.v2-screener-table td.is-semantic-activity-soft {
    color: #a8c7ff;
}

.v2-screener-table td.is-semantic-activity {
    color: #65d6c4;
    font-weight: 600;
}

.v2-screener-table td.is-semantic-activity-high {
    color: #35d89a;
    font-weight: 650;
}


/* RSI regime */

.v2-screener-table td.is-semantic-rsi-low {
    color: #70b7ff;
    font-weight: 600;
}

.v2-screener-table td.is-semantic-rsi-high {
    color: #f0b95f;
    font-weight: 600;
}


/* Distance from 60D high */

.v2-screener-table td.is-semantic-near-high {
    color: #54d7a2;
}

.v2-screener-table td.is-semantic-far-high {
    color: #e9828d;
}


/*
 * Existing formatCell() uses inner spans for performance fields.
 * Make sure those inherit the stronger semantic cell color.
 */

.v2-screener-table td.is-semantic-positive .is-positive,
.v2-screener-table td.is-semantic-negative .is-negative {
    color: inherit;
}


/*
 * Keep semantic colors visible during purple row hover.
 */

.v2-screener-table tbody tr:hover td.is-semantic-positive,
.v2-screener-table tbody tr:hover td.is-semantic-negative,
.v2-screener-table tbody tr:hover td.is-semantic-activity,
.v2-screener-table tbody tr:hover td.is-semantic-activity-high,
.v2-screener-table tbody tr:hover td.is-semantic-activity-soft,
.v2-screener-table tbody tr:hover td.is-semantic-rsi-low,
.v2-screener-table tbody tr:hover td.is-semantic-rsi-high,
.v2-screener-table tbody tr:hover td.is-semantic-near-high,
.v2-screener-table tbody tr:hover td.is-semantic-far-high {
    background-color: transparent;
}


/* ==========================================================
   Custom Screener — Quick Screen Guidance
   ========================================================== */

.v2-screener-preset-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(116, 139, 173, 0.16);
}

.v2-screener-preset-guide-default {
    font-size: 12px;
    color: #7890ad;
}

.v2-screener-preset-guide-copy {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.v2-screener-preset-guide-copy strong {
    flex: 0 0 auto;
    font-size: 13px;
    color: #d8e6fa;
}

.v2-screener-preset-guide-copy > span {
    font-size: 12px;
    line-height: 1.4;
    color: #8fa6c4;
}

.v2-screener-preset-criteria {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.v2-screener-preset-criterion {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid rgba(143, 100, 255, 0.34);
    border-radius: 999px;
    background: rgba(117, 72, 220, 0.08);
    color: #bdaaff;
    font-size: 11px;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .v2-screener-preset-guide {
        align-items: flex-start;
        flex-direction: column;
    }

    .v2-screener-preset-criteria {
        justify-content: flex-start;
    }
}


/* Custom Screener contextual help */
.v2-screener-help-label {
    display: inline-block;
    width: fit-content;
    cursor: help;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: rgba(164, 139, 255, 0.58);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.v2-screener-help-label:hover,
.v2-screener-help-label:focus-visible {
    color: #d7ccff;
    text-decoration-color: #9d7cff;
    outline: none;
}

.v2-screener-tooltip {
    position: fixed;
    z-index: 10000;
    width: min(330px, calc(100vw - 24px));
    padding: 13px 14px;
    border: 1px solid #33415a;
    border-radius: 8px;
    background: #111a28;
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.34);
    color: #b9c9df;
    font-size: 12px;
    line-height: 1.45;
    pointer-events: none;
}

.v2-screener-tooltip[hidden] {
    display: none !important;
}

.v2-screener-tooltip strong,
.v2-screener-tooltip span,
.v2-screener-tooltip em {
    display: block;
}

.v2-screener-tooltip strong {
    margin-bottom: 7px;
    color: #f2f5fb;
    font-size: 13px;
    font-style: normal;
}

.v2-screener-tooltip span + span {
    margin-top: 5px;
}

.v2-screener-tooltip em {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid #28354a;
    color: #b49cff;
    font-style: normal;
    font-weight: 600;
}


/* ==========================================================
   Custom Screener — Peer-relative valuation
   ========================================================== */

.v2-screener-table td.is-peer-valuation {
    height: 52px;
    padding-top: 5px;
    padding-bottom: 5px;
    vertical-align: middle;
}

.v2-peer-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    cursor: help;
}

.v2-peer-value {
    color: #c2cad6;
    font-size: 10.5px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.v2-peer-context {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    font-size: 8.5px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.v2-peer-arrow {
    font-size: 9px;
    line-height: 1;
}

.v2-peer-context.is-peer-below {
    color: #42b9b1;
}

.v2-peer-context.is-peer-near {
    color: #778499;
}

.v2-peer-context.is-peer-above {
    color: #d5a14c;
}

.v2-peer-cell:hover .v2-peer-value {
    color: #eef1f6;
}


/* ==========================================================
   Custom Screener — Financial peer percentile context
   ========================================================== */

.v2-peer-context.is-peer-rank-high {
    color: #42b9b1;
}

.v2-peer-context.is-peer-rank-mid {
    color: #778499;
}

.v2-peer-context.is-peer-rank-low {
    color: #d5a14c;
}

.v2-peer-context.is-peer-rank-neutral {
    color: #8d98aa;
}

.v2-financial-peer-cell .v2-peer-context {
    font-variant-numeric: tabular-nums;
}



/* ==========================================================
   Peer-relative screener filters
   ========================================================== */

.v2-screener-peer-filter-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 8px;
    margin-top: 5px;
    padding-top: 13px;
    border-top: 1px solid #263246;
}

.v2-screener-peer-filter-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.v2-screener-peer-filter-heading strong {
    color: #c9bcf2;
    font-size: 11px;
    font-weight: 650;
}

.v2-screener-peer-filter-heading span {
    max-width: 290px;
    color: #718096;
    font-size: 9px;
    line-height: 1.35;
    text-align: right;
}

.v2-screener-peer-filter-group > .v2-screener-more {
    grid-column: 1 / -1;
    margin-top: 1px;
}

.v2-screener-peer-filter-group > .v2-screener-more-grid {
    grid-column: 1 / -1;
}

/*
 * Existing .v2-screener-more-grid uses display:contents.
 * Keep peer extra controls inside the parent grid.
 */
.v2-screener-peer-filter-group
    > .v2-screener-more-grid:not([hidden]) {
    display: contents;
}

@media (max-width: 560px) {
    .v2-screener-peer-filter-group {
        grid-template-columns: 1fr;
    }

    .v2-screener-peer-filter-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .v2-screener-peer-filter-heading span {
        max-width: none;
        text-align: left;
    }
}

/* ==========================================================
   Custom Screener — Symbol + Watchlist
   ========================================================== */

.v2-screener-symbol-cell {
    min-width: 150px;
}

.v2-screener-symbol-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.v2-screener-symbol-line .v2-watchlist-star {
    flex: 0 0 auto;
}

.v2-screener-company {
    margin-top: 3px;
    padding-left: 27px;
    max-width: 220px;
    overflow: hidden;
    color: #718097;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-screener-table tbody tr:hover .v2-screener-company {
    color: #8e9bb0;
}


/* Custom Screener root visibility guard */
#v2-custom-screener[hidden] {
    display: none !important;
}
