:root {
  --bg: #fdfdfd;
  --text: #454545;
  --muted: #666;
  /* https://colorcodes.io/purple/lavender-purple-color-codes/ */
  --accent: #2F8F9D;
  --accent2: #1F4E5F;
  --cardbg: #2f8f9d0d; /* 0.05 opacity */
  --border: #e5e5e5;
  font-family: Open Sans, sans-serif;
}

#chart-container {
  position: relative;
  width: fit-content;
  margin: 0 auto;
}
/* Axes */
.axis path, .axis line { stroke: #e5e5e5; }
.axis text { fill: #666; font-size: 11px; }
.axis-label { fill: #666; font-size: 12px; }
.grid line { stroke: #e5e5e5; stroke-dasharray: 3,3; }
.grid path { stroke: none; }

/* Bubbles */
.bubble {
    stroke: rgba(0,0,0,0.5);
    stroke-width: 1.8;
    transition: opacity 0.2s;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.bubble:hover { stroke: var(--accent2); stroke-width: 2.5; opacity: 1 !important; }

/* Tooltip */
#tooltip {
    position: absolute;
    pointer-events: none;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.7;
    opacity: 0;
    transition: opacity 0.15s;
    max-width: 220px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
#tooltip .tip-date { font-weight: 600; color: var(--accent); margin-bottom: 4px; }
#tooltip .bloom { font-size: 1.1em; font-weight: 700; }
#tooltip .bloom.high { color: #c0392b; }
#tooltip .bloom.med  { color: #e67e22; }
#tooltip .bloom.low  { color: #27ae60; }

/* Controls */
#controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}
#play-btn {
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 75px;
    padding: 6px 18px;
    font-size: 13px;
    cursor: pointer;
    min-width: 80px;
    font-family: inherit;
    transition: background-color 0.3s ease;
}
#play-btn:hover { background: var(--accent2); }
#date-slider {
    flex: 1;
    accent-color: var(--accent);
    cursor: pointer;
}
#date-label {
    font-size: 13px;
    color: var(--accent);
    min-width: 100px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
#speed-label { font-size: 12px; color: #666; white-space: nowrap; }
#speed-select {
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #454545;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

/* Legend */
#legend {
    display: flex;
    gap: 32px;
    margin-top: 16px;
    font-size: 14px;
    color: #666;
    align-items: flex-start;
}
.legend-section { display: flex; flex-direction: column; gap: 4px; }
.legend-title { color: #454545; font-weight: 600; margin-bottom: 2px; }
.legend-row { display: flex; align-items: center; gap: 6px; }
.legend-swatch {
    width: 12px; height: 12px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.legend-size-row { display: flex; align-items: flex-end; gap: 10px; }
.legend-bubble {
    background: rgba(47, 143, 157, 0.2);
    border-radius: 50%;
    border: 1px solid rgba(47, 143, 157, 0.4);
}

.viz-subtitle {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 20px;
}

/* Remove paragraph max-width restriction for visualization page */
main.container p {
    max-width: none;
}

svg { display: block; }

/* Timeline */
#timeline-section { margin-top: 28px; }
#timeline-label { font-weight: 600; color: #454545; margin-bottom: 3px; font-size: 16px; }
#timeline-sublabel { color: #666; margin-bottom: 8px; font-size: 14px; }
.event-rect { cursor: pointer; }
.event-rect:hover { opacity: 1 !important; }
#timeline-tip {
    position: fixed;
    pointer-events: none;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.7;
    opacity: 0;
    transition: opacity 0.15s;
    max-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 100;
}
#timeline-tip .tip-peak { font-weight: 700; color: var(--accent2); }

/* Chart card borders */
#chart-container, #timeline-container {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

#timeline-container {
    width: fit-content;
    margin: 0 auto;
}

/* Stat bar */
#bloom-stats {
    display: flex;
    gap: 28px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; gap: 1px; }
.stat-value { font-weight: 700; color: var(--accent2); line-height: 1.1; }
.stat-label { color: #999; }

/* Missing data disclaimer */
.data-disclaimer {
    font-size: 14px;
    color: #999;
    font-style: italic;
    margin-top: 8px;
}