/* Overview charts (PLAN.md workstream C). Everything is scoped under .mo-overview. */

.mo-overview {
  /* data colours; chrome uses the site tokens directly */
  --mo-surface: var(--panel);
  --mo-new: #3987e5;
  --mo-repeat: #d95926;
  --mo-point: #3987e5;
  --mo-planet: var(--gold);
  --mo-unknown: var(--muted);
  /* temperature ramp, coolest (3,000 K) to hottest (30,000 K) */
  --mo-temp-1: #e5534b;
  --mo-temp-2: #f0954a;
  --mo-temp-3: #f3ead6;
  --mo-temp-4: #a9cbf5;
  --mo-temp-5: #5b93e6;
  position: relative;
  min-width: 0;
}
:root[data-theme="night"] .mo-overview {
  --mo-new: #f05a4b;
  --mo-repeat: #a8392f;
  --mo-point: #f05a4b;
  --mo-temp-1: #8f2c23;
  --mo-temp-2: #a8392f;
  --mo-temp-3: #c9473b;
  --mo-temp-4: #e8584a;
  --mo-temp-5: #ff7a6c;
}

.mo-overview .mo-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 12px; }
.mo-overview .mo-title { margin: 0; font-size: 28px; line-height: 1.1; }
.mo-overview .mo-readout { margin: 0; color: var(--muted); font-size: 14px; }

/* ---- filter row */
.mo-overview .mo-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 12px;
}
.mo-overview .mo-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mo-overview .mo-field__label { font-size: 12px; color: var(--muted); }
.mo-overview .mo-inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mo-overview .mo-dash { color: var(--muted); font-size: 12px; }
.mo-overview .mo-select,
.mo-overview .mo-num {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 8px; font-size: 13px; min-width: 0; max-width: 100%;
}
.mo-overview .mo-num { width: 84px; }
.mo-overview .mo-range { width: 130px; accent-color: var(--accent); }
.mo-overview .mo-out { color: var(--text); font-variant-numeric: tabular-nums; }
.mo-overview .mo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-overview .mo-chip {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px;
  padding: 3px 10px; cursor: pointer; white-space: nowrap; font-size: 13px; line-height: 1.4;
}
.mo-overview .mo-chip:hover { border-color: var(--muted); }
.mo-overview .mo-chip[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.mo-overview .mo-chip__n { opacity: .7; margin-left: 4px; font-size: 12px; }
.mo-overview .mo-reset {
  background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 13px;
}
.mo-overview .mo-reset:hover { border-color: var(--accent); color: var(--accent); }
.mo-overview .mo-field--reset { margin-left: auto; }

.mo-overview .mo-selbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; font-size: 13px; }
.mo-overview .mo-selbar[hidden] { display: none; }
.mo-overview .mo-selbar__count { font-weight: 600; }
.mo-overview .mo-selbar__hint { color: var(--muted); font-size: 12px; }

/* ---- chart grid */
.mo-overview { container-type: inline-size; container-name: mo; }
.mo-overview .mo-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@container mo (min-width: 800px) {
  .mo-overview .mo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container mo (min-width: 1180px) {
  .mo-overview .mo-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mo-overview .mo-card { grid-column: span 3; }
  .mo-overview .mo-card[data-chart="hr"],
  .mo-overview .mo-card[data-chart="dist"],
  .mo-overview .mo-card[data-chart="polar"] { grid-column: span 2; }
  .mo-overview .mo-card[data-chart="cond"] { grid-column: 1 / -1; }
}
.mo-overview .mo-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; min-width: 0;
}
.mo-overview .mo-card.mo-card--wide { grid-column: 1 / -1; }
.mo-overview .mo-card[data-chart="sky"] { --mo-surface: var(--bg); }
.mo-overview .mo-card__title {
  margin: 0; font-size: 15px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0;
}
.mo-overview .mo-card__sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); max-width: 80ch; }
.mo-overview .mo-card__foot { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mo-overview .mo-card__foot:empty { display: none; }
.mo-overview .mo-plot { width: 100%; min-width: 0; }
.mo-overview .mo-svg { display: block; max-width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.mo-overview .mo-empty { color: var(--muted); font-size: 13px; padding: 32px 0; text-align: center; margin: 0; }

/* ---- legend */
.mo-overview .mo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.mo-overview .mo-legend:empty { display: none; }
.mo-overview .mo-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.mo-overview .mo-legend__ramp { display: inline-block; width: 90px; height: 8px; border-radius: 4px; }
.mo-overview .mo-legend__end { font-variant-numeric: tabular-nums; }
.mo-overview .mo-legend__dot { display: inline-block; border-radius: 50%; background: var(--muted); }
.mo-overview .mo-legend__diamond { display: inline-block; width: 8px; height: 8px; background: var(--mo-planet); transform: rotate(45deg); margin: 0 2px; }
.mo-overview .mo-legend__cross { color: var(--text); font-weight: 700; font-size: 15px; line-height: 1; }
.mo-overview .mo-legend__rect { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.mo-overview .mo-legend__rect--sel { background: var(--text); }
.mo-overview .mo-legend__selkey { display: none; }
.mo-overview.has-selection .mo-legend__selkey { display: inline-flex; }

/* ---- svg chrome */
.mo-overview .mo-axis path.domain,
.mo-overview .mo-axis line { stroke: var(--line); }
.mo-overview .mo-axis text { fill: var(--muted); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.mo-overview .mo-axis-label { fill: var(--muted); font-size: 11px; }
.mo-overview .mo-gridlines line,
.mo-overview .mo-gridlines circle { stroke: var(--line); stroke-opacity: .7; fill: none; stroke-width: 1; }
.mo-overview .mo-gridlines .is-horizon { stroke: var(--muted); stroke-opacity: .7; }
.mo-overview .mo-ref { stroke: var(--muted); stroke-opacity: .45; fill: none; stroke-width: 1; }
.mo-overview .mo-ref-label { fill: var(--muted); font-size: 10px; }
.mo-overview .mo-label {
  fill: var(--text); font-size: 11px; pointer-events: none;
  paint-order: stroke; stroke: var(--mo-surface); stroke-width: 3px; stroke-linejoin: round;
}
.mo-overview .mo-sky-ticks text { fill: var(--muted); font-size: 10px; }
.mo-overview .mo-compass { fill: var(--text) !important; font-weight: 600; font-size: 12px !important; }

.mo-overview .mo-sphere { fill: var(--bg); stroke: var(--line); }
.mo-overview .mo-graticule { fill: none; stroke: var(--line); stroke-width: .6; }
.mo-overview .mo-bound { fill: none; stroke: var(--muted); stroke-opacity: .3; stroke-width: .7; }
.mo-overview .mo-bound.is-strong { stroke: var(--accent); stroke-opacity: .75; stroke-width: 1.2; }
.mo-overview .mo-equator { fill: none; stroke: var(--muted); stroke-opacity: .6; stroke-width: 1; }
.mo-overview .mo-ecliptic { fill: none; stroke: var(--gold); stroke-opacity: .5; stroke-width: 1; }
.mo-overview .mo-zenith-path { fill: none; stroke: var(--accent); stroke-opacity: .55; stroke-width: 1; stroke-dasharray: 4 4; }
.mo-overview .mo-zenith-session { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-opacity: .85; }
.mo-overview .mo-zenith-now { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.mo-overview .mo-zenith-label { fill: var(--accent); }
.mo-overview .mo-legend__zenith { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); margin-right: 4px; vertical-align: middle; }
.mo-overview .mo-cons-names text { fill: var(--muted); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }

/* ---- marks */
.mo-overview .mo-marks { pointer-events: none; }
.mo-overview .mo-dot { stroke: var(--mo-surface); stroke-width: 2; transition: opacity .15s; }
.mo-overview .mo-card[data-chart="sky"] .mo-dot { stroke-width: 1; }
.mo-overview .mo-cons { fill: var(--text); stroke: var(--mo-surface); stroke-width: 1; transition: opacity .15s; }
.mo-overview.has-selection .is-dim { opacity: .14; }
.mo-overview .mo-hover { fill: none; stroke: var(--text); stroke-width: 1.5; pointer-events: none; }
.mo-overview .mo-mean { stroke: var(--text); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.mo-overview .mo-brush .selection { fill: var(--accent); fill-opacity: .12; stroke: var(--accent); stroke-opacity: .7; }
.mo-overview .mo-brush .overlay { cursor: crosshair; }
.mo-overview .mo-svg.is-pointing .mo-brush .overlay,
.mo-overview .mo-svg.is-pointing { cursor: pointer; }
.mo-overview .mo-bar { transition: opacity .15s; }
.mo-overview .mo-col.is-dimbar .mo-bar { opacity: .3; }
.mo-overview .mo-col:hover .mo-bar { filter: brightness(1.15); }
.mo-overview .mo-col.is-active .mo-cap { fill: var(--text); font-weight: 700; }
.mo-overview .mo-selbar { fill: var(--text); pointer-events: none; }
.mo-overview .mo-hit { fill: transparent; cursor: pointer; }
.mo-overview .mo-cap { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* ---- tooltip */
.mo-overview .mo-tip {
  position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none;
  min-width: 150px; max-width: 260px; padding: 8px 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); font-size: 12px; line-height: 1.45;
}
.mo-overview .mo-tip[hidden] { display: none; }
.mo-overview .mo-tip__title { font-weight: 600; font-size: 13px; color: var(--text); }
.mo-overview .mo-tip__sub { color: var(--muted); margin-bottom: 4px; }
.mo-overview .mo-tip__row { display: flex; gap: 6px; align-items: baseline; }
.mo-overview .mo-tip__row strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.mo-overview .mo-tip__row span { color: var(--muted); }
.mo-overview .mo-tip__note { color: var(--muted); margin-top: 4px; font-size: 11px; }
.mo-overview .mo-tip__hint { color: var(--accent); margin-top: 4px; font-size: 11px; }

/* ---- table view */
.mo-overview .mo-table { margin-top: 16px; }
.mo-overview .mo-table__wrap { overflow-x: auto; }
.mo-overview .mo-table table { font-size: 13px; }
.mo-overview .mo-table td, .mo-overview .mo-table th { padding: 6px 8px; white-space: nowrap; }
.mo-overview .mo-num-cell { text-align: right; }
.mo-overview .mo-table tr.is-sel td { background: color-mix(in srgb, var(--accent) 14%, transparent); }

@media (max-width: 600px) {
  .mo-overview .mo-filters { padding: 12px; gap: 10px 14px; }
  .mo-overview .mo-field--small { flex: 1 1 90px; }
  .mo-overview .mo-field--reset { margin-left: 0; }
  .mo-overview .mo-card { padding: 12px; }
  .mo-overview .mo-title { font-size: 24px; }
}

/* ---- glossary tooltips (styles in style.css .gl / .gtip); chips are buttons, so no underline */
.mo-overview .mo-chip.gl { text-decoration: none; cursor: pointer; }
.mo-overview .mo-legend__item.gl { cursor: help; }
.mo-overview .mo-axis .tick text.gl { text-decoration: none; cursor: help; }

/* satellite passes */
.mo-overview .mo-sat-pass { fill: none; stroke: var(--muted); stroke-opacity: .35; stroke-width: 1; stroke-dasharray: 2 3; }
.mo-overview .mo-sat-pass.is-visible { stroke-opacity: .7; stroke-dasharray: 5 3; }
.mo-overview .mo-sat-pass.is-seen { stroke: var(--good); stroke-opacity: 1; stroke-width: 2.5; stroke-dasharray: none; }
.mo-overview .mo-sat-arrow { fill: var(--good); }
.mo-overview .mo-passes path { pointer-events: stroke; }
.mo-overview .mo-legend__pass { display: inline-block; width: 18px; height: 0; border-top: 2px dashed var(--muted); margin-right: 4px; vertical-align: middle; }
.mo-overview .mo-legend__pass.is-seen { border-top: 3px solid var(--good); }
.mo-overview .mo-line-label { paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.mo-overview .mo-line-label.is-seen { fill: var(--good); font-weight: 600; }
.mo-overview .mo-line-label.is-zenith { fill: var(--accent); }
