/* 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: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 44px;
    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: 6px 0 0 6px;
}

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

.split-arrow-btn svg {
    width: 14px;
    height: 14px;
}

.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: calc(50vh + 32px);
    transform: translateY(-50%);
    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, left 0.3s cubic-bezier(0.4, 0, 0.2, 1), right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    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;
}

/* Keep each edge arrow on the seam between an open side menu and the page. */
@media (min-width: 769px) {
    .split-ghost-left {
        left: 260px;
    }

    body.sidebar-closed .split-ghost-left {
        left: 0;
    }

    body.right-sidebar-open .split-ghost-right {
        right: 260px;
    }

    body:not(.sidebar-closed) .split-ghost-left.visible,
    body.right-sidebar-open .split-ghost-right.visible {
        opacity: 1;
    }
}

/* 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;
}
html[data-theme="light"] .wl-skel-cell {
    background: linear-gradient(90deg, #d5dbe3 25%, #f4f6f8 50%, #d5dbe3 75%);
    background-size: 400px 100%;
}

.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 0 auto;
    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;
}
.bot-mark {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
    overflow: visible;
    pointer-events: none;
}
.bot-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-muted);
    white-space: nowrap;
}
.bot-credit .bot-mark {
    width: 20px;
    height: 20px;
}
.cc-meta:has(.bot-credit) {
    justify-content: space-between;
}
.cc-meta-end {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
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;
    /* Same ink as the stock chart / :root --gain — light theme --gain is darker. */
    --pf-gain: #4d9e6e;
}

.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: 4px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 4px;
}

.pf-tab-btn {
    flex: 1;
    text-align: center;
    font-size: 13px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    color: var(--text-muted) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font-sans);
}

.pf-tab-btn:hover {
    color: var(--text-primary) !important;
    background: transparent !important;
}

.pf-tab-btn.active {
    color: var(--text-primary) !important;
    background: var(--bg-elevated) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28) !important;
    font-weight: 600;
}

html[data-theme="light"] .pf-tab-bar {
    background: #e8ecf0;
}

html[data-theme="light"] .pf-tab-btn.active {
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

.pf-skel {
    display: grid;
    gap: 12px;
}

.pf-skel-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

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

.pf-tx-field[hidden] { display: none; }

.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-hours { width: 110px; }
.pf-tx-hours-box {
    height: 34px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
}
.pf-tx-hours-box input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--neon, #00e5ff);
}

.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;
}
.pf-tx-row.is-focus { background: color-mix(in srgb, var(--accent, #5fd4e6) 16%, transparent); }

/* 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;
}

html[data-theme="light"] .investing-btn--primary {
    color: #f4f6f8;
}

html[data-theme="light"] .investing-btn--primary:hover {
    background: #0f766e;
    color: #f4f6f8;
    opacity: 1;
}

.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: color-mix(in srgb, var(--pf-gain) 12%, transparent);
    border-color: color-mix(in srgb, var(--pf-gain) 30%, transparent);
    color: var(--pf-gain);
}
.pf-embed-generate:hover {
    background: color-mix(in srgb, var(--pf-gain) 20%, transparent);
}
.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(auto-fit, minmax(150px, 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: color-mix(in srgb, var(--pf-gain) 15%, transparent);
    color: var(--pf-gain);
}

/* 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: color-mix(in srgb, var(--pf-gain) 12%, transparent);
    border-color: color-mix(in srgb, var(--pf-gain) 30%, transparent);
    color: var(--pf-gain);
}

/* 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, var(--loss) 0%, #eab308 45%, var(--pf-gain) 100%);
    opacity: 0.4;
}
.pf-risk-fill {
    height: 100%;
    background: var(--pf-gain);
    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: var(--pf-gain);
    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;
}

.pf-attr-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.pf-attr-kpis {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
}
.pf-attr-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 12px;
}
.pf-attr-table {
    width: 100%;
    min-width: 640px;
}
.pf-attr-note {
    margin: 10px 0 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.45;
}
.pf-attr-empty {
    padding: 16px 4px;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .pf-analytics-kpis { grid-template-columns: repeat(2, 1fr); }
    .pf-attr-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-bm-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 12px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: 13px;
}
.pf-bm-confirm[hidden] { display: none; }
.pf-bm-confirm-actions { display: flex; gap: 8px; }
.pf-bm-save, .pf-bm-cancel {
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: inherit;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
}
.pf-bm-save { background: var(--accent, #3b6cff); color: #fff; border-color: transparent; }
.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: color-mix(in srgb, var(--pf-gain) 12%, transparent);
    color: var(--pf-gain);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--pf-gain) 25%, transparent);
    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: color-mix(in srgb, var(--pf-gain) 40%, transparent);
}
.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: color-mix(in srgb, var(--pf-gain) 8%, transparent);
}
.pf-bm-sym {
    font-size: 12px;
    font-weight: 700;
    color: var(--pf-gain);
    min-width: 50px;
}
.pf-bm-name {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Saved alert editor */
.alert-detail-view .wl-header .alert-detail-heading,
.alert-create-view .wl-header .alert-detail-heading {
    flex: 1 1 auto;
    min-width: 0;
}
.alert-mark-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.alert-mark-icon svg {
    width: 16px;
    height: 16px;
}
.alert-detail-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.alert-detail-title-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}
.alert-name-input {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0 0 2px;
    cursor: text;
    border-bottom: 1px solid color-mix(in srgb, var(--text-muted) 45%, transparent);
}
.alert-name-input:hover,
.alert-name-input:focus {
    border-bottom-color: var(--neon);
}
.alert-create-view .wl-title-input::placeholder,
.alert-detail-view .wl-title-input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}
.alert-detail-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.alert-detail-sub {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
}
.alert-create-body,
.alert-edit-body {
    container-type: inline-size;
    container-name: alert-form;
}
.alert-form-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.alert-edit-body {
    padding: 20px 20px 28px;
    overflow-y: auto;
    flex: 1;
}
.alert-form-side .alert-field-group {
    margin: 0;
}
@container alert-form (min-width: 760px) {
    .alert-form-split {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
        column-gap: 32px;
        align-items: start;
    }
    .alert-form-side .alert-text-field {
        min-height: 140px;
    }
}
.alert-edit-body .alert-field-group + .alert-field-group,
.alert-edit-body .alert-create-submit {
    margin-top: 16px;
}
.alert-schedule-box .alert-field-group + .alert-field-group { margin-top: 16px; }
.alert-schedule-box [hidden] { display: none !important; }
#alert-event-section { margin-bottom: 32px; }
#alert-schedule-section { margin-bottom: 16px; }
.alert-weekday-group { flex-wrap: wrap; }
.alert-weekday-group .alert-toggle-btn { flex: 1 1 52px; min-width: 0; padding: 8px 4px; }
.alert-text-field {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border, rgba(0, 240, 255, 0.18));
    border-radius: 8px;
    background: var(--bg-card, rgba(255, 255, 255, 0.03));
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    outline: none;
}
textarea.alert-text-field {
    resize: vertical;
    min-height: 76px;
}
.alert-text-field:focus {
    border-color: var(--neon-cyan, #0e7490);
}
.alert-text-field::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}
.alert-detail-copy {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary);
    white-space: pre-wrap;
}
.alert-cancel-link {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--loss, #b91c1c);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
html[data-theme="light"] .alert-text-field {
    background: #ffffff;
    border-color: #d5dbe3;
    color: #111827;
}
html[data-theme="light"] .alert-text-field::placeholder {
    color: #9ca3af;
}
html[data-theme="light"] .alert-text-field:focus {
    border-color: #0e7490;
}
.alert-notif-banner.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
@media (max-width: 768px) {
    .alert-notif-banner-inner {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px 10px;
    }
    .alert-notif-banner-icon,
    .alert-notif-banner .alert-bot-btn,
    .alert-notif-banner-more,
    .alert-notif-banner-clear-all,
    .alert-notif-banner-dismiss {
        flex-shrink: 0;
    }
    .alert-notif-banner-msg {
        min-width: 0;
        white-space: normal;
        overflow: hidden;
    }
    .alert-notif-more-prefix,
    .alert-notif-more-suffix {
        display: none;
    }
}
.alert-event-options {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border, rgba(0, 240, 255, 0.12));
}
.alert-event-options[hidden] { display: none !important; }
.alert-event-options .alert-field-label { margin-bottom: 8px; }
.alert-option-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 10px;
    margin-top: 8px;
}
.alert-option-name {
    flex: 0 0 92px;
    padding-top: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.alert-option-row .alert-pill-grid { flex: 1 1 180px; }

/* Watchlist / portfolio aggregate list — same card row as the library list,
   with ticker, up, down, and (portfolios) day-return columns. */
#investing-content > .lib-view .lib-view-toggle {
    flex-shrink: 0;
}
.inv-list-wrap {
    min-width: 0;
}
.inv-list-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 34px 8px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.inv-day-name {
    flex: 1;
    min-width: 0;
    padding-left: 26px;
}
.inv-day-head,
.inv-day-col {
    width: 64px;
    flex-shrink: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.inv-day-head--day,
.inv-day-col--day {
    width: 84px;
}
.inv-day-col {
    font-size: 12px;
    color: var(--text-muted);
}
.inv-day-col--up { color: var(--gain); }
.inv-day-col--down { color: var(--loss); }
.inv-day-head--io,
.inv-day-col--io {
    width: 220px;
    text-align: left;
}
.inv-scr-io {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    width: 100%;
}
.inv-scr-n {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}
.inv-scr-n--in { color: var(--gain); }
.inv-scr-n--out { color: var(--loss); }
.inv-scr-names {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-secondary);
}
.inv-list-wrap--screeners { overflow-x: auto; }
.inv-list-wrap--screeners .inv-list-head,
.inv-list-wrap--screeners .lib-card--row { min-width: 720px; }
@media (max-width: 768px) {
    .inv-list-wrap { overflow-x: auto; }
    .inv-day-head,
    .inv-day-col { width: 48px; }
    .inv-day-head--day,
    .inv-day-col--day { width: 68px; }
    .inv-day-head--io,
    .inv-day-col--io { width: 180px; }
}
.pf-tx-case { min-width: 0; }
.pf-case-row { display: flex; align-items: center; gap: 4px; }
.pf-case-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  max-width: 200px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}
.pf-case-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
  font-size: 12px;
}
.pf-case-btn svg { flex-shrink: 0; }
.pf-case-btn:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.pf-case-btn--icon {
    width: 34px;
    max-width: none;
    padding: 0;
    justify-content: center;
}
.pf-tx-cash-symbol {
    display: flex;
    align-items: center;
    height: 34px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-sizing: border-box;
}
.pf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.pf-case-clear {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.alert-table .st-nav-mark--code,
.nav-tree-item .st-nav-mark--code,
.alert-detail-heading .st-nav-mark--code {
    width: auto;
    min-width: 26px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 10px;
    letter-spacing: 0.03em;
    flex: 0 0 auto;
}
.alert-detail-heading .st-nav-mark--code {
    min-width: 32px;
    height: 28px;
    border-radius: 14px;
    font-size: 12px;
}
.alert-strategy-open {
    display: inline-block;
    margin-top: 12px;
    color: var(--text-primary);
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.pf-case-clear:hover { color: var(--text-primary); }
.pf-tx-notes { flex: 2 1 160px; width: auto; min-width: 140px; }
@media (max-width: 768px) {
    #pf-tx-form {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .pf-tx-form-row {
        flex-wrap: nowrap;
        width: max-content;
    }
    .pf-tx-field,
    .pf-tx-notes,
    .pf-tx-case {
        flex: 0 0 auto;
    }
    .pf-tx-notes { width: 160px; min-width: 160px; }
}

/* Tools page in the main pane. Siblings stay hidden while it is open. */
#main-content.tools-open > :not(#v2-put-to-work) {
    display: none !important;
}
#main-content.tools-open,
#v2-put-to-work,
#v2-put-to-work * {
    scrollbar-width: none;
}
#main-content.tools-open::-webkit-scrollbar,
#v2-put-to-work::-webkit-scrollbar,
#v2-put-to-work *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
#v2-put-to-work[hidden] {
    display: none !important;
}
