/* ChartKit — استایل مشترک نمودار (خانه، سیگنال، دمو) */

.ck { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ck-stage {
  position: relative;
  width: 100%;
  min-height: 260px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(2, 6, 16, 0.5);
}
.ck-canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.ck-canvas:focus-visible { box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.55); }

.ck-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(9, 15, 27, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.ck-seg { display: inline-flex; background: rgba(15, 23, 42, 0.6); border-radius: 9px; padding: 2px; gap: 1px; }
.ck-seg button {
  border: 0;
  background: transparent;
  color: #9fb0c9;
  font: inherit;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.ck-seg button:hover { color: #e6edfb; background: rgba(56, 189, 248, 0.1); }
.ck-seg button.active { background: rgba(56, 189, 248, 0.2); color: #e0f2fe; }
.ck-btn {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
  color: #c2d0e4;
  font: inherit;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
}
.ck-btn:hover { border-color: rgba(56, 189, 248, 0.45); color: #e0f2fe; }
.ck-btn.on { background: rgba(56, 189, 248, 0.18); border-color: rgba(56, 189, 248, 0.55); color: #e0f2fe; }
.ck-div { width: 1px; height: 18px; background: rgba(148, 163, 184, 0.18); margin: 0 2px; }

/* در حالت تمام‌صفحه */
.chart-box:fullscreen { width: 100vw; height: 100vh; max-height: none; border-radius: 0; background: #060b16; }
.chart-box:fullscreen .ck-stage { min-height: 0; flex: 1; }
.chart-box:fullscreen .ck-canvas { height: 100%; }

/* پنجره‌های چارت (سیگنال و دمو) */
.chart-host { height: min(58vh, 440px); min-height: 300px; }
.chart-host .ck { height: 100%; }
.chart-host .ck-stage { flex: 1 1 auto; min-height: 0; }
@media (max-width: 720px) {
  .chart-host { height: min(52vh, 380px); }
  .ck-toolbar { gap: 4px; padding: 5px; }
  .ck-seg button, .ck-btn { font-size: 10px; padding: 4px 7px; }
}
