#tonghop-tab{display:none;width:100%;flex:1}
#tonghop-tab.active{display:flex!important;flex-direction:column;flex:1;width:100%;min-height:calc(100vh - 75px);height:calc(100vh - 75px);max-height:calc(100vh - 75px);overflow:hidden;box-sizing:border-box}
.th-container{display:flex;flex-direction:column;gap:10px;padding:10px 12px;background:#f4f6f8;border-radius:12px;border:1px solid rgba(15,23,42,.14);flex:1;min-height:100%;height:100%;max-height:100%;overflow:hidden;box-sizing:border-box;color:#0f172a;font-family:Segoe UI,system-ui,sans-serif}
.th-ticker-wrap{flex:0 0 auto}
.th-ticker{display:flex;gap:4px;overflow-x:auto;padding-bottom:2px}
.th-ticker-card{position:relative;flex:0 0 auto;min-width:102px;max-width:118px;background:#fff;border:1px solid rgba(15,23,42,.16);border-radius:6px;padding:4px 6px;cursor:pointer;transition:border-color .2s,box-shadow .2s}
.th-ticker-card:hover{border-color:rgba(59,130,246,.55)}
.th-ticker-card.active{border-color:#3b82f6;box-shadow:0 0 0 1px rgba(59,130,246,.35)}
.th-ticker-top{display:flex;justify-content:space-between;align-items:baseline;gap:4px;margin-bottom:1px;padding-right:10px}
.th-ticker-code{font-size:9px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.15px}
.th-ticker-name{font-size:8px;color:#94a3b8;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:1px}
.th-ticker-price{font-size:11px;font-weight:800;color:#0f172a;letter-spacing:-.15px;line-height:1.1;margin:0;margin-right:10px;white-space:nowrap}
.th-ticker-chg{font-size:8px;font-weight:700;display:inline-flex;align-items:center;gap:1px;padding:0 4px;border-radius:3px;line-height:14px}
.th-ticker-chg.up{background:rgba(16,185,129,.15);color:#059669}
.th-ticker-chg.down{background:rgba(239,68,68,.15);color:#dc2626}
.th-sparkline-box{margin-top:3px;width:100%;height:16px}
.th-sparkline{width:100%;height:100%;display:block}
.th-up{color:#059669}.th-down{color:#dc2626}
.th-main{display:grid;grid-template-columns:260px minmax(0,1fr) 345px;gap:8px;flex:1;min-height:0;height:100%;max-height:100%;overflow:hidden;box-sizing:border-box}
.th-left,.th-right{background:#fff;border:1px solid rgba(15,23,42,.16);border-radius:10px;padding:0;overflow:hidden;height:100%!important;max-height:100%!important;min-height:0!important;box-sizing:border-box!important}
.th-left{width:260px!important;min-width:260px!important;max-width:260px!important;padding:10px;overflow-y:auto}
.th-right{width:345px!important;min-width:345px!important;max-width:345px!important}
.th-detail-empty{color:#64748b;font-size:12px;text-align:center;padding:40px 10px}
.th-pd-head{display:flex;align-items:flex-start;gap:8px;margin-bottom:8px}
.th-pd-icon{font-size:18px;line-height:1}
.th-pd-title{font-size:13px;font-weight:800;color:#0f172a;text-transform:uppercase;letter-spacing:.3px}
.th-pd-badges{display:flex;align-items:center;gap:6px;margin-top:3px}
.th-pd-code-badge{background:#2563eb;color:#fff;font-size:10px;font-weight:800;padding:1px 6px;border-radius:4px;font-family:monospace}
.th-pd-exch{font-size:11px;color:#64748b;font-weight:600}
.th-pd-price-row{display:flex;align-items:baseline;gap:6px;margin:6px 0 2px}
.th-pd-price{font-size:22px;font-weight:800}
.th-pd-ccy{font-size:11px;color:#64748b}
.th-pd-chg{font-size:12px;font-weight:700;margin-bottom:10px}
.th-pd-section{margin-top:10px;padding-top:10px;border-top:1px solid rgba(15,23,42,.1)}
.th-pd-section-title{font-size:10px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;color:#2563eb;margin-bottom:6px}
.th-pd-section-title.muted{color:#0f172a}
.th-pd-row{display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:11px;color:#475569;padding:4px 0;border-bottom:1px solid rgba(15,23,42,.06)}
.th-pd-row:last-child{border-bottom:none}
.th-pd-row .lbl{display:flex;align-items:center;gap:5px}
.th-pd-row .val{color:#0f172a;font-weight:700;text-align:right}
.th-pd-checks{list-style:none;padding:0;margin:0}
.th-pd-checks li{font-size:12px;color:#0f172a;font-weight:600;line-height:1.45;padding:5px 0;display:flex;gap:6px;align-items:flex-start}
.th-pd-checks li::before{content:"\2713";color:#059669;font-weight:800}
.th-center{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;height:100%;max-height:100%;overflow:hidden;box-sizing:border-box}
.th-chart-wrap{background:#fff;border:1px solid rgba(15,23,42,.16);border-radius:10px;display:flex;flex-direction:column;min-height:240px;flex:1 1 52%;overflow:hidden;box-sizing:border-box}
.th-chart-head{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid rgba(15,23,42,.1);flex-wrap:wrap}
.th-chart-title{font-weight:700;font-size:13px}
.th-chart-tfs{display:flex;gap:4px}
.th-tf-btn{background:transparent;border:1px solid rgba(15,23,42,.18);color:#64748b;border-radius:4px;padding:2px 8px;font-size:11px;cursor:pointer}
.th-tf-btn.active{background:rgba(59,130,246,.15);border-color:#3b82f6;color:#1d4ed8}
.th-open-full-chart{margin-left:auto;background:rgba(59,130,246,.1);border:1px solid rgba(59,130,246,.35);color:#1d4ed8;border-radius:6px;padding:4px 10px;font-size:11px;font-weight:600;cursor:pointer}
.th-chart{flex:1;min-height:180px;position:relative;background:#fff}
.th-chart-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#64748b;font-size:13px}
.th-table-wrap{background:#fff;border:1px solid rgba(15,23,42,.16);border-radius:10px;display:flex;flex-direction:column;flex:1 1 48%;min-height:220px;overflow:hidden;box-sizing:border-box}
.th-table-tabs{display:flex;align-items:center;gap:6px;padding:8px 10px;border-bottom:1px solid rgba(15,23,42,.1);overflow-x:auto;flex-shrink:0}
.th-cat-btn{background:transparent;border:1px solid rgba(15,23,42,.16);color:#64748b;border-radius:999px;padding:4px 10px;font-size:11px;cursor:pointer;white-space:nowrap}
.th-order-tab{border-style:dashed}
.th-order-subfilter-btn{background:transparent;border:1px solid rgba(148,163,184,.3);color:#94a3b8;border-radius:4px;padding:3px 10px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s}
.th-order-subfilter-btn:hover{background:rgba(59,130,246,.12);color:#38bdf8;border-color:rgba(59,130,246,.4)}
.th-order-subfilter-btn.active{background:#3b82f6;border-color:#3b82f6;color:#fff}
.th-tab-divider{display:inline-block;width:2px;height:20px;background:rgba(15,23,42,.22);margin:0 8px;border-radius:2px;flex-shrink:0}
.th-table-scroll{overflow-y:auto;overflow-x:auto;flex:1;min-height:0}
.th-table-scroll.hidden{display:none!important}
#th-market-panel{overflow-x:hidden!important}
.th-table{width:100%!important;max-width:100%!important;border-collapse:collapse;font-size:11px;text-align:right;white-space:nowrap;table-layout:fixed;box-sizing:border-box}
.th-table th{position:sticky;top:0;background:#f8fafc;color:#64748b;font-size:11px;padding:6px 3px;border-bottom:1px solid rgba(15,23,42,.12);z-index:1;box-sizing:border-box;white-space:nowrap}
.th-table th.th-left,.th-table td.th-left{text-align:left}
.th-table td{padding:5px 3px;border-bottom:1px solid rgba(15,23,42,.08);cursor:pointer;font-size:11px;font-variant-numeric:tabular-nums;transition:background-color .3s ease;box-sizing:border-box;white-space:nowrap}
.th-table tbody tr:hover{background:rgba(15,23,42,.04)}
.th-table tbody tr.selected{background:rgba(59,130,246,.12)}
.th-table .td-code{font-family:monospace;font-weight:700;color:#0284c7;font-size:11px}
.th-table th:nth-child(1),.th-table td:nth-child(1){width:12%;padding-left:6px}
.th-table th:nth-child(2),.th-table td:nth-child(2){width:26%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.th-table th:nth-child(3),.th-table td:nth-child(3){width:9%}
.th-table th:nth-child(4),.th-table td:nth-child(4){width:9%}
.th-table th:nth-child(5),.th-table td:nth-child(5){width:8.5%}
.th-table th:nth-child(6),.th-table td:nth-child(6){width:9%}
.th-table th:nth-child(7),.th-table td:nth-child(7){width:9%}
.th-table th:nth-child(8),.th-table td:nth-child(8){width:9%}
.th-table th:nth-child(9),.th-table td:nth-child(9){width:8.5%;padding-right:6px}
/* Order panels inside the center table */
.th-order-table{width:100%;border-collapse:collapse;font-size:12px;white-space:nowrap;table-layout:fixed}
.th-order-table th{position:sticky;top:0;background:#f8fafc;color:#64748b;font-size:11px;padding:8px 10px;border-bottom:1px solid rgba(15,23,42,.12);z-index:1;box-sizing:border-box}
.th-order-table th.th-col-left,.th-order-table td.th-col-left{text-align:left}
.th-order-table td{padding:8px 10px;border-bottom:1px solid rgba(15,23,42,.08);box-sizing:border-box}
.th-order-table td.td-code{font-family:monospace;font-weight:800;color:#0284c7;font-size:11px;text-align:left}
.th-order-table tbody tr:hover{background:rgba(15,23,42,.04)}

.th-ticker-x{position:absolute;top:1px;right:1px;width:12px;height:12px;padding:0;border:none;border-radius:3px;background:transparent;color:#94a3b8;font-size:11px;line-height:12px;cursor:pointer;opacity:.55;z-index:2}
.th-ticker-x:hover{opacity:1;color:#dc2626;background:rgba(220,38,38,.12)}
.th-ticker-add-wrap{position:relative;flex:0 0 auto;align-self:stretch;display:flex;align-items:center}
.th-ticker-add{width:28px;height:100%;min-height:62px;border:1px dashed rgba(15,23,42,.28);border-radius:7px;background:rgba(15,23,42,.03);color:#2563eb;font-size:22px;font-weight:300;cursor:pointer;line-height:1}
.th-ticker-add:hover{border-color:#3b82f6;color:#1d4ed8;background:rgba(59,130,246,.1)}
.th-add-picker{position:absolute;top:calc(100% + 4px);left:0;z-index:40;width:240px;background:#fff;border:1px solid rgba(15,23,42,.16);border-radius:8px;box-shadow:0 12px 28px rgba(15,23,42,.18);padding:8px;max-height:280px;display:flex;flex-direction:column;gap:6px}
.th-add-search{width:100%;box-sizing:border-box;background:#f8fafc;border:1px solid rgba(15,23,42,.16);border-radius:5px;color:#0f172a;padding:6px 8px;font-size:12px}
.th-add-results{overflow:auto;max-height:220px;display:flex;flex-direction:column;gap:2px}
.th-add-item{display:flex;flex-direction:column;align-items:flex-start;gap:1px;text-align:left;background:transparent;border:none;border-radius:5px;color:#0f172a;padding:6px 8px;cursor:pointer;font-size:11px}
.th-add-item:hover{background:rgba(59,130,246,.12)}
.th-add-item b{font-family:monospace;color:#0284c7;font-size:11px}
.th-add-item span{color:#64748b;font-size:10px;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.th-add-empty{color:#64748b;font-size:11px;padding:10px;text-align:center}
#th-chart.th-chart{min-height:280px;height:100%;display:flex;flex-direction:column;background:#fff;position:relative!important}
#th-chart #amcharts-draw-div-90{flex:1;min-height:220px;background:#fff}
#th-chart #stock-toolbar-container-90{background:#f8fafc;border-bottom:1px solid rgba(15,23,42,.1)}
@media (max-width:1100px){.th-main{grid-template-columns:1fr}.th-left,.th-right{max-height:none}}

/* SPS inline dock */
.th-right #sps-order-drawer.inline,#sps-order-drawer.inline{position:relative!important;top:auto!important;left:auto!important;width:100%!important;max-width:100%!important;min-width:100%!important;height:100%!important;max-height:100%!important;display:block!important;z-index:1;overflow:hidden!important;box-sizing:border-box!important}
#sps-order-drawer.inline .sps-drawer-overlay,#sps-order-drawer.inline .sps-drawer-close{display:none!important}
#sps-order-drawer.inline .sps-drawer-content{position:relative!important;width:100%!important;max-width:100%!important;min-width:100%!important;box-sizing:border-box!important;height:100%!important;max-height:100%!important;border-left:none!important;border-radius:10px!important;box-shadow:none!important;animation:none!important;padding:10px 8px 12px!important;overflow-y:auto!important;overflow-x:hidden!important;background:#fff;color:#0f172a}
#sps-order-park:empty{display:none}

/* ===== Dark / Cosmic: nen den + vien sang ===== */
body.dark-mode #tonghop-tab .th-container,
body.cosmic-mode #tonghop-tab .th-container{background:#000;border-color:rgba(203,213,225,.55);color:#e2e8f0}
body.dark-mode #tonghop-tab aside.th-left,
body.dark-mode #tonghop-tab .th-right,
body.dark-mode #tonghop-tab .th-chart-wrap,
body.dark-mode #tonghop-tab .th-table-wrap,
body.dark-mode #tonghop-tab .th-ticker-card,
body.cosmic-mode #tonghop-tab aside.th-left,
body.cosmic-mode #tonghop-tab .th-right,
body.cosmic-mode #tonghop-tab .th-chart-wrap,
body.cosmic-mode #tonghop-tab .th-table-wrap,
body.cosmic-mode #tonghop-tab .th-ticker-card{background:#050505;border-color:rgba(203,213,225,.55)}
body.dark-mode #tonghop-tab .th-chart-head,
body.dark-mode #tonghop-tab .th-table-tabs,
body.dark-mode #tonghop-tab .th-table th,
body.dark-mode #tonghop-tab .th-order-table th,
body.cosmic-mode #tonghop-tab .th-chart-head,
body.cosmic-mode #tonghop-tab .th-table-tabs,
body.cosmic-mode #tonghop-tab .th-table th,
body.cosmic-mode #tonghop-tab .th-order-table th{background:#000!important;border-color:rgba(203,213,225,.42)!important;color:#94a3b8!important}
body.dark-mode #tonghop-tab .th-chart,
body.dark-mode #tonghop-tab #th-chart,
body.dark-mode #tonghop-tab #amcharts-draw-div-90,
body.dark-mode #tonghop-tab #stock-toolbar-container-90,
body.cosmic-mode #tonghop-tab .th-chart,
body.cosmic-mode #tonghop-tab #th-chart,
body.cosmic-mode #tonghop-tab #amcharts-draw-div-90,
body.cosmic-mode #tonghop-tab #stock-toolbar-container-90{background:#000!important;border-color:rgba(203,213,225,.42)}
body.dark-mode #tonghop-tab .th-pd-title,
body.dark-mode #tonghop-tab .th-ticker-price,
body.dark-mode #tonghop-tab .th-pd-row .val,
body.dark-mode #tonghop-tab .th-chart-title,
body.cosmic-mode #tonghop-tab .th-pd-title,
body.cosmic-mode #tonghop-tab .th-ticker-price,
body.cosmic-mode #tonghop-tab .th-pd-row .val,
body.cosmic-mode #tonghop-tab .th-chart-title{color:#f8fafc}
body.dark-mode #tonghop-tab .th-up,body.cosmic-mode #tonghop-tab .th-up{color:#34d399}
body.dark-mode #tonghop-tab .th-down,body.cosmic-mode #tonghop-tab .th-down{color:#f87171}
body.dark-mode #tonghop-tab .th-ticker-chg.up,body.cosmic-mode #tonghop-tab .th-ticker-chg.up{color:#10b981}
body.dark-mode #tonghop-tab .th-ticker-chg.down,body.cosmic-mode #tonghop-tab .th-ticker-chg.down{color:#ef4444}
body.dark-mode #tonghop-tab #sps-order-drawer.inline .sps-drawer-content,
body.cosmic-mode #tonghop-tab #sps-order-drawer.inline .sps-drawer-content{background:#050505!important;color:#e2e8f0}
body.dark-mode #tonghop-tab .th-add-picker,body.cosmic-mode #tonghop-tab .th-add-picker{background:#050505;border-color:rgba(203,213,225,.45);color:#e2e8f0}
body.dark-mode #tonghop-tab .th-add-search,body.cosmic-mode #tonghop-tab .th-add-search{background:#000;border-color:rgba(203,213,225,.35);color:#fff}
body.dark-mode #tonghop-tab .th-table td,
body.dark-mode #tonghop-tab .th-order-table td,
body.cosmic-mode #tonghop-tab .th-table td,
body.cosmic-mode #tonghop-tab .th-order-table td{border-bottom-color:rgba(203,213,225,.28);color:#e2e8f0;background:transparent}
body.dark-mode #tonghop-tab .th-table tbody tr:hover,
body.dark-mode #tonghop-tab .th-order-table tbody tr:hover,
body.cosmic-mode #tonghop-tab .th-table tbody tr:hover,
body.cosmic-mode #tonghop-tab .th-order-table tbody tr:hover{background:rgba(255,255,255,.05)}
body.dark-mode #tonghop-tab .th-table .td-code,
body.dark-mode #tonghop-tab .th-order-table .td-code,
body.cosmic-mode #tonghop-tab .th-table .td-code,
body.cosmic-mode #tonghop-tab .th-order-table .td-code{color:#38bdf8}

/* ===== Dynamic Green / Red / Yellow Price Colors ===== */
.th-up,
.th-table td.th-up,
#tonghop-tab .th-table td.th-up,
body.dark-mode #tonghop-tab .th-table td.th-up,
body.cosmic-mode #tonghop-tab .th-table td.th-up,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table td.th-up {
    color: #10b981 !important;
    font-weight: 600;
}

.th-down,
.th-table td.th-down,
#tonghop-tab .th-table td.th-down,
body.dark-mode #tonghop-tab .th-table td.th-down,
body.cosmic-mode #tonghop-tab .th-table td.th-down,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table td.th-down {
    color: #ef4444 !important;
    font-weight: 600;
}

.th-ref,
.th-table td.th-ref,
#tonghop-tab .th-table td.th-ref,
body.dark-mode #tonghop-tab .th-table td.th-ref,
body.cosmic-mode #tonghop-tab .th-table td.th-ref,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table td.th-ref {
    color: #eab308 !important;
    font-weight: 600;
}

/* ===== Bid Always Green, Ask Always Red ===== */
.th-table td.td-bid,
.th-table th.th-col-bid,
#tonghop-tab .th-table td.td-bid,
#tonghop-tab .th-table th.th-col-bid,
body.dark-mode #tonghop-tab .th-table td.td-bid,
body.cosmic-mode #tonghop-tab .th-table td.td-bid,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table td.td-bid {
    color: #10b981 !important;
    font-weight: 600;
}

.th-table td.td-ask,
.th-table th.th-col-ask,
#tonghop-tab .th-table td.td-ask,
#tonghop-tab .th-table th.th-col-ask,
body.dark-mode #tonghop-tab .th-table td.td-ask,
body.cosmic-mode #tonghop-tab .th-table td.td-ask,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table td.td-ask {
    color: #ef4444 !important;
    font-weight: 600;
}

/* ===== Real-Time Tick Flash Animations (High-Visibility Glow) ===== */
@keyframes thFlashGreen {
    0% {
        background-color: rgba(16, 185, 129, 0.75) !important;
        box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.9);
    }
    50% {
        background-color: rgba(16, 185, 129, 0.4) !important;
        box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.5);
    }
    100% {
        background-color: transparent !important;
        box-shadow: none;
    }
}

@keyframes thFlashRed {
    0% {
        background-color: rgba(239, 68, 68, 0.75) !important;
        box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.9);
    }
    50% {
        background-color: rgba(239, 68, 68, 0.4) !important;
        box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.5);
    }
    100% {
        background-color: transparent !important;
        box-shadow: none;
    }
}

.th-table td.th-flash-up,
.th-table td.flash-up,
.th-order-table td.th-flash-up,
.th-order-table td.flash-up,
#tonghop-tab .th-table td.th-flash-up,
#tonghop-tab .th-table td.flash-up,
#tonghop-tab .th-order-table td.th-flash-up,
#tonghop-tab .th-order-table td.flash-up {
    animation: thFlashGreen 0.9s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.th-table td.th-flash-down,
.th-table td.flash-down,
.th-order-table td.th-flash-down,
.th-order-table td.flash-down,
#tonghop-tab .th-table td.th-flash-down,
#tonghop-tab .th-table td.flash-down,
#tonghop-tab .th-order-table td.th-flash-down,
#tonghop-tab .th-order-table td.flash-down {
    animation: thFlashRed 0.9s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* ===== Light mode hard overrides (toolbar + SPS) ===== */
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="finai-fav-toolbar"]{
  background:#f1f5f9!important;
  border-color:#cbd5e1!important;
  color:#0f172a!important;
}
body:not(.dark-mode):not(.cosmic-mode) #stock-toolbar-container-90 .am5stock-control,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 .am5stock-control {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 button,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 select,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 .am5stock-control-button,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 .am5stock-control-text,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 .toolbar-btn,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 .tf-btn,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="custom-indicators-btn-"],
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="bg-toggle-btn-"],
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="htf-bias-toggle-btn-"]{
  background:#fff!important;
  color:#0f172a!important;
  border:1px solid #cbd5e1!important;
}
body:not(.dark-mode):not(.cosmic-mode) #stock-toolbar-container-90 svg,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90 svg{
  filter:brightness(0.2)!important;
}
body:not(.dark-mode):not(.cosmic-mode) [id^="htf-bias-container"],
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="htf-bias-container"]{
  background:rgba(248,250,252,.95)!important;
  border:1px solid #cbd5e1!important;
  color:#0f172a!important;
  box-shadow:0 4px 12px rgba(15,23,42,.12)!important;
}
body:not(.dark-mode):not(.cosmic-mode) [id^="htf-bias-container"] table th,
body:not(.dark-mode):not(.cosmic-mode) [id^="htf-bias-container"] table td,
body:not(.dark-mode):not(.cosmic-mode) [id^="htf-bias-container"] > div,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="htf-bias-container"] table th,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="htf-bias-container"] table td,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab [id^="htf-bias-container"] > div{
  color:#334155!important;
  border-color:#e2e8f0!important;
}
body:not(.dark-mode):not(.cosmic-mode) .htf-bias-title {
  color: #0f172a !important;
}
body:not(.dark-mode):not(.cosmic-mode) .htf-bias-header {
  border-bottom-color: #cbd5e1 !important;
}

/* SPS order panel light */
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-drawer-content{
  background:#fff!important;
  color:#0f172a!important;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tab-btn{color:#64748b!important}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tab-btn.active{color:#0f172a!important;border-bottom-color:#10b981!important}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-account-badge{color:#64748b!important}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-side-toggle{background:#f1f5f9!important}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-side-btn{color:#64748b!important;background:transparent!important}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-side-btn.buy.active{background:#10b981!important;color:#fff!important}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-side-btn.sell.active{background:#ef4444!important;color:#fff!important}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-contract-card{
  background:#f8fafc!important;border:1px solid #e2e8f0!important;color:#0f172a!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-type-btn{
  background:#f1f5f9!important;border-color:#cbd5e1!important;color:#475569!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-type-btn.active{
  background:#10b981!important;border-color:#10b981!important;color:#fff!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-num-input{
  background:#f8fafc!important;border-color:#cbd5e1!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-num-input button,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-num-input input{
  color:#0f172a!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-form-group label,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-radio-group,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-prompt{
  color:#475569!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-mkt-select{
  background:#f1f5f9!important;color:#0f172a!important;border:1px solid #cbd5e1!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-green-banner{
  background:#ecfdf5!important;color:#065f46!important
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-drawer-header,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-form-group{
  border-color:#e2e8f0!important
}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-mini-table td,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-book-table td,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-portfolio-table td,
body:not(.dark-mode):not(.cosmic-mode) .sps-mini-table td,
body:not(.dark-mode):not(.cosmic-mode) .sps-book-table td,
body:not(.dark-mode):not(.cosmic-mode) .sps-portfolio-table td {
  color: #0f172a !important;
}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-mini-table td.ob-sym,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-mini-table td.th-sym,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-book-table td.ob-sym,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-book-table td.th-sym,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-portfolio-table td.ob-sym,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer.inline .sps-portfolio-table td.th-sym,
body:not(.dark-mode):not(.cosmic-mode) td.ob-sym,
body:not(.dark-mode):not(.cosmic-mode) td.th-sym {
  color: #0284c7 !important;
  font-weight: 700 !important;
}
/* ===== Light mode blue frames (chia o de nhin) ===== */
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-container{
  background:#eef4fb;
  border:1px solid #93c5fd;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-left,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-right,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-chart-wrap,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table-wrap{
  background:#ffffff;
  border:2px solid #60a5fa;
  box-shadow:0 0 0 1px rgba(59,130,246,.12);
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-ticker-card{
  border:1.5px solid #93c5fd;
  background:#ffffff;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-ticker-card.active{
  border-color:#2563eb;
  box-shadow:0 0 0 2px rgba(37,99,235,.22);
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-chart-head,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table-tabs{
  background:#eff6ff;
  border-bottom:1px solid #93c5fd;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-pd-section{
  border:1.5px solid #93c5fd;
  border-radius:8px;
  padding:10px 10px 8px;
  margin-top:10px;
  background:#f8fbff;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-pd-section-title{
  color:#1d4ed8;
  background:#dbeafe;
  margin:-10px -10px 8px;
  padding:6px 10px;
  border-radius:7px 7px 0 0;
  border-bottom:1px solid #93c5fd;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-pd-head{
  border:1.5px solid #93c5fd;
  border-radius:8px;
  padding:10px;
  background:#f8fbff;
  margin-bottom:10px;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-right #sps-order-drawer.inline .sps-drawer-content{
  border:none;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table th{
  background:#eff6ff;
  border-bottom-color:#93c5fd;
  color:#1e40af;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-tf-btn{
  border-color:#93c5fd;
  color:#1d4ed8;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-tf-btn.active{
  background:#3b82f6;
  border-color:#2563eb;
  color:#fff;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-cat-btn{
  border-color:#93c5fd;
  color:#1e40af;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-cat-btn.active{
  background:#3b82f6;
  border-color:#2563eb;
  color:#fff;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #stock-toolbar-container-90{
  background:#eff6ff!important;
  border-bottom:1px solid #93c5fd!important;
}
/* ===== Dark/Cosmic toolbar sync (kill leftover white buttons) ===== */
body.dark-mode #tonghop-tab #stock-toolbar-container-90,
body.cosmic-mode #tonghop-tab #stock-toolbar-container-90{
  background:#050505!important;
  border-bottom:1px solid rgba(148,163,184,.35)!important;
}
body.dark-mode #tonghop-tab #stock-toolbar-container-90 .am5stock-control,
body.cosmic-mode #tonghop-tab #stock-toolbar-container-90 .am5stock-control,
body.dark-mode #tonghop-tab [id^="finai-fav-toolbar"],
body.cosmic-mode #tonghop-tab [id^="finai-fav-toolbar"]{
  background:#0b0e14!important;
  border-color:#334155!important;
  color:#e2e8f0!important;
}
body.dark-mode #tonghop-tab #stock-toolbar-container-90 button,
body.cosmic-mode #tonghop-tab #stock-toolbar-container-90 button,
body.dark-mode #tonghop-tab #stock-toolbar-container-90 select,
body.cosmic-mode #tonghop-tab #stock-toolbar-container-90 select,
body.dark-mode #tonghop-tab #stock-toolbar-container-90 .am5stock-control-button,
body.cosmic-mode #tonghop-tab #stock-toolbar-container-90 .am5stock-control-button,
body.dark-mode #tonghop-tab [id^="custom-indicators-btn-"],
body.cosmic-mode #tonghop-tab [id^="custom-indicators-btn-"],
body.dark-mode #tonghop-tab [id^="bg-toggle-btn-"],
body.cosmic-mode #tonghop-tab [id^="bg-toggle-btn-"],
body.dark-mode #tonghop-tab [id^="htf-bias-toggle-btn-"],
body.cosmic-mode #tonghop-tab [id^="htf-bias-toggle-btn-"]{
  background:#1f2937!important;
  color:#e2e8f0!important;
  border:1px solid #374151!important;
  box-shadow:none!important;
}
body.dark-mode #tonghop-tab [id^="ai-analyze-btn-"],
body.cosmic-mode #tonghop-tab [id^="ai-analyze-btn-"]{
  background:linear-gradient(135deg,#8b5cf6,#6366f1)!important;
  color:#fff!important;
  border:none!important;
}
body.dark-mode #tonghop-tab #stock-toolbar-container-90 svg,
body.cosmic-mode #tonghop-tab #stock-toolbar-container-90 svg{
  filter:none!important;
}
body.dark-mode #tonghop-tab .light-chart-theme [id^="custom-indicators-btn-"],
body.cosmic-mode #tonghop-tab .light-chart-theme [id^="custom-indicators-btn-"],
body.dark-mode #tonghop-tab.light-chart-theme [id^="custom-indicators-btn-"],
body.cosmic-mode #tonghop-tab .light-chart-theme .am5stock-control-button{
  background:#1f2937!important;
  color:#e2e8f0!important;
  border-color:#374151!important;
}
body.dark-mode #tonghop-tab [id^="htf-bias-container"],
body.cosmic-mode #tonghop-tab [id^="htf-bias-container"]{
  background:rgba(15,23,42,.92)!important;
  color:#e2e8f0!important;
  border:1px solid rgba(148,163,184,.35)!important;
}
body.dark-mode #tonghop-tab .th-pd-section,
body.cosmic-mode #tonghop-tab .th-pd-section,
body.dark-mode #tonghop-tab .th-pd-head,
body.cosmic-mode #tonghop-tab .th-pd-head{
  background:transparent!important;
  border-color:rgba(148,163,184,.35)!important;
}
body.dark-mode #tonghop-tab .th-pd-section-title,
body.cosmic-mode #tonghop-tab .th-pd-section-title{
  background:rgba(30,41,59,.8)!important;
  color:#93c5fd!important;
  border-bottom-color:rgba(148,163,184,.35)!important;
}
body.dark-mode #tonghop-tab .th-tf-btn,
body.cosmic-mode #tonghop-tab .th-tf-btn,
body.dark-mode #tonghop-tab .th-cat-btn,
body.cosmic-mode #tonghop-tab .th-cat-btn{
  background:transparent!important;
  border-color:rgba(148,163,184,.4)!important;
  color:#94a3b8!important;
}
body.dark-mode #tonghop-tab .th-tf-btn.active,
body.cosmic-mode #tonghop-tab .th-tf-btn.active,
body.dark-mode #tonghop-tab .th-cat-btn.active,
body.cosmic-mode #tonghop-tab .th-cat-btn.active{
  background:#2563eb!important;
  border-color:#3b82f6!important;
  color:#fff!important;
}
body.dark-mode #tonghop-tab .th-tab-divider,
body.cosmic-mode #tonghop-tab .th-tab-divider{
  background:rgba(148,163,184,.5)!important;
  box-shadow:0 0 6px rgba(56,189,248,.35)!important;
}
body.dark-mode #tonghop-tab .th-open-full-chart,
body.cosmic-mode #tonghop-tab .th-open-full-chart{
  background:rgba(37,99,235,.2)!important;
  border-color:rgba(59,130,246,.45)!important;
  color:#93c5fd!important;
}
/* Soft scrollbar for dark panels */
body.dark-mode #tonghop-tab *::-webkit-scrollbar,
body.cosmic-mode #tonghop-tab *::-webkit-scrollbar{width:8px;height:8px}
body.dark-mode #tonghop-tab *::-webkit-scrollbar-track,
body.cosmic-mode #tonghop-tab *::-webkit-scrollbar-track{background:#0a0a0a}
body.dark-mode #tonghop-tab *::-webkit-scrollbar-thumb,
body.cosmic-mode #tonghop-tab *::-webkit-scrollbar-thumb{background:#334155;border-radius:8px}
body.dark-mode #tonghop-tab *::-webkit-scrollbar-thumb:hover,
body.cosmic-mode #tonghop-tab *::-webkit-scrollbar-thumb:hover{background:#475569}
/* Ticker show/hide bar */
.th-ticker-wrap{display:flex;flex-direction:column;gap:4px}
.th-ticker-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:22px}
.th-ticker-bar-label{font-size:11px;font-weight:700;color:#64748b;letter-spacing:.3px;text-transform:uppercase}
.th-ticker-toggle{
  border:1px solid rgba(59,130,246,.45);
  background:rgba(59,130,246,.12);
  color:#1d4ed8;
  border-radius:999px;
  padding:2px 10px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  line-height:18px;
}
.th-ticker-toggle:hover{background:rgba(59,130,246,.22)}
.th-ticker-wrap.collapsed .th-ticker{display:none}
body.dark-mode #tonghop-tab .th-ticker-bar-label,
body.cosmic-mode #tonghop-tab .th-ticker-bar-label{color:#94a3b8}
body.dark-mode #tonghop-tab .th-ticker-toggle,
body.cosmic-mode #tonghop-tab .th-ticker-toggle{
  background:rgba(59,130,246,.18);
  border-color:rgba(96,165,250,.5);
  color:#93c5fd;
}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-ticker-bar{
  border:1px solid #93c5fd;
  border-radius:8px;
  padding:4px 8px;
  background:#eff6ff;
}
/* Thong tin khac - clearer text */
body.dark-mode #tonghop-tab .th-pd-checks li,
body.cosmic-mode #tonghop-tab .th-pd-checks li{
  color:#e2e8f0!important;
  font-weight:600;
  opacity:1;
}
body.dark-mode #tonghop-tab .th-pd-row,
body.cosmic-mode #tonghop-tab .th-pd-row{color:#cbd5e1}
body.dark-mode #tonghop-tab .th-pd-row .lbl,
body.cosmic-mode #tonghop-tab .th-pd-row .lbl{color:#cbd5e1}
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-pd-checks li{
  color:#0f172a!important;
  opacity:1;
}

/* ==========================================================================
   STR DYNAMIC THEME SYSTEM — MỤC 3: GIAO DỊCH (#tonghop-tab)
   Đồng bộ 100% theo Theme Picker:
   1. Chế độ Nền: Đen (dark) / Vũ trụ nhiều màu (cosmic) / Trắng (light)
   2. Ngũ hành & Màu nhấn: Kim, Mộc, Thủy, Hỏa, Thổ & Custom Hex
   3. Viền khung: Themed borders phong thủy
   ========================================================================== */

/* 3.1 Khung tổng thể của tab */
#tonghop-tab {
    color: var(--str-text-main, #ffffff);
    background: transparent;
}

/* 3.2 Khung Container chính (.th-container) */
#tonghop-tab .th-container {
    background: var(--str-bg-card, #101010) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    color: var(--str-text-main, #ffffff) !important;
    border-radius: 14px !important;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Viền phong thủy khi bật tùy chọn */
body.str-themed-borders #tonghop-tab .th-container {
    border-color: var(--str-border-gold, rgba(56, 189, 248, 0.35)) !important;
}

/* Thích ứng 3 chế độ nền cho Th-Container */
body.cosmic-mode #tonghop-tab .th-container {
    background: var(--str-bg-card, rgba(15, 23, 42, 0.52)) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45) !important;
}

body.str-pure-black #tonghop-tab .th-container,
body.dark-mode:not(.cosmic-mode) #tonghop-tab .th-container {
    background: var(--str-bg-card, #101010) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6) !important;
}

body.str-pure-white #tonghop-tab .th-container,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-container {
    background: #ffffff !important;
    border: 1px solid var(--str-border-subtle, #e5e7eb) !important;
    color: #111827 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

/* 3.3 Dải Watchlist Ticker (.th-ticker-card & controls) */
#tonghop-tab .th-ticker-card {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

body.cosmic-mode #tonghop-tab .th-ticker-card {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #tonghop-tab .th-ticker-card,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-ticker-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* Ticker Card đang active */
#tonghop-tab .th-ticker-card.active {
    border-color: var(--str-accent, #38bdf8) !important;
    box-shadow: 0 0 0 1.5px var(--str-accent, #38bdf8), 0 4px 12px var(--str-accent-soft, rgba(56, 189, 248, 0.25)) !important;
}

#tonghop-tab .th-ticker-card:hover {
    border-color: var(--str-accent, #38bdf8) !important;
}

#tonghop-tab .th-ticker-price {
    color: var(--str-text-main, #ffffff) !important;
}

body.str-pure-white #tonghop-tab .th-ticker-price,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-ticker-price {
    color: #0f172a !important;
}

/* Nút thêm ticker */
#tonghop-tab .th-ticker-add {
    border-color: var(--str-border-subtle, rgba(255, 255, 255, 0.2)) !important;
    color: var(--str-accent, #38bdf8) !important;
    background: transparent !important;
}

#tonghop-tab .th-ticker-add:hover {
    border-color: var(--str-accent, #38bdf8) !important;
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
}

/* Popup tìm ticker (.th-add-picker) */
#tonghop-tab .th-add-picker {
    background: var(--str-bg-card, #101010) !important;
    border: 1px solid var(--str-border-gold, var(--str-border-subtle, rgba(255, 255, 255, 0.15))) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
}

body.cosmic-mode #tonghop-tab .th-add-picker {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(16px) !important;
}

body.str-pure-white #tonghop-tab .th-add-picker,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-add-picker {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12) !important;
}

#tonghop-tab .th-add-search {
    background: var(--str-bg-surface, #141414) !important;
    color: var(--str-text-main, #ffffff) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
}

body.str-pure-white #tonghop-tab .th-add-search,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-add-search {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

#tonghop-tab .th-add-search:focus {
    outline: none !important;
    border-color: var(--str-accent, #38bdf8) !important;
}

#tonghop-tab .th-ticker-toggle {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    border: 1px solid var(--str-accent, #38bdf8) !important;
    color: var(--str-accent, #38bdf8) !important;
}

/* 3.4 Cột Trái - Thông tin chi tiết sản phẩm (.th-left) */
#tonghop-tab aside.th-left {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    color: var(--str-text-main, #ffffff) !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

body.cosmic-mode #tonghop-tab aside.th-left {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #tonghop-tab aside.th-left,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab aside.th-left {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #111827 !important;
}

body.str-themed-borders #tonghop-tab aside.th-left {
    border-color: var(--str-border-gold, rgba(56, 189, 248, 0.35)) !important;
}

/* Badge mã hàng cột trái */
#tonghop-tab .th-pd-code-badge {
    background: linear-gradient(135deg, var(--str-accent, #0284c7), var(--str-accent-mid, #2563eb)) !important;
    color: var(--str-accent-fg, #ffffff) !important;
    font-weight: 800 !important;
}

/* Tiêu đề nhóm thông số */
#tonghop-tab .th-pd-section-title {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    color: var(--str-accent, #38bdf8) !important;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.08)) !important;
    border-radius: 4px !important;
    padding: 3px 6px !important;
    font-weight: 800 !important;
}

body.str-pure-white #tonghop-tab .th-pd-section-title,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-pd-section-title {
    border-bottom-color: #e2e8f0 !important;
}

/* Dòng thông số */
#tonghop-tab .th-pd-row {
    border-bottom-color: var(--str-border-subtle, rgba(255, 255, 255, 0.06)) !important;
}

#tonghop-tab .th-pd-row .lbl {
    color: var(--str-text-muted, #94a3b8) !important;
}

body.str-pure-white #tonghop-tab .th-pd-row .lbl,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-pd-row .lbl {
    color: #64748b !important;
}

#tonghop-tab .th-pd-row .val {
    color: var(--str-text-main, #ffffff) !important;
}

body.str-pure-white #tonghop-tab .th-pd-row .val,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-pd-row .val {
    color: #0f172a !important;
}

/* 3.5 Cột Giữa - Biểu đồ mini & Bảng thị trường (.th-center) */
#tonghop-tab .th-chart-wrap,
#tonghop-tab .th-table-wrap {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

body.cosmic-mode #tonghop-tab .th-chart-wrap,
body.cosmic-mode #tonghop-tab .th-table-wrap {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #tonghop-tab .th-chart-wrap,
body.str-pure-white #tonghop-tab .th-table-wrap,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-chart-wrap,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table-wrap {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.str-themed-borders #tonghop-tab .th-chart-wrap,
body.str-themed-borders #tonghop-tab .th-table-wrap {
    border-color: var(--str-border-gold, rgba(56, 189, 248, 0.35)) !important;
}

/* Header biểu đồ & Tabs bảng */
#tonghop-tab .th-chart-head,
#tonghop-tab .th-table-tabs {
    background: var(--str-bg-surface, #0f141c) !important;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
}

body.cosmic-mode #tonghop-tab .th-chart-head,
body.cosmic-mode #tonghop-tab .th-table-tabs {
    background: rgba(11, 18, 32, 0.7) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #tonghop-tab .th-chart-head,
body.str-pure-white #tonghop-tab .th-table-tabs,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-chart-head,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table-tabs {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

/* Nút Timeframe */
#tonghop-tab .th-tf-btn {
    background: transparent !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
    color: var(--str-text-muted, #94a3b8) !important;
    transition: all 0.15s ease !important;
}

body.str-pure-white #tonghop-tab .th-tf-btn,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-tf-btn {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

#tonghop-tab .th-tf-btn:hover {
    border-color: var(--str-accent, #38bdf8) !important;
    color: var(--str-accent, #38bdf8) !important;
}

#tonghop-tab .th-tf-btn.active {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.2)) !important;
    border-color: var(--str-accent, #38bdf8) !important;
    color: var(--str-accent, #38bdf8) !important;
    font-weight: 700 !important;
}

/* Nút Mở Biểu Đồ Đầy Đủ */
#tonghop-tab .th-open-full-chart {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    border: 1px solid var(--str-accent, #38bdf8) !important;
    color: var(--str-accent, #38bdf8) !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}

#tonghop-tab .th-open-full-chart:hover {
    filter: brightness(1.15) !important;
    box-shadow: 0 2px 10px var(--str-accent-soft, rgba(56, 189, 248, 0.35)) !important;
}

/* Tabs danh mục & vị thế */
#tonghop-tab .th-cat-btn {
    background: transparent !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
    color: var(--str-text-muted, #94a3b8) !important;
    transition: all 0.15s ease !important;
}

body.str-pure-white #tonghop-tab .th-cat-btn,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-cat-btn {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

#tonghop-tab .th-cat-btn:hover {
    border-color: var(--str-accent, #38bdf8) !important;
    color: var(--str-accent, #38bdf8) !important;
}

#tonghop-tab .th-cat-btn.active {
    background: linear-gradient(135deg, var(--str-accent, #0284c7), var(--str-accent-mid, #2563eb)) !important;
    border-color: var(--str-accent, #38bdf8) !important;
    color: var(--str-accent-fg, #ffffff) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px var(--str-accent-soft, rgba(56, 189, 248, 0.3)) !important;
}

#tonghop-tab .th-order-subfilter-btn.active {
    background: var(--str-accent, #38bdf8) !important;
    border-color: var(--str-accent, #38bdf8) !important;
    color: var(--str-accent-fg, #ffffff) !important;
}

/* Bảng thị trường & Bảng lệnh */
#tonghop-tab .th-table th,
#tonghop-tab .th-order-table th {
    background: var(--str-bg-surface, #141414) !important;
    color: var(--str-text-muted, #94a3b8) !important;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
}

body.cosmic-mode #tonghop-tab .th-table th,
body.cosmic-mode #tonghop-tab .th-order-table th {
    background: #0f172a !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #tonghop-tab .th-table th,
body.str-pure-white #tonghop-tab .th-order-table th,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table th,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-order-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom-color: #cbd5e1 !important;
}

#tonghop-tab .th-table td,
#tonghop-tab .th-order-table td {
    color: var(--str-text-main, #ffffff);
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.06)) !important;
}

body.str-pure-white #tonghop-tab .th-table td,
body.str-pure-white #tonghop-tab .th-order-table td,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table td,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-order-table td {
    color: #0f172a !important;
    border-bottom-color: #f1f5f9 !important;
}

#tonghop-tab .th-table tbody tr:hover,
#tonghop-tab .th-order-table tbody tr:hover {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.12)) !important;
}

#tonghop-tab .th-table tbody tr.selected {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.22)) !important;
}

#tonghop-tab .th-table .td-code,
#tonghop-tab .th-order-table .td-code {
    color: var(--str-accent, #38bdf8) !important;
    font-weight: 800 !important;
}

body.str-pure-white #tonghop-tab .th-table .td-code,
body.str-pure-white #tonghop-tab .th-order-table .td-code,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-table .td-code,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-order-table .td-code {
    color: var(--str-accent, #0284c7) !important;
}

/* 3.6 Cột Phải - Form Đặt Lệnh Trực Tiếp SPS (.th-right & drawer) */
#tonghop-tab .th-right {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

body.cosmic-mode #tonghop-tab .th-right {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #tonghop-tab .th-right,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab .th-right {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.str-themed-borders #tonghop-tab .th-right {
    border-color: var(--str-border-gold, rgba(56, 189, 248, 0.35)) !important;
}

#tonghop-tab #sps-order-drawer.inline .sps-drawer-content {
    background: transparent !important;
    color: var(--str-text-main, #ffffff) !important;
}

body.str-pure-white #tonghop-tab #sps-order-drawer.inline .sps-drawer-content,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-drawer-content {
    color: #111827 !important;
}

#tonghop-tab #sps-order-drawer.inline input,
#tonghop-tab #sps-order-drawer.inline select {
    background: var(--str-bg-surface, #0f141c) !important;
    color: var(--str-text-main, #ffffff) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
}

body.str-pure-white #tonghop-tab #sps-order-drawer.inline input,
body.str-pure-white #tonghop-tab #sps-order-drawer.inline select,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline input,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline select {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

#tonghop-tab #sps-order-drawer.inline input:focus,
#tonghop-tab #sps-order-drawer.inline select:focus {
    outline: none !important;
    border-color: var(--str-accent, #38bdf8) !important;
    box-shadow: 0 0 0 2px var(--str-accent-soft, rgba(56, 189, 248, 0.25)) !important;
}
