/* =============================================================================
   Synapse — EEG Explorer page styles (loaded with site.css + uPlot.min.css).
   ========================================================================== */
.eeg-head { margin-bottom: 18px; }
.eeg-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -.02em; }
.eeg-head p { color: var(--muted); max-width: 74ch; margin-top: 8px; }

/* "what you're looking at" banner — updates per state */
.eeg-state-desc {
  margin: 0 0 16px; padding: 11px 15px; border: 1px solid var(--border);
  border-left: 3px solid var(--cyan); border-radius: 10px; background: var(--surface);
  color: var(--text); font-size: .9rem; line-height: 1.5; max-width: 96ch;
}

.eeg-viewer {
  position: relative;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  padding: 10px 6px 4px; box-shadow: 0 1px 2px rgba(28, 48, 118, .05);
}
.eeg-ictal { position: absolute; top: 14px; right: 16px; z-index: 3; font-size: .78rem; font-weight: 700;
  color: var(--faint); background: rgba(255,255,255,.85); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; letter-spacing: .03em; }
.eeg-ictal.on { color: #fff; background: #d4342f; border-color: transparent; }
.eeg-status { position: absolute; left: 16px; top: 14px; z-index: 3; font-size: .82rem; color: var(--muted);
  background: rgba(255,255,255,.9); padding: 3px 10px; border-radius: 999px; }
.eeg-status:empty { display: none; }
.eeg-status.err { color: #b91c1c; }
[data-montage]:disabled { cursor: not-allowed; }
#eeg-chart { width: 100%; height: 560px; }
@media (max-width: 880px) { #eeg-chart { height: 460px; } }

/* trace + live scalp map side by side */
.eeg-stage { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
@media (max-width: 880px) { .eeg-stage { grid-template-columns: 1fr; } }
.eeg-map {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.eeg-map .grp-title { align-self: flex-start; margin-bottom: 4px; }
#topo { width: 100%; max-width: 230px; height: auto; aspect-ratio: 1 / 1; }
.topo-toggle { display: flex; gap: 6px; margin-top: 2px; }
.topo-toggle .ctl { padding: 6px 14px; font-size: .8rem; }
.topo-cap { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: var(--faint); font-weight: 700; }
.topo-bar {
  width: 116px; height: 8px; border-radius: 4px; border: 1px solid var(--border);
  background: linear-gradient(90deg, #1e64ff, #fff 50%, #ff3b3b);            /* diverging: voltage */
}
.topo-bar.seq {                                                              /* sequential: activity */
  background: linear-gradient(90deg, rgb(28,40,78), rgb(47,110,200) 25%, rgb(54,198,176) 50%, rgb(232,210,74) 75%, rgb(226,72,58));
}
.topo-mode-cap { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.topo-hint { font-size: .76rem; color: var(--faint); line-height: 1.45; text-align: center; margin: 2px 0 0; }

.eeg-controls {
  margin-top: 16px; display: flex; flex-wrap: wrap; gap: 22px 30px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
}
.eeg-controls .grp { min-width: 140px; }
.grp-title {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--faint); margin-bottom: 10px;
}
.eeg-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.ctl {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  font-size: .85rem; font-weight: 600; padding: 9px 13px; border-radius: 10px; cursor: pointer;
  transition: .15s; -webkit-tap-highlight-color: transparent; user-select: none;
}
.ctl:hover { border-color: var(--border-2); color: var(--text); background: var(--surface-3); }
.ctl.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(34, 211, 238, .5); }
.ctl.ev { background: var(--surface); }
.ctl.ev:active { transform: scale(.96); }

.eeg-slider { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.eeg-slider input[type=range] { accent-color: var(--cyan); width: 110px; }

.eeg-note {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--faint); line-height: 1.6;
}
.eeg-note a { color: var(--cyan); }

/* uPlot legend off / axis label tone already handled in JS opts */
.u-title, .u-legend { display: none; }
