/* Screener pills / table — extracted from styles.css */
/* Screener Max selector — native options follow the active theme */
.scr-max-select {
    padding: 2px 4px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-family: var(--font-sans);
    cursor: pointer;
    outline: none;
    color-scheme: inherit;
}
.scr-max-select:focus {
    color: var(--text-primary);
}
.scr-max-select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* Filter pills + dropdowns + Add Filter drawer */
.scr-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 15px;
    font-family: var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.scr-pill.is-on {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.06);
}

.scr-drop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    min-width: 200px;
    max-width: 260px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 0;
    z-index: 1200;
    box-shadow: var(--glow-lg);
    color: var(--text-primary);
}
.scr-drop-search {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}
.scr-drop-search::placeholder { color: var(--text-muted); }
.scr-drop-search:focus { border-color: var(--border-active); }
.scr-drop-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-family: var(--font-sans);
    text-align: left;
    cursor: pointer;
}
.scr-drop-item:hover { background: var(--bg-hover); }

.scr-member-dropdown {
    position: fixed;
    z-index: 99999;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 180px;
    box-shadow: var(--glow-lg);
    color: var(--text-primary);
}
.scr-member-item {
    padding: 9px 14px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.scr-member-item:hover { background: var(--bg-hover); }
.scr-member-empty {
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 13px;
}
.scr-member-loading {
    animation: scr-member-pulse 1s ease-in-out infinite;
}
@keyframes scr-member-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
.scr-member-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

#scr-filter-overlay {
    background: var(--overlay-scrim);
}
#scr-filter-drop {
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.16);
    color: var(--text-primary);
}
#scr-fdrop-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.scr-fdrop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-header);
    flex-shrink: 0;
}
.scr-fdrop-head--sub {
    padding: 12px 16px;
    justify-content: flex-start;
}
.scr-fdrop-search-wrap {
    padding: 8px 12px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
}
.scr-fdrop-search,
.scr-fdrop-num {
    width: 100%;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.scr-fdrop-search::placeholder,
.scr-fdrop-num::placeholder { color: var(--text-muted); }
.scr-fdrop-search:focus,
.scr-fdrop-num:focus {
    border-color: var(--border-active);
    background: var(--bg-card);
}
.scr-fdrop-body {
    overflow-y: auto;
    flex: 1;
    background: var(--bg-elevated);
}
.scr-fdrop-row {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s;
}
.scr-fdrop-row:hover { background: var(--bg-hover); }
.scr-fdrop-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}
.scr-fdrop-icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.scr-fdrop-chip {
    padding: 5px 11px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    font-weight: 400;
    transition: all .15s;
}
.scr-fdrop-chip.is-on {
    border-color: #a855f7;
    background: rgba(168, 85, 247, .2);
    color: #c084fc;
    font-weight: 600;
}
.scr-fdrop-manual {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-hover);
}

#scr-pill-modal-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 19px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
}
#scr-pill-modal-open:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.scr-symbol {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}
.scr-rule {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}
.scr-max-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding-left: 10px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
}

/* AI filter empty-state deepen buttons */
.scr-ai-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.scr-ai-expand-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.06);
}
.scr-ai-expand-btn--accent {
    border-color: rgba(168, 85, 247, 0.45);
    color: #c084fc;
}
.scr-ai-expand-btn--accent:hover {
    border-color: #a855f7;
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.1);
}

.scr-ai-universe-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.28);
    background: rgba(168, 85, 247, 0.07);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-sans);
    line-height: 1.4;
}
.scr-ai-universe-banner > span {
    flex: 1;
    min-width: 200px;
}
.scr-ai-universe-banner__meta {
    opacity: 0.75;
}

/* Workspace chrome (right-rail screener) */
.scr-workspace { display: flex; flex-direction: column; min-height: 0; height: 100%; }
#screener-workspace-body { flex: 1; min-height: 0; overflow: auto; }
.scr-chrome { padding: 0 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.scr-chrome-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scr-chrome-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex: 1 1 180px;
    min-width: 0;
}
.scr-chrome-name.wl-title-input {
    flex: 0 1 auto;
    width: auto;
    min-width: 8ch;
    max-width: 100%;
    field-sizing: content;
    font-size: 16px;
    font-weight: 600;
}
.scr-chrome-actions { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.scr-sked-wrap { position: relative; }
.scr-sked-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1300;
    min-width: 120px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.scr-sked-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
}
.scr-sked-item:hover { background: rgba(0,245,255,.08); }
.scr-sked-item.is-on { color: var(--neon, #00e5ff); }
.scr-chrome-status { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.scr-chrome-status:empty { display: none; }
.scr-chrome-status--err { color: var(--red, #f87171); }
.scr-add-wl {
    width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.scr-add-wl:hover { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.scr-wl-dest {
    position: fixed; z-index: 1300; min-width: 180px; max-height: 240px; overflow: auto;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.scr-wl-dest-item {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border: none;
    background: transparent; color: var(--text-primary); font-size: 13px; cursor: pointer; border-radius: 6px;
}
.scr-wl-dest-item:hover { background: rgba(0,245,255,.08); }
.scr-result-view .period-toggle-btn {
    padding: 6px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#scr-mosaic-host { width: 100%; min-width: 0; container-type: inline-size; container-name: scr-mosaic; }
.scr-mosaic-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.scr-mosaic-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.scr-mosaic-tile { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--bg-card); min-width: 0; min-height: 0; overflow: hidden; }
.scr-mosaic-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; min-width: 0; }
.scr-mosaic-head img { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.scr-mosaic-sym { background: none; border: none; color: var(--text-primary); font-weight: 700; cursor: pointer; flex-shrink: 0; }
.scr-mosaic-name { flex: 1; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.scr-mosaic-chart { width: 100%; height: 168px; min-width: 0; }
@container scr-mosaic (min-width: 560px) {
    .scr-mosaic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .scr-mosaic-chart { height: 150px; }
}
@container scr-mosaic (min-width: 900px) {
    .scr-mosaic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .scr-mosaic-chart { height: 148px; }
}
.scr-mosaic-empty { color: var(--text-muted); font-size: 12px; padding: 24px 0; text-align: center; }
.scr-mosaic-sma { display: inline-flex; align-items: center; }
.scr-mosaic-sma-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.scr-mosaic-sentinel { height: 1px; }
.scr-mosaic-chart a[href*="tradingview"],
.scr-mosaic-tile a[href*="tradingview"],
.scr-mosaic-chart div[style*="bottom: 4px"] {
    display: none !important;
}

@media (max-width: 768px) {
    #screener-workspace-body .scr-pill-wrap button { font-size: 13px; padding: 5px 10px; }
    #scr-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    #scr-table-wrap table { min-width: 700px; }
    .scr-mosaic-chart,
    .scr-mosaic-chart canvas { touch-action: pan-y; }
}
