/* Hero "open the chart" panel on /backtest/<symbol>/, /tick-data/<symbol>/ and
   /trading-simulator/ (owner, 2026-11-02). A dimmed fake candle chart with one
   OPEN CHART button, timeframe chips under it, and on the simulator a market
   search above it. Markup is injected by scripts/feature-pages/inject-chart-panel.js,
   behaviour + candles by /chart-panel.js. Self-contained: the three page
   templates (guide.css split hero, lp.css, inline landing CSS) share no tokens. */
.cpanel {
  --cp-accent: #00d4ff;
  --cp-buy: #00e676;
  --cp-sell: #ff3d57;
  --cp-border: #1c2531;
  --cp-text: #cbd7e4;
  --cp-muted: #7d93ac;
  --cp-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  position: relative;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  font-family: var(--cp-mono);
}
.cpanel[data-cp="tick"] { --cp-accent: #f5c542; }
.hero-content .cpanel { margin: 4px auto 0; }

/* Market search (simulator only) */
.cp-search { position: relative; }
.cp-search-box {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 46px;
  border: 1px solid var(--cp-border); border-radius: 11px;
  background: rgba(10,15,23,.82);
  transition: border-color .15s;
}
.cp-search-box:focus-within { border-color: var(--cp-accent); }
.cp-search-box svg { flex: 0 0 16px; color: var(--cp-muted); }
.cp-search-box input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  color: #fff; font: 600 13px var(--cp-mono); letter-spacing: .04em;
}
.cp-search-box input::placeholder { color: var(--cp-muted); }
.cp-search-cur {
  flex: 0 0 auto; padding: 4px 9px; border-radius: 999px;
  border: 1px solid rgba(0,212,255,.35); color: var(--cp-accent);
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
}
.cp-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  max-height: 264px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  border: 1px solid var(--cp-border); border-radius: 11px;
  background: #0b1119; box-shadow: 0 18px 44px rgba(0,0,0,.55);
}
.cp-list[hidden] { display: none; }
.cp-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  color: var(--cp-text); font-size: 12.5px; font-weight: 600;
}
.cp-list li span:last-child { color: var(--cp-muted); font-size: 10.5px; letter-spacing: .1em; }
.cp-list li[aria-selected="true"], .cp-list li:hover { background: rgba(0,212,255,.1); color: #fff; }
.cp-list .cp-empty { cursor: default; color: var(--cp-muted); }
.cp-list .cp-empty:hover { background: none; color: var(--cp-muted); }

/* The chart */
.cp-chart {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--cp-border); border-radius: 14px;
  background: linear-gradient(180deg, #0c121a, #070b11);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  text-decoration: none; color: inherit;
}
.cp-head {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  background: rgba(7,11,17,.6);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #e8f1fa;
}
.cp-head .cp-tf-cur { color: var(--cp-accent); }
.cp-head .cp-tag {
  margin-left: auto; padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12); color: var(--cp-muted);
  font-size: 9.5px; letter-spacing: .14em;
}
.cp-chart svg.cp-candles {
  position: absolute; inset: 40px 0 0 0; width: 100%; height: calc(100% - 40px);
  opacity: .5; transition: opacity .25s;
}
.cp-chart::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 50% 58%, rgba(5,8,12,.15), rgba(5,8,12,.62));
}
.cp-open {
  position: absolute; left: 50%; top: 58%; z-index: 3;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 12px;
  background: var(--cp-accent); color: #04121a;
  font: 700 13px var(--cp-mono); letter-spacing: .14em; white-space: nowrap;
  box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 0 6px rgba(255,255,255,.04);
  transition: transform .18s, filter .18s;
}
.cpanel[data-cp="tick"] .cp-open { color: #1a1204; }
.cp-open svg { width: 14px; height: 14px; }
.cp-chart:hover svg.cp-candles { opacity: .62; }
.cp-chart:hover .cp-open { transform: translate(-50%, -50%) scale(1.04); filter: brightness(1.08); }
.cp-chart:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 3px; }

/* Timeframe chips */
.cp-tfs { display: flex; gap: 6px; }
.cp-tfs button {
  flex: 1 1 0; min-width: 0; height: 36px; padding: 0 4px;
  border: 1px solid var(--cp-border); border-radius: 9px;
  background: rgba(10,15,23,.7); color: var(--cp-muted);
  font: 700 11.5px var(--cp-mono); letter-spacing: .06em; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.cp-tfs button:hover { color: #fff; border-color: rgba(255,255,255,.22); }
.cp-tfs button[aria-pressed="true"] {
  color: var(--cp-accent); border-color: var(--cp-accent);
  background: rgba(0,212,255,.08);
}
.cpanel[data-cp="tick"] .cp-tfs button[aria-pressed="true"] { background: rgba(245,197,66,.08); }

/* The feature list that used to sit in the split hero's right column, moved
   to its own band right under the hero. */
.cp-tools { padding-top: 8px; }
.cp-tools .tool-panel { aspect-ratio: auto; max-width: none; }
.cp-tools .tp-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; margin: 16px 0; }
.cp-tools .tp-list li { font-size: 12px; }
.cp-tools .tp-cta { align-self: flex-start; padding: 13px 26px; }

@media (max-width: 520px) {
  .cp-open { padding: 13px 20px; font-size: 12px; }
  .cp-tfs { gap: 4px; }
  .cp-tfs button { height: 34px; font-size: 10.5px; letter-spacing: 0; }
  .cp-head { padding: 9px 11px; font-size: 10px; }
  .cp-head .cp-tag { display: none; }
}
