/* The options context layer on the Charts page: the overlay toggle rail and
   the panel of gamma, max pain, flow, IV rank and dark pool readouts.

   A SEPARATE FILE FROM charts.css ON PURPOSE. charts.css owns the page shell,
   the header, the chart well and the sidebar. This owns one feature that sits
   inside that shell, and keeping them apart means the overlay layer can be read,
   reviewed and reverted as one thing. It loads after charts.css, so the single
   override in it is deliberate and is marked as such.

   Boundaries by tone, not by lines: panel over void, well inside panel. 8px
   gaps, 4px radius. Every number is mono with tabular figures, every label is
   tracked caps in the muted grey, and no body text is pure white. */

/* ── the toggle rail ────────────────────────────────────────────────────── */
/* The template's placeholder line is removed by the overlay layer when it
   runs, so it survives as the no-script state and needs no rule here. */

.charts-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border: 0;
  border-radius: var(--banana-radius);
  background: var(--banana-surface-container);
  color: var(--banana-on-surface-variant);
  font-family: var(--banana-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.charts-overlay-toggle:hover { background: var(--banana-surface-container-high); }

/* The dot is the state, not the color of the label. An off toggle is a hollow
   ring so that on and off are told apart by shape as well as by brightness. */
.charts-overlay-toggle__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--banana-outline);
  background: transparent;
}

.charts-overlay-toggle[aria-pressed="true"] {
  background: var(--banana-surface-container-highest);
  color: var(--banana-text-body);
}

.charts-overlay-toggle[aria-pressed="true"] .charts-overlay-toggle__dot {
  border-color: var(--banana-chart-call);
  background: var(--banana-chart-call);
  box-shadow: 0 0 8px color-mix(in srgb, var(--banana-chart-call) 35%, transparent);
}

/* Each overlay's own accent, so the toggle and the thing it draws agree.
   Gamma walls take both call and put, so the toggle takes the pair. */
.charts-overlay-toggle[data-overlay="max_pain"][aria-pressed="true"] .charts-overlay-toggle__dot {
  border-color: var(--banana-chart-volume);
  background: var(--banana-chart-volume);
  box-shadow: 0 0 8px rgba(252, 224, 71, 0.35);
}

.charts-overlay-toggle[data-overlay="darkpool"][aria-pressed="true"] .charts-overlay-toggle__dot {
  border-color: var(--banana-on-surface-variant);
  background: var(--banana-on-surface-variant);
  box-shadow: none;
}

.charts-overlays__cost {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--banana-outline);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .charts-overlays__cost { display: none; }
}

/* ── the sidebar column ─────────────────────────────────────────────────── */

/* THE ONE LAYOUT RULE IN THIS FILE. A fixed height column whose first panel
   absorbs the slack pushes the last one off the bottom of the screen with no
   scrollbar to say so. The column scrolls as one thing instead, and each panel
   decides its own share in charts_sectors.css. The panel sizing that used to
   sit here belonged to a watchlist and an overlay foot rail, and both are
   gone. */
.charts-side { overflow-y: auto; }

.charts-ov {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--banana-outline-ghost);
}

.charts-ov:first-child {
  border-top: 0;
  padding-top: 2px;
}

.charts-ov__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.charts-ov__title {
  margin: 0;
  font-family: var(--banana-font-heading);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--banana-text-body);
}

.charts-ov__meta {
  font-family: var(--banana-font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--banana-outline);
}

.charts-ov__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  font-family: var(--banana-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.charts-ov__k { color: var(--banana-on-surface-variant); }
.charts-ov__v { color: var(--banana-text-body); }
.charts-ov__v[data-dir="up"] { color: var(--banana-chart-call); }
.charts-ov__v[data-dir="down"] { color: var(--banana-chart-put); }

/* A wall row carries a bar of its own so the panel reads in the same grammar
   as the chart: a band above the price and a band below it. */
.charts-ov__row--band {
  position: relative;
  padding-left: 10px;
}

.charts-ov__row--band::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 1px;
  background: var(--banana-chart-put);
}

.charts-ov__row--band .charts-ov__v[data-dir="up"] { color: var(--banana-chart-call); }

.charts-ov__row--band:has(.charts-ov__v[data-dir="up"])::before {
  background: var(--banana-chart-call);
}

.charts-ov__note {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--banana-on-surface-variant);
}

.charts-ov__note[data-tone="warn"] { color: var(--banana-chart-volume); }
.charts-ov__note[data-tone="error"] { color: var(--banana-chart-put); }

/* THE RULE THAT PICKED THE WALLS IS PART OF THE READOUT. It is set apart in
   the well tone rather than run in with the notes, because a reader who cannot
   account for a band on their chart is looking at decoration. */
.charts-ov__rule {
  margin: 6px 0 0;
  padding: 6px 8px;
  border-radius: var(--banana-radius);
  background: var(--banana-surface-container-lowest);
  font-size: 10px;
  line-height: 1.5;
  color: var(--banana-on-surface-variant);
}

.charts-ov__select {
  width: 100%;
  padding: 5px 6px;
  border: 0;
  border-radius: var(--banana-radius);
  background: var(--banana-surface-container-lowest);
  color: var(--banana-text-body);
  font-family: var(--banana-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.charts-ov__select:focus-visible {
  outline: 2px solid var(--banana-primary-fixed);
  outline-offset: 1px;
}

.charts-ov__big {
  font-family: var(--banana-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  line-height: 1.05;
  color: var(--banana-on-surface);
}

.charts-ov__spark {
  display: block;
  width: 100%;
  height: 44px;
  margin: 2px 0 4px;
  background: var(--banana-surface-container-lowest);
  border-radius: var(--banana-radius);
}

/* ── THE OVERLAY PICKER ──────────────────────────────────────────────────────
   Sits in the header beside the timeframes and is built to read as one of
   them: same padding, same radius, same mono face, same tone. It is a
   different KIND of control, a menu rather than a segmented choice, so it
   carries a caret and a count and nothing else distinguishes it. The count is
   the reason the closed state is useful: a trader needs to see that gamma is
   drawn without opening the menu to find out. */
.charts-ovmenu { position: relative; }

.charts-ovmenu__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 0;
  border-radius: var(--banana-radius);
  background: var(--banana-surface-container);
  color: var(--banana-on-surface-variant);
  font-family: var(--banana-font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.charts-ovmenu__btn:hover { background: var(--banana-surface-container-highest); }
.charts-ovmenu__btn:focus-visible {
  outline: 2px solid var(--banana-primary);
  outline-offset: 2px;
}
.charts-ovmenu__btn[aria-expanded="true"] {
  background: var(--banana-surface-container-highest);
  color: var(--banana-on-surface);
}

/* Gold marks an enabled control. The dots identify the chart series. */
.charts-ovmenu__count {
  min-width: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--banana-primary-fixed);
  color: var(--banana-on-primary-fixed);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.charts-ovmenu__caret {
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.7;
}

/* Boundaries by tone, per the design system: the popover is one surface step
   above the header it opens from, with no border doing the sectioning. */
.charts-ovmenu__pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--banana-radius);
  background: var(--banana-surface-container-high);
  box-shadow: 0 12px 28px rgb(0 0 0 / 46%);
}
.charts-ovmenu__pop[hidden] { display: none; }

.charts-ovmenu__pop .charts-overlay-toggle {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

@media (max-width: 900px) {
  /* The header wraps at narrow widths, so the popover anchors left to stay on
     screen rather than hanging off the right edge. */
  .charts-ovmenu__pop { right: auto; left: 0; }
}
.charts-overlay-preview-lock{padding:10px 12px;margin:0;max-width:260px;color:#aaa696;font:11px/1.7 Inter,system-ui,sans-serif}
.charts-overlay-preview-lock a{display:block;color:#dbc77e;text-decoration:none;margin-top:8px}
