/* ==========================================================================
   Bizmania Assistant — тёмный «остров» «Котировки».
   Намеренно тёмная зона внутри светлого UI. Загружается после app.css.
   ========================================================================== */

.q-terminal {
  background: #0e1117; color: #d1d4dc;
  border: 1px solid #232733; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.q-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px;
  background: #131722; align-items: center; border-bottom: 1px solid #232733;
}
.q-toolbar select {
  background: #131722; color: #d1d4dc; border: 1px solid #2a2e39; border-radius: var(--radius-xs);
  padding: 6px 9px; font-size: 13px; max-width: 180px;
}
.q-seg { display: inline-flex; border: 1px solid #2a2e39; border-radius: var(--radius-xs); overflow: hidden; }
.q-seg button {
  background: transparent; color: #b2b5be; border: none; padding: 6px 11px;
  font-size: 12px; font-family: inherit; cursor: pointer; line-height: 1.2;
}
.q-seg button + button { border-left: 1px solid #2a2e39; }
.q-seg button:hover { color: #fff; }
.q-seg button.active { background: #2962ff; color: #fff; }
.q-btn {
  background: #1e222d; color: #d1d4dc; border: 1px solid #2a2e39; border-radius: var(--radius-xs);
  padding: 6px 11px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.q-btn:hover { background: #2a2e39; }
.q-btn.active { background: #2962ff; border-color: #2962ff; color: #fff; }
.q-toolbar2 {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px;
  background: #0e1117; align-items: center; justify-content: space-between;
}
.q-legend { font-size: 12px; color: #b2b5be; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-chart-wrap { position: relative; height: clamp(340px, 62vh, 620px); background: #131722; }
#qChart { position: absolute; inset: 0; }
.q-chart-wrap canvas { max-height: none; }

/* Внутренняя таблица lightweight-charts не наследует стили таблиц данных */
.q-chart-wrap table { border-collapse: collapse; width: auto; }
.q-chart-wrap td { border: none; padding: 0; text-align: right; white-space: normal; word-break: normal; min-width: 0; }
.q-chart-wrap td:first-child { text-align: right; }
.q-chart-wrap th { border: none; padding: 0; }
.q-chart-wrap tr:nth-child(even) { background: transparent; }
.q-chart-wrap tr:hover { background: transparent; }

.q-tooltip {
  position: absolute; pointer-events: none; background: rgba(19, 23, 34, .94);
  border: 1px solid #2a2e39; border-radius: var(--radius-xs); padding: 7px 9px;
  font-size: 12px; font-variant-numeric: tabular-nums; color: #d1d4dc; z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
}
.q-tooltip .tt-time { color: #9ca3af; margin-bottom: 3px; }
.q-tooltip .tt-ohcl span { display: inline-block; margin-right: 8px; }

.q-levels { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.q-lvl { position: absolute; left: 0; right: 0; height: 14px; margin-top: -7px; border-top: 1px dashed rgba(240, 170, 80, .8); cursor: ns-resize; pointer-events: auto; touch-action: none; }
.q-lvl-label {
  position: absolute; right: 6px; top: -8px; background: rgba(240, 170, 80, .95); color: #0e1117;
  font-size: 11px; font-weight: 650; border-radius: 4px; padding: 0 4px; line-height: 16px;
  display: flex; align-items: center; gap: 2px;
}
.q-lvl-del { background: transparent; border: none; color: #0e1117; cursor: pointer; font-size: 12px; padding: 0 2px; line-height: 1; }
.q-status { padding: 7px 12px; font-size: 12px; color: #7a7f8d; border-top: 1px solid #232733; background: #0e1117; }
.q-hint { padding: 5px 12px; font-size: 11px; color: #7a7f8d; background: #0e1117; border-bottom: 1px solid #232733; }

@media (max-width: 1024px) {
  .q-toolbar select { max-width: none; flex: 1 1 140px; }
  .q-chart-wrap { height: clamp(300px, 54vh, 520px); }
}
