/* Dashboard mockup (sample data) */
.dash {
  border-radius: var(--r-lg); padding: 28px; background: linear-gradient(180deg, #121014, #0b0a0c);
  border: 1px solid var(--line-2); box-shadow: 0 60px 120px -60px rgba(0, 0, 0, .9), 0 0 140px -70px var(--glow);
}
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-title { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dash-title span { font-size: 14px; color: var(--muted); letter-spacing: 0; }
.dash-chips { display: flex; gap: 8px; }
.chip-live { color: var(--text); }
.chip-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); animation: blink 1.6s infinite; }
.chip-sample { color: var(--y); border-color: rgba(250, 204, 82, .4); background: rgba(250, 204, 82, .08); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi, .dcard { border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.kpi { padding: 18px 20px; }
.kpi p { color: var(--muted); font-size: 14px; }
.kpi b { display: block; margin-top: 6px; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-areas: "chart load" "top promo"; gap: 12px; }
.d-chart { grid-area: chart; }
.d-load { grid-area: load; }
.d-top { grid-area: top; }
.d-promo { grid-area: promo; }
.dcard { padding: 20px; min-width: 0; }
.dlabel { color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.dlabel span { color: var(--dim-text); }
/* Plot is a stretched SVG; axis labels are HTML so they stay 11px at any width (dash.js builds them). */
.chart { height: 220px; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 22px; }
.chart-y, .chart-x { position: relative; color: var(--dim-text); font-size: 11px; line-height: 1; font-variant-numeric: tabular-nums; }
.chart-y span { position: absolute; left: 0; transform: translateY(-50%); }
.chart-x { grid-column: 2; }
.chart-x span { position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap; }
.chart-x span:first-child { transform: none; }
.chart-x span:last-child { transform: translateX(-100%); }
.chart-plot { position: relative; min-width: 0; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: rgba(255, 255, 255, .06); }
.chart .area { opacity: .5; }
.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.peak-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; border: 3px solid var(--c); box-shadow: 0 0 16px 2px var(--glow); }
.chart.is-armed .line { stroke-dasharray: var(--len, 2000); stroke-dashoffset: var(--len, 2000); transition: stroke-dashoffset 2s var(--ease); }
.chart.is-armed.is-drawn .line { stroke-dashoffset: 0; }
.chart.is-armed .area, .chart.is-armed .peak-dot { opacity: 0; transition: opacity 1s ease 1.2s; }
.chart.is-armed.is-drawn .area { opacity: .5; }
.chart.is-armed.is-drawn .peak-dot { opacity: 1; }

.load { margin-bottom: 16px; }
.load p { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 8px; }
.load em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.lbar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.lbar i { display: block; height: 100%; width: var(--v); border-radius: 8px; background: var(--grad-h); transform-origin: left; transition: transform 1.4s var(--ease); }
.reveal-ready .dash:not(.in) .lbar i { transform: scaleX(0); }
.dnote { margin-top: 18px; font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(252, 85, 76, .3); background: rgba(252, 85, 76, .07); }
.rank { counter-reset: rank; display: grid; gap: 4px; }
.rank li { counter-increment: rank; display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rank li:last-child { border-bottom: 0; }
.rank li::before { content: counter(rank); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); }
.rank li:first-child::before { background: var(--grad); color: var(--ink); }
.rank span { flex: 1; }
.rank em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb th { text-align: left; font-weight: 500; color: var(--dim-text); font-size: 12.5px; padding: 0 0 8px; }
.lb th:not(:first-child), .lb td:not(:first-child) { text-align: right; }
.lb td { padding: 10px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lb tr:first-child td:last-child { color: var(--y); }

@media (max-width: 899px) {
  .dash { padding: 18px; border-radius: 26px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chart" "load" "top" "promo"; }
  .chart { height: 180px; }
}
/* Phones: three x ticks (10 PM, 12 AM, 3 AM) so the 11px labels never touch. */
@media (max-width: 480px) {
  .chart-x span:nth-child(2), .chart-x span:nth-child(4), .chart-x span:nth-child(5) { display: none; }
}

/* Chart crosshair and live KPI bump (dash.js) */
.chart-plot { touch-action: pan-y; cursor: crosshair; }
.chart-cross, .chart-dot, .chart-tip { position: absolute; opacity: 0; pointer-events: none; transition: opacity .15s; }
.chart-plot.is-hover .chart-cross, .chart-plot.is-hover .chart-dot, .chart-plot.is-hover .chart-tip { opacity: 1; }
.chart-cross { top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .25); }
.chart-dot { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--y); box-shadow: 0 0 0 4px rgba(250, 204, 82, .2); }
.chart-tip {
  display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; white-space: nowrap; font-size: 12px; color: var(--muted);
  background: rgba(17, 16, 19, .92); border: 1px solid var(--line-2); transform: translate(14px, -120%);
}
.chart-tip.is-left { transform: translate(calc(-100% - 14px), -120%); }
.chart-tip b { color: var(--text); font-size: 14px; font-weight: 600; }
.kpi b.is-bump { animation: kpi-bump .6s var(--ease); }
@keyframes kpi-bump { 0% { color: var(--y); transform: translateY(-3px); } 100% { transform: none; } }
