/* Symbol chart modal — Fintechpaa /trade (UT Bot) */
.chart-modal {
  --c-panel: #ffffff;
  --c-border: #e2e8f0;
  --c-text: #1f2937;
  --c-muted: #64748b;
  --c-accent: var(--fp-accent, #06b6d4);
  --c-primary: var(--fp-primary, #0f766e);
  --c-buy: #089981;
  --c-sell: #dc2626;
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
}
.chart-modal.open { display: flex; }
.chart-modal.expanded {
  padding: 6px;
}
.chart-dialog {
  display: flex;
  flex-direction: column;
  width: min(1200px, 100%);
  height: min(92vh, 980px);
  max-height: 94vh;
  overflow: hidden;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--fp-radius-lg, 16px);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}
.chart-modal.expanded .chart-dialog {
  width: 98vw;
  height: 96vh;
  max-height: 96vh;
  border-radius: 10px;
}
.chart-head {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
}
.chart-head h3 { margin: 0; font-size: 1rem; color: var(--c-primary); font-weight: 700; }
.chart-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chart-close,
.chart-expand {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}
.chart-close:hover,
.chart-expand:hover { border-color: var(--c-accent); color: var(--c-accent); }
.chart-expand[aria-pressed="true"] {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(6, 182, 212, 0.1);
}
.chart-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  overflow: hidden;
}
.chart-modal.expanded .chart-body {
  grid-template-columns: 1fr 280px;
}
@media (max-width: 900px) {
  .chart-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .chart-modal.expanded .chart-body { grid-template-rows: 1fr minmax(120px, 28vh); }
}
.chart-canvas-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
  padding: 10px 12px 12px;
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  .chart-canvas-wrap { border-right: none; border-bottom: 1px solid var(--c-border); }
}
#chartCanvas {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 440px;
  height: 100%;
  border-radius: 8px;
  background: #121a2b;
}
.chart-tooltip {
  position: absolute;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(17, 26, 43, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e6edf3;
  font-size: 0.75rem;
  line-height: 1.4;
  pointer-events: none;
}
.chart-side {
  overflow-y: auto;
  padding: 14px 16px 18px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--c-text);
}
.chart-side p { margin: 0 0 8px; }
.chart-side .tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 6px;
}
.chart-side .tag.buy { background: rgba(8, 153, 129, 0.15); color: var(--c-buy); }
.chart-side .tag.sell { background: rgba(220, 38, 38, 0.14); color: var(--c-sell); }
.chart-side .tag.ut { background: rgba(6, 182, 212, 0.14); color: var(--c-primary); }
.chart-legend {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 0.78rem;
}
.chart-legend span { display: flex; align-items: center; gap: 8px; }
.chart-legend i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.chart-legend .ut-long i { background: var(--c-buy); }
.chart-legend .ut-short i { background: var(--c-sell); }
.chart-legend .buyzone i { background: #089981; }
.chart-legend .sellzone i { background: #dc2626; }
.chart-legend .entry i { background: #0e7490; }
.chart-legend .stop i { background: #f7a600; }
.chart-legend .tp i { background: #3dd68c; }
.chart-hint { color: var(--c-muted); margin-top: 10px; }
.chart-side .dim { color: var(--c-muted); font-size: 0.78rem; }
.chart-link {
  background: none;
  border: none;
  color: var(--c-accent);
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  font-size: inherit;
}
.chart-link:hover { text-decoration: underline; }
.chart-loading {
  padding: 40px;
  text-align: center;
  color: var(--c-muted);
}
