.dh-chart-panel{ margin:0 0 16px; --dh-chart-accent:var(--btcAccent,#f7931a); }
html:not([data-theme="dark"]) .dh-chart-panel{ --dh-chart-accent:#b86608; }
.dh-chart-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  padding:0;
  border:1px solid var(--border);
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
}
.dh-chart-icon:hover{ color:var(--btcAccent,#f7931a); background:rgba(247,147,26,.08); }
.dh-chart-icon:disabled{ opacity:.4; cursor:default; }
.dh-chart-icon:focus-visible,.dh-chart-panel button:focus-visible,#dh-chart:focus-visible{ outline:2px solid var(--btcAccent,#f7931a); outline-offset:2px; }
.dh-chart-icon svg{ width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#dh-chart-close{ display:none; }
.dh-chart-summary{ display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:6px 20px; padding:16px 18px 4px; font-variant-numeric:tabular-nums; }
#dh-chart-value{ color:var(--text); font-size:1.65rem; font-weight:740; }
#dh-chart-range{ color:var(--muted); font-size:.76rem; }
.dh-chart-wrap{ position:relative; margin:0 8px; }
#dh-chart{ display:block; width:100%; height:clamp(280px,30vw,420px); cursor:crosshair; touch-action:pan-y; }
.dh-chart-grid{ stroke:var(--muted); stroke-opacity:.2; stroke-width:.8; stroke-dasharray:4 4; }
.dh-chart-axis{ stroke:var(--muted); stroke-opacity:.4; stroke-width:1; }
.dh-chart-text{ fill:var(--muted); font-size:11px; font-family:var(--mono,monospace); }
.dh-chart-line{ fill:none; stroke:var(--dh-chart-accent); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.dh-chart-area{ fill:var(--dh-chart-accent); fill-opacity:.16; }
.dh-chart-cursor{ pointer-events:none; }
.dh-chart-cursor line{ stroke:var(--muted); stroke-width:1; stroke-dasharray:4 4; }
.dh-chart-cursor circle{ fill:var(--dh-chart-accent); stroke:var(--shell-bg); stroke-width:2; }
.dh-chart-tooltip{ position:absolute; z-index:2; max-width:calc(100% - 16px); padding:9px 12px; border:1px solid var(--border); border-radius:8px; background:var(--shell-bg,#131a23); color:var(--text); box-shadow:0 4px 20px rgba(0,0,0,.18); font:12px/1.6 var(--mono,monospace); white-space:pre-line; pointer-events:none; }
.dh-chart-empty{ position:absolute; inset:0; display:grid; place-content:center; color:var(--muted); padding:20px; text-align:center; }
.dh-chart-empty[hidden],.dh-chart-tooltip[hidden]{ display:none; }
.dh-chart-status{ margin:0; padding:4px 18px 14px; color:var(--muted); font-size:.75rem; line-height:1.6; }
#dh-chart-dialog{ width:calc(100vw - 48px); max-width:1800px; max-height:calc(100dvh - 48px); padding:0; border:1px solid var(--border); border-radius:16px; background:var(--shell-bg,#131a23); color:var(--text); overflow:auto; }
#dh-chart-dialog::backdrop{ background:rgba(0,0,0,.7); backdrop-filter:blur(6px); }
#dh-chart-dialog .dh-chart-panel{ margin:0; border:0; border-radius:0; }
#dh-chart-dialog #dh-chart{ height:clamp(220px,calc(100dvh - 270px),900px); }
#dh-chart-dialog #dh-chart-expand{ display:none; }
#dh-chart-dialog #dh-chart-close{ display:inline-flex; }
body.dh-chart-open{ overflow:hidden; }
@media(max-width:600px){
  .dh-chart-panel .dh-panel-head{ padding:12px; }
  .dh-chart-panel .dh-panel-head-right{ width:100%; gap:6px; }
  .dh-chart-panel [aria-label="Chart period"]{ width:100%; }
  .dh-chart-summary{ padding:12px 12px 4px; }
  #dh-chart-value{ font-size:1.3rem; }
  .dh-chart-wrap{ margin:0 2px; }
  .dh-chart-status{ padding:4px 12px 12px; }
  #dh-chart-dialog{ width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:12px; }
  #dh-chart-dialog #dh-chart{ height:clamp(200px,calc(100dvh - 310px),700px); }
}
