.chart-container {
    background-color: var(--bg-box-white);
    border-radius: 6px;
}
.box-compare {
    display: grid;
    -webkit-box-pack: justify;
    justify-content: space-between;
    align-items: flex-start;
    scrollbar-width: none;
    position: relative;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 20%, 400px);
    color: var(--text-main);
}
.box-compare .box-right h2 {
    font-size: 21px;
    line-height: 28px;
    margin-bottom: 19px;
}
.box-right .list-stock, .box-right .list-industry {
    background-color: var(--bg-box-white);
    border-radius: 6px;
    margin: 0px 5px;
    padding: 1px 8px;
}
.box-right .stock-item, .box-right .industry-item {
    background-color: var(--bg-thead);
    border-radius: 6px;
}
.box-right .stock-item.hide, .box-right .industry-item.hide {
    background-color: var(--bg-box-white);
}
.box-right .ticker span:first-child, .box-right .industry span:nth-child(2) {
    color: var(--text-compare-ticker);
    font-weight: bold;
}
.box-right .ticker span:last-child, .box-right .industry span:nth-child(3) {
    font-size: 14px;
    color: var(--text-normal);
    display: inline-block;
    max-width: 186px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.box-right .industry span:nth-child(3) {
    max-width: 160px;
}
.box-right .remove-icon, .box-right .view-icon, .box-right .list-icon, #close-popup {
    cursor: pointer;
}
.box-right .view-icon, .box-right .list-icon {
    width: 18px;
    height: 18px;
}
.box-right .view-icon::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23212529' class='bi bi-eye' viewBox='0 0 16 16'%3E%3Cpath d='M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8M1.173 8a13 13 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5s3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5s-3.879-1.168-5.168-2.457A13 13 0 0 1 1.172 8z'/%3E%3Cpath d='M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0'/%3E%3C/svg%3E");
}
.box-right .view-icon.hide::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23212529' class='bi bi-eye-slash' viewBox='0 0 16 16'%3E%3Cpath d='M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7 7 0 0 0-2.79.588l.77.771A6 6 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755q-.247.248-.517.486z'/%3E%3Cpath d='M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829'/%3E%3Cpath d='M3.35 5.47q-.27.24-.518.487A13 13 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7 7 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12z'/%3E%3C/svg%3E");
}
body.dark-mode .box-right .view-icon::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23b8bed1' class='bi bi-eye' viewBox='0 0 16 16'%3E%3Cpath d='M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8M1.173 8a13 13 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5s3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5s-3.879-1.168-5.168-2.457A13 13 0 0 1 1.172 8z'/%3E%3Cpath d='M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0'/%3E%3C/svg%3E");
}
body.dark-mode .box-right .view-icon.hide::before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23b8bed1' class='bi bi-eye-slash' viewBox='0 0 16 16'%3E%3Cpath d='M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7 7 0 0 0-2.79.588l.77.771A6 6 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755q-.247.248-.517.486z'/%3E%3Cpath d='M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829'/%3E%3Cpath d='M3.35 5.47q-.27.24-.518.487A13 13 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7 7 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12z'/%3E%3C/svg%3E");
}
.box-left .nav-link {
    padding: 6px 10px;
    font-weight: 500;
    background-color: var(--bg-thead);
    color: var(--text-main);
    transition: color ease-in-out 0.3s;
}
.box-left .nav-link.active {
    background-color: #f5a502;
    color: #ffffff;
}
.chart {
    width: 100%;
    height: 600px;
}
#scatter-chart {
    height: 550px;
}
.compare-chart .type-chart {
    background-color: var(--bg-button-chart);
    position: absolute;
    top: 10px;
    right: 50px;
    padding: 3px;
    border-radius: 10px;
    z-index: 100;
}
.compare-chart .type-chart button {
    background-color: initial;
    border: none;
    color: var(--text-button-chart);
    font-size: 14px;
    border-radius: 6px;
}
.compare-chart .type-chart button.active {
    background-color: var(--bg-box-white);
}
.scatter-chart .select-smoney select {
    background-color: var(--bg-button-chart);
}
#ticker-input, #ticker-input::placeholder, #industry-input, #industry-input::placeholder {
    font-size: 13px;
}
#search-stock ul li, #search-industry ul li {
    font-size: 14px;
    cursor: pointer;
}
/* ── Ticker Popup ──────────────────────────────── */
.tp-overlay {
    position: fixed;
    top: 0;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000001;
    padding: 16px;
}

.tp-modal {
    background: var(--bg-box-white);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.tp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border-main);
    flex-shrink: 0;
}

.tp-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.tp-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.tp-modal-close:hover { color: var(--text-main); }

.tp-modal-body {
    padding: 12px 16px 0;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Search ── */
.tp-search-wrap {
    position: relative;
    margin-bottom: 8px;
    flex-shrink: 0;
}

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

.tp-search-input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--border-main);
    border-radius: 8px;
    background: var(--bg-box-white);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.tp-search-input:focus { border-color: #f5a502; }

/* ── Select-all / Deselect actions ── */
.tp-select-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.tp-select-action-btn {
    background: var(--bg-button-chart);
    border: none;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: color 0.12s;
}

.tp-select-action-btn:hover { color: #f5a502; }

.tp-select-divider {
    font-size: 11px;
    color: var(--border-main);
}

/* ── Asset logo ── */
.tp-asset-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
}

.tp-asset-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Ticker list ── */
.tp-ticker-results {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.tp-ticker-results::-webkit-scrollbar { width: 3px; }

.tp-ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}

.tp-ticker-item:hover { background: var(--bg-thead); }

.tp-ticker-item.tp-selected { background: rgba(245, 165, 2, 0.07); }

.tp-ticker-symbol {
    min-width: 48px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    flex-shrink: 0;
}

.tp-ticker-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-check-icon {
    flex-shrink: 0;
    color: #1a56db;
    display: none;
}

.tp-ticker-item.tp-selected .tp-check-icon { display: block; }

.tp-search-empty {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Footer ── */
.tp-modal-footer {
    padding: 10px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-main);
    flex-shrink: 0;
}

.tp-pending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.tp-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 10px;
    background: var(--bg-thead);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.tp-tag-remove {
    background: none;
    border: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s;
    padding: 0;
}

.tp-tag-remove:hover {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
}

.tp-footer-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.tp-btn-cancel {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-main);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.12s;
}

.tp-btn-cancel:hover {
    background: var(--bg-thead);
    color: var(--text-main);
}

.tp-btn-confirm {
    padding: 7px 20px;
    background: #f5a502;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.tp-btn-confirm:hover { opacity: 0.88; }
@media (max-width: 992px) {
    .box-compare {
        grid-template-columns: minmax(0, 1fr);
        overflow: hidden;
    }
    .box-compare .box-right {
        height: 100% !important;
        margin-top: 15px;
    }
}
@media (min-width: 992px) {
    .box-compare .box-right {
        grid-row: 1 / 999;
        grid-column: 2;
        z-index: 1;
        scrollbar-width: none;
        overflow: scroll;
        position: sticky;
        top: 60px;
    }
}
@media (max-width: 768px) {
    .popup-content {
        width: 90vw;
    }
    .scatter-controls label, .scatter-controls select {
        font-size: 15px;
    }
    .box-compare .box-right h2 {
        font-size: 19px;
        line-height: 26px;
    }
    .box-right .ticker span:first-child, .box-right .industry span:nth-child(2) {
        font-size: 15px;
    }
    .box-right .ticker span:last-child, .box-right .industry span:nth-child(3) {
        max-width: 68vw;
    }
}
@media (max-width: 480px) {
    .box-right .ticker span:last-child, .box-right .industry span:nth-child(3) {
        max-width: 60vw;
    }
}