/* Homepage price chart (dashboard/hero_chart.py + static/hero-chart.js).
   Colours come from marketing.css tokens; the panel carries its own dark set
   (Andy 30 Oct: dark/light), which the poster and the canvas both read. */
.mk-hero-inner:has(.mk-hero-chart) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
@media (max-width: 900px) { .mk-hero-inner:has(.mk-hero-chart) { grid-template-columns: minmax(0, 1fr); } }

.hc { margin: 0; border: 1px solid var(--rule); background: var(--paper-raise); min-width: 0; color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hc {
    --paper-raise: #11161b; --paper-sink: #0b0f13; --ink: #e6ebef; --ink-2: #c3ccd3; --ink-3: #8d99a4;
    --rule: #26303a; --rule-soft: #1b232b; --pos: #3fb68b; --neg: #e5604d; --oxide: #e2551f; --oxide-ink: #f2834f;
  }
}
:root[data-theme="dark"] .hc {
  --paper-raise: #11161b; --paper-sink: #0b0f13; --ink: #e6ebef; --ink-2: #c3ccd3; --ink-3: #8d99a4;
  --rule: #26303a; --rule-soft: #1b232b; --pos: #3fb68b; --neg: #e5604d; --oxide: #e2551f; --oxide-ink: #f2834f;
}
.hc-head, .hc-live-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); background: var(--paper-sink); border-bottom: 1px solid var(--rule); padding: 9px 14px;
}
.hc-sym b { color: var(--pos); font-weight: 600; }
.hc-res {
  font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.01em;
  text-transform: none; color: var(--pos); text-decoration: none; line-height: 1;
}
.hc-res:hover { text-decoration: underline; }
.hc-plot { position: relative; height: 320px; }
.hc-live-plot { position: relative; height: 112px; }
.hc-plot > svg.hc-poster, .hc-live-plot > svg.hc-poster { display: block; width: 100%; height: 100%; }
.hc-plot .hc-canvas, .hc-live-plot .hc-canvas { position: absolute; inset: 0; }
.hc-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.hc-cap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px;
  border-top: 1px solid var(--rule); padding: 9px 14px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); line-height: 1.5;
}
.hc-cap > span:first-child { flex-basis: 100%; color: var(--ink); }
.hc-cap a { color: var(--oxide-ink); }
.hc-attr { color: var(--ink-3); }
.hc-live { border-top: 1px solid var(--rule); }
.hc-live-head { border-top: none; }
.hc-live-px { color: var(--ink); text-transform: none; letter-spacing: .02em; }

/* Poster marks - same encoding as the live chart */
.hc-poster line.hc-up, .hc-poster rect.hc-up { stroke: var(--pos); fill: var(--pos); }
.hc-poster line.hc-dn, .hc-poster rect.hc-dn { stroke: var(--neg); fill: var(--neg); }
.hc-poster line { stroke-width: 1; }
.hc-poster .hc-win { fill: var(--pos); fill-opacity: .1; }
.hc-poster .hc-risk { fill: var(--neg); fill-opacity: .1; }
.hc-poster .hc-zone { fill: var(--oxide); fill-opacity: .28; }
.hc-poster .hc-l-entry { stroke: var(--oxide-ink); stroke-width: 1.5; }
.hc-poster .hc-l-stop { stroke: var(--neg); stroke-width: 1.5; stroke-dasharray: 5 3; }
.hc-poster .hc-l-tp { stroke: var(--pos); stroke-width: 1; stroke-dasharray: 3 3; }
.hc-poster .hc-ax { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); stroke: none; }
.hc-poster text.hc-l-entry { fill: var(--oxide-ink); }
.hc-poster text.hc-l-stop { fill: var(--neg); }
.hc-poster text.hc-l-tp { fill: var(--pos); }
.hc-poster .hc-mk-in { fill: var(--oxide-ink); }
.hc-poster .hc-mk-out { fill: var(--paper-raise); stroke: var(--pos); stroke-width: 2.5; }

/* Live overlay (drawn by hero-chart.js over the Lightweight Charts pane) */
.hc-ov-box { position: absolute; }
.hc-ov-win { background: rgba(44, 110, 86, .1); }
.hc-ov-risk { background: rgba(158, 43, 30, .1); }
.hc-ov-zone { background: rgba(226, 85, 31, .26); }
.hc-ov-line { position: absolute; height: 0; border-top: 1px dashed var(--pos); }
.hc-ov-line.stop { border-top: 1.5px dashed var(--neg); }
.hc-ov-line.entry { border-top: 1.5px solid var(--oxide-ink); }

.hc-fade { animation: hc-in .35s ease-out both; }
@keyframes hc-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hc-fade { animation: none; } }

@media (max-width: 640px) {
  .hc-plot { height: 280px; }
  .hc-res { font-size: 20px; }
  .hc-head, .hc-live-head, .hc-cap { padding-inline: 10px; }
}

/* Phones: headline, then the chart, then the rest, so the chart sits above the fold. */
@media (max-width: 900px) {
  .mk-hero-inner:has(.mk-hero-chart) { row-gap: 0; }
  .mk-hero-inner:has(.mk-hero-chart) > div:first-child { display: contents; }
  .mk-hero-inner:has(.mk-hero-chart) > div:first-child > * { order: 4; }
  .mk-hero-inner:has(.mk-hero-chart) > div:first-child > .mk-eyebrow { order: 1; }
  .mk-hero-inner:has(.mk-hero-chart) > div:first-child > h1 { order: 2; }
  .mk-hero-inner:has(.mk-hero-chart) > .mk-hero-chart { order: 3; margin: 6px 0 26px; }
}
@media (max-width: 640px) { .hc-plot { height: 240px; } }

