:root {
  --bg: #07111f;
  --bg2: #0a1728;
  --panel: rgba(15, 29, 47, .72);
  --panel2: rgba(17, 34, 55, .88);
  --line: rgba(160, 192, 225, .14);
  --text: #ecf5ff;
  --muted: #8da4ba;
  --cyan: #4ddcf8;
  --blue: #6da8ff;
  --l1: #4ddcf8;
  --l2: #a989ff;
  --l3: #ffb45d;
  --green: #6de6a5;
  --pink: #ff78bd;
  --red: #ff7085;
  --shadow: 0 18px 55px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% -10%, rgba(62, 135, 255, .12), transparent 38%),
    radial-gradient(circle at 90% 15%, rgba(77, 220, 248, .08), transparent 30%),
    linear-gradient(145deg, var(--bg), #06101d 48%, #091522);
  color: var(--text);
  overflow-x: hidden;
}
.ambient { position: fixed; pointer-events: none; filter: blur(80px); opacity: .2; border-radius: 50%; z-index: -1; }
.ambient-a { width: 420px; height: 420px; background: #1f73ff; top: -180px; left: 18%; }
.ambient-b { width: 340px; height: 340px; background: #36e2c0; right: -170px; top: 40%; }
.shell { width: min(1500px, calc(100% - 36px)); margin: 0 auto; padding: 30px 0 26px; }
.topbar { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; margin-bottom: 22px; }
h1 { margin: 2px 0 4px; font-size: clamp(2rem, 4vw, 3.35rem); letter-spacing: -.055em; font-weight: 780; }
h2 { margin: 2px 0 0; font-size: clamp(1.25rem, 2vw, 1.75rem); letter-spacing: -.03em; }
.eyebrow { color: var(--cyan); font-size: .71rem; font-weight: 800; letter-spacing: .17em; }
.subtitle { margin: 0; color: var(--muted); }
.status-cluster { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
.status-pill, .clock { border: 1px solid var(--line); background: rgba(12, 25, 42, .7); backdrop-filter: blur(14px); border-radius: 999px; padding: 10px 13px; font-size: .78rem; color: #bed0df; }
.clock { font-variant-numeric: tabular-nums; font-weight: 750; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #66798a; margin-right: 8px; box-shadow: 0 0 0 3px rgba(102,121,138,.12); }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(109,230,165,.13), 0 0 15px rgba(109,230,165,.5); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(255,112,133,.13); }
.glass { background: linear-gradient(180deg, rgba(18,36,58,.82), rgba(10,24,40,.72)); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.hero-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 14px; }
.total-card { padding: 24px; position: relative; overflow: hidden; min-height: 184px; }
.total-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -100px; top: -90px; border-radius: 50%; background: rgba(77,220,248,.12); filter: blur(8px); }
.card-label, .stat-card > span:last-child { color: var(--muted); font-size: .78rem; }
.hero-value { display: flex; align-items: baseline; gap: 10px; margin-top: 7px; font-size: clamp(3rem, 5vw, 5.4rem); font-weight: 790; letter-spacing: -.065em; font-variant-numeric: tabular-nums; line-height: .95; }
.hero-value small { font-size: 1rem; letter-spacing: 0; color: var(--muted); font-weight: 650; }
.hero-meta { display: flex; gap: 12px; align-items: center; margin-top: 18px; color: var(--muted); font-size: .78rem; }
.hero-meta strong { color: var(--green); font-size: .9rem; }
.sparkline { position: absolute; right: 19px; bottom: 19px; display: flex; gap: 4px; align-items: flex-end; height: 30px; opacity: .35; }
.sparkline span { width: 4px; background: var(--cyan); border-radius: 3px; }
.sparkline span:nth-child(1){height:25%}.sparkline span:nth-child(2){height:60%}.sparkline span:nth-child(3){height:42%}.sparkline span:nth-child(4){height:85%}.sparkline span:nth-child(5){height:65%}.sparkline span:nth-child(6){height:100%}.sparkline span:nth-child(7){height:70%}
.phase-card { padding: 20px; min-height: 184px; position: relative; overflow: hidden; }
.phase-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--phase); }
.phase-l1 { --phase: var(--l1); } .phase-l2 { --phase: var(--l2); } .phase-l3 { --phase: var(--l3); }
.phase-head { display: flex; justify-content: space-between; align-items: center; }
.phase-tag { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: color-mix(in srgb, var(--phase) 15%, transparent); color: var(--phase); font-weight: 850; }
.phase-power { font-size: 1.5rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.phase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 34px; }
.phase-grid div { border-top: 1px solid var(--line); padding-top: 10px; }
.phase-grid span { display: block; color: var(--muted); font-size: .72rem; margin-bottom: 4px; }
.phase-grid strong { font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 14px; }
.stat-card { padding: 16px; min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card strong { font-size: 1.35rem; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.stat-kicker { color: var(--cyan); text-transform: uppercase; font-weight: 750; font-size: .65rem; letter-spacing: .11em; }
.panel { margin-top: 14px; padding: 20px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.range-buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
button { font: inherit; cursor: pointer; }
.range-buttons button, .primary-btn { border: 1px solid var(--line); color: #b9ccdd; background: rgba(7,17,31,.55); border-radius: 10px; padding: 8px 11px; transition: .18s ease; }
.range-buttons button:hover, .range-buttons button.active, .primary-btn:hover { color: #fff; border-color: rgba(77,220,248,.42); background: rgba(77,220,248,.10); }
.range-buttons button.active { box-shadow: inset 0 0 0 1px rgba(77,220,248,.08); }
.series-selector { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 18px 0 8px; }
.series-selector label { display: inline-flex; align-items: center; gap: 7px; color: #aac0d3; font-size: .76rem; cursor: pointer; user-select: none; }
.series-selector input { accent-color: var(--cyan); }
.swatch { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.swatch.total { background: var(--blue); }.swatch.l1 { background: var(--l1); }.swatch.l2 { background: var(--l2); }.swatch.l3 { background: var(--l3); }.swatch.energy{background:var(--green)}.swatch.spot{background:var(--pink)}.swatch.weighted{background:var(--cyan)}.swatch.cost{background:#ffe071}
.chart-wrap { height: 390px; padding-top: 8px; }
.chart-foot { display: flex; justify-content: space-between; gap: 16px; color: #718ba2; font-size: .7rem; padding-top: 8px; border-top: 1px solid rgba(160,192,225,.08); }
.custom-range { display: flex; gap: 10px; align-items: end; margin-top: 14px; padding: 12px; border-radius: 13px; background: rgba(6,16,29,.4); border: 1px solid var(--line); }
.custom-range label { color: var(--muted); font-size: .72rem; }
.custom-range input { display: block; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; background: #071321; color: var(--text); padding: 8px; }
.hidden { display: none; }
footer { display: flex; justify-content: space-between; gap: 18px; padding: 18px 5px 0; color: #637b90; font-size: .7rem; }
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: repeat(3, 1fr); }
  .total-card { grid-column: 1 / -1; min-height: 155px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 1500px); padding-top: 18px; }
  .topbar, .panel-header { flex-direction: column; }
  .status-cluster, .range-buttons { justify-content: flex-start; }
  .hero-grid { grid-template-columns: 1fr; }
  .total-card { grid-column: auto; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-wrap { height: 340px; }
  .custom-range { align-items: stretch; flex-direction: column; }
  footer, .chart-foot { flex-direction: column; }
}
@media (max-width: 430px) {
  .summary-grid { grid-template-columns: 1fr; }
  .hero-value { font-size: 3.2rem; }
}

.plot { width: 100%; height: 100%; }
.modebar { opacity: .45; }
.modebar:hover { opacity: .9; }
