/*
 * Interactive Chart (/stock-analysis/interactive-chart). Builds on stock-analysis.css: the same
 * card, toolbar and segmented-control tokens, so the deep-blue skin only swaps values.
 */
.ic-quote {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.ic-name strong {
  font-size: 1.1rem;
  color: var(--sa-heading);
  margin-right: 6px;
}
.ic-last {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ic-change {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ic .is-up {
  color: var(--sa-good);
}
.ic .is-down {
  color: var(--sa-bad);
}
.ic-chips {
  margin: 0 0 0 auto;
  justify-content: flex-end;
}
.ic-chips a {
  padding: 2px 10px;
  font-size: 0.78rem;
}

.ic-card {
  padding: 12px 14px 14px;
  margin-bottom: 12px;
}
.ic-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 8px;
}

/* Segmented controls of buttons (stock-analysis.css styles the link version). */
.ic-seg {
  flex-wrap: wrap;
  max-width: 100%;
}
.ic-seg button {
  border: 0;
  background: transparent;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sa-muted);
  white-space: nowrap;
  line-height: 1.5;
}
.ic-seg button:hover:not(:disabled) {
  color: var(--sa-text);
}
.ic-seg button.active {
  background: var(--sa-card);
  color: var(--sa-text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}
[data-theme="dark"] .ic-seg button.active {
  background: #1a3358;
}
.ic-seg button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ic-seg button:focus-visible,
.ic-tools .btn:focus-visible {
  outline: 2px solid var(--sa-accent);
  outline-offset: 1px;
}

.ic-tools {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
.ic-tools .btn.active {
  background: var(--sa-accent);
  border-color: var(--sa-accent);
  color: #fff;
}

/* Studies: a disclosure with a floating menu, no Bootstrap JS needed. */
.ic-studies {
  position: relative;
}
.ic-studies > summary {
  list-style: none;
}
.ic-studies > summary::-webkit-details-marker {
  display: none;
}
.ic-studies-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
}
.ic-studies-menu label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}
.ic-studies-group {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sa-muted);
  margin: 6px 0 2px;
}
.ic-studies-group:first-child {
  margin-top: 0;
}

/* Crosshair readout */
.ic-readout {
  min-height: 2.6em;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--sa-text);
  margin-bottom: 4px;
}
.ic-r-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}
.ic-r-time {
  font-weight: 600;
}
.ic-r b {
  font-weight: 600;
  color: var(--sa-muted);
}
.ic-r-studies {
  color: var(--sa-muted);
}
.ic-sw {
  display: inline-block;
  width: 10px;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  border-radius: 2px;
}

/* Event badges (Studies menu, readout, list) and the event list under the chart. */
.ic-ev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 50%;
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
  flex: none;
}
.ic-ev-earnings { background: #2f80ed; }
.ic-ev-dividend { background: #22a447; }
.ic-ev-split { background: #f59e0b; }
.ic-ev-action { background: #8b9bb4; }
.ic-r-events {
  color: var(--sa-text);
}
.ic-events {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sa-border);
  font-size: 0.85rem;
}
.ic-ev-next {
  margin-bottom: 8px;
}
.ic-ev-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
.ic-ev-list li {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--sa-border);
}
.ic-ev-list li:last-child {
  border-bottom: 0;
}
.ic-ev-date {
  flex: none;
  width: 92px;
  color: var(--sa-muted);
  font-variant-numeric: tabular-nums;
}

.ic-stage {
  position: relative;
}
.ic-chart {
  width: 100%;
  height: 530px;
}
.ic-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: color-mix(in srgb, var(--sa-card) 80%, transparent);
  color: var(--sa-muted);
  font-weight: 500;
  z-index: 5;
}
.ic-status[hidden] {
  display: none;
}

@media (max-width: 767.98px) {
  .ic-seg button {
    padding: 3px 7px;
  }
  .ic-tools {
    margin-left: 0;
  }
  .ic-chips {
    margin-left: 0;
    justify-content: flex-start;
  }
}
