/* ================================
   GLOBAL RESET & BASE STYLES
================================ */
* {
    box-sizing: border-box !important;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #F8FAFC;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    user-select: none;
    color: #0F172A;
    -webkit-tap-highlight-color: transparent;
}

#app-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    padding: clamp(6px, 1.2vw, 12px);
    gap: 8px;
    overflow: hidden;
}

/* ================================
   HEADER
================================ */
#portal-header {
    background: #FFFFFF;
    padding: 8px clamp(10px, 1.8vw, 16px);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    border: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
}

.logo-h2 {
    font-size: clamp(18px, 2.3vw, 22px);
    margin: 0 0 2px 0;
    line-height: 1.1;
    display: flex;
    align-items: center;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
}

.stock {
    color: #091428;
    letter-spacing: 0.3px;
}

.cipher {
    color: #008ac5;
    letter-spacing: 0.3px;
}

.pro {
    color: #ea580c;
    letter-spacing: 0.3px;
}

.tagline {
    font-size: 11.5px;
    margin: 0;
    display: flex;
    align-items: center;
    color: #64748b;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-grow: 1;
}

.user-badge {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #0F172A;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
    height: 34px;
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    background-color: #10B981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ================================
   NAV BUTTON SYSTEM
================================ */
.nav-btn {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #0F172A;
    padding: 0 12px;
    border-radius: 8px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 11.5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    white-space: nowrap;
    height: 34px;
    min-width: 34px;
    box-sizing: border-box;
    flex-shrink: 0;
    gap: 6px;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
    line-height: 1;
}

.nav-btn:hover {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
}

.nav-btn:active {
    transform: scale(0.97);
}

.nav-btn-danger {
    background-color: #FEF2F2;
    border-color: #FECACA;
    color: #DC2626;
}

.nav-btn-danger:hover {
    background-color: #FEE2E2;
    border-color: #FCA5A5;
}

/* ================================
   CONTROL DECK
================================ */
#control-panel-deck {
    padding: 8px clamp(8px, 1.5vw, 14px);
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    background-color: #FFFFFF;
    border-radius: 10px;
    align-items: center;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    width: 100%;
    flex-shrink: 0;
    overflow-x: auto;
}

.control-left-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-grow: 1;
    min-width: 0;
}

.control-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.tf-selector {
    display: flex;
    background: #F1F5F9;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    border: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.tf-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 11.5px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    color: #475569;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.18s ease;
    line-height: 1;
}

.tf-btn:hover {
    color: #0F172A;
}

.tf-btn.active {
    background: #FFFFFF;
    color: #0284C7;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* ================================
   SELECT / INPUT
================================ */
.control-select {
    height: 38px;
    padding: 0 34px 0 12px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 13px;
    background-color: #FFFFFF;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    color: #0F172A;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.control-select:hover {
    border-color: #CBD5E1;
}

.control-select:focus {
    border-color: #0284C7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.control-select:disabled {
    background-color: #F8FAFC;
    cursor: not-allowed;
    opacity: 0.7;
}

.stock-selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 2 1 300px;
    /* Gives the dropdown group priority space */
    min-width: 220px;
    flex-wrap: nowrap;
}

#sector-select {
    flex: 0 0 130px;
    min-width: 110px;
}

#stock-select {
    flex: 1 1 200px;
    min-width: 160px;
    /* Prevents it from collapsing too small */
    width: auto;
}

.control-input {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 13px;
    background: #FFFFFF;
    color: #0F172A;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.control-input:hover {
    border-color: #CBD5E1;
}

.control-input:focus {
    border-color: #0284C7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

#symbol-input {
    flex: 0 0 90px;
    width: 90px;
    text-transform: uppercase;
    text-align: center;
}

/* ================================
   ACTION BUTTONS
================================ */
.btn-primary,
.btn-secondary,
.btn-lmap,
.btn-tv {
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
    box-sizing: border-box;
    line-height: 1;
}

.btn-primary:active,
.btn-secondary:active,
.btn-lmap:active,
.btn-tv:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: #091428;
    color: #FFFFFF;
    border: 1px solid #091428;
    box-shadow: 0 2px 4px rgba(9, 20, 40, 0.18);
}

.btn-primary:hover {
    background-color: #060d1b;
    border-color: #060d1b;
    box-shadow: 0 3px 6px rgba(9, 20, 40, 0.25);
}

.btn-secondary {
    background-color: #008ac5;
    color: #FFFFFF;
    border: 1px solid #008ac5;
    box-shadow: 0 2px 4px rgba(0, 138, 197, 0.18);
}

.btn-secondary:hover {
    background-color: #0073a5;
    border-color: #0073a5;
    box-shadow: 0 3px 6px rgba(0, 138, 197, 0.25);
}

.btn-secondary.active {
    background-color: #005c84;
    border-color: #005c84;
}

.btn-lmap {
    background-color: #ea580c;
    color: #FFFFFF;
    border: 1px solid #ea580c;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.18);
}

.btn-lmap:hover {
    background-color: #c74a07;
    border-color: #c74a07;
    box-shadow: 0 3px 6px rgba(234, 88, 12, 0.25);
}

/* TradingView button — purple accent */
.btn-tv {
    background-color: #6D28D9;
    color: #FFFFFF;
    border: 1px solid #6D28D9;
    box-shadow: 0 2px 4px rgba(109, 40, 217, 0.25);
}

.btn-tv:hover {
    background-color: #5B21B6;
    border-color: #5B21B6;
    box-shadow: 0 3px 6px rgba(109, 40, 217, 0.35);
}

/* ================================
   MAIN CONTENT AREA
================================ */
#main-content-area {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 10px;
}

.home-widgets-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}

.home-widgets-container iframe {
    border: none;
    border-radius: 10px;
    width: 100%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    flex-shrink: 0;
}

#chart-display-container {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    padding: 6px;
    box-sizing: border-box;
}

#chart-display-container.split-mode-active {
    display: flex;
    flex-direction: row;
    gap: 6px;
}

#chart-display-container.split-mode-active #chart-plot-area {
    width: 50%;
    height: 100%;
}

#chart-display-container.split-mode-active #lmap-display-area {
    width: 50%;
    height: 100%;
}

#chart-display-container.single-mode-active #chart-plot-area {
    width: 100%;
    height: 100%;
}

#chart-display-container.single-mode-active #lmap-display-area {
    display: none;
}

#chart-plot-area,
#lmap-display-area {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* ================================
   TRADINGVIEW LIGHTWEIGHT CHART CONTAINER
================================ */
#tv-chart-container {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    padding: 0;
    box-sizing: border-box;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#tv-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #FFFFFF;
    color: #0F172A;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #E2E8F0;
}

#tv-chart-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

#tv-chart-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6D28D9, #8B5CF6);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}

#tv-chart-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#tv-chart-header-text h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#tv-chart-header-text p {
    margin: 0;
    font-size: 11px;
    color: #64748B;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

#tv-chart-ohlc {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'IBM Plex Sans', monospace;
    font-size: 12.5px;
    color: #475569;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#tv-chart-ohlc span b {
    font-weight: 500;
    color: #0F172A;
    margin-left: 4px;
}

#tv-chart-close-btn {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

#tv-chart-close-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #FECACA;
}

#tv-chart-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
    position: relative;
    background: #FFFFFF;
}

/* Watermark overlay for TV chart */
#tv-chart-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    text-align: center;
    opacity: 0.05;
    user-select: none;
}

#tv-chart-watermark .wm-title {
    font-size: clamp(28px, 6vw, 56px);
    font-weight: 400;
    letter-spacing: 3px;
    color: #000000;
    line-height: 1.2;
}

#tv-chart-watermark .wm-sub {
    font-size: clamp(10px, 2vw, 14px);
    letter-spacing: 4px;
    color: #000000;
    margin-top: 6px;
    font-weight: 400;
}

/* ================================
   LOADING
================================ */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    width: 100%;
    height: 100%;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
}

.circular-loader {
    width: 100%;
    height: 100%;
    animation: rotate 2s linear infinite;
}

.loader-path {
    stroke: url(#gradient);
    stroke-width: 4;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* ================================
   SPLASH SCREEN — WITH FIREFLIES
================================ */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: opacity 0.3s ease;
    opacity: 1;
}

#splash-screen.hide {
    opacity: 0;
    pointer-events: none;
}

#splash-screen img {
    position: relative;
    z-index: 2;
    display: block;
    width: clamp(360px, 45vw, 520px);
    max-width: 75vw;
    max-height: 70vh;
    height: auto;
    margin: 0;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.9));
}

/* ================================
   FIREFLIES
================================ */
.fireflies {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.firefly {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 20px;
    animation: ease 200s alternate infinite;
    pointer-events: none;
}

.firefly::before,
.firefly::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform-origin: -10vw;
}

.firefly::before {
    background: #000;
    opacity: 0.4;
    animation: drift ease alternate infinite;
}

.firefly::after {
    background: #fff;
    opacity: 0;
    box-shadow: 0 0 0 0 yellow;
    animation: drift ease alternate infinite, flash ease infinite;
}

/* ================================
   RANDOMIZED MOTION PER FIREFLY
   (pre-computed since CSS has no random())
================================ */

.firefly:nth-child(1) {
    animation-name: move1;
}

.firefly:nth-child(1)::before {
    animation-duration: 11s;
}

.firefly:nth-child(1)::after {
    animation-duration: 11s, 6800ms;
    animation-delay: 0ms, 1250ms;
}

.firefly:nth-child(2) {
    animation-name: move2;
}

.firefly:nth-child(2)::before {
    animation-duration: 14s;
}

.firefly:nth-child(2)::after {
    animation-duration: 14s, 8200ms;
    animation-delay: 0ms, 3400ms;
}

.firefly:nth-child(3) {
    animation-name: move3;
}

.firefly:nth-child(3)::before {
    animation-duration: 9s;
}

.firefly:nth-child(3)::after {
    animation-duration: 9s, 9500ms;
    animation-delay: 0ms, 2100ms;
}

.firefly:nth-child(4) {
    animation-name: move4;
}

.firefly:nth-child(4)::before {
    animation-duration: 12s;
}

.firefly:nth-child(4)::after {
    animation-duration: 12s, 7300ms;
    animation-delay: 0ms, 5600ms;
}

.firefly:nth-child(5) {
    animation-name: move5;
}

.firefly:nth-child(5)::before {
    animation-duration: 16s;
}

.firefly:nth-child(5)::after {
    animation-duration: 16s, 6100ms;
    animation-delay: 0ms, 800ms;
}

/* ================================
   MOVEMENT KEYFRAMES
================================ */
@keyframes move1 {
    0% {
        transform: translateX(-38vw) translateY(22vh) scale(.4)
    }

    25% {
        transform: translateX(31vw) translateY(-44vh) scale(.9)
    }

    50% {
        transform: translateX(-12vw) translateY(15vh) scale(.6)
    }

    75% {
        transform: translateX(45vw) translateY(-20vh) scale(1)
    }

    100% {
        transform: translateX(-30vw) translateY(38vh) scale(.7)
    }
}

@keyframes move2 {
    0% {
        transform: translateX(45vw) translateY(-15vh) scale(.8)
    }

    20% {
        transform: translateX(-25vw) translateY(40vh) scale(.5)
    }

    40% {
        transform: translateX(18vw) translateY(-35vh) scale(1)
    }

    60% {
        transform: translateX(-40vw) translateY(12vh) scale(.6)
    }

    80% {
        transform: translateX(28vw) translateY(-25vh) scale(.9)
    }

    100% {
        transform: translateX(-15vw) translateY(30vh) scale(.7)
    }
}

@keyframes move3 {
    0% {
        transform: translateX(12vw) translateY(35vh) scale(.6)
    }

    33% {
        transform: translateX(-42vw) translateY(-18vh) scale(1)
    }

    66% {
        transform: translateX(35vw) translateY(-8vh) scale(.5)
    }

    100% {
        transform: translateX(-20vw) translateY(42vh) scale(.9)
    }
}

@keyframes move4 {
    0% {
        transform: translateX(-30vw) translateY(-30vh) scale(.5)
    }

    25% {
        transform: translateX(38vw) translateY(18vh) scale(.9)
    }

    50% {
        transform: translateX(-8vw) translateY(-42vh) scale(.7)
    }

    75% {
        transform: translateX(22vw) translateY(28vh) scale(1)
    }

    100% {
        transform: translateX(-45vw) translateY(-10vh) scale(.6)
    }
}

@keyframes move5 {
    0% {
        transform: translateX(28vw) translateY(-40vh) scale(.9)
    }

    20% {
        transform: translateX(-18vw) translateY(25vh) scale(.5)
    }

    40% {
        transform: translateX(42vw) translateY(-12vh) scale(.7)
    }

    60% {
        transform: translateX(-35vw) translateY(-32vh) scale(1)
    }

    80% {
        transform: translateX(15vw) translateY(38vh) scale(.6)
    }

    100% {
        transform: translateX(-28vw) translateY(-20vh) scale(.8)
    }
}

/* ================================
   DRIFT + FLASH ANIMATIONS
================================ */
@keyframes drift {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes flash {

    0%,
    30%,
    100% {
        opacity: 0;
        box-shadow: 0 0 0 0 yellow;
    }

    5% {
        opacity: 1;
        box-shadow: 0 0 20px 4px yellow;
    }
}

/* ================================
   TOAST NOTIFICATION
================================ */
#toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0F172A;
    color: #FFFFFF;
    padding: 18px 22px;
    border-radius: 14px;
    box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    font-size: 13.5px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    z-index: 9999;
    display: none;
    flex-direction: column;
    gap: 10px;
    border-left: 4px solid #10B981;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 400px;
    width: calc(100% - 48px);
    overflow: hidden;
}

#toast-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

@keyframes slideUp {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.toast-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    font-size: 15px;
    transition: background 0.2s, color 0.2s;
}

.toast-icon-wrap.error {
    background: rgba(238, 5, 79, 0.15);
    color: #EE054F;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.toast-line-1 {
    font-weight: 400;
    color: #F8FAFC;
    font-size: 14px;
    letter-spacing: 0.1px;
}

.toast-line-2 {
    font-weight: 400;
    font-size: 12.5px;
    color: #94A3B8;
    line-height: 1.5;
}

.toast-close-btn {
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    flex-shrink: 0;
    transition: color 0.15s;
    line-height: 1;
}

.toast-close-btn:hover {
    color: #F8FAFC;
}

.toast-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 10.5px;
    color: #64748B;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.toast-footer .brand-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 400;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #10B981, #34D399);
    border-radius: 0 3px 3px 0;
    transition: width 4.5s linear;
}

.toast-progress.error {
    background: linear-gradient(90deg, #EE054F, #F87171);
}

/* ================================
   WATCHLIST MODAL
================================ */
#watchlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.watchlist-card {
    background: #FFFFFF;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #E2E8F0;
}

.watchlist-photo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
}

.watchlist-photo-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.watchlist-photo-icon {
    width: 40px;
    height: 40px;
    background: #FEF9E7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EAB308;
    font-size: 20px;
    border: 1px solid #FDE68A;
}

.watchlist-photo-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: #0F172A;
    line-height: 1.2;
}

.watchlist-photo-title p {
    margin: 0;
    font-size: 11.5px;
    color: #64748B;
    font-weight: 400;
}

.watchlist-photo-close {
    background: #F1F5F9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.15s;
}

.watchlist-photo-close:hover {
    background: #E2E8F0;
}

.watchlist-photo-search-bar {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    align-items: center;
    flex-wrap: nowrap;
}

.watchlist-photo-search-bar .search-select-wrapper {
    flex: 1;
    position: relative;
    min-width: 0;
}

.watchlist-photo-search-bar select {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    padding: 0 36px 0 14px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13.5px;
    background: #FFFFFF;
    color: #0F172A;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.watchlist-photo-search-bar select:focus {
    border-color: #0284C7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.watchlist-photo-search-bar .add-btn {
    background: #0284C7;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 0 18px;
    height: 42px;
    font-weight: 400;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    font-family: 'IBM Plex Sans', sans-serif;
    flex-shrink: 0;
}

.watchlist-photo-search-bar .add-btn:hover {
    background: #0369A1;
}

.watchlist-photo-search-bar .add-btn:active {
    transform: scale(0.97);
}

.watchlist-photo-list {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
}

.watchlist-photo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 16px;
    gap: 10px;
    transition: box-shadow 0.15s;
}

.watchlist-photo-item:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    border-color: #CBD5E1;
}

.watchlist-photo-item-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.watchlist-photo-symbol-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.watchlist-photo-symbol {
    font-weight: 400;
    font-size: 14.5px;
    color: #0F172A;
}

.watchlist-photo-sector-badge {
    font-size: 10px;
    font-weight: 400;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    border: 1px solid transparent;
    line-height: 1.3;
}

.sector-badge-commercial-banks {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.sector-badge-index {
    background: #E0E7FF;
    color: #3730A3;
    border-color: #C7D2FE;
}

.sector-badge-investment {
    background: #DBEAFE;
    color: #1E40AF;
    border-color: #BFDBFE;
}

.sector-badge-hydropower {
    background: #D1FAE5;
    color: #065F46;
    border-color: #A7F3D0;
}

.sector-badge-development-banks {
    background: #FCE7F3;
    color: #9D174D;
    border-color: #FBCFE8;
}

.sector-badge-finance {
    background: #FFE4E6;
    color: #9F1239;
    border-color: #FECDD3;
}

.sector-badge-life-insurance {
    background: #F3E8FF;
    color: #6B21A8;
    border-color: #E9D5FF;
}

.sector-badge-non-life-insurance {
    background: #FFF7ED;
    color: #9A3412;
    border-color: #FED7AA;
}

.sector-badge-microfinance {
    background: #CCFBF1;
    color: #115E59;
    border-color: #99F6E4;
}

.sector-badge-hotels {
    background: #FEF9C3;
    color: #854D0E;
    border-color: #FEF08A;
}

.sector-badge-manufacturing {
    background: #E5E7EB;
    color: #374151;
    border-color: #D1D5DB;
}

.sector-badge-others {
    background: #F1F5F9;
    color: #475569;
    border-color: #E2E8F0;
}

.sector-badge-tradings {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
}

.watchlist-photo-name {
    font-size: 12px;
    color: #64748B;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watchlist-photo-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.watchlist-photo-actions button {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.watchlist-photo-actions button:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.watchlist-photo-actions .btn-chart {
    color: #0284C7;
    border-color: #BAE6FD;
    background: #F0F9FF;
}

.watchlist-photo-actions .btn-chart:hover {
    background: #E0F2FE;
}

.watchlist-photo-actions .btn-delete {
    color: #DC2626;
    border-color: #FECACA;
    background: #FEF2F2;
}

.watchlist-photo-actions .btn-delete:hover {
    background: #FEE2E2;
}

.watchlist-photo-actions .btn-lmap {
    color: #EA580C;
    border-color: #FED7AA;
    background: #FFF7ED;
}

.watchlist-photo-actions .btn-lmap:hover {
    background: #FFEDD5;
}

.watchlist-photo-footer {
    padding: 12px 18px;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: flex-end;
    background: #FFFFFF;
}

.watchlist-photo-footer button {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 8px 28px;
    font-weight: 400;
    font-size: 13.5px;
    color: #0F172A;
    cursor: pointer;
    transition: background 0.15s;
    font-family: 'IBM Plex Sans', sans-serif;
}

.watchlist-photo-footer button:hover {
    background: #E2E8F0;
}

/* ================================
   LOGIN MODAL
================================ */
#login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    color: #f2f2f2;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
    font-family: 'IBM Plex Sans', 'Lato', sans-serif;
    line-height: 1.5;
}

#stars,
#stars2,
#stars3 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

#stars {
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: 1743px 129px #FFF, 452px 1823px #FFF, 1204px 482px #FFF, 892px 1540px #FFF, 123px 782px #FFF, 1902px 342px #FFF, 541px 1192px #FFF, 1654px 920px #FFF, 321px 1450px #FFF, 1120px 1729px #FFF, 78px 391px #FFF, 1489px 1083px #FFF, 622px 590px #FFF, 1782px 1650px #FFF, 934px 210px #FFF, 345px 1289px #FFF, 1210px 843px #FFF, 1601px 1892px #FFF, 489px 650px #FFF, 1342px 1120px #FFF;
    animation: animStar 50s linear infinite;
}

#stars::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: 1743px 129px #FFF, 452px 1823px #FFF, 1204px 482px #FFF, 892px 1540px #FFF, 123px 782px #FFF, 1902px 342px #FFF, 541px 1192px #FFF, 1654px 920px #FFF, 321px 1450px #FFF, 1120px 1729px #FFF, 78px 391px #FFF, 1489px 1083px #FFF, 622px 590px #FFF, 1782px 1650px #FFF, 934px 210px #FFF, 345px 1289px #FFF, 1210px 843px #FFF, 1601px 1892px #FFF, 489px 650px #FFF, 1342px 1120px #FFF;
}

#stars2 {
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow: 420px 810px #FFF, 1240px 1350px #FFF, 310px 190px #FFF, 1720px 1120px #FFF, 850px 430px #FFF, 1400px 1820px #FFF, 210px 630px #FFF, 1150px 1040px #FFF, 640px 1670px #FFF, 1780px 300px #FFF;
    animation: animStar 100s linear infinite;
}

#stars2::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow: 420px 810px #FFF, 1240px 1350px #FFF, 310px 190px #FFF, 1720px 1120px #FFF, 850px 430px #FFF, 1400px 1820px #FFF, 210px 630px #FFF, 1150px 1040px #FFF, 640px 1670px #FFF, 1780px 300px #FFF;
}

#stars3 {
    width: 3px;
    height: 3px;
    background: transparent;
    box-shadow: 120px 400px #FFF, 1600px 1300px #FFF, 800px 200px #FFF, 300px 1700px #FFF, 1400px 700px #FFF;
    animation: animStar 150s linear infinite;
}

#stars3::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 3px;
    height: 3px;
    background: transparent;
    box-shadow: 120px 400px #FFF, 1600px 1300px #FFF, 800px 200px #FFF, 300px 1700px #FFF, 1400px 700px #FFF;
}

@keyframes animStar {
    from {
        transform: translateY(0px);
    }

    to {
        transform: translateY(-2000px);
    }
}

.login-card {
    width: 100%;
    max-width: 650px;
    max-height: 92vh;
    margin: auto;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 24px 32px;
    border-radius: 20px;
    background-color: #ffffff;
    color: #0F172A;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-card::-webkit-scrollbar {
    display: none;
}

.login-card .terms-container,
.login-card div:has(> a[href*="Terms"]) {
    margin-top: -4px;
    margin-bottom: -4px;
}

.login-card .copyright-text,
.login-card div:has(> *:contains("Copyright")) {
    margin-top: -4px;
}

/* ================================
   BACKTEST DRAWER PANEL
================================ */
#backtest-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 780px;
    height: 100vh;
    background: #FFFFFF;
    z-index: 3000;
    box-shadow: -30px 0 80px -20px rgba(15, 23, 42, 0.4);
    transform: translateX(105%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid #E2E8F0;
}

#backtest-drawer.open {
    transform: translateX(0);
}

.backtest-drawer-header {
    background: linear-gradient(135deg, #0B1A30 0%, #1A2F4A 100%);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.backtest-drawer-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.backtest-drawer-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #FCD535, #F0B90B);
    color: #0B1A30;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(240, 185, 11, 0.35);
}

.backtest-drawer-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.backtest-drawer-title-text h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 400;
    color: #FFFFFF;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backtest-drawer-title-text p {
    margin: 0;
    font-size: 11.5px;
    color: #94A3B8;
    font-weight: 400;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.backtest-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CBD5E1;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.backtest-close-btn:hover {
    background: rgba(238, 5, 79, 0.25);
    color: #FFFFFF;
    border-color: rgba(238, 5, 79, 0.5);
}

.backtest-drawer-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #F8FAFC;
}

.backtest-drawer-body::-webkit-scrollbar {
    width: 6px;
}

.backtest-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.backtest-drawer-body::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.backtest-drawer-body::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.bt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 600px) {
    .bt-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.bt-kpi-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bt-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.bt-kpi-label {
    font-size: 10.5px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.bt-kpi-value {
    font-size: 24px;
    font-weight: 400;
    color: #0B1A30;
    font-family: 'JetBrains Mono', 'IBM Plex Sans', monospace;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.bt-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bt-tp-rates {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

.bt-tp-rates-title {
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #0B1A30;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.bt-tp-rates-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bt-tp-rate-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bt-tp-rate-label {
    font-size: 12px;
    font-weight: 400;
    color: #0B1A30;
    min-width: 52px;
    font-family: 'JetBrains Mono', 'IBM Plex Sans', monospace;
}

.bt-tp-rate-bar-track {
    flex-grow: 1;
    height: 10px;
    background: #F1F5F9;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.bt-tp-rate-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #34D399);
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.bt-tp-rate-value {
    font-size: 11.5px;
    font-weight: 400;
    color: #475569;
    min-width: 100px;
    text-align: right;
    font-family: 'JetBrains Mono', 'IBM Plex Sans', monospace;
}

.bt-setups-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 2px solid #E2E8F0;
    flex-wrap: wrap;
}

.bt-setups-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bt-setups-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    color: #0284C7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.bt-setups-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bt-setups-title-text h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    color: #0B1A30;
    letter-spacing: 0.1px;
}

.bt-setups-title-text p {
    margin: 0;
    font-size: 11.5px;
    color: #64748B;
    font-weight: 400;
}

.bt-setups-count {
    font-size: 11.5px;
    font-weight: 400;
    color: #0284C7;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.bt-setups-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bt-setup-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.bt-setup-card:hover {
    border-color: #CBD5E1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.bt-setup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    gap: 10px;
    flex-wrap: wrap;
}

.bt-setup-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bt-setup-outcome-badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bt-setup-outcome-badge.win {
    background: #D1FAE5;
    color: #065F46;
}

.bt-setup-outcome-badge.loss {
    background: #FEE2E2;
    color: #991B1B;
}

.bt-setup-outcome-badge.open {
    background: #FEF3C7;
    color: #92400E;
}

.bt-setup-head-date {
    font-size: 12px;
    color: #64748B;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bt-setup-pnl-badge {
    font-size: 12px;
    font-weight: 400;
    font-family: 'JetBrains Mono', 'IBM Plex Sans', monospace;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.bt-setup-pnl-badge.win {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.bt-setup-pnl-badge.loss {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.bt-setup-pnl-badge.open {
    background: #FFFBEB;
    color: #D97706;
    border: 1px solid #FDE68A;
}

.bt-setup-body {
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}

@media (max-width: 600px) {
    .bt-setup-body {
        grid-template-columns: 1fr;
    }
}

.bt-setup-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.bt-setup-field-label {
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bt-setup-field-value {
    font-size: 14px;
    font-weight: 400;
    color: #0B1A30;
    font-family: 'JetBrains Mono', 'IBM Plex Sans', monospace;
}

.bt-setup-field-value.muted {
    color: #64748B;
    font-weight: 400;
    font-size: 13px;
}

.bt-tp-hit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 400;
    color: #065F46;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 2px 4px 2px 0;
    font-family: 'JetBrains Mono', 'IBM Plex Sans', monospace;
}

.bt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: #64748B;
}

.bt-empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FCD535, #F0B90B);
    color: #0B1A30;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 22px;
    box-shadow: 0 8px 28px rgba(240, 185, 11, 0.3);
}

.bt-empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 400;
    color: #0B1A30;
}

.bt-empty-state p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #64748B;
    max-width: 380px;
}

.bt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
}

.bt-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #E2E8F0;
    border-top: 4px solid #F0B90B;
    border-radius: 50%;
    animation: btSpin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes btSpin {
    to {
        transform: rotate(360deg);
    }
}

.bt-loading-text {
    font-size: 15px;
    font-weight: 400;
    color: #0B1A30;
    margin-bottom: 6px;
}

.bt-loading-sub {
    font-size: 12.5px;
    color: #64748B;
    font-weight: 400;
}

/* ================================
   RESPONSIVE ADJUSTMENTS (FIXED)
================================ */
@media (max-width: 1024px) {
    #control-panel-deck {
        gap: 6px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-lmap,
    .btn-tv {
        padding: 0 10px;
        font-size: 11.5px;
    }
}

@media (max-width: 900px) {
    #control-panel-deck {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        overflow-x: visible;
    }

    .control-left-group {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    .control-right-group {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .stock-selector-group {
        width: 100%;
        max-width: none;
        justify-content: center;
        flex: 1 1 100%;
    }

    #sector-select {
        flex: 1 1 40%;
        min-width: 0;
    }

    #stock-select {
        flex: 1 1 55%;
        min-width: 0;
    }

    #symbol-input {
        flex: 0 0 100px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-lmap,
    .btn-tv {
        flex: 1 1 auto;
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    #backtest-drawer {
        max-width: 100%;
    }

    #portal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        justify-content: center;
    }

    .user-badge {
        width: 100%;
        justify-content: center;
        font-size: 10.5px;
    }

    .tf-selector {
        width: 100%;
        justify-content: center;
    }

    .tf-btn {
        flex: 1;
        text-align: center;
    }

    #symbol-input {
        flex: 1 1 100%;
        width: 100%;
        text-align: center;
    }

    #chart-display-container.split-mode-active {
        flex-direction: column;
    }

    #chart-display-container.split-mode-active #chart-plot-area,
    #chart-display-container.split-mode-active #lmap-display-area {
        width: 100%;
        height: 50%;
    }
}

@media (max-width: 600px) {
    #control-panel-deck {
        padding: 10px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-lmap,
    .btn-tv {
        flex: 1 1 45%;
        min-width: 0;
        padding: 0 8px;
        font-size: 11px;
        height: 36px;
    }

    .btn-primary span,
    .btn-secondary span,
    .btn-lmap span,
    .btn-tv span {
        font-size: 10.5px;
    }

    .stock-selector-group {
        flex-wrap: wrap;
    }

    #sector-select,
    #stock-select {
        width: 100%;
        flex: 1 1 100%;
    }

    .nav-btn,
    .tf-btn {
        flex-grow: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-btn span:not(.fa):not(.fas):not(.far):not(.fab) {
        display: none;
    }

    .nav-btn {
        padding: 0 10px;
    }

    .btn-primary span,
    .btn-secondary span,
    .btn-lmap span,
    .btn-tv span {
        display: inline;
    }

    .btn-primary,
    .btn-secondary,
    .btn-lmap,
    .btn-tv {
        flex: 1 1 100%;
        justify-content: center;
        width: 100%;
    }

    .watchlist-card {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 14px;
    }

    .watchlist-photo-search-bar {
        flex-wrap: wrap;
    }

    .watchlist-photo-search-bar .search-select-wrapper {
        flex: 1 1 100%;
    }

    .watchlist-photo-search-bar .add-btn {
        width: 100%;
        justify-content: center;
    }

    .watchlist-photo-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .watchlist-photo-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .watchlist-photo-header {
        padding: 12px 14px;
    }

    .watchlist-photo-title h3 {
        font-size: 14px;
    }

    .watchlist-photo-icon {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }
}

/* ================================
   MOBILE SCROLL FIX
================================ */
@media (max-width: 900px) {

    html,
    body {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    #app-wrapper {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        overflow-x: hidden;
    }

    #main-content-area {
        flex-grow: 0;
        overflow-y: visible;
        min-height: auto;
        padding-bottom: 20px;
    }

    #chart-display-container,
    #tv-chart-container {
        min-height: 70vh;
    }
}