:root{
  --bg:#020411;
  --muted:#9aa7b2;
  --accent:#1f6feb;
  --up:#26a69a;
  --down:#ef5350;
}


*,
*::before,
*::after { box-sizing: border-box; }

body{
  background:var(--bg);
  color:#101014;
  font-family:Arial,Helvetica,sans-serif;
  
 
}
h3{margin:0 0 12px 0;text-align:center}

 

button{background:var(--accent);color:#fff;border:none;padding:8px 12px;border-radius:6px;cursor:pointer}
button.secondary{background:#2b2f33}
input[type=number]{width:100px;padding:6px;border-radius:6px;border:1px solid #22313a;background:#101014;color:#101014}



 


#chartBox {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;

    box-sizing: border-box;
    border-radius:12px;
    border:1px solid rgba(30,64,175,0.45);
    background:radial-gradient(circle at 0 0,#020617,#020617);
   
    z-index: 1;
}



@media (max-width: 1100px){
  #chartBox{
     height: 100%;
    min-height: 330px; 
  }

}

@media (max-width: 780px){
  #chartBox{
      border: none;
      border-radius: 0;
  }
}




@media (max-width: 780px) {
    body.history-collapsed-mobile .ux-block-left {
        max-height: none !important;
        overflow: hidden;
    }

    body.history-collapsed-mobile #chartBox {
        height: 100% !important;
        min-height: 0 !important;
    }
}









#chart {
  position: absolute;
  left: 0;
  top: 0;

  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}


#chart-overlay {
  position: absolute;     
  left: 0;
  top: 0;

  width: 100%;             
  height: 100%;           

  pointer-events: none;   
  z-index: 10;            
}







#chartSidebar {
  position: absolute;
  left: 0;
  top: 72px;
  bottom: 0;
  width: 36px;
  z-index: 10000;
  display: flex;
 align-items: flex-start;

  justify-content: center;
  padding-top: 0px;
  box-sizing: border-box;
  background: rgba(2,4,17,0.0);
  border-right: 1px solid rgba(34,49,58,0.0);
  pointer-events: none;
}
#sidebarTools { pointer-events: auto; }


canvas{display:block; width:100%; height:100%;}




.hint{color:var(--muted);font-size:13px;margin-top:10px;text-align:center}



label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center; 
}



#yAxisOverlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 100%;
  cursor: ns-resize;
  z-index: 1000;
  background: rgba(0,0,0,0);
  touch-action: none;
}




#sidebarTools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

#sidebarTools button {
  pointer-events: auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #2b2f33;
  background: #1f2937;
  color: #e6eef6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
#sidebarTools button.active {
  outline: 1px solid rgba(109, 175, 255, 0.8);
  background: #16325a;
}


#drawOverlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  cursor: default;
}


.chart-absolute {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 1000 !important;
}




#topControls {
    position: absolute;
    top: 10px;
    left: 5px;

    display: flex;
    flex-wrap: wrap; 
    align-items: flex-start;
    gap: 12px;

    z-index: 1012;
    pointer-events: none; 
}


#topControls > * {
    pointer-events: auto;
}





#tfMenu{
  position:absolute;
  top:100%;        
  left:50%;
  transform:translateX(-50%) translateY(-12px);
z-index: 0;
  display:flex;
  flex-direction:column;
  gap:6px;

  background:rgba(8,16,22,0.55);
  padding:4px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.05);

  max-height:0;
  overflow:hidden;
  opacity:0;
  transition:all .25s ease;
  pointer-events:none; 
}


#tfToolbar.open #tfMenu{
  max-height:300px;
  opacity:1;
  transform:translateX(-50%) translateY(0);
  pointer-events:auto;
}





#tfToolbar{
 position: relative;
  z-index: 140;
  pointer-events: none;
  display: flex;
 
 
}



#tfToolbar .tfBtn{
  pointer-events: auto;
  
  background: rgba(19, 40, 73, 0.5);

  color: #e6eef6;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
    padding-left: 4px !important; 
  padding-right: 4px !important;
    z-index: 140;
  
}

#tfToolbar .tfBtn {
    display: flex;
    align-items: center;
    justify-content: center;
  z-index: 140;
    height: 22px;      
    line-height: 22px;  

    padding-top: 0;
    padding-bottom: 0;

    box-sizing: border-box;
}







#tfToolbar .tfBtn.active{
  background: linear-gradient(180deg,#1f6feb,#0f4fb2);
  box-shadow: 0 2px 6px rgba(31,111,235,0.18);
}
#tfToolbar .tfBtn:focus{ outline: 0px solid rgba(96,165,250,0.35); }

#chartBox, #chart, #hSlider { touch-action: none; }
#yAxisOverlay { touch-action: none; }

/* Trade UI */
#tradeControls .timeBtn {
  background:#16325a;
  color:#e6eef6;
  border:none;
  border-radius:6px;
  cursor:pointer;
}
#tradeControls .timeBtn.active {
  background: linear-gradient(180deg,#1f6feb,#0f4fb2);
  box-shadow: 0 2px 6px rgba(31,111,235,0.18);
}
#tradeControls button:focus { outline: 0px solid rgba(96,165,250,0.35); }
#tradeNotif { color:#f8fafc; }






.controls{
display:flex;
gap:8px;
flex-wrap:wrap;
justify-content:space-between;
margin-top: 6px;  
margin-bottom:6px;
align-items:center;
padding: 5px 6px 6px 6px;

}




.controls{
  max-width: 6400px; 
  margin-left: auto;
  margin-right: auto;
  width: 100%;
 
}
@media (max-width: 1100px) {
    .controls {
    margin-top: 1px;     
        margin-bottom: 6px;   
     width: 100%;
     padding: 5px 5px 5px 5px;
}

}






.controls{
  background:linear-gradient(135deg,#020617,#020817);
  border-radius:10px;
  
  border:1px solid rgba(30,64,175,0.45); 
  box-shadow:0 10px 30px rgba(0,0,0,0.55);
}



.controls-left{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
 
}
.controls-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}


.controls-logo {
    display: flex;
    align-items: center;
    gap: 0px; 
}
@media (max-width: 780px) {
    .controls-logo {
        display: none !important;
    }
}




@media (max-width: 780px) {

  .controls-right {
    width: 100%;
    display: flex;
    justify-content: space-between; 
    gap:6px;
  }

  #balanceBox,
  #custom-button {
    order: 1;
  }

  #profile-button {
    order: 2;
    margin-left: auto; 
  }
}




button,
#sidebarTools button,
#tradeControls .timeBtn{
  border-radius:8px;
  border:1px solid rgba(148,163,184,0.25);
  background:radial-gradient(circle at 0 0,#1f2937,#020617);
  color:#e5e7eb;
  font-size:13px;
  padding:7px 12px;
  transition:
    background 0.18s ease-out,
    transform 0.12s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}
button.secondary{
  background:radial-gradient(circle at 0 0,#111827,#020617);
}
button:hover,
#sidebarTools button:hover,
#tradeControls .timeBtn:hover{
  background:linear-gradient(135deg,#1f6feb,#0f4fb2);
  border-color:rgba(96,165,250,0.8);
  box-shadow:0 4px 14px rgba(37,99,235,0.35);
  transform:translateY(-1px);
  will-change: transform;
}
button:active,
#sidebarTools button:active,
#tradeControls .timeBtn:active{
  transform:translateY(0);
  box-shadow:0 1px 4px rgba(15,23,42,0.8);
  background:linear-gradient(135deg,#0f4fb2,#1f6feb);
}

/* Follow */
#followBtn{
  background: #16325a;
  font-size: 13px;

}




.auth-btn {
    height: 47px;
    background: radial-gradient(circle at 0 0, #1f2937, #020617) !important;
    border: 1px solid rgba(148,163,184,0.25) !important;
    color: #e5e7eb !important;
}
/* Hover */
.auth-btn:hover {
    background: radial-gradient(circle at 0 0, #1f2937, #020617) !important;
    border-color: rgba(96,165,250,0.8) !important;
    box-shadow: 0 4px 14px rgba(37,99,235,0.35) !important;
    transform: translateY(-1px);
}

/* Active */
.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(15,23,42,0.8) !important;
    background: radial-gradient(circle at 0 0, #1f2937, #020617) !important;
}



#balanceBox{
    height:49px;
    display:flex;
    flex-direction:column;
    justify-content:center; 
    align-items:flex-start;  
    padding:0 10px;
    border-radius:8px;
    
    background:radial-gradient(circle at 0 0,#0f172a,#020617);
    border:1px solid #22313a;
    
    color:#e6eef6;
}
#balanceBox div:first-child{
  font-size:11px;
  color:var(--muted);
}
#balanceAmount{
  font-weight:700;
  font-size:17px;
  color:#e5e7eb;
}





.time-wrapper{
  position: relative;
  padding: 8px;               
  display:flex;
  justify-content:center;        
  align-items:center;     
  width:100%;
  box-sizing:border-box;
  border-radius:10px;
  margin-bottom: 4px;        
  background: linear-gradient(180deg, rgba(14,40,80,0.18), rgba(10,28,60,0.12));
  border: 1px solid rgba(59,130,246,0.14); /* тонкая синяя рамка */
  box-shadow: 0 6px 18px rgba(59,130,246,0.06), inset 0 1px 0 rgba(255,255,255,0.02);
}

@media (max-width:780px){
  .time-wrapper {
  margin-bottom: 2px; 
  }
}



#tradeControls{
  display:flex;
  flex-direction:column;
  justify-content: center;  
  gap:14px;
  align-items:stretch;
  padding:10px 12px;
  border-radius:12px;
  background:radial-gradient(circle at 0 0,#020617,#020617);
  border:1px solid rgba(30,64,175,0.45);
  max-width:360px;
  width:360px;
  z-index: 12;
}


@media (max-width:1100px){
  #tradeControls {
  height: auto;
  }
}



@media (max-width:780px){
  #tradeControls {
   height: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
   
    margin: 0 auto;
  }
}



#tradeTimes{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
#tradeAmount{
  display:flex;
  flex-direction:column;
  gap:6px;
}


#tradeNotifBox {
  min-width: 0;
  max-width: 100%;
  width: fit-content; 
  margin: 0 auto;  
}


input[type=number]:focus,
#stakeInput:focus,
#distInput:focus{
  border-color:rgba(96,165,250,0.9);
  box-shadow:0 0 0 1px rgba(96,165,250,0.6);
  background:radial-gradient(circle at 0 0,#020617,#020617);
}




#tradeButtons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap !important;
}
@media (max-width: 780px) {
#tradeButtons {
  
    gap: 14px;
   }
}



#tradeButtons button {
    flex: 1 1 0 !important;      /* одинаковое сжатие */
    min-width: 120px !important; /* минимальная ширина */
    max-width: 100% !important;
}



#buyBtn,
#sellBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

    height: 54px;
    line-height: 1.1;
    padding: 0;

    box-sizing: border-box;
    border: none;
    outline: none;
    border-radius: 8px;

    white-space: normal;
    font-weight: 700;
    font-size: 19px;

    flex: 1 1 auto !important;
    min-width: 100px !important;
    max-width: 100% !important;
    min-height: 54px !important;
}

/* BUY */
#buyBtn {
    background: var(--buy);
    color: #ffffff;
    box-shadow: 0 0px 10px rgba(93, 233, 221, 0.18);
}
#buyBtn:hover {
    background: var(--buyHover);
}

/* SELL */
#sellBtn {
    background: var(--sell);
    color: #ffffff;
    box-shadow: 0 0px 10px rgba(238, 89, 89, 0.18);
}
#sellBtn:hover {
    background: var(--sellHover);
}







#buyBtn,
#sellBtn {
    transition: background-color 0.2s linear, box-shadow 0.2s linear;
    will-change: background-color, box-shadow;
}






@media (min-width: 780px) {
    .compact-mode #buyBtn,
    .compact-mode #sellBtn {
        min-width: 100px !important;
        max-width: 100px !important;
        width: 100px !important;
        display: inline-block !important;
    }
}







 #buyBtn,
    #sellBtn {
        flex: 1 1 auto !important;
        min-width: 100px !important;
        max-width: 100% !important;
        white-space: normal !important;
    }









  #tradeButtons { width: 100% !important; justify-content: center !important; }
  


/* Компактный режим — фикс кнопок */
.compact-mode #tradeButtons {
    display: flex;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.compact-mode #tradeButtons button {
    width: 100% !important;     /* ← убивает 48% */
    margin: 0 !important;
    padding: 8px 10px !important;
    box-sizing: border-box;
}



.hint{
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
}



#leftCol{
  flex:1 1 auto;
}



#distControls{
  margin-top:16px;
  padding:10px 12px;
  border-radius:10px;
  background:radial-gradient(circle at 0 0,#020617,#020617);
  border:1px solid rgba(30,64,175,0.45);
  box-shadow:0 10px 28px rgba(0,0,0,0.8);
  position: relative; 
  z-index: 3;
}



body{
  color:#e5e7eb;
}
input[type=number]{
  color:#e5e7eb;
}



.time-row{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:center;
}


.time-row .timeBtn{
  appearance:none;
  -webkit-appearance:none;
  background: linear-gradient(180deg, #0f4fb2, #0b3a8a); 
  color:#ffffff;
  border:1px solid rgba(255,255,255,0.06);
  padding:6px 10px;
  border-radius:8px;
  font-size:13px;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 6px 18px rgba(11,58,138,0.12);
}


.time-row .timeBtn:hover{
  transform: translateY(-2px);
  background: linear-gradient(180deg, #2b6fe6, #0f4fb2);
  box-shadow: 0 12px 30px rgba(59,130,246,0.12);
}
.time-row .timeBtn:active{
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(11,58,138,0.12);
}


.time-row .timeBtn.active{
  background: linear-gradient(180deg, rgba(243,176,0,0.12), rgba(243,176,0,0.06));
  color:#071029;
  border-color: rgba(243,176,0,0.18);
  box-shadow: 0 10px 28px rgba(243,176,0,0.08);
}


@media (max-width:768px){
  .time-wrapper{ padding: 6px; border-radius:8px; }
  .time-row{ gap:6px; flex-wrap:wrap; justify-content:center; }
  .time-row .timeBtn{ padding:6px 8px; font-size:12px; }
}




.stake-row{
  display:flex;
  align-items:center;
  justify-content:center; 
  gap:12px;
  width:100%;
  max-width:320px; 
  box-sizing:border-box;
}





#sidebarTools button,
.time-row .timeBtn,
#tradeTimes .timeBtn{
  outline:none;
}
#sidebarTools button:focus,
.time-row .timeBtn:focus,
#tradeTimes .timeBtn:focus{
  box-shadow:0 0 0 3px rgba(31,111,235,0.18);
  border-color:rgba(96,165,250,0.9);
}

  


@media (min-width: 981px) {
  
  #tradeControls .stake-wrapper,
  #tradeAmount .stake-wrapper,
  .stake-wrapper {
    
   
    box-sizing: border-box !important;
    align-self: stretch !important;
  }
}


#tradeControls, #tradeAmount, #tradeControls .time-wrapper, #tradeAmount .time-wrapper {
  max-width: 100% !important;
  width: 100% !important;
}



.stake-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}






#tradeNotifBox {
  width: 100% !important;       
  min-width: 220px !important;    
  max-width: 360px !important;   
  height: 48px !important;        
  min-height: 48px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;     
  display: flex !important;
  align-items: center !important;  
  justify-content: center !important; 
  text-align: center !important;
  padding: 8px !important;     
}


#tradeNotifBox #tradeNotif {
  display: -webkit-box;
  -webkit-line-clamp: 2;          
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.15;
  max-height: calc(1.15em * 2);  
  width: 100%;
  box-sizing: border-box;
  padding: 0 6px;
}


#tradeNotifBox.single-line #tradeNotif {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  display: block;
  max-height: none;
}

#tradeNotifBox {
    min-width: 220px;
    max-width: 360px;
    padding: 8px;
    border-radius: 8px;
    background: #071018;
    color: #e6eef6;
    box-shadow: 0 0 10px rgba(96,165,250,0.3);
    border: 1px solid rgba(96,165,250,1);
    font-size: 13px;
    margin-top: 5px;
}

@media (max-width: 1100px) {
    #tradeNotifBox {
      display: none !important;
        margin-top: 35px;
    }
}

@media (max-width: 780px) {
    #tradeNotifBox {
        display: none !important;
        margin-top: 5px;
    }
}





#stakeInput::-webkit-outer-spin-button,
#stakeInput::-webkit-inner-spin-button,
input[type="number"].stake-input::-webkit-outer-spin-button,
input[type="number"].stake-input::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


#stakeInput::-moz-focus-inner,
input[type="number"].stake-input::-moz-focus-inner,
input[type="number"]::-moz-focus-inner {
  border: 0 !important;
}


input[type="number"][style*="background-image"],
#stakeInput[style*="background-image"],
input[type="number"].stake-input[style*="background-image"] {
  background-image: none !important;
}


#stakeInput,
input[type="number"].stake-input {
  padding:8px 0px;
  min-width: 90px;
  
  text-align: center;
  font-size: 17px;
  color: #e6eef6;
  background: #0f1720;
  
  border-radius: 6px;
  transition: border-color .12s ease, box-shadow .12s ease, transform .06s ease;
  outline: none;
}



#stakeInput:hover:not(:focus),
input[type="number"].stake-input:hover:not(:focus) {
  border-color: #5fa0ff !important;
  box-shadow: 0 0 0 1px rgba(96,165,250,0.4) !important;
}


#stakeInput:focus,
input[type="number"].stake-input:focus {
  border-color: #5fa0ff !important;
  box-shadow:
    0 0 5px rgba(120,170,255,0.45),
    0 0 10px rgba(120,170,255,0.25);

}




.pair-wrapper {
  position: relative;
  top: 0px;
  width: auto;
  max-width: 260px;
  font-family: inherit;
  z-index: 1;
}
@media (max-width: 1400px) {
 .pair-wrapper {
  top: 0px; 
}
}

.pair-toggle {
 
  background: rgba(19, 40, 73, 0.5);

  border: 1px solid #375263;
  padding: 0px 6px;
  border-radius: 8px;
  color: #e6eef6;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0px;
  transition: 0.15s;
  min-height: 31px;
  max-width: 100%;

}


@media (max-width: 1400px) {
 .pair-toggle {
 padding: 5px 4px;
    
}
}

#pairLabel {
  display: block;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
   font-weight: 600 !important; 
    margin-right: 6px
}



.pair-toggle.small #pairLabel {
  white-space: normal;
  word-break: break-word;
}


.pair-toggle .caret {
  margin-left: auto;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.pair-toggle.loaded .caret {
  opacity: 1;
  transform: translateX(0);
}


.pair-loading {
  font-size: 12px;
  color: #1f6feb;
  margin-left: 8px;
  opacity: 0;
  display: none;
  transition: opacity 0.15s ease;
}

.pair-toggle.loading .pair-loading {
  display: inline;
  opacity: 0.8;
}


.pair-wrapper.open .pair-toggle {
  border-color: #1f6feb;
  box-shadow: 0 0 8px rgba(31, 111, 235, 0.6);
}


.pair-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
 /* min-width: calc(100% + 160px);*/

width: 310px !important; 
    min-width: 310px !important;

  background: #0f1720;
  border: 1px solid #22313a;
  border-radius: 8px;
  padding: 8px;
  z-index: 122222220;
  box-shadow: 0 0 12px rgba(31, 111, 235, 0.25);
}

.pair-wrapper.open .pair-panel {
  display: block;
}


.pair-header-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px 6px;
  font-size: 11px;
  color: #9aa7b2;
  border-bottom: 1px solid #1b2633;
  margin-bottom: 4px;
}


.pair-search {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #22313a;
  background: #101014;
  color: #e6eef6;
  margin-bottom: 8px;
}


.pair-list {
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden;
 
}


.pair-item {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #e6eef6;

  display: flex;
  align-items: center;
  gap: 8px;
}


.pair-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1; 
  min-width: 0;
}

.pair-item-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.pair-profit {
  font-size: 12px;
  color: #a7e6ff;
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
   position: relative;
    z-index: 2; 
}


.pair-item:hover {
  background: rgba(255,255,255,0.05);
}

.pair-item.active {
  background: rgba(31,111,235,0.3);
  color: #fff;
}


.pair-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pair-icon.loaded {
  opacity: 1;
  transform: scale(1);
}


#pairIcon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  opacity: 1 !important;
  transform: scale(1) !important;
  flex-shrink: 0;
}





#hoverShade {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 1; 
}






.pair-toggle,
#pairLabel,
.pair-item
{
    font-size: 15px !important;
font-family: "Manrope", sans-serif !important;

}



@media (max-width: 1400px) {
 .pair-toggle,
#pairLabel,
.pair-item {
    font-size: 14px !important;
    
}
}


.otc-tag {
  font-family: "Manrope", sans-serif !important;
  font-weight: 600;
  font-size: 12px
}



.pair-item {
    position: relative;
    overflow: hidden;
}

.pair-item .roi-shade {
    position: absolute;
    top: 20%;
    bottom: 20%;
    right: 0;
    width: 40%;
    pointer-events: none;
    z-index: 0;
    opacity: 0; 
    transition: opacity 0.4s ease;
}




.pair-item.roi-up .roi-shade {
    opacity: 1;
    background: linear-gradient(
        to left,
        rgba(0, 255, 85, 0.6) 0%,
        rgba(0, 255, 85, 0.15) 50%,
        rgba(0, 255, 85, 0.00) 100%
    );
}


.pair-item.roi-down .roi-shade {
    opacity: 1;
    background: linear-gradient(
        to left,
        rgba(255, 0, 34, 0.6) 0%,
        rgba(255, 0, 34, 0.15) 50%,
        rgba(255, 0, 34, 0.00) 100%
    );
}

/* 🔥 Тонкая синяя современная прокрутка для списка пар */
.pair-list::-webkit-scrollbar {
    width: 6px;
}

.pair-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}

.pair-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e3a8a, #3b82f6);
    border-radius: 10px;
}

.pair-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
}



.pair-panel {
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.pair-list {
    overscroll-behavior: contain;
    touch-action: pan-y;
}



.fav-star {
    font-size: 18px;
    width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}




















/* МОДАЛКА Global statistic */
.stats-modal {
    position: fixed;
    inset: 0;
    display: none;
   z-index: 19999;

    
    
}
.stats-modal.active { display: block; }

.stats-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    
}

.stats-window {
    position: relative;
    margin: 40px auto;
    max-width: 1100px;
    background: #05060c;
    color: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 0 20px #7b2cff55;
    display: flex;
    gap: 24px;
    padding: 24px;

     
    overflow-y: auto;


     scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE/Edge Legacy */
  
}




/* КНОПКА ЗАКРЫТЬ */

.stats-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;

    background: #0b0d16;
    border: 1px solid #7b2cff;
    box-shadow: 0 0 12px #7b2cff;

    color: #e5e7eb;
    border-radius: 18%;
    font-size: 20px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    line-height: 1;
    padding: 0;
}
/* ПК: крест по центру */
.stats-close::before {
    content: "×";
    display: block;
}

/* МОБИЛЬНЫЕ: поднимаем крест выше */

@media (hover: none) and (pointer: coarse) {
    .stats-close::before {
        transform: translateY(-1px); /* если мало — сделай -4px или -5px */
    }
}






.stats-close:hover {
    background: #1a0f2d;          /* тёмно‑фиолетовый фон */
    border-color: #c13bf6;        /* СИНЯЯ ОБВОДКА */
    box-shadow: 0 0 16px #9d4dff; /* СИНЕЕ СВЕЧЕНИЕ */
    color: #fff;                  /* белый крестик */
}

/* ЛЕВАЯ ЧАСТЬ */
.stats-left { flex: 0 0 360px; display: flex; flex-direction: column; gap: 16px; }
.stats-user-block { display: flex; gap: 12px; align-items: center; }

.stats-period-title { font-size: 16px; font-weight: 600; }

/* КНОПКИ ПЕРИОДОВ */
.stats-period-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-period-btn {
    flex: 1 1 calc(33% - 8px);
    padding: 8px 10px;

    background: #0b0d16;
    border: 1px solid #7b2cff;
    box-shadow: 0 0 10px #7b2cff55;

    border-radius: 6px;
    color: #e5e7eb;
    cursor: pointer;
    transition: 0.15s;
}
.stats-period-btn:hover {
    background: #1a0f2d;
    border-color: #9d4dff;
    box-shadow: 0 0 14px #9d4dff;
}
.stats-period-btn.active {
    background: #3b1a6f;
    border-color: #b06aff;
    box-shadow: 0 0 16px #b06aff;
}

/* КАРТОЧКИ */
.stats-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats-card {
    background: #0b0d16;
    border: 1px solid #7b2cff;
    box-shadow: 0 0 12px #7b2cff55;

    border-radius: 8px;
    padding: 10px;
}
.stats-card:hover {
    background: #1a0f2d;
    box-shadow: 0 0 16px #9d4dff;
}
.stats-card-label { font-size: 12px; color: #b3b3b3; }
.stats-card-value { font-size: 16px; font-weight: 600; color: #e5e7eb; }

/* ПРАВАЯ ЧАСТЬ */
.stats-right { flex: 1; display: flex; flex-direction: column; gap: 12px; }

/* ГРАФИК */
.stats-chart-wrapper {
    background: #0b1120;
    border: 1px solid #7b2cff;
    box-shadow: 0 0 14px #7b2cff55;

    border-radius: 10px;
    padding: 0;
    position: relative;
    overflow: hidden;
}
.stats-chart-wrapper:hover {
    background: #120d25;
    box-shadow: 0 0 18px #9d4dff;
}

#statsCanvas {
    width: 100%;
    height: 280px;
    display: block;
}

/* TOOLTIP */
.stats-tooltip {
    position: absolute;
    background: #0b0d16;
    border: 1px solid #7b2cff;
    box-shadow: 0 0 10px #7b2cffaa;

    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    display: none;
    pointer-events: none;
    transform: translateY(-120%);
    color: #e5e7eb;
}

@media (max-width: 768px) {
    .stats-window { flex-direction: column; max-width: 100%; margin: 0; border-radius: 0; height: 100%; }
    #statsCanvas { height: 220px; }
    .stats-period-btn { flex: 1 1 48%; }
}




















.docs-content {
    padding: 10px 5px;
    color: #e5e7eb;
    font-size: 15px;
    line-height: 1.55;
}

.docs-content h2 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
    color: #b06aff;
}


@media (min-width: 780px) {

    #docsModal .docs-content {
        max-height: 80vh;     /* ограничиваем высоту */
        overflow-y: auto;     /* скролл ТУТ */
        padding-right: 10px;  /* чтобы не прилипало к краю */
    }

    /* Тонкая синяя современная прокрутка — как в копи-модалке */
    #docsModal .docs-content::-webkit-scrollbar {
        width: 6px;
    }

    /* трек с отступом сверху */
    #docsModal .docs-content::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.25);
        border-radius: 10px;

        /* ОТСТУП СВЕРХУ У ПРОКРУТКИ */
        margin-top: 40px;
    }

    #docsModal .docs-content::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #711e8a, #b06aff);
        border-radius: 10px;
    }

    #docsModal .docs-content::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #b06aff, #b06aff);
    }
}




/* Кнопка возврата к активной свече */
#returnActiveCandleBtn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);

    width: 36px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    color: #8ddcff;
    background: rgba(12, 29, 48, 0.55);
    border: 1px solid rgba(72, 190, 255, 0.4);
    border-radius: 9px;
    box-shadow: 0 0 12px rgba(0, 160, 255, 0.2);

    cursor: pointer;
    z-index: 999999;
    touch-action: manipulation;

    /* По умолчанию кнопка скрыта */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    /* Плавное появление и скрытие */
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* Кнопка нужна — плавно показываем */
#returnActiveCandleBtn.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Наведение */
#returnActiveCandleBtn:hover {
    background: rgba(20, 55, 83, 1);
    border-color: rgba(72, 190, 255, 0.9);
    box-shadow: 0 0 15px rgba(0, 160, 255, 0.3);
}

#returnActiveCandleBtn svg {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

@media (max-width: 600px) {
    #returnActiveCandleBtn {
        right: 6px;
        width: 32px;
        height: 36px;
    }
}

























/* =========================================
   УНИВЕРСАЛЬНАЯ МОДАЛКА ИНДИКАТОРОВ
========================================= */

.ind-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: Inter, system-ui, sans-serif;
}

.ind-modal.is-open {
    display: flex;
}

.ind-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 18, .78);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.ind-window {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    max-height: min(720px, 90dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e5edf8;
    background: #0b1220;
    border: 1px solid rgba(56, 189, 248, .22);
    border-radius: 15px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .55),
                0 0 28px rgba(14, 165, 233, .07);
    animation: indAppear .18s ease-out;
}

@keyframes indAppear {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.ind-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px;
    border-bottom: 1px solid #202c3d;
    background: linear-gradient(120deg, #101d30, #0b1220 75%);
    
}

.ind-eyebrow {
    color: #38bdf8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.ind-heading h2 {
    margin: 7px 0 5px;
    font-size: 21px;
    font-weight: 700;
}

.ind-heading p {
    margin: 0;
    color: #8494aa;
    font-size: 12px;
}


.ind-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;

    border: 1px solid #2b394c;
    border-radius: 8px;
    color: #a9b8ca;
    background: #111c2b;
    cursor: pointer;
}
.ind-close svg {
    width: 14px;
    height: 14px;
}

.ind-close:hover {
    color: white;
    border-color: #38bdf8;
}

.ind-body {
    overflow-y: auto;
    padding: 21px 22px;
}

.ind-section-title {
    margin-bottom: 15px;
    color: #71849d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.ind-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 17px;
    color: #d4deeb;
    font-size: 13px;
}

.ind-field input[type="number"] {
    width: 105px;
    height: 38px;
    box-sizing: border-box;
    padding: 0 10px;
    border: 1px solid #2a394d;
    border-radius: 8px;
    outline: none;
    color: #f1f7ff;
    background: #080f1b;
}

.ind-field input:focus {
    border-color: #38bdf8;
}

.ind-field input[type="color"],
.ind-level-color {
    width: 42px;
    height: 34px;
    padding: 3px;
    border: 1px solid #2b3b50;
    border-radius: 8px;
    background: #111c2b;
    cursor: pointer;
}

.ind-level-title {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #202c3d;
}

.ind-level-row {
    display: grid;
    grid-template-columns: 1fr 90px 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
    padding: 11px;
    border: 1px solid #202e40;
    border-radius: 9px;
    background: #0e1827;
}

.ind-level-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d5dfed;
    font-size: 12px;
}

.ind-level-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.ind-level-value {
    width: 100%;
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
    padding: 0 8px;
    border: 1px solid #2a394d;
    border-radius: 7px;
    outline: none;
    color: #f1f7ff;
    background: #080f1b;
}

.ind-level-value:focus {
    border-color: #38bdf8;
}

.ind-footer {
    display: flex;
    gap: 10px;
    padding: 16px 22px 20px;
    border-top: 1px solid #202c3d;
    background: #0b1220;
}

.ind-btn {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.ind-reset {
    border: 1px solid #304056;
    color: #b8c5d6;
    background: #121d2d;
}

.ind-reset:hover {
    border-color: #64748b;
    color: white;
}

.ind-save {
    flex: 1;
    border: 1px solid #38bdf8;
    color: #04111e;
    background: linear-gradient(110deg, #38bdf8, #22d3ee);
}

.ind-save:hover {
    filter: brightness(1.08);
}

@media (max-width: 480px) {
    .ind-modal {
        padding: 10px;
    }

    .ind-window {
        max-height: 92dvh;
        border-radius: 13px;
    }

    .ind-header {
        padding: 18px 16px 15px;
    }

    .ind-body {
        padding: 18px 16px;
    }

    .ind-footer {
        padding: 13px 16px 16px;
    }

    .ind-btn {
        padding: 0 10px;
        font-size: 11px;
    }
}


/* =========================================
   ПРОКРУТКА В УНИВЕРСАЛЬНОЙ МОДАЛКЕ
========================================= */

.ind-body {
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: #3f77c0 rgba(0, 0, 0, 0.25);
}

/* Ширина прокрутки */
.ind-body::-webkit-scrollbar {
    width: 6px;
}

/* Тёмный трек */
.ind-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    margin-top: 40px;
}

/* Фиолетовый градиентный ползунок */
.ind-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e4d8a, #6a9eff);
    border-radius: 10px;
}

/* Цвет при наведении */
.ind-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6a9eff, #6a99ff);
}


@media (max-width: 779px) {
    .ind-modal .ind-window {
        max-height: calc(100dvh - 180px) !important;
    }
}



/* =========================================
   STOCH — УРОВНИ И ЦВЕТА
========================================= */

.ind-levels-hint {
    margin: 0 0 12px;
    color: #8494aa;
    font-size: 12px;
    line-height: 1.5;
}

#stochLevelsEditor .ind-level-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 42px;
    align-items: center;
    gap: 10px;

    width: 100%;
    margin: 0 0 11px;
    padding: 11px;

    box-sizing: border-box;
    border: 1px solid #202e40;
    border-radius: 9px;
    background: #0e1827;
}

#stochLevelsEditor .ind-level-label {
    grid-column: 1;
    grid-row: 1;

    display: flex;
    align-items: center;
    gap: 8px;

    min-width: 0;
    margin: 0;

    color: #d5dfed;
    font-size: 12px;
}

#stochLevelsEditor input.ind-level-value {
    grid-column: 2;
    grid-row: 1;

    display: block;
    width: 100%;
    min-width: 0;
    height: 34px;
    margin: 0;
    padding: 0 8px;

    box-sizing: border-box;
    border: 1px solid #2a394d;
    border-radius: 7px;
    outline: none;

    color: #f1f7ff;
    background: #080f1b;
    font: inherit;
}

#stochLevelsEditor input.ind-level-value:focus {
    border-color: #38bdf8;
}

#stochLevelsEditor input.ind-level-color,
#stochLevelsEditor input[type="color"] {
    grid-column: 3;
    grid-row: 1;

    justify-self: end;
    align-self: center;

    width: 42px;
    min-width: 42px;
    height: 34px;
    margin: 0;
    padding: 3px;

    box-sizing: border-box;
    border: 1px solid #2b3b50;
    border-radius: 8px;
    background: #111c2b;
    cursor: pointer;
}

#stochLevelsEditor .ind-level-dot {
    display: inline-block;
    flex: 0 0 7px;

    width: 7px;
    height: 7px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}






/* =========================================
   RSI — УРОВНИ И ЦВЕТА
   Стиль и отступы как у STOCH
========================================= */

#rsiLevelsEditor .ind-level-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 42px;
    align-items: center;
    gap: 10px;

    width: 100%;
    margin: 0 0 11px;
    padding: 11px;

    box-sizing: border-box;
    border: 1px solid #202e40;
    border-radius: 9px;
    background: #0e1827;
}

/* Название уровня и цветная точка */
#rsiLevelsEditor .ind-level-label {
    grid-column: 1;
    grid-row: 1;

    display: flex;
    align-items: center;
    gap: 8px;

    min-width: 0;
    margin: 0;

    color: #d5dfed;
    font-size: 12px;
}

/* Поле ввода значения */
#rsiLevelsEditor input.ind-level-value {
    grid-column: 2;
    grid-row: 1;

    display: block;
    width: 100%;
    min-width: 0;
    height: 34px;
    margin: 0;
    padding: 0 8px;

    box-sizing: border-box;
    border: 1px solid #2a394d;
    border-radius: 7px;
    outline: none;

    color: #f1f7ff;
    background: #080f1b;
    font: inherit;
}

#rsiLevelsEditor input.ind-level-value:focus {
    border-color: #38bdf8;
}

/* Выбор цвета — отдельная колонка с отступом */
#rsiLevelsEditor input.ind-level-color,
#rsiLevelsEditor input[type="color"] {
    grid-column: 3;
    grid-row: 1;

    justify-self: end;
    align-self: center;

    width: 42px;
    min-width: 42px;
    height: 34px;
    margin: 0;
    padding: 3px;

    box-sizing: border-box;
    border: 1px solid #2b3b50;
    border-radius: 8px;
    background: #111c2b;
    cursor: pointer;
}

/* Цветная точка слева от названия */
#rsiLevelsEditor .ind-level-dot {
    display: inline-block;
    flex: 0 0 7px;

    width: 7px;
    height: 7px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}








/* Отступы для Telegram WebApp челки */
body.telegram-webapp {
    padding-top: calc(var(--tg-content-safe-area-inset-top, 0px) + 0px);
    padding-left: var(--tg-safe-area-inset-left, 0px);
    padding-right: var(--tg-safe-area-inset-right, 0px);
    padding-bottom: var(--tg-safe-area-inset-bottom, 0px);
    box-sizing: border-box;
}



/* =========================================
   ОТСТУПЫ МОДАЛОК ТОЛЬКО В TELEGRAM WEBAPP
========================================= */

@media (max-width: 779px) {
    body.telegram-webapp {
        padding-top: calc(var(--tg-content-safe-area-inset-top, 0px) + 46px);
    }

    /* Обычные модалки */
    body.telegram-webapp .modal-content {
        margin-top: calc(
            40px + var(--tg-content-safe-area-inset-top, 0px) + 46px
        );
    }

    /* Модалка копи-трейда */
    body.telegram-webapp #kopiModal {
        padding-top: calc(
            40px + var(--tg-content-safe-area-inset-top, 0px) + 46px
        );
    }

    /* Модалка оформления */
    body.telegram-webapp #bgPickerModal {
        padding-top: calc(
            40px + var(--tg-content-safe-area-inset-top, 0px) + 46px
        );
    }
}

/* =========================================
   ОТСТУП МОДАЛКИ СТАТИСТИКИ В TELEGRAM
========================================= */

@media (max-width: 779px) {
    body.telegram-webapp .stats-window {
        margin-top: calc(
            46px + var(--tg-content-safe-area-inset-top, 0px)
        );
    }
}


/* =========================================
   ОТСТУП КОНТЕНТА МОДАЛКИ В TELEGRAM
========================================= */


@media (max-width: 779px) {
    body.telegram-webapp .stats-window {
        margin-top: 0;
        padding-top: calc(
            46px + var(--tg-content-safe-area-inset-top, 0px) + 24px
        );
    }

    body.telegram-webapp .stats-window .stats-close {
        top: calc(
            12px + 46px + var(--tg-content-safe-area-inset-top, 0px) + 24px
        );
    }
}




/* Отступ модалки достижений в Telegram WebApp */
@media (max-width: 779px) {
    body.telegram-webapp .achievement-modal {
        padding-top: calc(
            110px + var(--tg-content-safe-area-inset-top, 0px)
        );
    }
}


