/* overview view styles — owned by the overview feature; loaded after /styles.css. */
.ov { display: grid; gap: 14px; }
.ov-ink { color: var(--ink); font-weight: 600; }

/* entrance: staggered rise (off with reduced motion) */
.ov-in { animation: ov-rise .42s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes ov-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- agent strip ---------- */
.ov-agent { display: grid; gap: 10px; border-color: var(--line); position: relative; overflow: hidden; }
.ov-agent.running { border-color: var(--ink); }
.ov-agent-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ov-agent-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ov-status { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ov-agent-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ov-agent-meta .engine-logos { display: inline-flex; gap: 4px; }
.ov-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bar2); flex: none; position: relative; }
.ov-dot.scheduled { background: var(--good); }
.ov-dot.running { background: var(--good); animation: ov-pulse 1.6s ease-out infinite; }
@keyframes ov-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.ov-narrative p { margin: 0 0 2px; font-size: 14.5px; line-height: 1.5; }
.ov-narrative p:first-child { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.ov-progress { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.ov-progress i { display: block; height: 100%; width: 0; background: var(--bar); border-radius: 99px; transition: width .6s ease; }
.ov-progress-label { margin: 0; }

/* ---------- brief ---------- */
.ov-brief { border-left: 3px solid var(--accent); }
.ov-brief-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.ov-kicker { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ov-headline { font-size: 20px; letter-spacing: -.02em; margin: 2px 0 6px; line-height: 1.25; }
.ov-summary { color: var(--ink); margin: 0 0 8px; max-width: 75ch; }
.ov-bullets { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 3px; }
.ov-bullets li::marker { color: var(--muted); }
.ov-focus { display: flex; gap: 10px; align-items: baseline; background: var(--soft); border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; }
.ov-focus span { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); flex: none; }

/* ---------- KPI tiles + engine cards ---------- */
.ov-kpis { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1280px) { .ov-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ov-kpi, .ov-engine { display: grid; gap: 6px; align-content: start; }
.ov-kpi-top, .ov-engine-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.ov-kpi .label { font-size: 12px; color: var(--muted); }
.ov-kpi-val { font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ov-num { font-variant-numeric: tabular-nums; }
.ov-spark { width: 100%; height: 34px; display: block; }
.ov-spark-empty { display: block; height: 34px; line-height: 34px; font-family: var(--mono); font-size: 11px; }
.ov-engines { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ov-engine .engine-chip { font-weight: 600; }
.ov-engine .ov-kpi-val .small { margin-left: 4px; letter-spacing: 0; font-weight: 500; }

.ov-delta { font: 500 11px/1 var(--mono); padding: 3px 7px; border-radius: 99px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.ov-delta.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 9%, transparent); }
.ov-delta.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.ov-delta .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- two-up rows ---------- */
.ov-cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.ov-sub { margin: -6px 0 10px; }
.ov-mv-cols { display: grid; gap: 14px; }
.ov-good { color: var(--good); } .ov-bad { color: var(--bad); }
.ov-movers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ov-movers li { display: grid; grid-template-columns: 14px 16px minmax(0, 1fr); gap: 6px; align-items: center; font-size: 13px; }
.ov-movers a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-movers a:hover { text-decoration: underline; }
.ov-mv-icon { font: 600 13px/1 var(--mono); text-align: center; }
.ov-movers.won .ov-mv-icon { color: var(--good); } .ov-movers.lost .ov-mv-icon { color: var(--bad); }

.ov-comp { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(50px, 1fr) 40px 72px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.ov-comp > .ov-delta { justify-self: end; }
.ov-comp .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-comp .pill { font-size: 10px; padding: 0 5px; margin-left: 4px; }

.ov-mission-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ov-ring { width: 64px; height: 64px; flex: none; }
.ov-ring-fg { transition: stroke-dashoffset .9s cubic-bezier(.2, .7, .2, 1); }
.ov-mission { list-style: none; margin: 0; padding: 0; counter-reset: m; }
.ov-mission li { counter-increment: m; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ov-mission li::before { content: counter(m); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font: 500 11px/1 var(--mono); }

.ov-locs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.ov-loc { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

.ov-locked { background: var(--soft); }
.ov-locked h2::before { content: '🔒 '; }
.ov-nudge { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-color: var(--ink); }
.ov-nudge > div { flex: 1 1 260px; }

@media (max-width: 600px) {
  .ov-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ov-kpi-val { font-size: 24px; }
  .ov-cols { grid-template-columns: 1fr; }
  .ov-mv-cols { grid-template-columns: 1fr; }
  .ov-agent-meta { margin-left: 0; width: 100%; }
  .ov-comp { grid-template-columns: minmax(0, 1fr) 56px 36px 66px; }
  .ov-headline { font-size: 18px; }
}
/* ---------- markets card ---------- */
.ov-mk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ov-mk-head h2 { margin: 0; }
.ov-mk-links { display: flex; align-items: center; gap: 12px; }
.ov-flag { font-size: 18px; line-height: 1; width: 24px; text-align: center; flex: none; font-family: var(--mono); }
.ov-mk-rows { display: grid; gap: 2px; }
.ov-mk-row { display: grid; grid-template-columns: 24px minmax(0, 1.2fr) minmax(60px, 1fr) 44px; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ov-mk-row:first-child { border-top: 0; }
.ov-mk-row > b.mono { text-align: right; }
.ov-mk-name { display: grid; min-width: 0; }
.ov-mk-name b, .ov-mk-elabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-mk-wait { text-align: right; }
.ov-mk-notice { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.ov-mk-edit { display: grid; gap: 6px; margin-bottom: 10px; }
.ov-mk-erow { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(70px, 110px) 28px auto; align-items: center; gap: 8px; }
.ov-mk-erow input[type=range] { width: 100%; accent-color: var(--bar); }
.ov-mk-search { display: flex; gap: 8px; margin-bottom: 8px; }
.ov-mk-search input { flex: 1; min-width: 0; font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.ov-mk-results { display: grid; gap: 4px; margin-bottom: 10px; max-height: 220px; overflow: auto; }
.ov-mk-result { display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; color: var(--ink); background: var(--soft); border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.ov-mk-result:hover { border-color: var(--ink); }
.ov-mk-result span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-mk-result em { font: 500 11px/1 var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.ov-mk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .ov-mk-row { grid-template-columns: 24px minmax(0, 1fr) 44px; } .ov-mk-row .bar, .ov-mk-wait { display: none; } .ov-mk-erow { grid-template-columns: 24px minmax(0, 1fr) auto; } .ov-mk-erow input[type=range] { grid-column: 2 / -1; grid-row: 2; } .ov-mk-erow [data-wv] { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .ov-in { animation: none; }
  .ov-dot.running { animation: none; }
  .ov-progress i, .ov-ring-fg { transition: none; }
}

/* ---------- live run progress (Boost, cron or MCP) ---------- */
.ov-run { display: grid; gap: 12px; border-color: var(--ink); position: relative; }
#ovRunBody { display: grid; gap: 12px; min-width: 0; }
.ov-run-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ov-run-head h2 { margin: 0 0 2px; }
.ov-run-head p { margin: 0; }
.ov-run-pct { font-size: 34px; font-weight: 650; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ov-run .ov-progress { height: 8px; }
.ov-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.ov-steps li { display: inline-flex; align-items: center; gap: 7px; }
.ov-step-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--bar2); flex: none; }
.ov-steps li.done { color: var(--ink); }
.ov-steps li.done .ov-step-dot { background: var(--good); box-shadow: none; }
.ov-steps li.current { color: var(--ink); font-weight: 600; }
.ov-steps li.current .ov-step-dot { background: var(--bar); box-shadow: none; animation: ov-breathe 1.8s ease-in-out infinite; }
@keyframes ov-breathe { 50% { opacity: .35; } }
.ov-run-engines { display: grid; gap: 8px; }
.ov-run-eng { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr) 64px; align-items: center; gap: 12px; font-size: 13px; }
.ov-run-bar { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.ov-run-bar i { display: block; height: 100%; background: var(--bar); border-radius: 99px; transition: width .6s ease; }
.ov-run-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.ov-run-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-run-meta span:first-child { color: var(--ink); font-weight: 600; }
.ov-run-mini { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ov-run-mini p { margin: 0; }

/* ---------- "how to upgrade this section" ---------- */
.ov-tip { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--soft); display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; font-size: 13.5px; line-height: 1.45; }
.ov-tip p { margin: 0; flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.ov-tip p b { margin-right: 4px; }
.ov-tip-wide { margin-top: -2px; background: var(--panel); border: 1px solid var(--line); }
.ov-tip-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ov-tip-x { font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; padding: 4px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ov-tip-x:hover { color: var(--ink); }
.ov-tip-x:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 4px; }

/* ---------- run history ---------- */
.ov-h-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ov-h-head h2 { margin: 0 0 2px; }
.ov-h-head p { margin: 0; }
.ov-h-spark { width: 160px; max-width: 100%; }
.ov-hist { list-style: none; margin: 0 0 8px; padding: 0; }
.ov-hrow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .8fr); gap: 6px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ov-hrow:first-child { border-top: 0; }
.ov-hrow.off { color: var(--muted); }
.ov-h-when { display: grid; gap: 2px; min-width: 0; }
.ov-h-when b { font-variant-numeric: tabular-nums; }
.ov-h-st { color: var(--bad); }
.ov-h-what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-h-what .engine-logos { display: inline-flex; gap: 3px; }
/* label | value | change chip, the chip in a fixed-width slot so values line up whether or not a change is shown */
.ov-h-m { display: grid; grid-template-columns: auto auto minmax(9ch, auto); align-items: baseline; gap: 6px; justify-content: end; justify-items: start; }
.ov-h-m b { font-variant-numeric: tabular-nums; }
.ov-pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }

@media (max-width: 600px) {
  .ov-run-pct { font-size: 28px; }
  .ov-run-eng { grid-template-columns: minmax(0, 1fr) 56px; gap: 4px 10px; }
  .ov-run-eng .ov-run-bar { grid-column: 1 / -1; grid-row: 2; }
  .ov-hrow { grid-template-columns: 1fr 1fr; }
  .ov-h-when, .ov-h-what { grid-column: 1 / -1; }
  .ov-h-m { justify-content: start; }
}
/* ---------- run history page (/app/overview/history): range, growth factors, charts, full rows ---------- */
.rh { display: grid; gap: 14px; }
.rh h2 { margin: 0 0 2px; }
.rh h3 { margin: 0 0 2px; font-size: 14px; }
.rh-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.rh-head p { margin: 0; }
.rh-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rh-range { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.rh-range .btn { border: 0; border-radius: 0; border-left: 1px solid var(--line); }
.rh-range .btn:first-child { border-left: 0; }
.rh-range .btn.on { background: var(--ink); color: var(--panel); }
.rh-range .btn:focus-visible, .rh [data-csv]:focus-visible { outline: 2px solid var(--info); outline-offset: -2px; }
.rh-sec-head { margin-bottom: 10px; }
.rh-sec-head p { margin: 0; }
.rh-empty h2 { font-size: 16px; }
.rh-empty p { margin: 4px 0 0; }
.rh-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.rh-tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.rh-tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.rh-tile-top .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-streak { font-size: 11px; color: var(--good); white-space: nowrap; }
.rh-tile-mid { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; }
.rh-val { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rh-tile-spark { width: 90px; flex: 0 0 auto; display: flex; justify-content: flex-end; }
.rh-tile-spark .ov-spark { width: 90px; height: 28px; }
.rh-tile-facts { margin: 0; display: grid; gap: 2px; }
.rh-tile-facts div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rh-tile-facts dt { white-space: nowrap; }
.rh-tile-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rh-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rh-chart { min-width: 0; }
.rh-chart > p { margin: 0 0 8px; }
.rh-plot { width: 100%; min-height: 60px; }
.chart-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart-tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex: 0 0 auto; }
.chart-marker path { cursor: help; }
.rh-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.rh-row .ov-h-what { gap: 4px 10px; }
.rh-wl b.w { color: var(--good); } .rh-wl b.l { color: var(--bad); }
.rh-nom { grid-column: 1 / -1; margin: 0; }
.rh-ms { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 18px; }
.rh-ms .ov-h-m { justify-content: start; grid-template-columns: minmax(0, 1fr) auto minmax(9ch, auto); }
@media (max-width: 900px) { .rh-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .rh-head { align-items: flex-start; }
  .rh-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .rh-tile-spark, .rh-tile-spark .ov-spark { width: 64px; }
  .rh-val { font-size: 19px; }
  .rh-row { grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
  .rh-row:first-child { border-top: 1px solid var(--line); }
  .rh-ms { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ov-steps li.current .ov-step-dot { animation: none; }
  .ov-run-bar i { transition: none; }
}

/* visually hidden live line for the progress card (phase changes only) */
.ov-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- action traces (markers): chart legend icons, overview history spark marks, goals met line ---------- */
.mk-ico { display: inline-block; vertical-align: -1px; flex: 0 0 auto; }
.chart-legend .mk-ico { margin-right: 0; }
.chart-mk { cursor: help; }
.ov-spark-wrap { position: relative; padding-top: 9px; }
.ov-mks { position: absolute; left: 3px; right: 3px; top: 0; height: 10px; }
.ov-mk { position: absolute; top: 0; transform: translateX(-50%); line-height: 0; cursor: help; }
.ov-mk-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 4px 0 0; font-size: 11px; }
.ov-mk-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ov-goals-met { margin: 2px 0 0; display: flex; align-items: center; gap: 5px; color: var(--good); }
