            #warningPopup {
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.80);
                z-index: 2000;
                justify-content: center;
                align-items: center;
            }
        
            #warningPopup.active {
                display: flex !important;
            }
            :root {
                --color1: #006eff;
                --color2: #b554aa;
                --color3: #00c6ff;
                --text1: #f0f0f0;
                --text2: #ddd;
                --text3: #fff;
                --bg1: #3d3d96;
                --bg2: #15233f;
                --bg3: #003042;
                --bg4: #006594;
                --tab-inactive-bg: #23243a;
                --tab-active-bg: linear-gradient(90deg, #c0203b 0%, #2364a1 100%);
            }

            body {
                font-family: 'Poppins', sans-serif;
                background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3), var(--bg4));
                background-size: 400% 400%;
                animation: animatedBackground 12s ease infinite;
                color: var(--text1);
                min-height: 100vh;
                padding: 20px;
                overflow-x: hidden;
                display: grid;
                align-content: center;
                align-items: center;
                justify-items: center;
                transition: color 1.5s ease;
            }

            @keyframes animatedBackground {
                0% {
                    background-position: 0% 50%;
                }
                50% {
                    background-position: 100% 50%;
                }
                100% {
                    background-position: 0% 50%;
                }
            }
            .choices[data-type*=select-multiple] .choices__inner, .choices[data-type*=text] .choices__inner {
                border-color: #006eff!important;
            }
            .copy_signal_btn_otc,
            .copy_signal_btn_real {
                cursor: pointer;
                background: linear-gradient(90deg, #c0203b 0%, #2364a1 100%);
                border: none;
                color: var(--text1);
                font-weight: 700;
                border-radius: 40px;
                text-transform: uppercase;
                transition: all 0.18s;
                margin-top: 1.2rem;
                font-size: 1rem;
                min-width: 165px;
                box-shadow: 0 4px 15px #001c3824;
                margin-bottom: 10px;
            }

            .main-container {
                background: rgb(0 0 0 / 33%);
                backdrop-filter: blur(9px);
                padding: 38px 24px 24px 24px;
                border-radius: 20px;
                box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
                width: 100%;
                max-width: 540px;
                text-align: center;
                border: 1px solid rgba(255, 255, 255, 0.09);
                color: var(--text1);
                margin: 0 auto;
                position: relative;
            }

            .main-container h1 {
                animation: colorChange 15s ease infinite;
                margin-bottom: 0.3rem;
                font-weight: 700;
                letter-spacing: 2px;
                text-transform: uppercase;
                color: var(--color1);
            }

            .main-container p {
                animation: textColorChange 15s ease infinite;
                margin-bottom: 1.3rem;
                color: var(--text1);
                font-weight: 300;
            }

            .form-group {
                animation: colorChange 15s ease infinite;
                font-weight: 600;
            }

            /* Tabs */
            .tab-switch-row {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 0;
                margin-bottom: 18px;
                margin-top: 5px;
            }
            label {
            font-size: 15px;
            }
            .tab-switch-btn {
                flex: 1;
                border: none;
                outline: none;
                background: var(--tab-inactive-bg);
                color: #c4e5ff;
                font-weight: 600;
                font-size: 1.09rem;
                padding: 10px 0 10px 0;
                border-radius: 16px 16px 0 0;
                margin: 0 3px;
                transition: background 0.18s, color 0.16s;
                cursor: pointer;
                box-shadow: none;
                position: relative;
                z-index: 1;
            }

            .tab-switch-btn.active {
                background: linear-gradient(90deg, #c0203b 0%, #2364a1 100%);
                color: #fff;
                box-shadow: 0 2px 18px rgba(0, 0, 0, 0.12);
            }

            .tab-switch-btn:not(.active):hover {
                color: var(--color1);
                background: #23243acc;
            }

            /* Label color */
            .form-label {
                animation: colorChange 15s ease infinite;
                font-weight: 600;
                color: var(--color1);
                margin-bottom: 0.5rem;
                /* margin-top: 10px; */
                display: block;
                text-align: left;
                font-size: 15px;
            }

            /* Inputs and selects */
            .form-control {
                background-color: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(255, 255, 255, 0.2);
                animation: textColorChange 15s ease infinite;
                color: var(--text1);
                border-radius: 10px;
                transition: all 0.3s ease;
                width: 100%;
                min-width: 0;
                font-size: 14px!important;
            }

            .form-control:focus,
            select:focus,
            input[type="time"]:focus,
            input[type="number"]:focus,
            input[type="date"]:focus {
                border-color: var(--color1) !important;
                box-shadow: 0 0 12px #e9456055 !important;
                background-color: rgba(36, 45, 78, 0.96) !important;
                color: #fff !important;
            }

            .form-control option {
                background-color: var(--bg3);
                color: var(--text1);
            }

            /* Real Market - single select styling fix */
            #cbAtivo:disabled,
            #cbAtivo option:disabled {
                color: #d2d8e1 !important;
                background: #222432 !important;
            }

            /* OTC Choices.js styling */
            .choices__inner {
                background: #20223b !important;
                color: #e8f6ff !important;
                border-radius: 10px !important;
                min-height: 44px;
                border: 1px solid #e9456095 !important;
                padding: 7px 7px 2px 7px !important;
                box-shadow: none !important;
            }

            .choices__list--multiple .choices__item {
                background: #0e213e;
                color: #a1e2ff;
                border-radius: 9px;
                font-size: 14px;
                margin-bottom: 5px;
                margin-right: 5px;
                padding: 4px 10px;
                border: 1px solid #00c6ff95;
                box-shadow: 0 2px 12px #00c6ff22;
            }

            .choices__list--dropdown,
            .choices__list[role=listbox] {
                background: #18192d !important;
                color: #fff !important;
                border-radius: 12px;
                font-size: 15px;
                max-height: 220px;
            }

            .choices__item--selectable.is-highlighted,
            .choices__item--selectable.is-selected {
                background-color: #184cc9bb !important;
                color: #fff !important;
            }

            /* Generate Button */
            .btn-generate {
                background: linear-gradient(90deg, #c0203b 0%, #2364a1 100%);
                border: none;
                color: var(--text1);
                padding: 13px 0;
                font-weight: 700;
                border-radius: 40px;
                text-transform: uppercase;
                letter-spacing: 1px;
                transition: all 0.18s;
                margin-top: 1.2rem;
                width: 100%;
                font-size: 1.13rem;
                box-shadow: 0 4px 15px #001c3824;
                /* animation: colorChange 15s ease infinite; */
            }

            .btn-generate:hover,
            .btn-generate:focus {
                background: linear-gradient(90deg, #e94560 40%, #00c6ff 100%);
                color: #fff !important;
                box-shadow: 0 8px 32px #e9456062;
                transform: translateY(-2px) scale(1.03);
            }

            /* Footer links */
            .footer-links {
                animation: textColorChange 15s ease infinite;
                margin-top: 2rem;
                font-size: 1.06rem;
            }

            .choices__input {
                background: transparent !important;
            }

            .footer-links a {
                color: var(--text1);
                text-decoration: none;
                margin: 0 10px;
                transition: color 0.3s;
            }

            .footer-links a:hover {
                color: var(--color1);
            }

            #signalOutput,
            #otcSignalOutput {
    /*             margin-top: 22px; */
                background: transparent;
                padding: 18px;
                border-radius: 10px;
                max-height: 300px;
                overflow-y: auto;
                color: var(--text1);
                font-family: monospace;
                text-align: center;
                /* white-space: pre-wrap; */
                font-size: 1rem;
            }

            @keyframes colorChange {

                0%,
                100% {
                    color: var(--color1);
                }

                33% {
                    color: var(--color2);
                }

                66% {
                    color: var(--color3);
                }
            }

            @keyframes textColorChange {

                0%,
                100% {
                    color: var(--text1);
                }

                33% {
                    color: var(--text2);
                }

                66% {
                    color: var(--text3);
                }
            }

            /* Hide conditional fields unless active */
            .conditional-field {
                display: none;
            }

            .conditional-field.active {
                display: block;
            }

            /* Welcome Screen Style */
            #welcomePage .infinity-logo {
                width: 120px;
                height: 60px;
                margin-bottom: 14px;
                filter: drop-shadow(0 3px 12px #e9456065);
            }

            #welcomePage h1 {
                color: var(--color1);
                font-size: 2.3rem;
                margin-top: 0.7rem;
            }

            #welcomePage p {
                margin-top: 0.5rem;
                margin-bottom: 1.6rem;
                font-size: 1.15rem;
                color: #fff;
                font-weight: 400;
                letter-spacing: 0.2px;
            }

            #welcomeBtnRow {
                margin-top: 26px;
                margin-bottom: 25px;
                display: flex;
                justify-content: center;
                gap: 28px;
            }

            .welcome-btn {
                background: linear-gradient(90deg, #c0203b 0%, #2364a1 100%);
                color: #fff;
                border: none;
                padding: 18px 36px;
                border-radius: 18px;
                font-size: 1.21rem;
                font-weight: 600;
                cursor: pointer;
                transition: background 0.22s, box-shadow 0.22s, color 0.16s;
                margin: 0 14px;
                box-shadow: 0 2px 15px #000a;
            }

            .welcome-btn:hover {
                background: linear-gradient(90deg, #e94560 20%, #00c6ff 100%);
                color: #fff;
                transform: scale(1.03);
                box-shadow: 0 8px 22px #e9456042;
            }

            #welcomePage .footer-links {
                margin-top: 2.6rem;
            }

            #welcomeNote {
                margin-top: 1.2rem;
                font-size: 1.08rem;
                color: #ffd6ec;
                text-align: center;
            }

            /* Responsive tweaks */
            @media (max-width: 540px) {
                .main-container {
                    padding: 10px 3px;
                    max-width: 99vw;
                }

                #welcomeBtnRow {
                    flex-direction: column;
                    gap: 15px;
                }
            }
    /* --- Universal Responsive Fixes --- */

    /* Make sure html and body use full width and have no extra spacing */
    html, body {
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        overflow-x: hidden;
    }

    body {
        min-height: 100vh;
        min-width: 100vw;
    }

    /* Main container adaptive sizing */
    .main-container {
        width: 96vw;
        max-width: 540px;
        min-width: 0;
        margin: 12px auto;
        padding: 36px 16px 18px 16px;
    }

    /* Logo scaling */
    .infinity-logo {
        width: 110px;
        height: auto;
        max-width: 33vw;
        margin-bottom: 13px;
    }

    /* Buttons and tabs */
    .welcome-btn, .btn-generate {
        font-size: 1.02rem;
        padding: 14px 0;
        min-width: 200px;
    }

    @media (max-width: 700px) {
        .main-container {
            max-width: 99vw;
            padding: 16px 3vw 13px 3vw;
        }
        .footer-links {
            font-size: 0.97rem;
            margin-top: 1.6rem;
        }
        .infinity-logo {
            width: 75px;
            max-width: 38vw;
        }
        .tab-switch-row {
            flex-direction: column;
            gap: 2px;
        }
        .tab-switch-btn {
            font-size: 1rem;
            padding: 10px 0;
            width: 100%;
            margin: 2px 0;
        }
        #welcomeBtnRow {
            flex-direction: column;
            gap: 15px;
        }
    }

    @media (max-width: 500px) {
        .main-container {
            padding: 10px 1vw 10px 1vw;
            min-width: unset;
            max-width: 99vw;
            border-radius: 11px;
        }
        .infinity-logo {
            width: 62px;
            margin-bottom: 9px;
        }
        h1, #welcomePage h1 {
            font-size: 1.35rem !important;
            margin-top: 0.23rem;
        }
        p, #welcomePage p {
            font-size: 1.01rem !important;
        }
        .tab-switch-btn {
            font-size: 0.98rem;
            border-radius: 9px 9px 0 0;
        }
        .form-label {
            font-size: 14px;
        }
        .form-control, select, input[type="time"], input[type="number"], input[type="date"] {
            font-size: 0.97rem;
            min-height: 37px;
        }
        .footer-links {
            margin-top: 1.1rem;
            font-size: 0.92rem;
        }
        #welcomeNote {
            font-size: 0.95rem;
            margin-top: 0.7rem;
        }
    }

    /* Ensure the warning popup covers everything and its content is centered and scrollable if needed */
    #warningPopup, #passwordModal {
        align-items: center;
        justify-content: center;
        padding: 0;
        min-height: 100vh;
        min-width: 100vw;
        z-index: 3000;
    }

    #warningPopup > div, #passwordModal > .modal-content {
        width: 99vw;
        max-width: 410px;
        min-width: 0;
        margin: 0 auto;
        font-size: 1.02rem;
        padding: 18px 5vw;
    }

    @media (max-width: 360px) {
        .main-container, #warningPopup > div, #passwordModal > .modal-content {
            padding: 5vw 1vw 5vw 1vw;
            font-size: 0.91rem;
        }
        .form-control, select, input[type="time"], input[type="number"], input[type="date"] {
            font-size: 0.89rem;
        }
        .welcome-btn, .btn-generate {
            font-size: 0.97rem;
            padding: 11px 0;
        }
    }

    #signalOutput, #otcSignalOutput {
        font-size: 0.98rem;
        padding: 10px 4px 13px 4px;
        max-width: 99vw;
        box-sizing: border-box;
    }

    /* Choices.js Fixes for mobile */
    .choices__inner, .choices__list--dropdown, .choices__list[role=listbox] {
        font-size: 1rem;
        min-width: 0;
        max-width: 100vw;
        word-break: break-word;
    }

    @media (max-width: 450px) {
        .choices__inner, .choices__list--dropdown, .choices__list[role=listbox] {
            font-size: 0.96rem;
            padding-left: 3px !important;
            padding-right: 3px !important;
        }
    }
    @media (max-width: 600px) {
    .form-label {
        font-size: 1rem !important;
        line-height: 1.1 !important;
        white-space: normal !important;
        word-break: break-word;
    }
    .form-row {
        display: flex !important;
        flex-direction: row;
        gap: 6px;
    }
    .form-row .form-group.col {
        flex: 1 1 0;
        min-width: 0;
        margin-bottom: 0;
        padding-right: 3px;
        padding-left: 3px;
    }
    }
