/* Investing pane — watchlists, morning brief, portfolios */

/* Investing pane content */
.investing-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.investing-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    opacity: 0.5;
}

/* Full-width modes */
.split-view.full-terminal .split-pane-left { flex: 1; }
.split-view.full-terminal .split-pane-right { display: none; }
.split-view.full-terminal .split-divider { display: none; }

.split-view.full-investing .split-pane-left { display: none; }
.split-view.full-investing .split-pane-right { display: block; flex: 1; }
.split-view.full-investing .split-divider { display: none; }

/* ── Split divider arrow buttons ──────────────────────────────────── */
.split-divider-arrows {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: auto;  /* always on — JS controls visibility via .show */
    opacity: 0;
    z-index: 1;
    transition: opacity 0.15s;
}

.split-divider-arrows.show {
    opacity: 1;
}

.split-arrow-btn {
    position: absolute;
    top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 28px;
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.18);
    color: rgba(0, 240, 255, 0.6);
    cursor: pointer;
    padding: 0;
    z-index: 2;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* Left arrow: sits to the left of the bar, rounded on the left */
#split-arrow-left {
    right: calc(100% + 1px);
    border-radius: 5px 0 0 5px;
}

/* Right arrow: sits to the right of the bar, rounded on the right */
#split-arrow-right {
    left: calc(100% + 1px);
    border-radius: 0 5px 5px 0;
}

.split-arrow-btn:hover {
    background: rgba(0, 240, 255, 0.16);
    border-color: rgba(0, 240, 255, 0.45);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.18);
}

/* ── Ghost restore buttons ────────────────────────────────────────── */
.split-ghost-btn {
    position: fixed;
    top: 72px;
    width: 22px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: transparent;
    cursor: pointer;
    z-index: 1050;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;
    pointer-events: none;
    opacity: 0;
}

/* When active: invisible hit-area, reveals only on hover */
.split-ghost-btn.visible {
    pointer-events: auto;
    opacity: 0;
}

/* Right ghost: anchored to right edge */
.split-ghost-right {
    right: 0;
    border-radius: 6px 0 0 6px;
}

/* Left ghost: anchored to left edge */
.split-ghost-left {
    left: 0;
    border-radius: 0 6px 6px 0;
}

/* Full reveal on hover */
.split-ghost-btn.visible:hover {
    opacity: 1;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

/* ── Investing Pane Forms ─────────────────────────────────────────── */
.investing-create {
    max-width: 480px;
}

.investing-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 24px 0;
}

.investing-form {
    display: flex;
    flex-direction: column;
}

.investing-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.investing-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.investing-input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.investing-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.investing-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.investing-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.investing-btn--primary {
    background: var(--neon);
    color: #000;
}

.investing-btn--primary:hover {
    background: #33f5ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.investing-btn--secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.investing-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Detail view in central pane */
.rs-detail {
    max-width: 600px;
}

.rs-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.rs-detail-back {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.rs-detail-back:hover {
    border-color: var(--neon);
    color: var(--neon);
}

.rs-detail-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.rs-detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rs-detail-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.rs-detail-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rs-detail-symbol {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--neon);
    letter-spacing: 0.5px;
}

.rs-detail-add-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.rs-detail-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.rs-detail-input:focus {
    border-color: var(--neon);
}

.rs-detail-add-btn {
    padding: 8px 16px;
    background: var(--neon);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.rs-detail-add-btn:hover {
    background: #33f5ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.rs-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.rs-detail-holding {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.rs-detail-holding-sym {
    font-weight: 600;
    color: var(--neon);
    min-width: 60px;
}

.rs-detail-holding-shares {
    color: var(--text-secondary);
}

.rs-detail-holding-cost {
    color: var(--text-muted);
    margin-left: auto;
}

.rs-section-empty {
    color: var(--text-muted);
    font-size: 13px;
    opacity: 0.6;
    padding: 8px 0;
}

/* ── Watchlist Detail View ────────────────────────────────────────── */
.wl-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.wl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.wl-title-input {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    outline: none;
    padding: 4px 0;
    flex: 1;
    min-width: 0;
    transition: border-color 0.2s;
    font-family: var(--font-sans);
}

.wl-title-input:hover {
    border-bottom-color: var(--border);
}

.wl-title-input:focus {
    border-bottom-color: var(--neon);
}

.wl-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s;
    flex-shrink: 0;
    opacity: 0.5;
}

.wl-close-btn:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* Sidebar item hover delete */
.nav-tree-item { position: relative; }

.rs-hover-delete {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    background: none;
    border: none;
    color: #b05252;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    transition: opacity 0.12s, background 0.12s;
    z-index: 2;
}

.nav-tree-item:hover .rs-hover-delete,
.lib-card:hover .rs-hover-delete {
    opacity: 1;
}

.rs-hover-delete:hover {
    color: #b05252;
}

/* Confirmation row */
.rs-item--confirming {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
}

.rs-confirm-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rs-confirm-yes {
    background: none;
    border: none;
    color: #b05252;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.12s;
}

.rs-confirm-yes:hover {
    background: rgba(176, 82, 82, 0.15);
}

.rs-confirm-divider {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 12px;
}

.rs-confirm-no {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.12s;
}

.rs-confirm-no:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Search bar — mirrors header search */
.wl-search-wrap {
    position: relative;
    margin-bottom: 16px;
    z-index: 10;
}

.wl-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.wl-search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.wl-search-input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.wl-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Table container */
.wl-table-wrap {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.wl-table-wrap::-webkit-scrollbar { display: none; }

.wl-table { width: 100%; }

/* Row-level delete button — appears on hover */
.wl-remove-cell {
    width: 36px;
    padding: 8px 8px 8px 0;
    text-align: center;
}

.wl-remove-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.wl-row:hover .wl-remove-btn {
    opacity: 1;
}

.wl-remove-btn:hover {
    color: #b05252;
    background: rgba(176, 82, 82, 0.12);
}

/* Watchlist search dropdown */
.wl-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--glow-md);
    scrollbar-width: none;
}

.wl-search-dropdown::-webkit-scrollbar { display: none; }

.wl-search-dropdown.active {
    display: block;
}

.wl-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.wl-dd-item:hover {
    background: var(--bg-hover);
}

.wl-dd-item.wl-dd-added {
    opacity: 0.4;
    cursor: default;
}

.wl-dd-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wl-dd-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wl-dd-init {
    font-size: 10px;
    font-weight: 700;
    color: #333;
}

.wl-dd-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wl-dd-sym {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.wl-dd-name {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-dd-check {
    color: var(--neon);
    font-size: 14px;
    flex-shrink: 0;
}

/* Sort arrows */
.wl-sort-arrow {
    font-size: 10px;
    opacity: 0.6;
}

/* Watchlist skeleton shimmer rows */
@keyframes wl-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.wl-skel-cell {
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 400px 100%;
    animation: wl-shimmer 1.2s ease-in-out infinite;
}

.wl-skel-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.wl-skel-ticker {
    height: 18px;
    width: 60px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 18px;
}

.wl-skel-num {
    height: 16px;
    width: 56px;
    margin-left: auto;
}

/* ── Session dot ─────────────────────────────────────────────────────────── */
/* Small dot shown to the left of prices to indicate market session */
.sess-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
    background: #4b5563; /* default grey (closed) */
}
.sess-dot--open {
    background: var(--gain, #4d9e6e);
    animation: pulseDot 2s infinite;
}
.sess-dot--pre,
.sess-dot--after {
    background: #f97316; /* orange for extended hours */
    animation: pulseDot 2.5s infinite;
}
.sess-dot--closed {
    background: #4b5563;
    animation: none;
}

/* ── Cell flash on live price change ─────────────────────────────────────── */
/* Applied to price <td> elements in watchlist and positions tables */
.cell-flash-gain {
    animation: flashGain 0.65s ease;
}
.cell-flash-loss {
    animation: flashLoss 0.65s ease;
}

/* Row removal animation */
@keyframes wl-fade-out {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(20px); height: 0; padding: 0; overflow: hidden; }
}


.wl-row-removing {
    animation: wl-fade-out 0.28s ease-out forwards;
    pointer-events: none;
}

/* Sidebar item removal animation */
.rs-item-removing {
    animation: wl-fade-out 0.28s ease-out forwards;
    pointer-events: none;
}

/* Sidebar loading skeleton items */
.rs-skel-item {
    padding: 8px 12px 8px 36px;
}

.rs-skel-bar {
    height: 14px;
    width: 80%;
    border-radius: 4px;
}

/* ── Watchlist View Switcher ─────────────────────────────────────── */
.wl-view-switcher {
    display: flex;
    gap: 2px;
    margin: 0 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}
.wl-view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}
.wl-view-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.wl-view-btn.active {
    background: var(--neon, #00e5ff);
    color: #0a0a0f;
}
.wl-view-btn.active svg {
    stroke: #0a0a0f;
}
html[data-theme="light"] .wl-view-btn.active {
    color: #ffffff;
}
html[data-theme="light"] .wl-view-btn.active svg {
    stroke: #ffffff;
}

/* ── Morning Brief Card ──────────────────────────────────────────── */
.wl-brief-panel {
    flex: 1;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 4px 20px;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.wl-brief-panel::-webkit-scrollbar { display: none; width: 0; height: 0; }
.wl-mt {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
}

.wl-brief-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.7;
}

.wl-brief-card {
    padding: 20px;
    animation: fadeInBrief 0.3s ease-out;
}
@keyframes fadeInBrief {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wl-brief-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wl-brief-header-icon {
    font-size: 18px;
}
.wl-brief-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}
.wl-brief-header-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.wl-brief-summary {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary, #b0b8c4);
    margin-bottom: 20px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border-left: 3px solid var(--neon, #00e5ff);
}

.wl-brief-section {
    margin-bottom: 18px;
}
.wl-brief-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0.6;
}

.wl-brief-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 8px 0;
}

/* Mover rows */
.wl-brief-mover {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.12s;
    margin-bottom: 4px;
}
.wl-brief-mover:hover {
    background: rgba(255,255,255,0.03);
}

.wl-brief-ticker-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.wl-brief-ticker-badge:hover {
    background: var(--neon, #00e5ff);
    color: #0a0a0f;
}

.wl-brief-mover-pct {
    font-size: 13px;
    font-weight: 600;
    min-width: 65px;
    flex-shrink: 0;
}
.wl-brief-mover--gain .wl-brief-mover-pct {
    color: var(--gain, #4d9e6e);
}
.wl-brief-mover--loss .wl-brief-mover-pct {
    color: var(--loss, #e04f5f);
}

.wl-brief-mover-price {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 60px;
    flex-shrink: 0;
}

.wl-brief-mover-reason {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.8;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Earnings rows */
.wl-brief-earnings-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    margin-bottom: 2px;
}
.wl-brief-earnings-date {
    font-size: 10px;
    font-weight: 700;
    color: #f97316;
    min-width: 72px;
    letter-spacing: 0.5px;
}
.wl-brief-earnings-meta {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
}

/* Market context */
.wl-brief-context {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary, #b0b8c4);
    padding: 8px 0;
}

/* Footer */
.wl-brief-footer {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.5;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.04);
    margin-top: 8px;
}

/* ── Portfolio Detail ─────────────────────────────────────────────── */
.pf-detail {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pf-neon-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon, #00e5ff), transparent);
    margin-bottom: 16px;
    opacity: 0.5;
}

.pf-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 2px;
}

.pf-tab-btn {
    flex: 1;
    text-align: center;
    font-size: 13px !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    color: var(--text-muted) !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font-sans);
}

.pf-tab-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255,255,255,0.05) !important;
}

.pf-tab-btn.active {
    color: var(--text-primary) !important;
    background: rgba(255,255,255,0.08) !important;
    font-weight: 600;
}

.pf-tab-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Portfolio Transaction Form */
.pf-tx-form-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 4px;
}

.pf-tx-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 0 0 auto;
    width: 90px;
}

.pf-tx-field--symbol {
    width: 150px;
}

.pf-search-wrap {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    margin-bottom: 0 !important;
}

.pf-search-wrap .wl-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.pf-search-wrap .pf-search-input {
    width: 100%;
}

.pf-search-wrap .wl-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    z-index: 50;
}

.pf-tx-actions {
    min-width: auto;
    flex: 0 0 auto;
    width: auto;
}

/* Force all form inputs to the same height */
.pf-tx-form-row .investing-input {
    font-size: 12px;
    padding: 6px 8px;
    height: 34px;
    box-sizing: border-box;
}

.pf-tx-edit-btn:hover {
    color: var(--neon, #00e5ff) !important;
}

.pf-edit-input {
    font-size: 12px !important;
    padding: 4px 6px !important;
    height: 28px;
}

/* Delete button: hidden by default, show on row hover */
.pf-tx-del-btn {
    opacity: 0;
    transition: opacity 0.12s;
}

.pf-tx-row:hover .pf-tx-del-btn {
    opacity: 1;
}

/* Editable cells: subtle underline on hover */
.pf-editable {
    transition: border-bottom 0.12s;
    border-bottom: 1px solid transparent;
}

.pf-editable:hover {
    border-bottom: 1px dashed rgba(255,255,255,0.2);
}

.investing-label {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.investing-input {
    font-size: 13px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s;
}

.investing-input:focus {
    border-color: var(--neon, #00e5ff);
}

.investing-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Date picker override for dark theme */
.investing-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

.investing-btn {
    font-family: var(--font-sans);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
}

.investing-btn--primary {
    background: var(--neon, #00e5ff);
    color: #0a0a0f;
    font-weight: 600;
}

.investing-btn--primary:hover {
    opacity: 0.85;
}

.investing-btn--secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
}

.investing-btn--secondary:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* Portfolio Embed Button & Modal */
.pf-embed-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted, #8b949e);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pf-embed-btn:hover {
    color: #58a6ff;
    border-color: rgba(88,166,255,0.35);
    background: rgba(88,166,255,0.08);
}

.pf-embed-modal {
    position: relative;
    z-index: 20;
    margin: 0 0 16px;
}
.pf-embed-modal-inner {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(88,166,255,0.25);
    border-radius: 10px;
    padding: 18px 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.pf-embed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.pf-embed-modal-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #e6edf3;
}
.pf-embed-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #8b949e);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.pf-embed-close:hover { color: #e6edf3; }

.pf-embed-desc {
    font-size: 12px;
    color: var(--text-muted, #8b949e);
    margin-bottom: 14px;
    line-height: 1.5;
}

.pf-embed-section { margin-bottom: 12px; }
.pf-embed-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #8b949e);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.pf-embed-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.pf-embed-code {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: #58a6ff;
    background: rgba(88,166,255,0.07);
    border: 1px solid rgba(88,166,255,0.18);
    border-radius: 6px;
    padding: 8px 12px;
    word-break: break-all;
    line-height: 1.5;
    user-select: all;
}
.pf-embed-copy {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(88,166,255,0.12);
    border: 1px solid rgba(88,166,255,0.3);
    border-radius: 6px;
    color: #58a6ff;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pf-embed-copy:hover {
    background: rgba(88,166,255,0.2);
}

.pf-embed-note {
    font-size: 11px;
    color: #e3a414;
    background: rgba(227,164,20,0.08);
    border: 1px solid rgba(227,164,20,0.2);
    border-radius: 6px;
    padding: 7px 10px;
    margin-top: 4px;
    line-height: 1.4;
}

.pf-embed-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.pf-embed-action-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid;
}
.pf-embed-generate {
    background: rgba(0,212,170,0.1);
    border-color: rgba(0,212,170,0.3);
    color: #00d4aa;
}
.pf-embed-generate:hover {
    background: rgba(0,212,170,0.2);
}
.pf-embed-regenerate {
    background: rgba(88,166,255,0.1);
    border-color: rgba(88,166,255,0.3);
    color: #58a6ff;
}
.pf-embed-regenerate:hover {
    background: rgba(88,166,255,0.2);
}
.pf-embed-revoke {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.25);
    color: #ef4444;
}
.pf-embed-revoke:hover {
    background: rgba(239,68,68,0.18);
}
.pf-embed-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Portfolio Statistics */
/* ═══ Portfolio Analytics (Statistics Tab) ═══ */
.pf-analytics-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 8px 0 16px;
}
.pf-akpi {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pf-akpi-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pf-akpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.pf-akpi-sub {
    font-size: 11px;
    color: var(--text-muted);
}
.pf-analytics-section {
    margin-bottom: 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 16px;
}
.pf-analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.pf-analytics-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pf-chart-wrap {
    position: relative;
    height: 280px;
}
.pf-chart-medium {
    height: 220px;
}

/* Toggle buttons */
.pf-analytics-toggle {
    display: flex;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.pf-atoggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.pf-atoggle-btn.active {
    background: rgba(0,212,170,0.15);
    color: #00d4aa;
}

/* Range pills */
.pf-analytics-pills {
    display: flex;
    gap: 3px;
}
.pf-apill {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.pf-apill.active, .pf-apill:hover {
    background: rgba(0,212,170,0.12);
    border-color: rgba(0,212,170,0.3);
    color: #00d4aa;
}

/* Risk cards */
.pf-risk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.pf-risk-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px;
}
.pf-risk-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.pf-risk-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.pf-risk-desc {
    font-size: 10px;
    color: var(--text-muted);
}
.pf-risk-gauge {
    margin-bottom: 8px;
}
.pf-risk-track {
    position: relative;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: visible;
}
.pf-risk-gradient {
    background: linear-gradient(90deg, #ef4444 0%, #eab308 35%, #22c55e 60%, #00d4aa 100%);
    opacity: 0.4;
}
.pf-risk-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #0ea5e9);
    border-radius: 4px;
}
.pf-risk-marker {
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pf-risk-value {
    font-size: 12px;
    font-weight: 700;
    color: #00d4aa;
    background: var(--bg-primary, #0d1117);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}
.pf-risk-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
}
.pf-risk-benchmark {
    text-align: center;
}
.pf-risk-bm-badge {
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Sector table */
.pf-sector-table {
    max-height: 260px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .pf-analytics-kpis { grid-template-columns: repeat(2, 1fr); }
    .pf-risk-grid { grid-template-columns: 1fr; }
}

/* Benchmark selector bar */
.pf-benchmark-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 12px;
    gap: 12px;
}
.pf-benchmark-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pf-benchmark-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pf-benchmark-vs {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}
.pf-benchmark-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(0,212,170,0.12);
    color: #00d4aa;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,212,170,0.25);
    letter-spacing: 0.3px;
}
.pf-benchmark-search-wrap {
    position: relative;
    flex: 0 0 200px;
}
.pf-benchmark-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 5px 10px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s;
}
.pf-benchmark-input:focus {
    border-color: rgba(0,212,170,0.4);
}
.pf-benchmark-input::placeholder {
    color: var(--text-muted);
}
.pf-benchmark-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 4px;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--glow-md);
}
.pf-benchmark-dropdown.active {
    display: block;
}
.pf-bm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.pf-bm-item:hover {
    background: rgba(0,212,170,0.08);
}
.pf-bm-sym {
    font-size: 12px;
    font-weight: 700;
    color: #00d4aa;
    min-width: 50px;
}
.pf-bm-name {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
