.chart_area{
  position: relative;
  display: inline-block;
}
#graph-cover:hover ~ #line-g{
  display: block;
}

#line-g{
  position: absolute;
  top: -1000px;
  height: 0;
  border-top: 1px dashed #ccc;
  /* border-top: 1px dashed black; */
  display: none;
}
#line-v{
  position: absolute;
  left: -1000px;
  width: 0px;
  border-left: 1px dashed #ccc;
  /* border-left: 1px dashed black; */
  display: none;
}
#graph-cover:hover ~ #line-v{
  display: block;
}
#candle-info{
  display: none;
  padding: 1px 4px 1px 4px;
  font: Bold 13px "Courier New";
  background: rgba(255,255,255,0.7);
  color: rgba(0,0,50,0.7);
  position: absolute;
  top:  2px;
  left: 2px;
  z-index: 2;
}
#graph-cover:hover ~ #point-price,#graph-cover:hover ~ #from-to-text,#graph-cover:hover ~ #candle-info{
  display: inline-block;
}
#last-price{
  display: inline-block;
  padding: 1px 2px;
  font: Bold 13px "Courier New";
  /* background: #000; */
  background: #2c2e61;
  color: #fff;
  position: absolute;
  top: -1000px;
  left: 10px;
  z-index: 2;
}
#point-price{
  padding: 1px 2px;
  font: Bold 13px "Courier New";
  background: #888;
  color: #fff;
  position: absolute;
  top: -1000px;
  left: 10px;
  display: none;
  z-index: 3;
}
#graph-cover{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0, 0);
  z-index: 50;

}
#from-to-text{
  display: none;
  padding: 1px 0 1px 4px;
  width: 290px;
  font: Bold 13px "Courier New";
  background: #888;
  color: #fff;
  position: absolute;
  top: -1000px;
  left: 10px;
  z-index: 2;
}
.yellow-bg{
  background: #ff0;
}
#debug1{
  display: block;
}

.chart {
  position: relative;
}

.chart.second-chart .chart-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 80px;
  padding-right: 0;
}

.chart.second-chart .chart-header .instrument-info-2 {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  padding-left: 8px;
  margin-right: 0;
}

.chart.second-chart .chart-header-secondary-label {
  font-size: 11px;
  margin-right: 6px;
}

.second-chart-collapse-btn {
  position: static;
  margin-left: 0;
  z-index: 900;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.second-chart-collapse-btn i {
  font-size: 10px;
  line-height: 1;
}

.chart.second-chart .second-chart-collapse-btn {
  background-color: #2c2e61;
  color: #ffffff;
  border-color: #2c2e61;
}
.chart.second-chart .second-chart-collapse-btn:hover {
  background-color: #3b3d7a;
  border-color: #3b3d7a;
}
.chart.second-chart.second-chart--collapsed .second-chart-collapse-btn {
  background-color: #d6b56c;
  color: #2c2e61;
  border-color: #d6b56c;
}
.chart.second-chart.second-chart--collapsed .second-chart-collapse-btn:hover {
  background-color: #e3c783;
  border-color: #e3c783;
}

.second-chart--collapsed .second-chart-body {
  display: none;
}

.second-chart--collapsed .chart-header .instrument-info-2 {
  display: none;
}

.chart-screenshot-btn,
.chart-expand-btn,
.chart-restore-btn {
  position: absolute;
  top: 2px;
  right: 8px;
  z-index: 900; /* ниже сайдбара (2500) и лоадера (3000) */
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
}
.chart-screenshot-btn i, .chart-expand-btn i, .chart-restore-btn i { font-size: 10px; line-height: 22px; }

/* Кнопка screenshot левее expand button */
.chart-screenshot-btn { right: 32px; }

/* В expanded mode screenshot button тоже сдвигается левее */
.chart--expanded .chart-screenshot-btn { right: 72px; }

/* Расположим кнопку restore левее на 30px, показываем её только в expanded */
.chart-restore-btn { right: 40px; display: none; }
.chart--expanded .chart-restore-btn { display: inline-block; }
.chart--expanded .chart-expand-btn { display: none; }

.chart--expanded {
  position: fixed !important;
  z-index: 1000 !important;
  /* Убираем ограничение исходного .chart */
  max-width: none !important;
  /* Фолбэк на полный экран */
  width: 100vw !important;
  height: 100vh !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.chart--expanded .container {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.chart--expanded .chart-header {
  max-width: none !important;
  width: 100% !important;
}

.chart--expanded .chart_area_2 {
  width: 100% !important;
}

/* В expanded фиксируем позицию кнопки restore относительно окна */
.chart--expanded .chart-restore-btn {
  position: absolute !important; /* внутри .chart, поверх белого заголовка */
  top: 2px !important;
  right: 8px !important;
}

body.no-scroll {
  overflow: hidden !important;
}

.chart_area_2{
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dee2e6;
  border-radius: 8px 8px 0 0;
  background-color: #ffffff;
  overflow: hidden;
}
#graph-cover-2:hover ~ #line-g-2{
  display: block;
}
#line-g-2{
  position: absolute;
  top: -1000px;
  height: 0;
  border-top: 1px dashed #ccc;
  display: none;
}
#line-v-2{
  position: absolute;
  left: -1000px;
  width: 0px;
  border-left: 1px dashed #ccc;
  display: none;
}
#graph-cover-2:hover ~ #line-v-2{
  display: block;
}
#candle-info-2{
  display: none;
  padding: 1px 4px 1px 4px;
  font: Bold 13px "Courier New";
  background: rgba(255,255,255,0.7);
  color: rgba(0,0,50,0.7);
  position: absolute;
  top:  2px;
  left: 2px;
  z-index: 2;
}
#graph-cover-2:hover ~ #point-price-2,#graph-cover-2:hover ~ #from-to-text-2,#graph-cover-2:hover ~ #candle-info-2{
  display: inline-block;
}
#last-price-2{
  display: inline-block;
  padding: 1px 2px;
  font: Bold 13px "Courier New";
  background: #2c2e61;
  color: #fff;
  position: absolute;
  top: -1000px;
  left: 10px;
  z-index: 2;
}
#point-price-2{
  padding: 1px 2px;
  font: Bold 13px "Courier New";
  background: #888;
  color: #fff;
  position: absolute;
  top: -1000px;
  left: 10px;
  display: none;
  z-index: 3;
}
#graph-cover-2{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0, 0);
  z-index: 50;
}
#from-to-text-2{
  display: none;
  padding: 1px 0 1px 4px;
  width: 290px;
  font: Bold 13px "Courier New";
  background: #888;
  color: #fff;
  position: absolute;
  top: -1000px;
  left: 10px;
  z-index: 2;
}

.chart.second-chart .second-chart-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #2c2e61;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.chart.second-chart #analysisBoardTabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0 12px;
  margin-top: 0;
  margin-bottom: 0;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background-color: #f8f9fa;
}

.chart.second-chart #analysisBoardTabs .nav-item {
  margin-bottom: 0;
}

.chart.second-chart #analysisBoardTabs .nav-link {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  color: #2c2e61;
  background-color: #d6b56c; /* Золотистый фон как у неактивных вкладок таблиц */
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chart.second-chart #analysisBoardTabs .nav-link:hover {
  background-color: #e3c783;
  color: #2c2e61;
}

.chart.second-chart #analysisBoardTabs .nav-link.active {
  background-color: #2c2e61;
  color: #ffffff;
}

.chart.second-chart #analysisBoardTabContent {
  padding-top: 8px;
}
