:root {
  --realized: #1d5570;
  --realized-soft: rgba(29, 85, 112, 0.12);
  --model: #e69a4c;
  --model-soft: rgba(230, 154, 76, 0.14);
  --band-fill: rgba(176, 205, 222, 0.42);
  --grid: #e7e7e7;
  --separator: #aecbdb;
  --ink: #232323;
  --muted: #767676;
  --card-bg: #ffffff;
  --page-bg: #f4f6f8;
  --border: #e3e5e8;
  --radius: 14px;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

.mono {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

.dashboard {
    margin: 0 auto;
    padding: 0;
    width: 100%;
    max-width: 100%;
    padding-top: 30px;
    border-top: 1px dashed #d4d8ed;
}

.chart-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.chart-header h1 {
    font-family: var(--font-heading);
    font-size: var(--font-size-h4);
    font-weight: 500;
    color: var(--color-primary);
    line-height: 140%;
    margin: 0;
    max-width: 100%;
}

.subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.replay-btn:hover {
  background: #000;
  transform: translateY(-1px);
}

.replay-btn:active {
  transform: translateY(0);
}

.replay-icon {
  width: 14px;
  height: 14px;
  color: #fff;
}

.chart-card {
  position: relative;
  background: rgba(248, 249, 255, 0.95);
  border: 1px solid rgba(6, 17, 38, 0.08);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(6, 17, 38, 0.13);
  padding: 20px;
}

#chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* ---- Live ticker bar (sits between the header and the chart card) ---- */
.ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #161a1f;
  color: #e8eaed;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 12.5px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ticker.visible {
  opacity: 1;
  transform: translateY(0);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0524a;
  box-shadow: 0 0 0 0 rgba(224, 82, 74, 0.6);
  animation: pulse 1.2s infinite;
  flex: 0 0 auto;
}

.ticker.done .pulse-dot {
  background: #3fbf72;
  animation: none;
  box-shadow: none;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224, 82, 74, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(224, 82, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 82, 74, 0); }
}

.ticker-day {
  font-weight: 700;
  color: #fff;
}

.ticker-time {
  color: #9aa3ad;
}

.ticker-sep {
  color: #4a5159;
}

.ticker-label {
  color: #9aa3ad;
}

.ticker-val {
  font-size: 13px;
  margin-right: 2px;
}

.ticker-val.realized { color: #6fb6d4; }
.ticker-val.model { color: var(--model); }

.ticker-status {
  margin-left: auto;
  color: #777f88;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot.realized { background: var(--realized); }
.dot.model { background: var(--model); }

/* ---- Tooltip ---- */
.tooltip {
  position: absolute;
  pointer-events: none;
  background: #1d2126;
  color: #fff;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.5;
  z-index: 6;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.12s ease;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.tooltip.visible {
  opacity: 1;
}

.tooltip .t-day {
  font-weight: 700;
  margin-bottom: 2px;
}

.tooltip .t-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip .t-row .dot {
  width: 6px;
  height: 6px;
}

/* ---- SVG text defaults ---- */
.axis-label {
  font-size: 12.5px;
  fill: var(--muted);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

.day-label {
  font-size: 13px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  transition: fill 0.2s ease;
}

.day-label.active {
  fill: var(--realized);
}

.tick-label {
  font-size: 11.5px;
  fill: var(--muted);
  text-anchor: middle;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

.legend-label {
  font-size: 13px;
  fill: var(--ink);
}

.ann-strong {
  font-size: 13px;
  font-weight: 700;
  fill: var(--ink);
  text-anchor: end;
}

.ann-muted {
  font-size: 12px;
  fill: var(--muted);
  text-anchor: end;
}

.footnote {
  margin: 16px 4px 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 767px) {

  .chart-header{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 18px;
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .chart-header .header-text{
    text-align: center;
  }
  .footnote{
    text-align: center;
  }

}

@media (max-width: 640px) {
  .chart-card {
    padding: 14px;
  }
  .ticker {
    font-size: 11.5px;
    padding: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .replay-btn, .day-label, .ticker {
    transition: none;
  }
  .pulse-dot {
    animation: none;
  }
}
