                /*******************************************************
                *     estos son los estilos de los selectores          *
                *      que aparecen en la pestana de grafico y niveles *      
                ********************************************************/
/* Hay 1 contenedor principal, 7 <select>, y 1 <button>, y cada uno de estos con sus contenedores:
  ------contenedor------> 
  id= #selectoresChart [barra principal; envuelve a todos los select]
  ------selectores------> 
  id= #selectorMdo [selector de mercado]
  id= #selectorActivo [selector de activo]
  id= #selectorPeriod [selector de periodo]
  id= #indicatorSelector1 [selector de indicador de precio, SMA, Bollinger...]
  id= #indicatorSelector2 [selector de indicador de bottom, RSI, Stochastics...]
  id= #trends [selector de trends, no se muestra en la pestaña de grafico, solo en levels]
  id= #pivots [selector de pivot points]
  id= #supresLevel [BOTON de soportes y resisentencias, solo en pestana levels]

  Se trabaja con la biblioteca select2 y sus clases. Si no se pone ninguno de estos id delante, la aplicará a todos.
*/
/*******este es el contenedor principal*/
#selectoresChart {
    height: 45px;
    color: white;
    background: #151f28;
    border: 1px solid black;
	display: flex !important;
    align-items: center;
    -moz-box-sizing: border-box; /*	lo mismo que box-sizing pero para navegadores antiguos */
    box-sizing: border-box;
	z-index: 2 !important;
}
#selectoresChart .select2-container {
    width: 100% !important;
}
#selectoresChart .select2-selection--single {
    box-shadow: none !important;
    background-color: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 3px !important;
    height: 26px !important;
}
#selectoresChart .select2-selection--single .select2-selection__rendered {
    line-height: 26px !important;
    font-size: 11px !important;
    color: rgba(255,255,255,0.75) !important;
    padding-left: 8px !important;
}
#selectoresChart .select2-selection--single .select2-selection__arrow {
    height: 26px !important;
}
#selectoresChart .select2-container--open .select2-selection--single {
    border-color: rgba(255,255,255,0.3) !important;
}
/*******todos los contenedores por individual*/
#mcdoCont {
    width: 20%;
    margin-left: 10px;
    margin-right: 10px;
    position: relative;
    display: inline-block;
}
#activoCont {
    width: 14%;
    min-width: 100px;
    margin-right: 6px;
    position: relative;
    display: inline-block;
}

#periodCont {
    margin-right: 6px;
    position: relative;
    display: inline-block;
}

#selector1Cont {
    width: 14%;
    min-width: 110px;
    margin-right: 6px;
    position: relative;
    display: inline-block;
}

#selector2Cont {
    width: 14%;
    min-width: 110px;
    margin-right: 6px;
    position: relative;
    display: inline-block;
}
#pivotsCont {
    margin-right: 6px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
}
/* Select2 oculto — el UI es ahora el ind-group custom */
#pivotsCont .select2-container { display: none !important; }
/*******aqui ya empiezan las clases de select2*/

.select2-dropdown {
    z-index: 99999999 !important;
    background-color: #1e2d3a !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    font-size: 11px !important;
}
.select2-results__option {
    color: rgba(255,255,255,0.75) !important;
    padding: 4px 8px !important;
}
.select2-results__option--highlighted {
    background-color: rgba(255,255,255,0.12) !important;
    color: #fff !important;
}
.select2-search--dropdown .select2-search__field {
    background-color: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    color: #fff !important;
    font-size: 11px !important;
}

/* Esto lo ponemos para hacer un display none despues en las media queries */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    display: block; 
}


#select2-selectorPeriod-container .select2-selection__rendered {
    display: none !important;
}

/*******individualizamos los dropdowns*/
.dropdown-selectorPeriod {
    width: auto !important;
    left: 0 !important;
}

.dropdown-selectorMdo,
.dropdown-selectorActivo,
.dropdown-indicatorSelector1,
.dropdown-indicatorSelector2,
.dropdown-pivots {
    left: 0 !important;
    width: 35.5% !important;
}
/******Esta es la cajita de info (tooltip) de cada selector */
.custom-tooltip {
    display: block;
    opacity: 0; /* Asegúrate de que el tooltip comience invisible para el fade in */
    border: solid 1px white;
    background-color: #398dff;
    color: white;
    font-size: 0.7rem;
    position: absolute;
    transform: translateX(-50%);

    padding: 0.2rem;
    border-radius: 0px;
    z-index: 1000;
    max-width: 50px;
    text-align: center;
    transition: opacity 0.30s ease-in-out; 
}
/******La clase del nombre del asset que aparece en la esquina izq del grafico, junto con el ultimo precio y pocentaje de subida */
#assetTag { /* El contenedor principal */
    display: flex !important;
    flex-direction: row !important;
    position: absolute !important;
    align-items: center;
    gap: 6px;
    margin-left: 5%;
    top: 2%;
    background: transparent;
    float: none;
    height: auto !important;
    width: auto !important;
    cursor: default;
}

#selectedVariationCont {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.main-asset {
    color: #333;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: 14px;
    text-align: left !important;
    opacity: 1;
    margin-right: 4px;
}
.dark-mode .main-asset {
    color: #f0f0f0;
}
.last-price {
    font-size: 10px;
    font-weight: 600;
}
.last-variation {
    margin-top: 1px;
    font-size: 10px;
    font-weight: 600;
    color: #cccccc;
}

#pcWidth {
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: #3a4460;
    border-radius: 2px;
    outline: none;
}
#pcWidth::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7a8fbb;
    cursor: pointer;
}
#pcWidth::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7a8fbb;
    cursor: pointer;
    border: none;
}
#srWidth {
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: #3a4460;
    border-radius: 2px;
    outline: none;
}
#srWidth::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7a8fbb;
    cursor: pointer;
}
#srWidth::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7a8fbb;
    cursor: pointer;
    border: none;
}

#ohlcBar {
    font-size: 10px;
    font-weight: 400;
    color: #555;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
#ohlcBar span.ohlc-label { color: #999; }
.dark-mode #ohlcBar { color: #ccc; }
.dark-mode #ohlcBar span.ohlc-label { color: #666; }

/******************************************
*              MEDIA QUERIES              *
*******************************************/

@media (max-width: 750px) {
    /* Ajustamos la barrita negra y como queremos que trate a los elementos qur tiene dentro (selectores) */
    #selectoresChart {
        display: flex;
        flex-wrap: wrap; 
        justify-content: flex-start;
        align-items: center; 
        width: 100%;
        min-height: 45px;
        height: auto; 
        box-sizing: border-box;
    }
    #selectoresChart > * {
        margin-top: 5px;
        margin-bottom: 5px; 
    }

    /* Ajustamos el ancho de los contenedores */
    #selectoresChart .select2-container--default .select2-selection--single {
       max-width: 3rem !important;
    }
    #mcdoCont {
        margin-left: 2.5rem !important;
    }
    #pivotsCont {
        margin-right: 2.5rem !important;
    }

    #mcdoCont,
    #activoCont,
    #periodCont,
    #selector1Cont,
    #selector2Cont,
    #pivotsCont  {
        width: auto;
        min-width: 3rem;
        margin-left: 5px;
        margin-right: 5px;
    }
    
    /* Ocultamos el texto de dentro del selector y la flechita */
    #selectoresChart .select2-container--default .select2-selection--single .select2-selection__rendered {
        display: none;
    }
    #selectoresChart .select2-container--default .select2-selection--single .select2-selection__arrow {
        display: none;
    }

    /* posicion del icono */
    #selectoresChart .select2-container--default .select2-selection--single {
        position: relative;
        padding-left: 30px; /* Espacio para el ícono */
    }

    /* clases para cada icono */
    .icono-indicatorSelector1::after, .icono-indicatorSelector2::after, .icono-pivots::after, .icono-selectorPeriod::after, .icono-selectorMdo::after, .icono-selectorActivo::after {
        content: ""; /* Se especifica por selector */
        font-family: 'FontAwesome';
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 1rem;
        visibility: visible;
        cursor: pointer;
    }

    .icono-indicatorSelector1::after {
        content: "\f201"; /* icono para indicador precio */ 
    }
    .icono-indicatorSelector2::after {
        content: "\f682"; /* icono para indicador bottom */
    }
    .icono-pivots::after {
        content: "\f1de"; /* icono para pivots */
    }
    .icono-selectorPeriod::after {
        content: "\f017"; /* icono para period */
    }
    .icono-selectorMdo::after {
        content: "\f54f"; /* icono para market */
        cursor: pointer;
    }
    .icono-selectorActivo::after {
        content: "\f07c"; /* icono para activo */
    }
    /* hay que ajustar el dropdown */ 
    .dropdown-selectorMdo,
    .dropdown-selectorActivo,
    .dropdown-indicatorSelector1,
    .dropdown-indicatorSelector2,
    .dropdown-pivots,
    .dropdown-selectorPeriod {
        width: auto !important; 
        top: calc(100% + 8px) !important;
    }
	
	/* Nombre activo y variación*/
	
	.main-asset {
        font-weight: 400;
        font-size: 11px;
    }
	
	.last-price {
		font-size: 7px;
	}
	.last-variation {
		font-size: 7px;
	}
}

/* A partir de 850, los botones del lateral se ponen arriba, por lo que hay que ajustar */
@media (max-width: 850px) {
    #assetTag { /* El contenedor que indica el asset y lo que ha subido/bajado */
        top: 10%;
        margin-left: 10%;
    }
}

/* Indicator group dropdown buttons */
#indGroupBtns {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 4px;
    height: 26px;
}
.ind-group {
    position: relative;
    height: 26px;
    display: flex;
    align-items: center;
}
.ind-group-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    padding: 0 8px !important;
    height: 26px !important;
    line-height: 26px;
    box-sizing: border-box !important;
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
.ind-group-btn:hover,
.ind-group-btn.open {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}
.ind-group-btn.sr-active {
    background: rgba(80,200,110,0.15);
    color: #50c86e;
    border-color: rgba(80,200,110,0.35);
}
.ind-group-btn.sr-active:hover {
    background: rgba(80,200,110,0.25);
}
body:not(.dark-mode) .ind-group-btn.sr-active {
    background: rgba(44,187,126,0.15) !important;
    color: #1a8a55 !important;
    border-color: rgba(44,187,126,0.55) !important;
}
body:not(.dark-mode) .ind-group-btn.sr-active:hover {
    background: rgba(44,187,126,0.25) !important;
}
.ind-group-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    background: #1e2d3a;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    z-index: 99999999;
    min-width: 148px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.ind-group-dropdown.open {
    display: block;
}
.ind-dd-item {
    display: block;
    padding: 5px 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    white-space: nowrap;
}
.ind-dd-item:hover:not(.ind-dd-disabled) {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.ind-dd-disabled {
    color: rgba(255,255,255,0.28);
    cursor: default;
}
.ind-dd-sep {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 2px 0;
}
.ind-dd-gear {
    display: block;
    padding: 5px 12px;
    font-size: 11px;
    color: #7a8fbb;
    cursor: pointer;
    white-space: nowrap;
}
.ind-dd-gear:hover {
    background: rgba(255,255,255,0.07);
    color: #a0b8d8;
}
body:not(.dark-mode) .ind-dd-sep {
    border-color: rgba(0,0,0,0.1);
}
body:not(.dark-mode) .ind-dd-gear {
    color: #5a7aaa;
}
body:not(.dark-mode) .ind-dd-gear:hover {
    background: rgba(0,0,0,0.05);
}
.ind-dd-active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.ind-dd-active::before {
    content: '• ';
}
.ind-grp-active {
    color: #fff !important;
    border-color: rgba(255,255,255,0.35) !important;
    background: rgba(255,255,255,0.12) !important;
}
.pivot-clear-btn {
    background: rgba(210,35,35,0.85);
    border: none;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
    flex-shrink: 0;
    transition: background 0.12s;
}
.pivot-clear-btn.pivot-active { display: inline-flex; }
.pivot-clear-btn:hover { background: rgba(235,50,50,1); }

/* Period-control dropdown items */
.ind-dd-period-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ind-dd-period-item:hover:not(.ind-dd-active) {
    background: rgba(255,255,255,0.08);
}
.ind-dd-period-item.ind-dd-active {
    background: rgba(255,255,255,0.08);
}
.ind-dd-period-item.ind-dd-active::before { content: ''; }
.ind-pd-name {
    flex: 1;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    min-width: 0;
    white-space: nowrap;
}
.ind-dd-period-item.ind-dd-active .ind-pd-name { color: #fff; }
.ind-pd-sel,
.ind-pd-inp {
    background: #1e2d3a;
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    font-size: 10px;
    height: 18px;
    border-radius: 2px;
    padding: 0 2px;
    box-sizing: border-box;
    text-align: center;
}
.ind-pd-sel {
    width: 44px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 14px;
    background-color: #1e2d3a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='rgba(255,255,255,0.6)' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 3px center;
}
.ind-pd-sel option {
    background: #1e2d3a;
    color: #fff;
}
.ind-pd-inp {
    width: 36px;
}
.ind-pd-inp::-webkit-inner-spin-button,
.ind-pd-inp::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Strip of green BT buttons, above the red X strip */
#btIndBtns {
    position: absolute;
    bottom: 54px;
    left: 5px;
    display: flex;
    flex-direction: row;
    gap: 5px;
    z-index: 9999999;
    pointer-events: none;
}
.bt-ind-btn {
    pointer-events: auto;
    height: 20px;
    padding: 0 8px;
    background: rgba(35, 160, 70, 0.88);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
    transition: background 0.12s;
    white-space: nowrap;
    line-height: 1;
}
.bt-ind-btn:hover {
    background: rgba(50, 190, 80, 1);
}

/* Strip of active-indicator X buttons, bottom-left of rChart */
#activeIndBtns {
    position: absolute;
    bottom: 28px;
    left: 5px;
    display: flex;
    flex-direction: row;
    gap: 5px;
    z-index: 9999999;
    pointer-events: none;
}
.ind-remove-btn {
    pointer-events: auto;
    width: 20px;
    height: 20px;
    background: rgba(210, 35, 35, 0.88);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    line-height: 1;
    transition: background 0.12s;
}
.ind-remove-btn:hover {
    background: rgba(235, 50, 50, 1);
}

/* Custom chart-type / timeframe dropdown buttons */
.chart-dd-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.chart-dd-btn {
    white-space: nowrap;
    padding: 0 6px;
    font-size: 11px;
}
.chart-dd-list {
    display: none;
    position: absolute;
    top: calc(100% + 3px);
    right: 0;
    background: #1a2b3c;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    z-index: 9999;
    min-width: 130px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
.chart-dd-list.open { display: block; }
.chart-dd-item {
    display: block;
    padding: 5px 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    white-space: nowrap;
}
.chart-dd-item:hover:not(.chart-dd-disabled):not(.chart-dd-active) {
    background: rgba(255,255,255,0.07);
    color: #fff;
}
.chart-dd-item.chart-dd-active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.chart-dd-item.chart-dd-active::before { content: '• '; }
.chart-dd-item.chart-dd-disabled {
    color: rgba(255,255,255,0.25);
    cursor: default;
}
.chart-dd-sep { border-top: 1px solid rgba(255,255,255,0.1); margin: 2px 0; }

/* Label de categoría del tipo de gráfico, superpuesto sobre rChart */
#chartCatLabel {
    position: absolute;
    bottom: 20px;
    right: 12px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}
.chart-dd-header {
    display: block;
    padding: 5px 12px 2px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    cursor: default;
    pointer-events: none;
}

/* Zoom +/- buttons, bottom-center of rChart */
#zoomControls {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 9999;
    pointer-events: auto;
}
#zoomControls button {
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
    user-select: none;
}
.dark-mode #zoomControls button { color: #f0f0f0; }
#zoomControls button:hover { opacity: 0.6; }
#zoomControls button:active { opacity: 0.4; }

/* Botones de periodo (D, H1) y tipo de grafico (candle, bar, line) en toolbar */
.chart-btn-group {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    gap: 1px;
    height: 26px;
}

.chart-btn {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 0 6px !important;
    font-size: 11px;
    font-weight: 700;
    line-height: 26px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px !important;
    min-width: 24px;
    box-sizing: border-box !important;
    transition: color 0.15s, background 0.15s;
    letter-spacing: 0.02em;
}

.chart-btn:hover:not(:disabled) {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.07);
}

.chart-btn.chart-btn-active {
    color: white;
    border-color: rgba(255,255,255,0.25);
}

.chart-btn:disabled {
    color: rgba(255,255,255,0.18);
    cursor: not-allowed;
}

/* #selectoresChart dentro del nav (una sola fila).
   flex: 0 1 auto -> no crece (navCtrlGroup/C/N/D queda visible), pero si puede encoger */
nav #selectoresChart {
    flex: 0 1 auto;
    background: transparent;
    border: none;
    height: 100%;
    min-width: 0;
}

/* =====================================================
   LEFT SIDEBAR FLYOUT (theme popup, etc.)
   ===================================================== */
.lsb-flyout {
    position: fixed;
    background: #141f2e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    padding: 4px 0;
    z-index: 99999;
    min-width: 130px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    display: none;
}
.lsb-flyout-item {
    padding: 8px 16px;
    font-size: 11px;
    color: rgba(255,255,255,0.72);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.12s;
}
.lsb-flyout-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
}
.lsb-flyout-item.lsb-active { color: #5bc2e7; }
.lsb-check { font-size: 9px; opacity: 0; width: 10px; flex-shrink: 0; }
.lsb-flyout-item.lsb-active .lsb-check { opacity: 1; }
.lsb-flyout-sep {
    height: 1px;
    background: rgba(255,255,255,0.09);
    margin: 3px 0;
}
.lsb-theme-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lsb-theme-del {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.28);
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
    margin-left: 4px;
}
.lsb-theme-del:hover {
    color: rgba(255,80,80,0.9);
    background: rgba(255,80,80,0.12);
}
.lsb-theme-edit {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.28);
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
    margin-left: 2px;
}
.lsb-theme-edit:hover {
    color: rgba(91,194,231,0.9);
    background: rgba(91,194,231,0.12);
}
.lsb-theme-reset {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.28);
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
    margin-left: 2px;
}
.lsb-theme-reset:hover {
    color: rgba(255,160,60,0.9);
    background: rgba(255,160,60,0.12);
}
.lsb-new-custom {
    color: rgba(255,255,255,0.4) !important;
    font-style: italic;
    font-size: 10px !important;
}

/* =====================================================
   SHARED MODAL BASE
   ===================================================== */
.rb-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
}
.rb-overlay.rb-open { display: flex; }
.rb-modal {
    background: #141f2e;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.7);
    overflow: hidden;
    position: relative;
}
.rb-modal-hdr {
    padding: 16px 20px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.rb-modal-hdr h3 {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.rb-modal-close {
    position: absolute;
    top: 11px; right: 13px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.12s;
}
.rb-modal-close:hover { color: rgba(255,255,255,0.9); }

/* Cursor dot — shown when draw mode is active */
#cursor-dot {
    position: fixed;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.45);
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 99999;
    display: none;
    transform: translate(-50%, -50%);
}

/* =====================================================
   SHORTCUTS PANEL
   ===================================================== */
#shortcutsPanel {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #141f2e;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.65);
    z-index: 99999;
    display: none;
    overflow: hidden;
}
#shortcutsPanel .rb-modal-hdr { text-align: left; }
#shortcutsPanel .sc-body { padding: 10px 20px 16px; }
#shortcutsPanel table { width: 100%; border-collapse: collapse; }
#shortcutsPanel td {
    padding: 5px 0;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    vertical-align: middle;
}
#shortcutsPanel td:first-child { width: 55%; color: rgba(255,255,255,0.85); }
.sc-key {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: monospace;
}
.sc-config-title {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    padding: 10px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.sc-config-hint { font-size: 9px; color: rgba(255,255,255,0.3); }
.sc-config-tbl { width: 100%; }
.sc-config-tbl td:first-child { color: rgba(255,255,255,0.75); font-size: 11px; padding: 4px 0; }
.sc-hotkey {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 10px;
    font-family: monospace;
    min-width: 56px;
    text-align: center;
}
.sc-hotkey.sc-editable { cursor: pointer; }
.sc-hotkey.sc-editable:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
}
.sc-hotkey.sc-capturing {
    background: rgba(255,200,50,0.15);
    border-color: rgba(255,200,50,0.55);
    color: rgba(255,200,50,0.9);
    animation: sc-blink 0.7s step-end infinite;
}
@keyframes sc-blink { 50% { opacity: 0.35; } }

/* =====================================================
   TIMEZONE MODAL
   ===================================================== */
#tzOverlay { z-index: 99998; }
#tzModal {
    width: 380px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
#tzModal .tz-desc {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    line-height: 1.6;
    margin: 8px 0 0 0;
}
#tzModal .tz-current {
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}
.tz-loc-btn {
    display: block;
    margin: 10px auto;
    background: transparent;
    border: 1px solid rgba(100,180,255,0.5);
    border-radius: 14px;
    color: rgba(100,180,255,0.85);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 5px 18px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s;
}
.tz-loc-btn:hover {
    background: rgba(100,180,255,0.1);
    border-color: rgba(100,180,255,0.9);
    color: rgba(100,180,255,1);
}
#tzList { flex: 1; overflow-y: auto; padding: 0 0 4px 0; }
.tz-item {
    padding: 8px 20px;
    font-size: 11px;
    color: rgba(255,255,255,0.62);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
}
.tz-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.tz-item.tz-active { background: rgba(100,180,255,0.1); color: #5bc2e7; font-weight: 600; }
.tz-item::before { content: "\2022"; color: rgba(255,255,255,0.2); font-size: 14px; }
.tz-item.tz-active::before { color: #5bc2e7; }
.tz-dst-note {
    font-size: 10px;
    color: rgba(255,200,80,0.75);
    margin: 6px 0 0 0;
    line-height: 1.4;
    text-align: center;
}
.tz-scroll-hint {
    text-align: center;
    font-size: 9px;
    color: rgba(255,255,255,0.28);
    padding: 5px;
    font-style: italic;
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* =====================================================
   CUSTOM THEME MODAL
   ===================================================== */
#customThemeOverlay { z-index: 99999; }
#customThemeModal { width: 400px; }
.ct-body { padding: 14px 18px 16px; }
.ct-cols { display: flex; gap: 0; align-items: flex-start; }
.ct-col { flex: 1; min-width: 0; }
.ct-divider {
    width: 1px;
    background: rgba(255,255,255,0.1);
    align-self: stretch;
    margin: 0 14px;
    flex-shrink: 0;
}
.ct-row {
    display: flex;
    align-items: center;
    margin-bottom: 9px;
    gap: 6px;
}
.ct-label {
    flex: 1;
    font-size: 11px;
    color: rgba(255,255,255,0.68);
    white-space: nowrap;
}
.ct-swatches { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.ct-swatch {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.25);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}
.ct-swatch input[type="color"] {
    position: absolute;
    top: -3px; left: -3px;
    width: 28px; height: 28px;
    border: none;
    cursor: pointer;
    opacity: 0;
}
.ct-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 9px 0; }
.ct-name-row {
    margin-top: 14px;
    text-align: center;
}
.ct-name-row label {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 6px;
}
.ct-name-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 4px;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    padding: 6px 12px;
    width: 200px;
    box-sizing: border-box;
    text-align: center;
    outline: none;
}
.ct-name-input:focus { border-color: rgba(100,180,255,0.5); }
.ct-footer-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
    margin-bottom: 2px;
}
.ct-save-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 24px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s;
}
.ct-save-btn:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.95);
    border-color: rgba(255,255,255,0.4);
}
.ct-reset-btn {
    background: transparent;
    border: 1px solid rgba(255,100,100,0.3);
    border-radius: 14px;
    color: rgba(255,110,110,0.6);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 24px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s;
}
.ct-reset-btn:hover {
    background: rgba(255,80,80,0.1);
    color: rgba(255,130,130,0.9);
    border-color: rgba(255,80,80,0.5);
}

/* Timezone button in nav */
#btnTimezone {
    font-size: 10px !important;
    gap: 3px;
    margin-right: 2px;
    color: rgba(255,255,255,0.42) !important;
    letter-spacing: 0;
}
#btnTimezone:hover { color: rgba(255,255,255,0.85) !important; }

/* =====================================================
   DAY (LIGHT) THEME OVERRIDES FOR NAV ELEMENTS
   ===================================================== */
body:not(.dark-mode) #selectoresChart {
    background: #dde3eb !important;
    color: #1a2b3c;
}

/* Select2 in light mode */
body:not(.dark-mode) #selectoresChart .select2-selection--single {
    background-color: rgba(0,0,0,0.06) !important;
    border-color: rgba(0,0,0,0.18) !important;
}
body:not(.dark-mode) #selectoresChart .select2-selection--single .select2-selection__rendered {
    color: #1a2b3c !important;
}
body:not(.dark-mode) #selectoresChart .select2-container--open .select2-selection--single {
    border-color: rgba(0,0,0,0.3) !important;
}

/* =====================================================
   MOBILE NAV ROW-1: selectoresChart compacto
   ===================================================== */
@media (max-width: 768px) {
    /* Impedir que flex:1 se coma todo el ancho de nav-row-1;
       flex-shrink:1 permite encoger para que navCtrlGroup (C/N/D) quede visible */
    nav #selectoresChart {
        flex: 0 1 auto;
        flex-wrap: nowrap;   /* folder + grey en la misma linea */
        align-items: center;
        height: auto;
    }
    /* Eliminar los margenes verticales que apilan los hijos */
    nav #selectoresChart > * {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    /* activo2Cont: limitar ancho para que quepa junto al folder */
    nav #activo2Cont {
        min-width: 0;
    }
    nav #activo2Cont .select2-container {
        width: 44px !important;
    }
}

/* Indicator group buttons in light mode */
body:not(.dark-mode) .ind-group-btn {
    background: rgba(0,0,0,0.06) !important;
    border-color: rgba(0,0,0,0.14) !important;
    color: rgba(0,0,0,0.65) !important;
}
body:not(.dark-mode) .ind-group-btn:hover,
body:not(.dark-mode) .ind-group-btn.open {
    background: rgba(0,0,0,0.11) !important;
    color: #000 !important;
    border-color: rgba(0,0,0,0.24) !important;
}
body:not(.dark-mode) .ind-grp-active {
    color: #000 !important;
    border-color: rgba(0,0,0,0.32) !important;
    background: rgba(0,0,0,0.10) !important;
}

/* Indicator dropdowns in light mode */
body:not(.dark-mode) .ind-group-dropdown {
    background: #fff;
    border-color: rgba(0,0,0,0.14);
    box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}
body:not(.dark-mode) .ind-dd-item {
    color: rgba(0,0,0,0.7);
}
body:not(.dark-mode) .ind-dd-item:hover:not(.ind-dd-disabled) {
    background: rgba(0,0,0,0.05);
    color: #000;
}
body:not(.dark-mode) .ind-dd-active {
    color: #000;
    background: rgba(0,0,0,0.06);
}
body:not(.dark-mode) .ind-dd-disabled {
    color: rgba(0,0,0,0.28);
}
body:not(.dark-mode) .ind-pd-name {
    color: rgba(0,0,0,0.72);
}
body:not(.dark-mode) .ind-dd-period-item.ind-dd-active .ind-pd-name {
    color: #000;
}
body:not(.dark-mode) .ind-pd-sel,
body:not(.dark-mode) .ind-pd-inp {
    background-color: #f4f6f8;   /* no shorthand: no resetea position ni repeat */
    background-image: none;
    border-color: rgba(0,0,0,0.2);
    color: #000;
    height: 18px !important;
}
body:not(.dark-mode) .ind-pd-sel {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='rgba(0,0,0,0.5)' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
    background-position: right 3px center;
    background-repeat: no-repeat;
}
body:not(.dark-mode) .ind-pd-sel option {
    background: #fff;
    color: #000;
}
body:not(.dark-mode) .ind-dd-period-item {
    border-bottom-color: rgba(0,0,0,0.06);
}
body:not(.dark-mode) .ind-dd-period-item:hover:not(.ind-dd-active) {
    background: rgba(0,0,0,0.04);
}

/* Chart dropdown buttons in light mode */
body:not(.dark-mode) .chart-btn {
    color: rgba(0,0,0,0.5);
}
body:not(.dark-mode) .chart-btn:hover:not(:disabled) {
    color: rgba(0,0,0,0.85);
    background: rgba(0,0,0,0.06);
}
body:not(.dark-mode) .chart-btn.chart-btn-active {
    color: #000;
    border-color: rgba(0,0,0,0.25);
}
body:not(.dark-mode) .chart-btn:disabled {
    color: rgba(0,0,0,0.18);
}

/* Chart dropdown lists in light mode */
body:not(.dark-mode) .chart-dd-list {
    background: #fff;
    border-color: rgba(0,0,0,0.14);
    box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}
body:not(.dark-mode) .chart-dd-item {
    color: rgba(0,0,0,0.7);
}
body:not(.dark-mode) .chart-dd-item:hover:not(.chart-dd-disabled):not(.chart-dd-active) {
    background: rgba(0,0,0,0.05);
    color: #000;
}
body:not(.dark-mode) .chart-dd-item.chart-dd-active {
    color: #000;
    background: rgba(0,0,0,0.06);
}
body:not(.dark-mode) .chart-dd-item.chart-dd-disabled {
    color: rgba(0,0,0,0.25);
}
body:not(.dark-mode) .chart-dd-sep {
    border-top-color: rgba(0,0,0,0.08);
}
body:not(.dark-mode) .chart-dd-header {
    color: rgba(0,0,0,0.38);
}

/* =====================================================
   SERIES CONFIG GEAR BUTTON + PANEL
   ===================================================== */
#wtSeriesConfigBtn {
    position: absolute;
    top: 17px;
    right: 4px;
    color: rgba(255,255,255,0.38);
    font-size: 8px;
    cursor: pointer;
    z-index: 99999999;
    line-height: 1;
    user-select: none;
    transition: color 0.15s;
}
#wtSeriesConfigBtn:hover {
    color: rgba(255,255,255,0.8);
}
body:not(.dark-mode) #wtSeriesConfigBtn {
    color: rgba(0,0,0,0.32);
}
body:not(.dark-mode) #wtSeriesConfigBtn:hover {
    color: rgba(0,0,0,0.72);
}

#wtSeriesConfigPanel {
    display: none;
    position: absolute;
    top: 39px;
    right: 4px;
    background: #1a2b3c;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 4px;
    padding: 10px 12px;
    z-index: 9999999;
    min-width: 210px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
#wtSeriesConfigPanel.open { display: block; }
body:not(.dark-mode) #wtSeriesConfigPanel {
    background: #fff;
    border-color: rgba(0,0,0,0.14);
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}

.wt-cfg-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
body:not(.dark-mode) .wt-cfg-title { color: rgba(0,0,0,0.45); }

.wt-cfg-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.wt-cfg-label {
    flex: 1;
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    min-width: 50px;
}
body:not(.dark-mode) .wt-cfg-label { color: rgba(0,0,0,0.72); }

.wt-cfg-vis {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: #5bc2e7;
    flex-shrink: 0;
}
.wt-cfg-color {
    width: 26px;
    height: 18px;
    padding: 1px 2px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 2px;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}
body:not(.dark-mode) .wt-cfg-color { border-color: rgba(0,0,0,0.22); }

#wtSeriesSaveBtn {
    margin-top: 9px;
    width: 100%;
    height: 23px;
    background: rgba(91,194,231,0.18);
    border: 1px solid rgba(91,194,231,0.4);
    border-radius: 3px;
    color: #5bc2e7;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.15s;
}
#wtSeriesSaveBtn:hover { background: rgba(91,194,231,0.35); }

/* =====================================================
   AI TRAIN BUTTON (Coming Soon) — kept for nav use
   ===================================================== */
#aiTrainBtn {
    position: absolute;
    top: 17px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 12px;
    cursor: default;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999999;
    pointer-events: auto;
    transition: color 0.2s;
}
#aiTrainBtn:hover {
    color: rgba(255,255,255,0.65);
}
body:not(.dark-mode) #aiTrainBtn {
    color: rgba(0,0,0,0.28);
}
body:not(.dark-mode) #aiTrainBtn:hover {
    color: rgba(0,0,0,0.55);
}
