/* Multi-chart workspace: the canvas size follows its draggable pane. */
#drawKind[hidden],
#thirds[hidden],
.chart-popup[hidden],
.chart-pane[hidden],
.drawing-delete[hidden] {
  display: none !important;
}

#chartGrid {
  min-height: 250px;
  overflow: hidden;
  isolation: isolate;
}

.split-root {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
}

.pane-split {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.split-y {
  flex-direction: column;
}

.split-x {
  flex-direction: row;
}

.chart-pane {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #e7e8e9;
}

.chart-pane canvas,
.chart-pane canvas#chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.chart-pane.active-pane:after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #3b82f6;
  pointer-events: none;
  opacity: 0.75;
}

.pane-controls {
  position: absolute;
  left: 8px;
  top: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 85%;
  pointer-events: none;
}

.pane-controls select {
  pointer-events: auto;
  width: 58px;
  font-size: 11px;
  padding: 4px 5px;
  background: #1e293bee;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 7px;
}

.pane-status {
  font-size: 9px;
  color: #475569;
  background: #e7e8e9bd;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark-chart .pane-status {
  color: #94a3b8;
  background: #0f172acc;
}

.pane-divider {
  flex: 0 0 6px;
  background: #334155;
  position: relative;
  z-index: 3;
  touch-action: none;
}

.pane-divider:hover,
.pane-divider:focus-visible {
  background: #3b82f6;
}

.split-x > .pane-divider {
  cursor: col-resize;
}

.split-y > .pane-divider {
  cursor: row-resize;
}

.chart-popup {
  position: fixed;
  z-index: 40;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 35px #0007;
  max-width: calc(100vw - 16px);
}

.popup-title {
  font-size: 11px;
  color: #94a3b8;
  margin: 0 0 10px;
}

.layout-options {
  display: grid;
  grid-template-columns: repeat(3, 94px);
  gap: 6px;
}

.layout-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 4px;
  color: #cbd5e1;
}

.layout-options small {
  font-size: 9px;
  line-height: 1.2;
}

.drawing-icons {
  display: flex;
  gap: 5px;
}

.drawing-icons button {
  display: grid;
  place-items: center;
  padding: 7px;
  width: 42px;
  height: 42px;
  color: #cbd5e1;
}

.drawing-delete {
  position: absolute;
  z-index: 4;
  font-size: 10px !important;
  padding: 6px 8px !important;
  background: #1e293b !important;
  color: #fca5a5 !important;
  border-color: #64748b !important;
}

.replaybar {
  gap: 8px;
  flex-wrap: wrap;
}

.replay-left {
  flex-wrap: wrap;
}

.replay-left select {
  padding: 6px;
  max-width: 145px;
}

#replayStep {
  max-width: 115px;
}

.chart-toolbar .tools {
  gap: 4px;
}

.chart-full .chart-meta {
  padding-bottom: 5px;
}

.chart-watermark {
  z-index: 1;
}

.session-calendar {
  width: 310px;
  padding: 14px;
  z-index: 10000;
}

.calendar-heading {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-heading select {
  min-width: 0;
  padding: 7px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-grid span {
  text-align: center;
  padding: 6px 0;
  color: #94a3b8;
  font-size: 11px;
}

.calendar-grid button {
  padding: 8px 0;
  min-width: 0;
}

.calendar-grid button:disabled {
  color: #64748b;
  background: #1e293b;
  opacity: 0.45;
  cursor: not-allowed;
  border-color: transparent;
}

.calendar-grid button.selected {
  background: #2563eb;
  color: white;
  border-color: #93c5fd;
}

/* Keep navigation and execution controls in compact, independently wrapping groups. */
.replaybar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.mini-trade,
.session-navigation,
.replay-left {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.replaybar button,
.replaybar select {
  height: 34px;
  box-sizing: border-box;
  white-space: nowrap;
  font-size: 11px;
  padding: 6px 9px;
}

.session-navigation select {
  width: 124px;
  flex: 0 0 124px;
}

.session-navigation button {
  flex: 0 0 auto;
}

.replay-left select {
  width: 74px;
}

.replaybar .progress {
  flex: 1 1 100px;
  min-width: 80px;
}

@media (max-width: 600px) {
  .session-navigation {
    flex-wrap: wrap;
  }

  .replaybar .progress {
    display: none;
  }
}
