/* ══════════════════════════════════════════════════════════════════════════
   charts.css — Chart containers, titles, GEX panel, glossary.
   Loaded by: index, aggregate, live, joke.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Chart title + section labels ─────────────────────────────────────── */
.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: #b0bec5;
  margin-bottom: 8px;
  padding: 0 2px;
}
.chart-section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #546e7a;
  margin: 14px 0 4px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.axis2-legend {
  font-size: 11px;
  color: #78909c;
  text-transform: none;
  letter-spacing: 0;
}
.btn-overlay-toggle {
  padding: 2px 10px;
  font-size: 11px;
  background: transparent;
  color: #78909c;
  border: 1px solid #37474f;
  border-radius: 4px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: color 0.15s, border-color 0.15s;
}
.btn-overlay-toggle:hover {
  color: #b0bec5;
  border-color: #546e7a;
}
.btn-overlay-toggle--active {
  color: #FF9800;
  border-color: #FF9800;
}
.overlay-toggle-group {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* ── Small num-stepper for inline chart-section-label use ────────────── */
.num-stepper--sm { height: 18px; }
.num-stepper--sm .num-stepper__btn { width: 18px; font-size: 11px; }
.num-stepper--sm input[type="number"] { width: 26px; min-width: 26px; font-size: 10px; }

/* ── Chart fullscreen — shared across pages ───────────────────────────── */
.chart-wrap {
  position: relative;
}
.chart-full-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  padding: 0 7px;
  font-size: 10px;
  line-height: 16px;
  background: rgba(26, 29, 39, 0.70);
  color: #546e7a;
  border: 1px solid #37474f;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chart-full-btn:hover {
  color: #b0bec5;
  border-color: #546e7a;
  background: rgba(26, 29, 39, 0.92);
}
.chart-container--fullscreen {
  position: fixed !important;
  inset: 24px !important;
  width: auto !important;
  height: auto !important;
  z-index: 9000 !important;
  margin: 0 !important;
  border-radius: 8px !important;
  background: #1a1d27;
}
#chart-exit-btn {
  display: none;
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 9001;
  padding: 3px 12px;
  font-size: 12px;
  background: rgba(26, 29, 39, 0.92);
  border: 1px solid #546e7a;
  border-radius: 4px;
  color: #b0bec5;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#chart-exit-btn:hover { color: #fff; border-color: #78909c; }
#chart-exit-btn.visible { display: block; }

/* ── Chart containers ─────────────────────────────────────────────────── */
.chart-container {
  width: 100%;
  height: 340px;
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
}
/* Stacked 3-grid charts (Greeks, Exposure) need extra height for x-axis labels */
.chart-container--stacked {
  height: 380px;
}
/* Tall chart container (heatmap) */
.chart-container--tall {
  height: 420px;
}
/* Short chart container (aggregate bar chart — includes x-axis labels) */
.chart-container--short {
  height: 260px;
}
/* Compact chart container (per-contract Greeks — Gamma / Vanna / Delta) */
.chart-container--compact {
  height: 160px;
}

/* ── GEX Summary panel ────────────────────────────────────────────────── */
.gex-panel {
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 10px 18px 14px;
  margin-top: 4px;
  margin-bottom: 16px;
  min-height: 36px;
}
.gex-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 32px;
  align-items: center;
  margin-bottom: 10px;
}
.gex-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
}
.gex-key {
  color: #546e7a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  white-space: nowrap;
}
.gex-val {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.gex-empty {
  font-size: 12px;
  color: #546e7a;
  padding: 4px 0;
}
.gex-guidance {
  width: 100%;
  font-size: 11px;
  opacity: 0.85;
  padding: 4px 0 2px 0;
  line-height: 1.5;
}
.gex-tip {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid #2a2d3e;
  border-radius: 6px;
}
.gex-tip-headline {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}
.gex-tip-bullets {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gex-tip-bullets li {
  font-size: 11px;
  color: #90a4ae;
  line-height: 1.55;
}
.gex-tip-group {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #2a2d3e;
}
.gex-tip-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #546e7a;
  margin-bottom: 4px;
}
.gex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}
.gex-table thead th {
  text-align: left;
  color: #546e7a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid #2a2d3e;
}
.gex-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
.gex-table td {
  padding: 5px 8px 5px 0;
  vertical-align: middle;
  border-bottom: 1px solid #1e2130;
  white-space: nowrap;
}
.gex-table td.gex-td-desc {
  white-space: normal;
  color: #78909c;
  font-size: 11px;
  line-height: 1.4;
}
.gex-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.gex-oor {
  color: #546e7a;
  font-size: 10px;
  font-weight: normal;
}

/* ── Glossary ─────────────────────────────────────────────────────────── */
.glossary {
  background: #1a1d27;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  margin-top: 20px;
  overflow: hidden;
}
.glossary-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #b0bec5;
  list-style: none;
  user-select: none;
}
.glossary-toggle::-webkit-details-marker { display: none; }
.glossary-toggle::before {
  content: '\25B6';
  font-size: 10px;
  color: #546e7a;
  transition: transform 0.2s;
}
details[open] .glossary-toggle::before { transform: rotate(90deg); }
.glossary-toggle:hover { color: #e0e0e0; }
.glossary-hint {
  font-size: 11px;
  color: #546e7a;
  font-weight: 400;
}
.glossary-body {
  padding: 0 18px 18px;
  border-top: 1px solid #2a2d3e;
}
.glossary-section {
  margin-top: 16px;
}
.glossary-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #546e7a;
  margin-bottom: 10px;
}
.glossary-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.glossary-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.glossary-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 3px;
}
.glossary-term {
  font-size: 12px;
  font-weight: 600;
  color: #cfd8dc;
  margin-bottom: 2px;
}
.glossary-desc {
  font-size: 12px;
  color: #78909c;
  line-height: 1.6;
}

/* ── Regime case table (glossary section) ─────────────────────────────── */
.glossary-case-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 4px;
}
.glossary-case-table thead th {
  text-align: left;
  color: #546e7a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px 5px 0;
  border-bottom: 1px solid #2a2d3e;
  white-space: nowrap;
}
.glossary-case-table tbody tr {
  border-bottom: 1px solid #1e2130;
}
.glossary-case-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.glossary-case-table td {
  padding: 7px 10px 7px 0;
  vertical-align: top;
  color: #90a4ae;
  line-height: 1.55;
}
.glossary-case-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
  color: #cfd8dc;
  font-size: 11px;
}
.glossary-case-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.gc-pos     { color: #4ade80; font-weight: 600; white-space: nowrap; }
.gc-neg     { color: #EF5350; font-weight: 600; white-space: nowrap; }
.gc-neutral { color: #78909c; font-weight: 600; white-space: nowrap; }
.gc-action  { color: #b0bec5; font-style: italic; }

/* ── Knowledge Insights — row-based grid (shared by daily + live) ───── */
.ki-details { margin-bottom: 10px; }
.ki-body { padding: 0 !important; }
.ki-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid #546e7a;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  color: #b0bec5;
}
.ki-header-row {
  display: grid;
  grid-template-columns: 90px 0.7fr 1.5fr 1.5fr;
  gap: 1px;
  background: #2a2d3e;
  border-bottom: 1px solid #3a3d4e;
}
.ki-hcell {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #546e7a;
  padding: 5px 8px;
  background: #12141c;
}
.ki-row {
  display: grid;
  grid-template-columns: 90px 0.7fr 1.5fr 1.5fr;
  gap: 1px;
  background: #2a2d3e;
  border-bottom: 1px solid #1e2130;
}
.ki-row:last-child { border-bottom: none; }
.ki-cell {
  font-size: 11px;
  color: #b0bec5;
  padding: 6px 8px;
  background: #1a1d27;
  line-height: 1.45;
}
.ki-cell--topic {
  font-weight: 600;
  color: #e0e0e0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ki-cell--message { color: #e0e0e0; font-weight: 500; }
.ki-cell--reason  { color: #94a3b8; }
.ki-pos { color: #4ade80; }
.ki-neg { color: #EF5350; }

/* ── ΔOI Alerts panel ───────────────────────────────────────────────────── */
.doi-alert-header { margin-bottom: 8px; }
.doi-alert-list { display: flex; flex-direction: column; gap: 6px; }
.doi-alert-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 5px 10px; background: rgba(255,255,255,0.02);
  border: 1px solid #2a2d3e; border-radius: 5px; font-size: 12px;
}
.doi-badge {
  display: inline-block; font-size: 10px; padding: 1px 6px;
  border-radius: 3px; font-weight: 600; white-space: nowrap;
}
.doi-badge-opening  { background: rgba(66,165,245,0.2);  color: #42A5F5; }
.doi-badge-closing  { background: rgba(255,183,77,0.2);  color: #FFB74D; }
.doi-badge-crumble  { background: rgba(239,83,80,0.2);   color: #EF5350; }
.doi-badge-build    { background: rgba(74,222,128,0.2);   color: #4ade80; }
.doi-badge-vol-open { background: rgba(74,222,128,0.15);  color: #81C784; }
.doi-badge-vol-close{ background: rgba(239,83,80,0.15);   color: #E57373; }
.doi-badge-sr-invalidated   { background: rgba(239,83,80,0.25);  color: #EF5350; font-weight: 600; }
.doi-badge-sr-strengthening { background: rgba(74,222,128,0.25); color: #4ade80; font-weight: 600; }
.doi-badge-sr-forming       { background: rgba(255,213,79,0.2);  color: #FFD54F; }
.doi-badge-sr-weakening     { background: rgba(255,152,0,0.2);   color: #FFA726; }
.doi-alert-strike { color: #e0e0e0; font-weight: 600; white-space: nowrap; }
.doi-alert-exp    { color: #78909c; font-size: 11px; white-space: nowrap; }
.doi-alert-delta  { font-weight: 600; font-size: 11px; white-space: nowrap; }
.doi-alert-impact { color: #90a4ae; font-size: 11px; font-style: italic; }
.doi-alert-detail { color: #78909c; font-size: 10px; width: 100%; margin-top: 2px; }
.doi-zone {
  font-size: 9px; padding: 1px 5px; border-radius: 2px;
  text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600;
}
.doi-zone-support    { background: rgba(74,222,128,0.1);  color: #4ade80; }
.doi-zone-resistance { background: rgba(239,83,80,0.1);   color: #EF5350; }
.doi-zone-atm        { background: rgba(255,213,79,0.1);  color: #FFD54F; }
.doi-date-selector {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #2a2d3e;
}
.doi-date-label { color: #78909c; font-size: 11px; white-space: nowrap; }
.doi-date-sel {
  font-size: 11px; height: 24px; padding: 0 4px;
  background: #272a3a; color: #e0e0e0; border: 1px solid #3a3d4e;
  border-radius: 3px; min-width: 110px;
}
.doi-load-btn { height: 22px; padding: 0 10px; font-size: 10px; line-height: 20px; margin-left: auto; }
