/* ══════════════════════════════════════════════════════
   WATCHLIST PANEL  — TradingView style
   ══════════════════════════════════════════════════════ */

/* Panel override: no fixed header — topbar is custom */
.wl-panel { padding: 0; overflow: hidden; flex-direction: column; position: relative; }

/* ── Top toolbar ── */
button.wl-topbar-left {
    border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    padding: 0 4px 0 8px; min-width: 0; flex: 1;
    height: 36px; font-family: inherit;
    border-radius: 4px; transition: background 100ms;
}
button.wl-topbar-left:hover { background: var(--ui-hover, rgba(128,128,140,.14)); }

.wl-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 6px 0 2px; height: 36px; flex-shrink: 0;
    border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.08));
}
.wl-topbar-left { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; cursor: pointer; }
.wl-list-name {
    font-size: 12.5px; font-weight: 700; color: var(--ui-fg);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 110px;
}
.wl-topbar-right { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.wl-tb-btn {
    width: 26px; height: 26px; border: none; background: transparent;
    color: var(--ui-muted); cursor: pointer; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: background 100ms, color 100ms;
}
.wl-tb-btn:hover { background: var(--ui-hover, rgba(128,128,128,.14)); color: var(--ui-fg); }

/* ── Column header ── */
.wl-col-hdr {
    display: flex; align-items: center; padding: 3px 8px 3px 36px;
    font-size: 10px; font-weight: 600; color: var(--ui-muted);
    letter-spacing: .4px; text-transform: uppercase; flex-shrink: 0;
    border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.06));
    background: var(--ui-panel);
}
.wl-ch-sym { flex: 1; }
.wl-ch-last { width: 54px; text-align: right; }
.wl-ch-ch   { width: 44px; text-align: right; }
.wl-ch-pct  { width: 46px; text-align: right; }

/* ── Scrollable list body ── */
.wl-body { flex: 1; overflow-y: auto; overflow-x: hidden; }
.wl-body::-webkit-scrollbar { width: 3px; }
.wl-body::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 2px; }

/* ── Section header ── */
.wl-section-hdr {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 8px 3px; font-size: 9.5px; font-weight: 700;
    color: var(--ui-muted); letter-spacing: .6px; text-transform: uppercase;
    cursor: pointer; user-select: none;
    border-top: 1px solid var(--ui-border, rgba(255,255,255,.05));
}
.wl-section-hdr:first-child { border-top: none; }
.wl-section-arrow { font-size: 10px; transition: transform .15s; }
.wl-section-hdr.collapsed .wl-section-arrow { transform: rotate(-90deg); }

/* ── Symbol row ── */
.wl-row {
    display: flex; align-items: center;
    padding: 5px 8px; gap: 5px; cursor: pointer;
    border-bottom: 1px solid rgba(128,128,128,.05);
    transition: background 80ms; position: relative;
}
.wl-row:hover { background: var(--ui-hover, rgba(128,128,128,.1)); }
.wl-row.wl-row-active { background: rgba(41,98,255,.1); }

/* Symbol badge (colored circle with 2-letter abbr) */
.wl-badge {
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 7.5px; font-weight: 800; color: #fff;
    flex-shrink: 0; letter-spacing: -.3px;
}
.wl-row-sym { flex: 1; min-width: 0; }
.wl-row-sym-name {
    font-size: 11.5px; font-weight: 700; color: var(--ui-fg);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wl-row-sym-full {
    font-size: 9.5px; color: var(--ui-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Price columns */
.wl-row-last { width: 54px; text-align: right; font-size: 11px; font-weight: 600; color: var(--ui-fg); flex-shrink: 0; }
.wl-row-ch   { width: 44px; text-align: right; font-size: 10.5px; font-weight: 500; flex-shrink: 0; }
.wl-row-pct  { width: 46px; text-align: right; font-size: 10.5px; font-weight: 600; flex-shrink: 0; }
.wl-row-ch.up, .wl-row-pct.up   { color: #26a69a; }
.wl-row-ch.down, .wl-row-pct.down { color: #ef5350; }
.wl-row-ch.flat, .wl-row-pct.flat { color: var(--ui-muted); }

/* Hover action buttons (show on row hover) */
.wl-row-actions {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    display: none; align-items: center; gap: 2px;
    background: var(--ui-panel); border-radius: 4px;
    padding: 1px 2px; box-shadow: -2px 0 8px rgba(0,0,0,.2);
}
.wl-row:hover .wl-row-actions { display: flex; }
.wl-row-action-btn {
    width: 20px; height: 20px; border: none; background: transparent;
    color: var(--ui-muted); cursor: pointer; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; transition: background 80ms, color 80ms;
}
.wl-row-action-btn:hover { background: rgba(128,128,140,.2); color: var(--ui-fg); }

/* ── Symbol detail sub-panel ── */
.wl-detail-panel {
    position: absolute; inset: 0;
    background: var(--ui-panel); display: flex; flex-direction: column;
    z-index: 5;
}
.wl-detail-panel.hidden { display: none; }

.wl-detail-topbar {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px; border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.08));
    flex-shrink: 0;
}
.wl-back-btn {
    width: 24px; height: 24px; border: none; background: transparent;
    color: var(--ui-muted); cursor: pointer; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 100ms;
}
.wl-back-btn:hover { background: var(--ui-hover); color: var(--ui-fg); }

.wl-detail-sym-info { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.wl-detail-sym-badge {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px; font-weight: 800; color: #fff;
}
.wl-detail-sym-name { font-size: 12px; font-weight: 700; color: var(--ui-fg); }
.wl-detail-sym-full { font-size: 10px; color: var(--ui-muted); margin-top: 1px; }

.wl-detail-price-row {
    display: flex; align-items: baseline; gap: 8px;
    padding: 10px 12px 6px;
}
.wl-detail-price { font-size: 22px; font-weight: 700; color: var(--ui-fg); }
.wl-detail-change { font-size: 13px; font-weight: 600; }
.wl-detail-change.up { color: #26a69a; }
.wl-detail-change.down { color: #ef5350; }

.wl-detail-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.08));
    padding: 0 8px; flex-shrink: 0;
}
.wl-dtab {
    padding: 6px 10px; border: none; background: transparent;
    color: var(--ui-muted); font-size: 11.5px; font-weight: 500;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: color .1s; font-family: inherit;
}
.wl-dtab:hover { color: var(--ui-fg); }
.wl-dtab.active { color: var(--ui-fg); border-bottom-color: var(--ui-fg); font-weight: 600; }

.wl-detail-body { flex: 1; overflow-y: auto; padding: 0; }
.wl-detail-body::-webkit-scrollbar { width: 3px; }
.wl-detail-body::-webkit-scrollbar-thumb { background: var(--ui-border); }

/* Performance table */
.wl-perf-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 4px; padding: 10px 10px 6px;
}
.wl-perf-cell {
    background: rgba(128,128,140,.1); border-radius: 4px;
    padding: 5px 6px; text-align: center;
}
.wl-perf-period { font-size: 9px; color: var(--ui-muted); font-weight: 700; letter-spacing: .3px; }
.wl-perf-val { font-size: 12px; font-weight: 700; margin-top: 2px; }
.wl-perf-val.up { color: #26a69a; }
.wl-perf-val.down { color: #ef5350; }

/* News items */
.wl-news-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.06));
    cursor: pointer;
}
.wl-news-item:hover { background: var(--ui-hover); }
.wl-news-source { font-size: 9.5px; color: var(--accent, #2962ff); font-weight: 600; margin-bottom: 3px; }
.wl-news-headline { font-size: 11.5px; color: var(--ui-fg); line-height: 1.4; }
.wl-news-time { font-size: 9.5px; color: var(--ui-muted); margin-top: 3px; }

/* Overview info rows */
.wl-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 12px; border-bottom: 1px solid rgba(128,128,128,.06);
    font-size: 11.5px;
}
.wl-info-label { color: var(--ui-muted); }
.wl-info-val { color: var(--ui-fg); font-weight: 600; }

/* ══════════════════════════════════════
   ADD SYMBOL OVERLAY
   ══════════════════════════════════════ */
.wl-add-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
}
.wl-add-overlay.hidden { display: none; }
.wl-add-dialog {
    background: var(--ui-panel, #1e222d);
    border: 1px solid var(--ui-border, rgba(255,255,255,.1));
    border-radius: 6px; width: 560px; max-width: calc(100vw - 32px);
    display: flex; flex-direction: column;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
    max-height: 80vh; overflow: hidden;
}

.wl-add-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.08));
}
.wl-add-title { font-size: 15px; font-weight: 700; color: var(--ui-fg); }
.wl-add-close-btn {
    width: 26px; height: 26px; border: none; background: transparent;
    color: var(--ui-muted); cursor: pointer; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: background .1s;
}
.wl-add-close-btn:hover { background: var(--ui-hover); color: var(--ui-fg); }

.wl-add-search-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.08));
}
.wl-add-input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--ui-fg); font-size: 14px; font-family: inherit;
}
.wl-add-input::placeholder { color: var(--ui-muted); }

.wl-add-type-tabs {
    display: flex; gap: 4px; padding: 8px 12px; flex-wrap: wrap;
    border-bottom: 1px solid var(--ui-border, rgba(255,255,255,.06));
    flex-shrink: 0;
}
.wl-type-tab {
    padding: 4px 10px; border-radius: 20px; border: none;
    background: rgba(128,128,140,.12); color: var(--ui-muted);
    font-size: 11.5px; font-weight: 500; cursor: pointer;
    transition: background .1s, color .1s; font-family: inherit;
}
.wl-type-tab.active, .wl-type-tab:hover { background: var(--ui-fg); color: var(--ui-panel); }

.wl-add-results { flex: 1; overflow-y: auto; min-height: 200px; }
.wl-add-results::-webkit-scrollbar { width: 4px; }
.wl-add-results::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 2px; }

.wl-add-result-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; cursor: pointer; border-bottom: 1px solid rgba(128,128,128,.06);
    transition: background .08s;
}
.wl-add-result-row:hover { background: var(--ui-hover, rgba(128,128,140,.1)); }
.wl-add-result-row.in-list { opacity: .5; }
.wl-add-res-badge { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 8.5px; font-weight: 800; color: #fff; }
.wl-add-res-info { flex: 1; min-width: 0; }
.wl-add-res-sym { font-size: 13px; font-weight: 700; color: var(--ui-fg); }
.wl-add-res-name { font-size: 11px; color: var(--ui-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-add-res-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.wl-add-res-type { font-size: 10px; color: var(--ui-muted); text-transform: lowercase; }
.wl-add-res-exch { font-size: 10px; color: var(--ui-muted); font-weight: 600; }
.wl-add-res-add-btn {
    width: 26px; height: 26px; border: 1px solid var(--ui-border); border-radius: 4px;
    background: transparent; color: var(--ui-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1; transition: all .1s; flex-shrink: 0;
}
.wl-add-res-add-btn:hover { background: #26a69a; border-color: #26a69a; color: #fff; }
.wl-add-res-add-btn.added { background: rgba(239,83,80,.15); border-color: #ef5350; color: #ef5350; }

.wl-add-footer {
    padding: 8px 16px; font-size: 10.5px; color: var(--ui-muted);
    border-top: 1px solid var(--ui-border, rgba(255,255,255,.06));
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   OPTIONS / SETTINGS POPUPS
   ══════════════════════════════════════ */
.wl-popup {
    position: fixed; z-index: 9500;
    background: var(--ui-panel, #1e222d);
    border: 1px solid var(--ui-border, rgba(255,255,255,.12));
    border-radius: 6px; min-width: 200px;
    box-shadow: 0 8px 28px rgba(0,0,0,.4);
    padding: 5px 0; font-size: 12.5px;
}
.wl-popup.hidden { display: none; }


.wl-popup-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px; color: var(--ui-fg); cursor: pointer;
    transition: background .08s; white-space: nowrap;
}
.wl-popup-row:hover { background: var(--ui-hover, rgba(128,128,140,.12)); }
.wl-popup-row svg { flex-shrink: 0; color: var(--ui-muted); }
.wl-popup-toggle-row { cursor: default; justify-content: space-between; }
.wl-popup-toggle-row:hover { background: transparent; }
.wl-popup-sc { margin-left: auto; font-size: 10.5px; color: var(--ui-muted); padding-left: 16px; }
.wl-popup-sep { height: 1px; background: var(--ui-border, rgba(255,255,255,.08)); margin: 4px 0; }

.wl-sett-section-hdr {
    padding: 6px 14px 3px; font-size: 9.5px; font-weight: 700;
    color: var(--ui-muted); letter-spacing: .6px; text-transform: uppercase;
}
.wl-sett-check, .wl-sett-radio {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; color: var(--ui-fg); cursor: pointer;
    transition: background .08s; font-size: 12.5px;
}
.wl-sett-check:hover, .wl-sett-radio:hover { background: var(--ui-hover); }
.wl-sett-check input, .wl-sett-radio input { accent-color: var(--ui-fg); width: 13px; height: 13px; cursor: pointer; }

/* Mini toggle switch */
.wl-mini-toggle { position: relative; display: inline-flex; cursor: pointer; }
.wl-mini-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.wl-mini-track {
    width: 30px; height: 16px; background: rgba(128,128,140,.3);
    border-radius: 8px; transition: background .2s; position: relative;
}
.wl-mini-knob {
    position: absolute; top: 2px; left: 2px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; transition: transform .2s;
}
.wl-mini-toggle input:checked + .wl-mini-track { background: #2962ff; }
.wl-mini-toggle input:checked + .wl-mini-track .wl-mini-knob { transform: translateX(14px); }

/* ── Light theme adjustments ── */


/* ══════════════════════════════════════════════════════
   WATCHLIST DROPDOWNS  (.wl-dropdown)
   ══════════════════════════════════════════════════════ */
.wl-dropdown {
    position: fixed;
    z-index: 99999;
    background: var(--ui-panel, #1e222d);
    border: 1px solid var(--ui-border, rgba(255,255,255,.1));
    border-radius: 8px;
    padding: 6px 0;
    min-width: 220px;
    box-shadow: 0 8px 28px rgba(0,0,0,.4);
    font-family: inherit;
    font-size: 13px;
}
.wl-dropdown.hidden { display: none; }

.wl-dd-item {
    display: flex; align-items: center;
    height: 34px; padding: 0 12px 0 8px;
    cursor: pointer; color: var(--ui-fg, #d1d4dc);
    transition: background 80ms; user-select: none; gap: 0;
}
.wl-dd-item:hover { background: rgba(120,120,140,.14); }
.wl-dd-item.wl-dd-disabled { opacity: .42; cursor: default; pointer-events: none; }
.wl-dd-item.wl-dd-item-toggle { cursor: default; }
.wl-dd-item.wl-dd-item-toggle:hover { background: transparent; }

.wl-dd-icon {
    width: 28px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ui-muted, #787b86);
}
.wl-dd-lbl { flex: 1; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.wl-dd-sc  { font-size: 11px; color: var(--ui-muted, #787b86); flex-shrink: 0; margin-left: 6px; }

.wl-dd-sep { height: 1px; background: var(--ui-border, rgba(255,255,255,.08)); margin: 5px 0; }
.wl-dd-section-hdr {
    padding: 6px 12px 3px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase;
    color: var(--ui-muted, #787b86); user-select: none;
}
.wl-dd-check-row { cursor: pointer; }

/* Light theme */


