/* chart-indicators-panel.css v3
   Standalone Indicators & Tools panel loaded inside chart cockpit iframe */

/* ── Base ── */
.chart-indicators-panel-body {
  margin: 0;
  min-height: 100vh;
  box-sizing: border-box;
  background: #0b0f14;
  color: var(--text-primary, #c9d1d9);
  font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
  font-size: 13px;
}

/* ── Root container ── */
.cip-root {
  padding: 0 0 40px;
  max-width: 820px;
  margin: 0 auto;
}

/* ── Header ── */
.cip-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.7);
  background: rgba(13, 17, 23, 0.6);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.cip-header__left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cip-header__icon {
  font-size: 14px;
}

.cip-header__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-blue, #58a6ff);
}

.cip-header__sub {
  font-size: 11px;
  color: rgba(139, 148, 158, 0.6);
  margin-left: auto;
}

/* ── Section wrapper ── */
.cip-section {
  margin: 0;
  padding: 16px 18px 20px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.cip-section__hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.cip-section__ico {
  font-size: 13px;
  opacity: 0.8;
}

.cip-section__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(201, 209, 217, 0.75);
}

.cip-section__hint {
  font-size: 11px;
  color: rgba(139, 148, 158, 0.55);
  margin-left: 4px;
}

.cip-section__badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(88, 166, 255, 0.12);
  color: rgba(88, 166, 255, 0.8);
  border: 1px solid rgba(88, 166, 255, 0.2);
}

/* ── Pinned quick tools board ── */
.cip-pinned-board {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px dashed rgba(88, 166, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  align-items: center;
}

.cip-pinned-empty {
  font-size: 11px;
  color: rgba(139, 148, 158, 0.5);
  margin: 0;
}

/* Pinned chip inside board (rendered by JS) */
.cip-pinned-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 6px;
  background: rgba(30, 37, 48, 0.9);
  border: 1px solid rgba(88, 166, 255, 0.25);
  font-size: 11px;
  font-weight: 600;
  color: rgba(201, 209, 217, 0.85);
  cursor: default;
}

.cip-pinned-chip[data-active="true"] {
  border-color: rgba(88, 166, 255, 0.55);
  background: rgba(88, 166, 255, 0.1);
  color: #a8d0ff;
}

.cip-pinned-chip__unpin {
  background: none;
  border: none;
  padding: 0 0 0 3px;
  cursor: pointer;
  font-size: 11px;
  color: rgba(139, 148, 158, 0.55);
  line-height: 1;
  transition: color 0.15s;
}

.cip-pinned-chip__unpin:hover {
  color: rgba(248, 81, 73, 0.85);
}

/* ── Controls grid ── */
.cip-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.cip-ctrl-group {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid rgba(48, 54, 61, 0.55);
  border-radius: 8px;
  padding: 10px 12px;
}

.cip-ctrl-group__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(139, 148, 158, 0.6);
  margin-bottom: 8px;
}

.cip-ctrl-group__body {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cip-btn {
  font-size: 11px !important;
  padding: 3px 9px !important;
  height: 26px !important;
}

/* ── Decision engine section (inherits chart-decision-strip styles) ── */
.cip-section .chart-decision-strip {
  margin: 0;
  border-radius: 8px;
}

.cip-strategy-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

/* ── Indicators section ── */
.cip-ind-group {
  margin-bottom: 16px;
  background: rgba(16, 20, 27, 0.5);
  border: 1px solid rgba(48, 54, 61, 0.45);
  border-radius: 10px;
  overflow: hidden;
}

.cip-ind-group:last-child {
  margin-bottom: 0;
}

.cip-ind-group__hd {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px 8px;
  background: rgba(22, 27, 34, 0.7);
  border-bottom: 1px solid rgba(48, 54, 61, 0.4);
}

.cip-ind-group__name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(201, 209, 217, 0.7);
}

.cip-ind-group__desc {
  font-size: 11px;
  color: rgba(139, 148, 158, 0.5);
}

/* ── Indicator list ── */
.cip-ind-list {
  display: flex;
  flex-direction: column;
}

/* ── Single indicator row ── */
.cip-ind-row {
  display: grid;
  grid-template-columns: auto 104px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.3);
  transition: background 0.12s;
}

.cip-ind-row:last-child {
  border-bottom: none;
}

.cip-ind-row:hover {
  background: rgba(88, 166, 255, 0.04);
}

.cip-ind-row--future {
  opacity: 0.55;
}

.cip-ind-row--future:hover {
  background: none;
}

/* Toggle chip in indicator row — keep left-aligned */
.cip-ind-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Spark canvas */
.cip-spark {
  display: block;
  width: 100px;
  height: 24px;
  border-radius: 3px;
  opacity: 0.75;
}

/* Description text */
.cip-ind-row__desc {
  font-size: 11px;
  color: rgba(139, 148, 158, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Insight (live readout) */
.cip-insight {
  font-size: 10px;
  color: rgba(139, 148, 158, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Soon" tag */
.cip-ind-row__tag {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 139, 253, 0.1);
  color: rgba(88, 166, 255, 0.6);
  border: 1px solid rgba(88, 166, 255, 0.15);
  white-space: nowrap;
}

/* ── Pin button ── */
.cip-pin-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  opacity: 0.35;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, transform 0.1s;
}

.cip-pin-btn:not(:disabled):hover {
  opacity: 1;
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
}

.cip-pin-btn[data-pinned="true"] {
  opacity: 1;
  background: rgba(88, 166, 255, 0.15);
  border-color: rgba(88, 166, 255, 0.4);
}

.cip-pin-btn[data-pinned="true"]:hover {
  background: rgba(248, 81, 73, 0.1);
  border-color: rgba(248, 81, 73, 0.3);
}

.cip-pin-btn:active {
  transform: scale(0.88);
}

.cip-pin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.2;
}

/* ── Responsive: narrow iframe ── */
@media (max-width: 560px) {
  .cip-ind-row {
    grid-template-columns: auto 1fr auto;
  }
  .cip-spark,
  .cip-ind-row__desc {
    display: none;
  }
  .cip-controls-grid {
    grid-template-columns: 1fr 1fr;
  }
  .cip-header__sub {
    display: none;
  }
}
