.chart-frame { padding: 18px; }
.chart-shell { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; align-items: stretch; }
.lw-chart { width: 100%; min-height: 360px; border: 1px solid var(--border); border-radius: 14px; background: #071018; overflow: hidden; }
.chart-attribution { display: inline-block; margin-top: 8px; color: var(--muted); font-size: 11px; text-decoration: none; }
.chart-attribution:hover { color: var(--accent); }
.chart-side { display: grid; gap: 10px; }
.chart-side div { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: rgba(6, 11, 16, 0.95); }
.chart-side span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.chart-side strong { display: block; color: var(--white); font-size: 16px; overflow-wrap: anywhere; }
.chart-legend { display: grid; gap: 10px; }
.chart-legend-head { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: rgba(6, 11, 16, 0.95); }
.chart-legend-head strong { display: block; color: var(--white); font-size: 14px; margin-bottom: 6px; }
.chart-legend-head span { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.chart-legend-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: rgba(6, 11, 16, 0.95); }
.chart-legend-key { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chart-legend-key strong { color: var(--white); font-size: 13px; }
.chart-legend-item p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.chart-legend-swatches { display: inline-flex; align-items: center; gap: 6px; min-width: 38px; }
.chart-legend-swatch { width: 16px; height: 4px; border-radius: 999px; display: inline-block; }
.chart-legend-swatch-price { background: #53d9ff; }
.chart-legend-swatch-baseline { background: #ffbf47; }
.chart-legend-swatch-support { background: #35ff8d; }
.chart-legend-swatch-resistance { background: #ffbf47; }
.chart-legend-swatch-stop { background: #ff5c7a; }
.chart-legend-swatch-take { background: #53d9ff; }

html[data-theme="light"] .lw-chart { background: #fbfdff; }
html[data-theme="light"] .chart-legend-head { background: var(--warm-panel); border-color: var(--warm-border); }
html[data-theme="light"] .chart-side strong,
html[data-theme="light"] .chart-legend-head strong,
html[data-theme="light"] .chart-legend-key strong { color: var(--text); }
html[data-theme="light"] .chart-side div,
html[data-theme="light"] .chart-legend-item { background: rgba(255, 255, 255, 0.94); }
html[data-theme="light"] .chart-legend-key strong { color: var(--warm-accent); }
html[data-theme="light"] .chart-legend-head span,
html[data-theme="light"] .chart-legend-item p { color: var(--muted); }

@media (max-width: 760px) {
  .chart-frame { padding: 8px; }
  .chart-shell { grid-template-columns: 1fr; }
  .lw-chart { min-height: 300px; border-radius: 10px; }
}
