.async-study-select {
  align-items: stretch;
}

.async-study-select__typeahead {
  flex: 1 1 auto;
  min-width: 0;
}

.async-study-select__clear {
  display: inline-flex;
  min-width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-color: #94a3b8;
  color: #334155;
}

.async-study-select__clear:hover,
.async-study-select__clear:focus-visible {
  border-color: #0d6efd;
  background: #0d6efd;
  color: #fff;
}
.eeg-integrated__status {
  margin-left: 8px;
}

.eeg-integrated__plot {
  display: block;
  min-height: 240px;
}
/* EEG Control Panel Styles */
.eeg-control-panel {
  background-color: var(--background-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-section {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.control-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.control-group {
  flex: 1;
  min-width: 200px;
}

.control-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.control-label i {
  margin-right: 0.5rem;
  color: var(--primary-brand);
}

.control-select {
  width: 100%;
}

.filter-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-input label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.filter-input input {
  width: 70px;
}

.filter-input span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.filter-checkbox {
  display: flex;
  align-items: center;
}

.eeg-control-panel .playback-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.eeg-control-panel .playback-button {
  min-width: 100px;
}

.speed-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.speed-controls label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.recording-info {
  display: flex;
  gap: 2rem;
  justify-content: space-around;
  padding: 0.75rem;
  background-color: var(--background-hover);
  border-radius: 6px;
  margin-top: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .control-section {
    flex-direction: column;
  }
  
  .control-group {
    min-width: 100%;
  }
  
  .recording-info {
    flex-wrap: wrap;
    gap: 1rem;
  }
}
.eeg-control-panel__montage-hint {
  font-size: 12px;
}
/* Advanced EEG Controls Styling */
.advanced-eeg-controls {
  margin-bottom: 1.5rem;
}

.advanced-eeg-controls .card-body {
  padding: 1.5rem;
}

.control-section-title {
  font-weight: 600;
  color: var(--primary-brand);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

/* Filter Settings */
.form-range {
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  background-color: var(--primary-brand);
}

.form-range::-moz-range-thumb {
  background-color: var(--primary-brand);
}

.form-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Channel Groups */
.channel-groups-container {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.channel-groups-container::-webkit-scrollbar {
  width: 6px;
}

.channel-groups-container::-webkit-scrollbar-track {
  background: var(--background-main);
  border-radius: 3px;
}

.channel-groups-container::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* Waveform Colors Grid */
.waveform-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background-color: var(--background-main);
  border-radius: 0.375rem;
}

.color-picker-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-picker {
  width: 60px;
  height: 40px;
  padding: 0.25rem;
  border: 2px solid var(--border-subtle);
  border-radius: 0.25rem;
  cursor: pointer;
}

.color-picker:hover {
  border-color: var(--primary-brand);
}

.color-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
}

/* Preset Buttons */
.preset-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-buttons .btn {
  flex: 0 1 auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .advanced-eeg-controls .card-body {
    padding: 1rem;
  }

  .waveform-colors-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .preset-buttons {
    flex-direction: column;
  }

  .preset-buttons .btn {
    width: 100%;
  }

  .control-section-title {
    font-size: 0.85rem;
  }
}

/* Accessibility */
.form-check-input:focus {
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-select:focus,
.color-picker:focus {
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .color-picker {
    border-width: 3px;
  }

  .control-section-title {
    border-bottom-width: 3px;
  }
}
/* Annotation Tools Styling */
.annotation-tools {
  margin-bottom: 1.5rem;
}

.annotation-tools .card-body {
  padding: 1.5rem;
}

/* Annotation Form */
.annotation-form-card {
  background-color: var(--background-main);
  border: 1px solid var(--border-subtle);
}

.annotation-form-card .card-body {
  padding: 1rem;
}

/* Annotations List */
.annotations-list {
  max-height: 500px;
  overflow-y: auto;
}

.annotations-list::-webkit-scrollbar {
  width: 6px;
}

.annotations-list::-webkit-scrollbar-track {
  background: var(--background-main);
  border-radius: 3px;
}

.annotations-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* Annotation Item */
.annotation-item {
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
  padding: 1rem;
}

.annotation-item:hover {
  background-color: var(--background-hover);
  transform: translateX(2px);
}

.annotation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.annotation-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.annotation-type svg {
  font-size: 1rem;
}

.annotation-actions {
  display: flex;
  align-items: center;
}

.annotation-actions .btn-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.annotation-actions .btn-link:hover {
  color: var(--primary-brand);
}

.annotation-actions .text-danger:hover {
  color: var(--accent-urgent) !important;
}

/* Annotation Content */
.annotation-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.annotation-label {
  font-size: 1rem;
  color: var(--text-primary);
}

.annotation-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: 'Courier New', Courier, monospace;
}

.annotation-description {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background-color: var(--background-main);
  border-radius: 0.25rem;
}

/* Quick Add Section */
.quick-add-section {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.quick-add-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-add-buttons .btn {
  flex: 0 1 auto;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .annotation-tools .card-body {
    padding: 1rem;
  }

  .annotation-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .annotation-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .quick-add-buttons {
    flex-direction: column;
  }

  .quick-add-buttons .btn {
    width: 100%;
  }

  .annotations-list {
    max-height: 400px;
  }
}

/* Accessibility */
.annotation-item:focus-within {
  outline: 2px solid var(--primary-brand);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .annotation-actions,
  .quick-add-section {
    display: none;
  }

  .annotations-list {
    max-height: none;
    overflow: visible;
  }
}
.annotation-item {
  border-left: 4px solid var(--annotation-color, #6c757d);
}

.annotation-type__icon {
  color: var(--annotation-color, #6c757d);
}

.annotation-type__badge {
  border-left: 3px solid var(--annotation-color, #6c757d);
}
.eeg-status-badge {
  margin-top: 8px;
}

.eeg-recording-info {
  background-color: #f8f9fa;
}

.eeg-upload-section {
  background-color: #f8f9fa;
}

.eeg-plot-container {
  height: 60vh;
  overflow-y: auto;
}

.eeg-empty-state {
  background-color: #f8f9fa;
  border-radius: 8px;
}

.eeg-plot-container--embedded {
  height: 420px;
  border: 1px solid #d5e0ea;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
}

.eeg-data-visualization--embedded {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #d5e0ea;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(96, 141, 188, 0.1), transparent 34%),
    linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

.eeg-data-visualization__embedded-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.eeg-data-visualization__embedded-eyebrow {
  color: #4f6174;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eeg-data-visualization__embedded-title {
  margin: 0;
  color: #16324a;
  font-size: 18px;
  font-weight: 700;
}

.eeg-data-visualization__embedded-body {
  margin: 6px 0 0;
  color: #4f6174;
  font-size: 13px;
  line-height: 1.5;
}

.eeg-data-visualization__embedded-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.eeg-data-visualization__embedded-control {
  display: grid;
  gap: 6px;
  width: min(260px, 100%);
}

.eeg-data-visualization__embedded-control-label {
  color: #5d7185;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eeg-data-visualization__embedded-toolbar-actions {
  display: flex;
  align-items: flex-end;
}

.eeg-data-visualization__embedded-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px;
  color: #4f6174;
  font-size: 13px;
  text-align: center;
}

.eeg-data-visualization__embedded-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: #4f6174;
  font-size: 12px;
}

@media (max-width: 768px) {

  .eeg-plot-container--embedded {
    height: 340px;
  }
}
.topographic-map-3d {
  --topo-mode-accent: #4e7eaa;
  --topo-mode-accent-strong: #315b84;
  --topo-mode-accent-soft: rgba(78, 126, 170, 0.14);
  --topo-mode-border: #a8bdd0;
  display: grid;
  gap: 8px;
}

.topographic-map-3d__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #5f6b7a;
}

.topographic-map-3d__scene-summary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.topographic-map-3d__scene-accent {
  color: var(--topo-mode-accent-strong);
  font-weight: 700;
}

.topographic-map-3d__scene-renderer-tag {
  color: #5a6d83;
  font-weight: 600;
}

.topographic-map-3d__control {
  border: 1px solid #c7d2e0;
  background: #f6f8fb;
  border-radius: 999px;
  color: #22405f;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
}

.topographic-map-3d__control--active {
  border-color: var(--topo-mode-accent);
  background: linear-gradient(180deg, var(--topo-mode-accent) 0%, var(--topo-mode-accent-strong) 100%);
  color: #f5fbff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 0 1px var(--topo-mode-accent-soft);
}

.topographic-map-3d__canvas {
  width: 100%;
  max-width: var(--topo-max-width, 100%);
  min-height: 320px;
  border: 1px solid var(--topo-mode-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #07111f 0%, #15253b 100%);
  box-shadow: inset 0 0 0 1px var(--topo-mode-accent-soft);
}

.topographic-map-3d__surface--three {
  position: relative;
  overflow: hidden;
}

.topographic-map-3d__surface-svg {
  display: block;
  overflow: hidden;
}

.topographic-map-3d__surface-shadow {
  fill: rgba(7, 14, 24, 0.36);
  filter: blur(8px);
}

.topographic-map-3d__surface-shell {
  stroke: rgba(174, 208, 236, 0.48);
  stroke-width: 1.2;
}

.topographic-map-3d__surface-highlight {
  pointer-events: none;
}

.topographic-map-3d__surface-ring {
  fill: none;
  stroke: rgba(164, 206, 239, 0.18);
  stroke-width: 1;
}

.topographic-map-3d__surface-axis {
  fill: none;
  stroke: rgba(171, 212, 244, 0.2);
  stroke-width: 1;
  stroke-dasharray: 5 6;
}

.topographic-map-3d__surface-axis--vertical {
  stroke-dasharray: 4 5;
}

.topographic-map-3d__surface-outline {
  fill: none;
  stroke: rgba(198, 229, 250, 0.62);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.topographic-map-3d__surface-point-glow {
  pointer-events: none;
}

.topographic-map-3d__surface-point {
  stroke: rgba(244, 248, 255, 0.82);
  stroke-width: 1.2;
}

.topographic-map-3d__surface-label {
  fill: #f3f8ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  paint-order: stroke;
  stroke: rgba(7, 14, 24, 0.92);
  stroke-width: 3px;
}

.topographic-map-3d__surface-empty {
  fill: #dfeaf7;
  font-size: 14px;
  font-weight: 600;
}

.topographic-map-3d__scene-host {
  position: absolute;
  inset: 0;
}

.topographic-map-3d__label-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.topographic-map-3d__orientation-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.topographic-map-3d__orientation-marker {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(164, 206, 239, 0.34);
  border-radius: 999px;
  background: rgba(7, 14, 24, 0.72);
  color: #eaf7ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  box-shadow:
    0 10px 22px rgba(7, 14, 24, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  transition: opacity 160ms ease, background 160ms ease, border-color 160ms ease;
}

.topographic-map-3d__orientation-marker.is-visible {
  opacity: 1;
}

.topographic-map-3d__orientation-marker.is-muted {
  opacity: 0.56;
}

.topographic-map-3d__scene-debug {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.topographic-map-3d__scene-debug-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topographic-map-3d__scene-debug-strip span {
  border: 1px solid rgba(164, 206, 239, 0.24);
  border-radius: 999px;
  background: rgba(7, 14, 24, 0.78);
  color: #edf5ff;
  box-shadow:
    0 10px 20px rgba(7, 14, 24, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.topographic-map-3d__scene-debug-strip span {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topographic-map-3d__overlay-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  padding: 6px 10px;
  border: 1px solid rgba(164, 206, 239, 0.34);
  border-radius: 999px;
  background: rgba(7, 14, 24, 0.78);
  color: #f4f8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  opacity: 0;
  box-shadow:
    0 10px 24px rgba(7, 14, 24, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.topographic-map-3d__overlay-label.is-visible {
  opacity: 1;
}

.topographic-map-3d__overlay-label.is-reference {
  border-color: rgba(109, 203, 239, 0.62);
  background: rgba(7, 18, 28, 0.88);
  box-shadow:
    0 14px 28px rgba(7, 14, 24, 0.34),
    0 0 0 1px rgba(70, 180, 224, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.topographic-map-3d__overlay-label.is-selected {
  border-color: rgba(120, 221, 255, 0.92);
  background: linear-gradient(180deg, rgba(21, 63, 97, 0.96) 0%, rgba(13, 40, 66, 0.96) 100%);
  color: #f7fcff;
  box-shadow:
    0 16px 30px rgba(5, 11, 20, 0.38),
    0 0 0 1px rgba(89, 208, 255, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.topographic-map-3d__surface--three canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.topographic-map-3d__canvas--interactive {
  cursor: grab;
  touch-action: none;
}

.topographic-map-3d__canvas--interactive.is-dragging {
  cursor: grabbing;
}

@media (max-width: 768px) {
  .topographic-map-3d__meta {
    align-items: flex-start;
  }

  .topographic-map-3d__scene-debug {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }
}
.video-player {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #000;
  position: relative;
}

.video-player__container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.video-player__video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-player__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: #f8f9fa;
  background: rgba(0, 0, 0, 0.72);
}

.video-player__controls {
  background: rgba(0, 0, 0, 0.8);
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.video-player__controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.video-player__speed-control {
  display: flex;
  align-items: center;
  color: #fff;
}

.video-player__volume-control {
  display: flex;
  align-items: center;
}

.video-player__seek-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-player__seek-bar {
  flex: 1;
}

.video-player__time {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: #fff;
  min-width: 100px;
  text-align: center;
}

/* Dark mode support */
.dark-theme .video-player__controls {
  background: rgba(255, 255, 255, 0.05);
  border-top-color: rgba(255, 255, 255, 0.2);
}

.video-player--clinical .video-player__controls {
  padding: 0.5rem 0.75rem;
}

.video-player--clinical .video-player__controls-row {
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.video-player--clinical .video-player__speed-control--clinical {
  min-width: 4.5rem;
}

.video-player--clinical .video-player__speed-select {
  font-size: var(--app-ui-font-meta, 0.72rem);
  min-height: calc(var(--app-ui-font-meta, 0.72rem) * 2.2);
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.video-player--clinical .video-player__time {
  min-width: 4.5rem;
  font-size: var(--app-ui-font-meta, 0.72rem);
}

.video-player--clinical .video-player__volume-control .w-100px {
  width: 4rem !important;
}
.eeg-customization-panel {
  --eeg-customization-font-size: 0.625rem;
  --eeg-customization-title-size: 0.7rem;
  --eeg-customization-control-height: 24px;
  --eeg-customization-line-height: 1.2;
  --eeg-customization-panel-padding: 12px 14px 14px;
  border: 0;
  background: transparent;
}

html[data-font-size="large"] .eeg-customization-panel,
html[data-font-size="extra-large"] .eeg-customization-panel,
html[data-font-size="xlarge"] .eeg-customization-panel {
  --eeg-customization-font-size: 0.68rem;
  --eeg-customization-title-size: 0.74rem;
  --eeg-customization-control-height: 26px;
}

body.workspace-density-compact .eeg-customization-panel {
  --eeg-customization-font-size: 0.58rem;
  --eeg-customization-title-size: 0.66rem;
  --eeg-customization-control-height: 22px;
}

body.large-touch-targets .eeg-customization-panel {
  --eeg-customization-control-height: 28px;
}

html[data-large-touch-targets="true"] .eeg-customization-panel {
  --eeg-customization-control-height: 44px;
}

.eeg-customization-panel .card-body {
  padding: var(--eeg-customization-panel-padding);
  font-size: var(--eeg-customization-font-size);
  line-height: var(--eeg-customization-line-height);
}

.eeg-customization-panel__title {
  margin: 0 0 4px;
  font-size: var(--eeg-customization-title-size);
  font-weight: 600;
  line-height: 1.2;
}

.eeg-customization-panel__hint {
  margin: 0 0 8px;
  font-size: var(--eeg-customization-font-size);
  line-height: var(--eeg-customization-line-height);
  color: #64748b;
}

.eeg-customization-panel .form-control,
.eeg-customization-panel .form-select {
  min-height: var(--eeg-customization-control-height);
  padding: 2px 6px;
  font-size: var(--eeg-customization-font-size);
  line-height: var(--eeg-customization-line-height);
}

.eeg-customization-panel .btn {
  min-height: var(--eeg-customization-control-height);
  padding: 2px 8px;
  font-size: var(--eeg-customization-font-size);
  line-height: var(--eeg-customization-line-height);
}

.eeg-customization-panel .btn-sm {
  min-height: var(--eeg-customization-control-height);
  padding: 2px 8px;
  font-size: var(--eeg-customization-font-size);
}

.eeg-customization-panel .table {
  font-size: var(--eeg-customization-font-size);
  line-height: var(--eeg-customization-line-height);
  margin-bottom: 8px;
}

.eeg-customization-panel .table > :not(caption) > * > * {
  padding: 0.2rem 0.35rem;
}

.eeg-customization-panel .alert {
  padding: 0.35rem 0.5rem;
  margin-bottom: 8px;
  font-size: var(--eeg-customization-font-size);
  line-height: var(--eeg-customization-line-height);
}

.eeg-customization-panel .card.bg-light {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0;
}

.eeg-customization-panel .card.bg-light .card-body {
  padding: 8px;
}

.eeg-customization-panel .card.bg-light h6 {
  margin: 0 0 6px;
  font-size: var(--eeg-customization-font-size);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.eeg-customization-panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.eeg-customization-panel__form-row {
  row-gap: 6px !important;
  margin-bottom: 10px !important;
}

.eeg-customization-modal--wide {
  padding: 14px 16px 16px;
  overflow-y: auto;
}

.eeg-customization-modal__heading {
  font-size: var(--eeg-dock-panel-title-size, 0.7rem);
  line-height: 1.2;
  margin: 0 36px 6px 0;
  padding: 0;
  color: #f8fafc;
}

.eeg-customization-modal__scope {
  font-size: var(--eeg-dock-tab-font-size, 0.625rem);
  line-height: 1.2;
  margin: 0 36px 12px 0;
  padding: 0;
  color: #94a3b8;
}

.eeg-customization-modal--wide .eeg-customization-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #0f172a;
}

.eeg-customization-modal--wide .eeg-customization-panel__title {
  color: #0f172a;
}

.eeg-customization-modal--wide .eeg-customization-panel__hint {
  color: #475569;
}

.eeg-customization-modal--wide .eeg-customization-panel .card.bg-light {
  background: #ffffff !important;
}
.settings-workbench {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: var(--app-ui-font-body);
}

.settings-workbench__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.settings-workbench__header h1 {
  margin: 0;
  font-size: var(--app-ui-font-subheading);
  line-height: 1.2;
  font-weight: 600;
}

.settings-workbench__header p {
  margin: 0.35rem 0 0;
  font-size: var(--app-ui-font-meta);
  color: var(--bs-secondary-color, #6c757d);
}

.settings-workbench__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.settings-workbench__body {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.settings-workbench__list-card,
.settings-workbench__detail {
  min-width: 0;
}

.settings-workbench__list-card {
  overflow: hidden;
}

.settings-workbench__list-header,
.settings-workbench__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: var(--app-ui-font-title);
}

.settings-workbench__list-header .badge,
.settings-workbench__item-meta .badge {
  font-size: var(--app-ui-font-caption);
}

.settings-workbench__search {
  padding: 0.75rem;
  border-bottom: 1px solid var(--bs-border-color, #e4e8ee);
}

.settings-workbench__search .form-control {
  font-size: var(--app-ui-font-body);
}

.settings-workbench__loading,
.settings-workbench__empty {
  min-height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: var(--app-ui-font-body);
  color: var(--bs-secondary-color, #6c757d);
}

.settings-workbench__list {
  max-height: min(62vh, 46rem);
  overflow: auto;
}

.settings-workbench__list-item {
  width: 100%;
  min-height: 3.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.9rem;
  font-size: var(--app-ui-font-body);
  color: var(--bs-body-color, #1f2937);
  text-align: left;
  text-decoration: none;
  border: 0;
  border-bottom: 1px solid var(--bs-border-color, #edf0f4);
  border-radius: 0;
}

.settings-workbench__list-item:hover,
.settings-workbench__list-item:focus {
  color: var(--bs-primary, #0d6efd);
  background: var(--bs-primary-bg-subtle, #f7faff);
  text-decoration: none;
}

.settings-workbench__list-item.is-selected {
  color: var(--bs-primary, #0b5ed7);
  background: var(--bs-primary-bg-subtle, #eef5ff);
  box-shadow: inset 3px 0 0 var(--bs-primary, #0d6efd);
}

.settings-workbench__item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-workbench__item-title,
.settings-workbench__item-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-workbench__item-title {
  font-weight: 600;
  font-size: var(--app-ui-font-body);
}

.settings-workbench__item-subtitle {
  color: var(--bs-secondary-color, #6c757d);
  font-size: var(--app-ui-font-meta);
}

.settings-workbench__item-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.settings-workbench__detail > .card {
  min-width: 0;
}

html[data-large-touch-targets="true"] .settings-workbench__list-item {
  min-height: 2.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

@media (max-width: 900px) {
  .settings-workbench__body {
    grid-template-columns: 1fr;
  }

  .settings-workbench__list {
    max-height: 18rem;
  }
}
.eeg-config-page {
  padding: 0;
}

.eeg-config-table-wrap {
  overflow-x: auto;
}

.eeg-config-table {
  --eeg-config-col-pad: 0.5rem;
  --eeg-config-col-gap: 0.35rem;
  table-layout: fixed;
  width: 100%;
  min-width: 52rem;
  border-collapse: separate;
  border-spacing: 0;
}

.eeg-config-table th,
.eeg-config-table td {
  padding-left: var(--eeg-config-col-pad);
  padding-right: var(--eeg-config-col-pad);
}

.eeg-config-table-wrap .eeg-config-table > :not(caption) > * > :first-child {
  padding-left: 0.75rem;
}

.eeg-config-table-wrap .eeg-config-table > :not(caption) > * > :last-child {
  padding-right: 0.75rem;
}

.eeg-config-table th {
  white-space: nowrap;
  font-size: var(--app-ui-font-meta);
  font-weight: 600;
  color: var(--bs-secondary-color, #6c757d);
}

.eeg-config-table td {
  vertical-align: middle;
}

.eeg-config-table .form-select {
  width: 100%;
  min-width: 0;
  padding-right: 2rem;
}

.eeg-config-position-fields {
  display: flex;
  gap: 0.35rem;
  min-width: 0;
}

.eeg-config-position-fields .form-control {
  min-width: 0;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.eeg-config-table__cell--position {
  padding-right: 0.25rem;
}

.eeg-config-table__cell--color--compact {
  width: 3.25rem;
  padding-left: 0.25rem;
  padding-right: 0.35rem;
}

.eeg-config-table__cell--types {
  padding-right: calc(var(--eeg-config-col-pad) + var(--eeg-config-col-gap));
}

.eeg-config-table__cell--types .eeg-config-chip-list {
  padding-inline-end: 0.15rem;
}

.eeg-config-table__cell--category {
  padding-left: calc(var(--eeg-config-col-pad) + var(--eeg-config-col-gap));
}

.eeg-config-table__cell--color {
  width: 10%;
  padding-right: 0.25rem;
}

.eeg-config-table__cell--actions {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 3rem;
  padding-left: 0.25rem;
  padding-right: 0.75rem;
  text-align: center;
  white-space: nowrap;
}

.eeg-config-table__cell--actions .btn {
  margin-inline: auto;
}

.eeg-config-table__cell--notch {
  width: 3.75rem;
  min-width: 3.75rem;
  max-width: 4rem;
  padding-right: 0.25rem;
  text-align: center;
}

.eeg-config-table__cell--notch .form-check {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 0;
  min-height: 1.35rem;
}

.eeg-config-event-row--primary td {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.eeg-config-event-row--details td {
  padding-top: 0;
  padding-bottom: 0.75rem;
  border-top: 0;
  border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.075));
}

.eeg-config-event-row--primary + .eeg-config-event-row--details td {
  border-top: 0;
}

.eeg-config-event-details {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(14rem, 1.4fr) minmax(16rem, auto);
  gap: 0.75rem 1rem;
  align-items: end;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  background: var(--bs-tertiary-bg, #f8f9fa);
}

.eeg-config-event-details__field {
  margin-bottom: 0;
  min-width: 0;
}

.eeg-config-event-details__field--wide {
  grid-column: span 1;
}

.eeg-config-event-details__label {
  margin-bottom: 0.25rem;
  font-size: var(--app-ui-font-caption);
  font-weight: 600;
  color: var(--bs-secondary-color, #6c757d);
}

.eeg-config-event-details__switches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  min-width: 0;
}

.eeg-config-event-details__shortcut {
  width: auto;
  min-width: 9rem;
  max-width: 100%;
}

.eeg-config-chip-list {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem 0.5rem;
}

.eeg-config-chip-list .form-check {
  margin-bottom: 0;
  min-height: 1.35rem;
}

.eeg-config-color-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.eeg-config-color-badge {
  font-size: var(--app-ui-font-caption);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
}

.eeg-config-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(8rem, 1fr));
  gap: 0.75rem;
}

.eeg-config-event-set-editor {
  max-width: 34rem;
}

.eeg-config-event-set-editor .form-control {
  font-size: var(--app-ui-font-body);
}

.eeg-config-event-col-name {
  width: 15%;
  min-width: 9rem;
}

.eeg-config-event-col-types {
  width: 21%;
  min-width: 11.5rem;
}

.eeg-config-event-col-category {
  width: 11%;
  min-width: 7rem;
}

.eeg-config-event-col-priority {
  width: 11%;
  min-width: 7rem;
}

.eeg-config-event-col-signal {
  width: 13%;
  min-width: 8rem;
}

.eeg-config-event-col-color {
  width: 9%;
  min-width: 6.5rem;
}

.eeg-config-event-col-actions {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 3rem;
}

.eeg-config-col-actions {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 3rem;
}

.eeg-config-col-color--compact {
  width: 3.25rem;
  min-width: 3.25rem;
  max-width: 3.5rem;
}

.eeg-config-col-position {
  width: 8%;
  min-width: 6.75rem;
  max-width: 7.5rem;
}

.eeg-config-col-transformation {
  width: 12%;
  min-width: 9.5rem;
}

.eeg-config-col-display-name {
  width: 14%;
  min-width: 8.5rem;
}

.eeg-config-col-notch {
  width: 3.75rem;
  min-width: 3.75rem;
  max-width: 4rem;
}

.eeg-config-channel-col-code {
  width: 8%;
  min-width: 5.5rem;
}

.eeg-config-channel-col-name {
  width: 12%;
  min-width: 7rem;
}

html[data-large-touch-targets="true"] .eeg-config-event-row--primary td {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

html[data-large-touch-targets="true"] .eeg-config-chip-list .form-check {
  min-height: 2rem;
}

@media (max-width: 1200px) {
  .eeg-config-metric-grid {
    grid-template-columns: repeat(2, minmax(8rem, 1fr));
  }

  .eeg-config-event-details {
    grid-template-columns: 1fr;
  }

  .eeg-config-event-details__field--wide {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .eeg-config-chip-list {
    grid-template-columns: 1fr;
  }
}
.eeg-customization-page {
  font-size: var(--app-ui-font-body);
}

.eeg-customization-page .json-editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: var(--app-ui-font-meta);
}

.eeg-customization-page .customization-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.eeg-customization-page .customization-refresh-button {
  min-width: 5.75rem !important;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: var(--app-ui-font-body);
  line-height: 1.5;
}

.eeg-customization-page .table td,
.eeg-customization-page .table th {
  vertical-align: top;
}

.eeg-customization-page .card {
  border-color: var(--bs-border-color, #dee2e6);
}

.eeg-customization-page .card-header strong {
  font-size: var(--app-ui-font-title);
  font-weight: 600;
}

.eeg-customization-page .form-label {
  font-size: var(--app-ui-font-body);
  margin-bottom: 0.35rem;
}

.eeg-customization-page .text-muted,
.eeg-customization-page .small {
  font-size: var(--app-ui-font-meta) !important;
}

.eeg-customization-page .btn {
  font-size: var(--app-ui-font-body);
}

.eeg-customization-page__badge {
  font-size: var(--app-ui-font-caption);
}

.eeg-customization-page .app-ui-tabs.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.4rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.eeg-customization-page .app-ui-tabs.nav-tabs .nav-item {
  margin-bottom: -1px;
}

.eeg-customization-page .form-select {
  padding-right: 2rem;
}

.eeg-customization-page .customization-panel-columns {
  --bs-gutter-x: 0.85rem;
}
/* Edit Channel Pair Modal Styles */

.color-picker-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 2px solid #dee2e6;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-value {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #6c757d;
}

.color-picker-popover {
  position: absolute;
  z-index: 2;
  margin-top: 8px;
}

.color-picker-cover {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.preview-section {
  margin-top: 24px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.channel-pair-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin-top: 8px;
}

.color-indicator {
  width: 8px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pair-label {
  font-weight: 600;
  font-size: 16px;
  color: #212529;
}

.pair-detail {
  font-size: 14px;
  color: #6c757d;
}

/* Accessibility improvements */
.form-select:focus,
.form-control:focus {
  border-color: #0066cc;
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.modal-header {
  border-bottom: 2px solid #0066cc;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
}

/* Error state styling */
.form-text.text-danger {
  font-weight: 500;
  margin-top: 4px;
}

.color-picker-container {
  --channel-color: #0d6efd;
}

.color-swatch {
  background-color: var(--channel-color);
}

.color-indicator {
  background-color: var(--channel-color);
}

.change-summary-banner {
  position: fixed;
  top: 76px; /* Below SignalStateStrip */
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  min-width: 400px;
  max-width: 600px;
  animation: slideDown 300ms ease-out;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.change-summary-banner__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.change-summary-banner__changes {
  margin-bottom: 12px;
  list-style: none;
  padding-left: 0;
}

.change-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', Consolas, Monaco, monospace;
  font-size: 0.875rem;
  padding: 4px 0;
}

.change-item__param {
  font-weight: 600;
  min-width: 120px;
  color: #333;
}

.change-item__old {
  color: #d32f2f;
  text-decoration: line-through;
  font-weight: 500;
}

.change-item__arrow {
  color: #666;
  font-weight: bold;
}

.change-item__new {
  color: #2e7d32;
  font-weight: 600;
}

.change-summary-banner__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .change-item__param {
    color: #ddd;
  }

  .change-item__old {
    color: #ff6b6b;
  }

  .change-item__arrow {
    color: #999;
  }

  .change-item__new {
    color: #69db7c;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .change-summary-banner {
    min-width: 300px;
    max-width: 90vw;
    top: 70px;
  }

  .change-item {
    font-size: 0.8125rem;
  }

  .change-item__param {
    min-width: 100px;
  }
}
.ws-streaming-empty {
  text-align: center;
  padding: 40px;
  color: #999;
}
.waveform-minimap {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  background: #0b1220;
  border-top: 1px solid #1e293b;
  overflow: visible;
  margin: 0;
}

.waveform-minimap__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 2px 10px;
  border-bottom: 1px solid #1e293b;
  background: #111827;
  color: #94a3b8;
  font-size: 0.68rem;
  line-height: 1.3;
}

.waveform-minimap__title {
  color: #cbd5e1;
  font-weight: 600;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.waveform-minimap__video-badge {
  color: #67e8f9;
  font-weight: 500;
  font-size: 0.62rem;
}

.waveform-minimap__zoom-select select {
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 4px;
  font-size: 0.66rem;
  padding: 1px 4px;
  max-width: 7.5rem;
}

.waveform-minimap__zoom-bar {
  position: relative;
  margin: 0 10px 2px;
  border-radius: 4px;
  touch-action: none;
}

.waveform-minimap__zoom-bar-track {
  position: absolute;
  inset: 4px 0;
  border-radius: 3px;
  background: #1e293b;
  border: 1px solid #334155;
}

.waveform-minimap__zoom-bar-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 12px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.35);
  border: 1px solid #3b82f6;
  cursor: grab;
  touch-action: none;
}

.waveform-minimap__zoom-bar-thumb:active {
  cursor: grabbing;
}

.waveform-minimap__zoom-bar-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
}

.waveform-minimap__zoom-bar-handle--start {
  left: -2px;
}

.waveform-minimap__zoom-bar-handle--end {
  right: -2px;
}

.waveform-minimap__canvas {
  display: block;
  width: 100%;
  height: 36px;
  user-select: none;
}

.waveform-minimap__canvas--compact {
  height: 20px;
}

.waveform-minimap__tooltip {
  position: absolute;
  top: -54px;
  z-index: 200;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 4px 8px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.waveform-minimap__tooltip-label {
  font-size: 0.72rem;
  color: #e2e8f0;
  font-weight: 500;
  margin-bottom: 1px;
}

.waveform-minimap__tooltip-meta {
  font-size: 0.68rem;
  color: #94a3b8;
}
.eeg-navigation-timeline-stack {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
  gap: 0;
}

.eeg-navigation-timeline-stack__unified-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100%;
}

.eeg-navigation-timeline-stack__unified {
  flex-shrink: 0;
  width: 100%;
}

.eeg-navigation-timeline-stack__unified .waveform-minimap {
  border-top: none;
  border-bottom: none;
  margin: 0;
}

.eeg-navigation-timeline-stack .eeg-navigation-timeline {
  border-top: none;
  margin: 0;
}

.eeg-navigation-timeline-stack__macro-collapse-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #0f172a;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
}

.eeg-navigation-timeline-stack__macro-collapse-btn--overlay {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 2;
  background: rgba(15, 23, 42, 0.88);
}

.eeg-navigation-timeline-stack__macro-collapse-btn:hover {
  color: #e2e8f0;
  border-color: #475569;
}

.eeg-navigation-timeline-stack__unified-wrap--compact {
  min-height: 20px;
}

.eeg-navigation-timeline-stack__unified-wrap--compact .waveform-minimap__canvas {
  height: 20px;
}

.eeg-navigation-timeline-stack__macro-collapse-btn--expand {
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 14px;
  height: 12px;
  padding: 0;
  font-size: 0.5rem;
  line-height: 1;
  border-radius: 3px;
}
.trend-correlation-chart {
  width: 100%;
  margin-bottom: 0.65rem;
  border: 1px solid #1e293b;
  border-radius: 6px;
  overflow: hidden;
  background: #0b1220;
}

.trend-correlation-chart__canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  user-select: none;
}
/* Overlay container — absolutely positioned over the waveform canvas */
.waveform-event-markers {
  position: absolute;
  top: 5px;
  left: 10px;
  right: 10px;
  height: 22px;
  pointer-events: none;
  z-index: 10;
}

.waveform-event-marker {
  position: absolute;
  top: 0;
  width: 14px;
  height: 22px;
  transform: translateX(-50%);
  cursor: pointer;
  pointer-events: all;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.waveform-event-marker__flag {
  width: 2px;
  height: 16px;
  border-radius: 1px;
  opacity: 0.85;
  transition: opacity 0.1s, width 0.1s;
}

.waveform-event-marker:hover .waveform-event-marker__flag,
.waveform-event-marker.active .waveform-event-marker__flag {
  opacity: 1;
  width: 3px;
}

/* Popover */
.waveform-event-marker__popover {
  position: absolute;
  top: 22px;
  z-index: 200;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 5px;
  padding: 8px 10px;
  min-width: 168px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.waveform-event-marker__popover-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 0.78rem;
  color: #e2e8f0;
}

.waveform-event-marker__popover-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.waveform-event-marker__popover-row {
  font-size: 0.71rem;
  color: #94a3b8;
  margin-bottom: 2px;
}

.waveform-event-marker__popover-link {
  margin-top: 7px;
  display: block;
  font-size: 0.71rem;
  color: #60a5fa;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.waveform-event-marker__popover-link:hover {
  text-decoration: underline;
  color: #93c5fd;
}

/* Event count badge in toolbar */
.eeg-event-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  margin-left: 4px;
  vertical-align: middle;
}
.waveform-annotation-markers {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 12;
  pointer-events: none;
}

.waveform-annotation-marker {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  pointer-events: all;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid transparent;
  box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.35);
}

.waveform-annotation-marker--point {
  width: 8px;
  height: 18px;
  border-radius: 1px;
}

.waveform-annotation-marker--duration {
  height: 18px;
  min-width: 10px;
  transform: none;
  margin-top: -9px;
}

.waveform-annotation-marker__duration-glyph {
  position: absolute;
  top: 3px;
  right: 0px;
  display: inline-flex;
  width: 13px;
  height: 13px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.72);
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
}

.waveform-annotation-marker.is-dragging {
  box-shadow: 0 0 0 2px rgba(248, 250, 252, 0.45);
}

.waveform-annotation-marker__handle {
  position: absolute;
  top: -9px;
  width: 20px;
  height: 36px;
  border-radius: 2px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.7);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
  cursor: ew-resize;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
  z-index: 2;
}

.waveform-annotation-marker:hover .waveform-annotation-marker__handle,
.waveform-annotation-marker:focus-visible .waveform-annotation-marker__handle,
.waveform-annotation-marker.is-dragging .waveform-annotation-marker__handle {
  opacity: 1;
  pointer-events: auto;
}

.waveform-annotation-marker__handle--left {
  left: -10px;
}

.waveform-annotation-marker__handle--right {
  right: -10px;
}

.waveform-annotation-tooltip--above {
  margin-top: 0;
  margin-bottom: 12px;
}

.waveform-annotation-tooltip__title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #f8fafc;
}

.waveform-annotation-tooltip__meta {
  font-size: 0.72rem;
  color: #93c5fd;
  line-height: 1.3;
}

.waveform-annotation-tooltip__notes {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #cbd5e1;
  white-space: normal;
  line-height: 1.35;
}

.waveform-annotation-tooltip__channels {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.waveform-annotation-tooltip__section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #bfdbfe;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.waveform-annotation-tooltip__channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  max-height: 132px;
  overflow: auto;
  padding-right: 2px;
}

.waveform-annotation-tooltip__channel-option {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: #dbeafe;
}

.waveform-annotation-tooltip__channel-option input {
  flex: 0 0 auto;
}

.waveform-annotation-tooltip__channel-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waveform-annotation-tooltip__action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.waveform-annotation-tooltip__action {
  margin-top: 7px;
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.35);
  color: #f8fafc;
  font-size: 0.72rem;
  padding: 4px 7px;
  cursor: pointer;
}

.waveform-annotation-tooltip__action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.waveform-annotation-tooltip__action:hover {
  background: rgba(37, 99, 235, 0.72);
}

.waveform-annotation-tooltip__action--approve {
  background: rgba(5, 150, 105, 0.36);
  border-color: rgba(52, 211, 153, 0.56);
}

.waveform-annotation-tooltip__action--approve:hover {
  background: rgba(5, 150, 105, 0.72);
}

.waveform-annotation-tooltip__action--secondary {
  margin-left: 6px;
  background: rgba(30, 41, 59, 0.72);
}
/* ===================================
   QUICK ACTION TOOLBAR STYLES
   =================================== */

.quick-action-toolbar {
  position: fixed;
  z-index: 1000;
  background: var(--background-card, #ffffff);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 8px 8px 10px;
  transition:
    box-shadow 0.2s ease,
    background 0.2s ease;
  touch-action: none;
  user-select: none;
}

.quick-action-toolbar--dragging {
  cursor: grabbing;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.quick-action-toolbar-top-right {
  top: 100px;
  right: 20px;
}

.quick-action-toolbar--compact-list.quick-action-toolbar-top-right {
  top: 44px;
}

.quick-action-toolbar--compact-list.quick-action-toolbar-top-left {
  top: 44px;
}

.quick-action-toolbar-top-left {
  top: 100px;
  left: 20px;
}

.quick-action-toolbar-bottom-right {
  bottom: 20px;
  right: 20px;
}

.quick-action-toolbar-bottom-left {
  bottom: 20px;
  left: 20px;
}

.quick-action-toolbar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.quick-action-toolbar-handle,
.quick-action-toolbar-close,
.quick-action-toolbar-popin {
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text-secondary, #6c757d);
  color: #fff;
  cursor: grab;
}

.quick-action-toolbar-popin {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding: 0 10px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

.quick-action-toolbar-close {
  background: rgba(220, 53, 69, 0.95);
  cursor: pointer;
}

.quick-action-toolbar-handle:hover,
.quick-action-toolbar-close:hover,
.quick-action-toolbar-popin:hover {
  filter: brightness(1.08);
}

.quick-action-toolbar--labels {
  padding: 6px;
}

.quick-action-toolbar--labels .quick-action-toolbar-container {
  gap: 4px;
}

.quick-action-toolbar--compact-list {
  padding: 4px;
  border-radius: 8px;
  min-width: 148px;
  max-width: 220px;
  width: max-content;
}

.quick-action-toolbar--compact-list .quick-action-toolbar-container {
  gap: 2px;
  align-items: stretch;
  width: 100%;
}

.quick-action-toolbar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.quick-action-toolbar-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
}

.quick-action-list-item {
  display: block;
  width: 100%;
}

.quick-action-toolbar--compact-list .quick-action-btn--compact {
  width: 100%;
  min-height: 22px;
  height: auto;
  padding: 2px 6px;
  border-radius: 3px;
  justify-content: flex-start;
  box-sizing: border-box;
  transform: none;
}

.quick-action-toolbar--compact-list .quick-action-btn--compact:hover {
  transform: none;
  filter: brightness(1.08);
}

.quick-action-toolbar--compact-list .quick-action-label {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  width: 100%;
}

.quick-action-label__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-action-duration-glyph {
  display: inline-flex;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  font-size: 8px;
  line-height: 1;
}

.quick-action-list-type {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin: 0 0 2px;
}

.quick-action-list-type__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary, #64748b);
}

.quick-action-list-type__select {
  width: 100%;
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: 4px;
  background: var(--background-card, #ffffff);
  color: var(--text-primary, #0f172a);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 4px;
  line-height: 1.2;
}

.quick-action-toolbar--compact-list .customize-btn {
  width: 100%;
  min-height: 24px;
  height: 24px;
  margin-top: 2px;
}

.quick-action-btn--label {
  width: 112px;
  min-height: 34px;
  height: auto;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--quick-action-accent, var(--primary-brand, #0066cc));
  justify-content: flex-start;
}

.quick-action-btn--typed.quick-action-btn--label,
.quick-action-btn--typed.quick-action-btn--compact {
  background: var(--quick-action-accent);
  color: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-left: 4px solid rgba(15, 23, 42, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-weight: 650;
}

.quick-action-btn--typed.quick-action-btn--label:hover,
.quick-action-btn--typed.quick-action-btn--compact:hover {
  background: var(--quick-action-accent);
  filter: brightness(1.1);
}

.quick-action-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.quick-action-toolbar-handle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quick-action-toolbar--detached {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  transform: none;
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: auto;
  background: #111827;
}

.quick-action-toolbar--detached .quick-action-toolbar-header {
  justify-content: flex-start;
}

.quick-action-toolbar--detached .quick-action-toolbar-container {
  width: 100%;
  align-items: stretch;
}

.eeg-detached-shell .quick-action-toolbar--detached {
  padding: 8px;
}

.eeg-detached-shell .quick-action-list-type__label {
  color: #94a3b8;
}

.eeg-detached-shell .quick-action-list-type__select {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.quick-action-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border: none;
  background: var(--primary-brand, #0066cc);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.quick-action-btn:hover {
  background: var(--secondary-brand, #00a3a3);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quick-action-btn:active {
  transform: scale(0.98);
}

.quick-action-btn.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.quick-action-icon {
  font-size: 20px;
}

.drag-handle {
  position: absolute;
  bottom: 2px;
  right: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: rgba(255, 255, 255, 0.6);
}

.quick-action-btn:hover .drag-handle {
  opacity: 1;
}

.customize-btn {
  background: var(--text-secondary, #6c757d) !important;
  margin-top: 4px;
}

.customize-btn:hover {
  background: var(--text-primary, #212529) !important;
}

/* Tooltip customization */
.tooltip .shortcut-hint {
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-size: 11px;
  font-family: "Courier New", monospace;
}

/* Customize Panel */
.quick-action-customize-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--background-card, #ffffff);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  z-index: 1100;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.customize-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle, #dee2e6);
  background: var(--primary-brand, #0066cc);
  color: white;
  border-radius: 12px 12px 0 0;
}

.customize-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.customize-body {
  padding: 20px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}

.customize-action-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle, #dee2e6);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.customize-action-item:hover {
  background: var(--background-hover, #e9ecef);
  border-color: var(--primary-brand, #0066cc);
}

.customize-action-item input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.customize-action-item label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin: 0;
}

.action-reorder-controls {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.action-reorder-btn {
  border: 1px solid var(--border-subtle, #dee2e6);
  border-radius: 4px;
  background: var(--background-card, #ffffff);
  color: var(--text-primary, #212529);
  min-width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}

.action-reorder-btn:hover:not(:disabled) {
  background: var(--background-hover, #e9ecef);
}

.action-reorder-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-brand, #0066cc);
  color: white;
  border-radius: 6px;
  font-size: 16px;
}

.action-label {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary, #212529);
}

.action-shortcut {
  padding: 4px 8px;
  background: var(--background-hover, #e9ecef);
  border-radius: 4px;
  font-size: 12px;
  font-family: "Courier New", monospace;
  color: var(--text-secondary, #6c757d);
}

/* Responsive */
@media (max-width: 768px) {
  .quick-action-toolbar {
    padding: 6px;
  }

  .quick-action-btn {
    width: 42px;
    height: 42px;
  }

  .quick-action-icon {
    font-size: 18px;
  }

  .quick-action-customize-panel {
    width: 95vw;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .quick-action-toolbar {
    background: #2d3748;
  }

  .quick-action-customize-panel {
    background: #2d3748;
  }

  .customize-header {
    background: #1a365d;
  }

  .customize-action-item {
    border-color: #4a5568;
  }

  .customize-action-item:hover {
    background: #374151;
  }

  .action-label {
    color: #e2e8f0;
  }

  .action-shortcut {
    background: #374151;
    color: #a0aec0;
  }
}
.eeg-patient-context-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 4px 10px;
  background: var(--eeg-chrome-bg, #161b22);
  border-bottom: 1px solid var(--eeg-chrome-border, #2d3748);
  box-shadow: inset 3px 0 0 var(--eeg-safety, #fbbf24);
  color: var(--eeg-chrome-text, #e2e8f0);
  flex-shrink: 0;
  z-index: 12;
}

.eeg-patient-context-bar__exit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin: 0;
  padding: 4px 10px;
  min-height: 28px;
  border: 1px solid var(--eeg-chrome-btn-border, #475569);
  border-radius: 5px;
  background: var(--eeg-chrome-btn-bg, rgba(45, 55, 72, 0.72));
  color: var(--eeg-chrome-btn-text, #e2e8f0);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.eeg-patient-context-bar__exit:hover {
  background: var(--eeg-chrome-bg-elevated, #1c2129);
  border-color: #64748b;
  color: #ffffff;
}

.eeg-patient-context-bar__exit:focus-visible {
  outline: 2px solid var(--eeg-focus-ring, #93c5fd);
  outline-offset: 2px;
}

.eeg-patient-context-bar__identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.2;
}

.eeg-patient-context-bar__study-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 28%;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.2;
  color: var(--eeg-chrome-text-muted, #a8b4c4);
}

.eeg-patient-context-bar__live-status {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  min-width: 0;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.68rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.eeg-patient-context-bar__live-segment {
  white-space: nowrap;
}

.eeg-patient-context-bar__live-segment--study {
  font-weight: 600;
  color: #e2e8f0;
}

.eeg-patient-context-bar__live-divider {
  color: #64748b;
  flex-shrink: 0;
}

.eeg-patient-context-bar__clock-short {
  display: none;
}

.eeg-patient-context-bar__name {
  font-weight: 700;
  color: var(--eeg-safety-text, #fef3c7);
  flex-shrink: 0;
}

.eeg-patient-context-bar__divider {
  color: var(--eeg-chrome-text-subtle, #64748b);
  flex-shrink: 0;
}

.eeg-patient-context-bar__field {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  flex-shrink: 1;
}

.eeg-patient-context-bar__field--mrn {
  flex-shrink: 0;
}

.eeg-patient-context-bar__field--exam {
  flex-shrink: 0;
}

.eeg-patient-context-bar__label {
  color: var(--eeg-chrome-text-muted, #a8b4c4);
  font-weight: 500;
  flex-shrink: 0;
}

.eeg-patient-context-bar__value {
  color: var(--eeg-chrome-text, #e2e8f0);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eeg-patient-context-bar__controls-btn--active {
  background: var(--eeg-accent-muted-bg, rgba(59, 130, 246, 0.14));
  border-color: var(--eeg-accent-muted-border, rgba(59, 130, 246, 0.45));
  color: #eff6ff;
}

@media (max-width: 1180px) {
  .eeg-patient-context-bar__study-context {
    display: none;
  }
}

@media (max-width: 960px) {
  .eeg-patient-context-bar__clock-full {
    display: none;
  }

  .eeg-patient-context-bar__clock-short {
    display: inline;
  }
}

@media (max-width: 900px) {
  .eeg-patient-context-bar__exit-label {
    display: none;
  }

  .eeg-patient-context-bar__identity {
    font-size: 0.72rem;
    gap: 6px;
  }

  .eeg-patient-context-bar__live-status {
    font-size: 0.64rem;
    padding: 2px 6px;
  }
}

@media (prefers-contrast: more) {
  .eeg-patient-context-bar {
    border-bottom-width: 2px;
    box-shadow: inset 4px 0 0 var(--eeg-safety, #fbbf24);
  }

  .eeg-patient-context-bar__name {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: var(--eeg-safety, #fbbf24);
    text-underline-offset: 2px;
  }
}
.eeg-viewer {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 61px); /* Account for the application header */
  max-height: calc(100dvh - 61px);
  overflow: hidden; /* Prevent any overflow - everything must fit */
  background: var(--eeg-canvas-bg, #000000);
  color: #ffffff;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --eeg-chrome-bg: #161b22;
  --eeg-chrome-bg-elevated: #1c2129;
  --eeg-chrome-border: #2d3748;
  --eeg-chrome-border-subtle: #252b36;
  --eeg-chrome-text: #e2e8f0;
  --eeg-chrome-text-muted: #a8b4c4;
  --eeg-chrome-text-subtle: #64748b;
  --eeg-canvas-bg: #000000;
  --eeg-accent: #3b82f6;
  --eeg-accent-strong: #2563eb;
  --eeg-accent-hover: #60a5fa;
  --eeg-accent-muted-bg: rgba(59, 130, 246, 0.14);
  --eeg-accent-muted-border: rgba(59, 130, 246, 0.45);
  --eeg-safety: #fbbf24;
  --eeg-safety-text: #fef3c7;
  --eeg-focus-ring: #93c5fd;
  --eeg-focus-offset: 2px;
  --eeg-chrome-btn-bg: rgba(45, 55, 72, 0.72);
  --eeg-chrome-btn-border: #475569;
  --eeg-chrome-btn-text: #e2e8f0;
  --eeg-chrome-zone-height: 36px;
  --eeg-dock-clinical-accent: #3b82f6;
  --eeg-dock-trend-accent: #14b8a6;
  --eeg-dock-events-accent: #f59e0b;
  --eeg-dock-spectrogram-accent: #a855f7;
  --eeg-dock-psd-accent: #ec4899;
  --eeg-dock-tab-font-size: 0.625rem;
  --eeg-dock-tab-height: 24px;
  --eeg-dock-content-padding: 4px;
  --eeg-dock-panel-title-size: 0.7rem;
  /* LCP fix: tell the browser this element paints independently so it can
     short-circuit ancestor layout during initial load. */
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 0 calc(100dvh - 61px);
}

.eeg-viewer-container {
  --eeg-chrome-bg: #161b22;
  --eeg-chrome-bg-elevated: #1c2129;
  --eeg-chrome-border: #2d3748;
  --eeg-chrome-border-subtle: #252b36;
  --eeg-chrome-text: #e2e8f0;
  --eeg-chrome-text-muted: #a8b4c4;
  --eeg-chrome-text-subtle: #64748b;
  --eeg-canvas-bg: #000000;
  --eeg-accent: #3b82f6;
  --eeg-accent-strong: #2563eb;
  --eeg-accent-hover: #60a5fa;
  --eeg-accent-muted-bg: rgba(59, 130, 246, 0.14);
  --eeg-accent-muted-border: rgba(59, 130, 246, 0.45);
  --eeg-safety: #fbbf24;
  --eeg-safety-text: #fef3c7;
  --eeg-focus-ring: #93c5fd;
  --eeg-focus-offset: 2px;
  --eeg-chrome-btn-bg: rgba(45, 55, 72, 0.72);
  --eeg-chrome-btn-border: #475569;
  --eeg-chrome-btn-text: #e2e8f0;
  --eeg-dock-clinical-accent: #3b82f6;
  --eeg-dock-trend-accent: #14b8a6;
  --eeg-dock-events-accent: #f59e0b;
  --eeg-dock-spectrogram-accent: #a855f7;
  --eeg-dock-psd-accent: #ec4899;
}

/* WCAG 2.x: visible keyboard focus for all interactive chrome controls */
.eeg-viewer :is(button, [role="button"], a, select, input, textarea):focus-visible {
  outline: 2px solid var(--eeg-focus-ring);
  outline-offset: var(--eeg-focus-offset);
}

@media (prefers-reduced-motion: reduce) {
  .eeg-viewer :is(button, [role="button"]) {
    transition: none !important;
  }

  .eeg-viewer :is(button, [role="button"]):hover {
    transform: none !important;
  }

  .eeg-viewer *,
  .eeg-viewer *::before,
  .eeg-viewer *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  .eeg-viewer {
    --eeg-chrome-border: #94a3b8;
    --eeg-chrome-btn-border: #cbd5e1;
    --eeg-chrome-text-muted: #cbd5e1;
  }

  .annotation-panel-toggle__btn[aria-pressed="true"] {
    border-width: 2px;
  }

  .playback-controls .eeg-playback-control--primary {
    border-width: 2px;
  }
}

/* Control Bar */

html[data-font-size="large"] .eeg-viewer,
html[data-font-size="extra-large"] .eeg-viewer,
html[data-font-size="xlarge"] .eeg-viewer {
  --eeg-dock-tab-font-size: 0.68rem;
  --eeg-dock-tab-height: 26px;
  --eeg-dock-content-padding: 5px;
  --eeg-dock-panel-title-size: 0.74rem;
}

body.workspace-density-compact .eeg-viewer {
  --eeg-dock-tab-font-size: 0.58rem;
  --eeg-dock-tab-height: 22px;
  --eeg-dock-content-padding: 2px;
  --eeg-dock-panel-title-size: 0.66rem;
}

body.large-touch-targets .eeg-viewer {
  --eeg-dock-tab-height: 28px;
}

body.eeg-layout-immersive .eeg-viewer,
body.eeg-layout-immersive .eeg-viewer-container {
  height: 100%;
  max-height: 100%;
  contain-intrinsic-size: 0 100%;
}

/* Tab Content Wrapper - Must flex to fill available space */
.eeg-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0; /* Critical: allows flexbox shrinking */
  overflow: hidden;
}

.eeg-viewer-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-size: 1.2rem;
  color: #666;
  text-align: center;
}

.eeg-viewer-loading small {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #888;
}

.eeg-viewer-error {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 40px;
  text-align: center;
  color: #fff;
  background: #1a1a1a;
}

.eeg-viewer-error h3 {
  color: #ff6b6b;
  margin-bottom: 20px;
}

.eeg-viewer-error p {
  margin-bottom: 15px;
  color: #ccc;
}

.eeg-viewer-error ul {
  text-align: left;
  color: #aaa;
  margin-bottom: 20px;
}

.eeg-viewer-error code {
  background: #333;
  color: #ff6b6b;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
}

.eeg-viewer-error button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
}

.eeg-viewer-error button:hover {
  background: #0056b3;
}

/* Control Bar */

.eeg-controls--auto-hide {
  min-height: 34px;
}

.eeg-viewer-chrome-zone {
  flex-shrink: 0;
  width: 100%;
}

.eeg-viewer-chrome-zone--top {
  z-index: 12;
}

.eeg-viewer-workspace-peek-zone {
  position: relative;
}

.eeg-viewer-workspace-peek-zone::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 10px;
  pointer-events: auto;
}

.eeg-viewer-bottom-chrome {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
}

.eeg-calibration-warning-strip {
  flex-shrink: 0;
  padding: 4px 10px 0;
}

.eeg-calibration-warning-strip .eeg-calibration-warning {
  margin: 0;
}

.eeg-toolbar-status-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
}

.eeg-toolbar-status-row--expanded {
  padding-top: 0;
}

/* EEG-UX-005: Toolbar rows */
.eeg-toolbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  flex-wrap: wrap;
  row-gap: 6px;
  max-width: 100%;
  overflow: visible;
}

.eeg-toolbar-left-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  order: 1;
}

.eeg-toolbar-left-stack > .eeg-toolbar-cluster,
.eeg-toolbar-left-stack > .eeg-toolbar-row--filters {
  width: 100%;
  min-width: 0;
}

.eeg-toolbar-row--filters {
  background: #0d1829;
  border-top: 1px solid #1e293b;
}

.eeg-toolbar-cluster {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px 5px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.34);
  min-width: 0;
  overflow: visible;
}

.eeg-toolbar-cluster__label {
  font-size: 0.56rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7d8da6;
  opacity: 0.9;
  line-height: 1;
}

/* Workspace controls: compact single-row toolbars, no section/field labels */

.eeg-toolbar-row__label {
  display: block;
  flex: 0 0 100%;
}

.eeg-toolbar-cluster__content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.eeg-toolbar-cluster--actions {
  margin-left: 0;
  justify-self: auto;
  width: 100%;
  max-width: 100%;
}

.eeg-toolbar-cluster--actions .eeg-toolbar-cluster__content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.eeg-toolbar-cluster--signal {
  width: 100%;
  max-width: 100%;
  align-self: flex-start;
}

.eeg-toolbar-cluster--signal .eeg-toolbar-cluster__content,
.eeg-toolbar-cluster--dual .eeg-toolbar-cluster__content,
.eeg-toolbar-cluster--tools .eeg-toolbar-cluster__content,
.eeg-toolbar-row--filters {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.eeg-toolbar-cluster--signal .eeg-toolbar-overflow-row.eeg-toolbar-cluster__content,
.eeg-toolbar-cluster--dual .eeg-toolbar-overflow-row.eeg-toolbar-cluster__content,
.eeg-toolbar-cluster--tools .eeg-toolbar-overflow-row.eeg-toolbar-cluster__content {
  display: block;
  overflow: hidden;
}

.eeg-toolbar-cluster--signal .eeg-toolbar-cluster__content--overflow,
.eeg-toolbar-cluster--dual .eeg-toolbar-cluster__content--overflow,
.eeg-toolbar-cluster--tools .eeg-toolbar-cluster__content--overflow {
  overflow: hidden;
}

.eeg-toolbar-overflow-row {
  position: relative;
  width: 100%;
  min-width: 0;
}

.eeg-toolbar-overflow-row__measure {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  inset: 0 auto auto 0;
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: none;
  overflow: hidden;
  height: 0;
}

.eeg-toolbar-overflow-row__visible {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  flex-wrap: nowrap;
}

.eeg-toolbar-overflow-row__item {
  flex: 0 0 auto;
}

.eeg-toolbar-control-bundle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.eeg-toolbar-overflow-row__dropdown {
  flex: 0 0 auto;
}

.eeg-toolbar-overflow-row__toggle {
  min-width: 2rem;
  padding: 0.1rem 0.45rem;
  font-size: var(--app-ui-font-meta, 0.72rem);
  line-height: 1.2;
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.55);
}

.eeg-toolbar-overflow-row__toggle:hover,
.eeg-toolbar-overflow-row__toggle:focus-visible {
  border-color: #60a5fa;
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

.eeg-toolbar-overflow-row__menu {
  padding: 0.6rem;
  min-width: 16rem;
  max-width: min(28.8rem, 90vw);
  background: #0f172a;
  border: 1px solid #334155;
  z-index: 1200;
}

.eeg-toolbar-overflow-row__menu-item {
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
}

.eeg-toolbar-overflow-row__menu-item + .eeg-toolbar-overflow-row__menu-item {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}

.eeg-toolbar-cluster--signal .eeg-toolbar-overflow-row__menu-item .control-group,
.eeg-toolbar-cluster--dual .eeg-toolbar-overflow-row__menu-item .control-group {
  width: 100%;
}

/* Portaled overflow menu: controls render on document.body, so toolbar-cluster
   width rules do not apply. Give selects room for full option labels. */
.eeg-toolbar-overflow-row__menu .eeg-toolbar-overflow-row__menu-item {
  width: 100%;
}

.eeg-toolbar-overflow-row__menu .eeg-toolbar-control-bundle,
.eeg-toolbar-overflow-row__menu .control-group {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.eeg-toolbar-overflow-row__menu .eeg-toolbar-control-bundle {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.eeg-toolbar-overflow-row__menu .control-group select,
.eeg-toolbar-overflow-row__menu .eeg-signal-select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box;
  padding-right: 1.5rem;
  text-overflow: ellipsis;
}

.eeg-toolbar-overflow-row__menu .eeg-auto-fit-btn,
.eeg-toolbar-overflow-row__menu .eeg-toolbar-filter-toggle {
  width: 100%;
  justify-content: center;
}

.eeg-toolbar-cluster--dual,
.eeg-toolbar-cluster--tools {
  width: 100%;
}

.eeg-toolbar-cluster--signal .eeg-toolbar-cluster__content > *,
.eeg-toolbar-cluster--dual .eeg-toolbar-cluster__content > * {
  flex: 0 0 auto;
}

/* Speed button strip — clinical zones: careful / rapid / screening */

.eeg-speed-btn-strip__primary,
.eeg-speed-btn-strip__secondary {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  min-width: max-content;
}

.eeg-speed-btn-strip__secondary {
  display: none;
  min-width: max-content;
  max-width: none;
}

.eeg-speed-zone-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 2px;
  flex-shrink: 0;
}

.playback-controls .eeg-speed-btn,
.eeg-speed-btn {
  font-size: 0.75rem;
  font-family: monospace;
  padding: 1px 7px;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
  flex-shrink: 0;
  transition:
    background 0.1s,
    color 0.1s,
    border-color 0.1s;
}

.playback-controls .eeg-speed-btn-more,
.eeg-speed-btn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.playback-controls .eeg-speed-btn-more:hover,
.eeg-speed-btn-more:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #f8fafc;
}

.eeg-speed-btn-more__label {
  line-height: 1;
}

.playback-controls .eeg-speed-btn:hover,
.eeg-speed-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

/* Careful zone: ≤8× — blue (must beat .playback-controls button specificity) */

/* Rapid zone: 16–60× — amber */

/* Screening zone: ≥100× — red */

.eeg-output-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.eeg-toolbar-cluster--actions .eeg-toolbar-cluster__content {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.eeg-toolbar-cluster--actions .eeg-output-row {
  flex: 1 1 auto;
}

@media (max-width: 1260px) {

  .eeg-toolbar-left-stack {
    flex: 1 1 100%;
    margin-left: 0;
    width: 100%;
    justify-self: stretch;
  }
}

/* EEG-UX-005: Filters toggle button */
.eeg-toolbar-filter-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.eeg-toolbar-filter-toggle:hover {
  border-color: #475569;
  color: #cbd5e1;
}

.eeg-toolbar-filter-toggle.active {
  border-color: #f59e0b;
  color: #fcd34d;
}

.eeg-toolbar-filter-toggle.open {
  background: #0f172a;
}

.eeg-ruler-toggle {
  border-radius: 999px;
  border-color: rgba(56, 189, 248, 0.26);
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.96) 0%,
    rgba(30, 41, 59, 0.92) 100%
  );
  color: #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.12);
  transition:
    transform 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease,
    box-shadow 0.14s ease;
}

.eeg-ruler-toggle:hover {
  border-color: rgba(56, 189, 248, 0.42);
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 1) 0%,
    rgba(37, 99, 235, 0.18) 100%
  );
  color: #f8fafc;
  box-shadow:
    inset 0 1px 0 rgba(191, 219, 254, 0.12),
    0 10px 24px rgba(8, 47, 73, 0.18);
  transform: translateY(-1px);
}

.eeg-ruler-toggle.active {
  border-color: rgba(14, 165, 233, 0.62);
  background: linear-gradient(
    180deg,
    rgba(8, 47, 73, 0.98) 0%,
    rgba(14, 116, 144, 0.84) 100%
  );
  color: #e0f2fe;
  box-shadow:
    inset 0 1px 0 rgba(186, 230, 253, 0.18),
    0 0 0 1px rgba(14, 165, 233, 0.12),
    0 12px 28px rgba(8, 47, 73, 0.24);
}

.eeg-ruler-toggle:active {
  transform: translateY(0);
}

.eeg-toolbar-filter-toggle.eeg-ruler-toggle {
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  font-size: 0.75rem;
}

.eeg-filter-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  margin-left: 3px;
  flex-shrink: 0;
}

.eeg-review-tools-inline-label {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.eeg-calibration-badge-inline {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.control-group label {
  font-size: 0.75rem;
  color: #bbb;
  white-space: nowrap;
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.control-group select,
.control-group input[type="number"] {
  padding: 2px 6px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 0.75rem;
  max-width: 60px;
  min-width: 0;
  width: auto;
  flex-shrink: 0;
  transition:
    border-color 0.2s,
    background 0.2s;
  min-height: auto;
}

.control-group select:hover,
.control-group input[type="number"]:hover {
  border-color: #4a90e2;
  background: #222;
}

.control-group select:focus,
.control-group input[type="number"]:focus {
  outline: none;
  border-color: #4a90e2;
  background: #222;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.eeg-toolbar-cluster--signal select.eeg-signal-select--montage {
  min-width: 136px;
  width: 158px;
  max-width: 158px;
}

.eeg-toolbar-cluster--signal select.eeg-signal-select--perspective {
  min-width: 145px;
  width: 172px;
  max-width: 198px;
}

.eeg-toolbar-cluster--signal select.eeg-signal-select--trend-template {
  min-width: 132px;
  width: 158px;
  max-width: 187px;
}

.eeg-toolbar-cluster--signal select.eeg-signal-select--displaymode {
  min-width: 79px;
  width: 86px;
  max-width: 106px;
}

.eeg-toolbar-cluster--signal select.eeg-signal-select--rowheight {
  min-width: 86px;
  width: 86px;
  max-width: 114px;
}

.eeg-toolbar-cluster--signal .control-group--display-mode label,
.eeg-toolbar-cluster--signal .control-group--row-height label,
.eeg-toolbar-cluster--signal .control-group--sensitivity label,
.eeg-toolbar-cluster--signal .control-group--autofit label {
  display: none;
  min-width: 0;
}

.eeg-toolbar-cluster--signal select.eeg-signal-select--sensitivity {
  min-width: 86px;
  width: 101px;
  max-width: 110px;
}

.eeg-toolbar-cluster--signal .control-group--sensitivity label {
  min-width: 0;
}

.eeg-toolbar-cluster--signal .control-group--autofit label {
  min-width: 0;
}

.eeg-auto-fit-btn {
  min-width: 82px;
  padding-inline: 12px;
}

.eeg-auto-fit-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.eeg-toolbar-cluster--signal .control-group--row-height select:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.eeg-toolbar-cluster--signal select.eeg-signal-select--timescale {
  min-width: 106px;
  width: 106px;
  max-width: 119px;
}

.control-group input[type="range"] {
  width: 65px;
  flex-shrink: 0;
  height: 4px;
  background: #333;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #4a90e2;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  -webkit-transition: transform 0.2s;
  transition: transform 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: #5ba3ff;
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #4a90e2;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  -moz-transition: transform 0.2s;
  transition: transform 0.2s;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
  background: #5ba3ff;
}

.control-group input[type="checkbox"] {
  margin: 0 2px 0 0;
}

.eeg-toolbar-shortcuts-btn {
  min-width: 32px;
  padding: 2px 8px;
  font-weight: 700;
}

.eeg-control-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7ab3e8;
  font-size: 0.8rem;
  line-height: 1;
  padding: 2px;
  border-radius: 3px;
  text-decoration: none;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}

.eeg-control-link:disabled {
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.65;
}

.eeg-control-link:hover {
  color: #add0f5;
  background: rgba(74, 144, 226, 0.15);
}

/* Main Content Area */
.eeg-content {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.eeg-dock-resizer {
  flex: 0 0 auto;
  background: #1f2937;
  transition: background 0.15s;
}

.eeg-dock-resizer.active,
.eeg-dock-resizer:hover {
  background: #3b82f6;
}

.eeg-dock-resizer--right {
  width: 6px;
  cursor: col-resize;
}

.eeg-dock-resizer--bottom {
  height: 6px;
  width: 100%;
  cursor: row-resize;
}

.eeg-dock-right {
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: 460px;
  height: 100%;
  background: #0f172a;
  border-left: 1px solid #1e293b;
  overflow: hidden;
}

.eeg-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #1e293b;
  background: #111827;
  color: #e5e7eb;
}

.eeg-dock-header-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.eeg-dock-header strong {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
}

.eeg-dock-header-summary {
  color: #94a3b8;
  font-size: 0.68rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eeg-dock-header button {
  border: 1px solid #374151;
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
}

.eeg-dock-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.eeg-dock-header-actions > button.active {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
}

.eeg-dock-panel-controls {
  padding: 8px;
  border-bottom: 1px solid #1f2937;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0b1220;
}

.eeg-dock-panel-control-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
  font-size: 0.75rem;
}

.eeg-dock-panel-control-item label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.eeg-dock-panel-control-item button {
  min-width: 24px;
  border: 1px solid #334155;
  background: #1f2937;
  color: #cbd5e1;
  border-radius: 4px;
  padding: 2px 4px;
}

.eeg-dock-right-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eeg-dock-right-content > .annotation-timeline {
  flex: 1;
}

.eeg-dock-right-panel-slot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.eeg-dock-panel-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 16px;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
}

.eeg-live-topography-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #1f3550;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(10, 18, 32, 0.96) 0%,
    rgba(13, 24, 40, 0.98) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.08);
}

.eeg-live-topography-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.eeg-live-topography-card__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.eeg-live-topography-card__copy strong {
  color: #eff6ff;
  font-size: 0.82rem;
  line-height: 1.2;
}

.eeg-live-topography-card__copy span {
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1.35;
}

.eeg-live-topography-card__summary {
  display: block;
}

.eeg-live-topography-card__detail {
  color: #94a3b8;
  font-size: 0.68rem;
  line-height: 1.4;
}

.eeg-live-topography-card__empty {
  padding: 16px 14px;
  border: 1px dashed #31465f;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  font-size: 0.74rem;
  line-height: 1.45;
}

.eeg-live-topography-card .topographic-map-3d {
  gap: 6px;
}

.eeg-live-topography-card .topographic-map-3d__meta {
  color: #aebfd1;
  font-size: 11px;
}

.eeg-live-topography-card .topographic-map-3d__scene-accent,
.eeg-live-topography-card .topographic-map-3d__scene-renderer-tag {
  color: #e2ecf8;
}

.eeg-live-topography-card .topographic-map-3d__canvas {
  min-height: 188px;
  border-radius: 12px;
}

.eeg-dock-bottom {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #1f2937;
  background: #0b1220;
  flex-shrink: 0;
  /* CLS fix: isolate dock height changes from the waveform area above.
     'layout style size' prevents the browser from reflowing ancestors
     when the dock expands/collapses or is resized. */
  contain: layout style size;
}

.eeg-dock-bottom-host {
  flex-shrink: 0;
}

.eeg-dock-events-trends {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--eeg-chrome-bg);
  border-top: 1px solid var(--eeg-chrome-border-subtle);
}

.eeg-dock-events-trends--right {
  flex: 1 1 auto;
  margin-top: 6px;
  border-top: 1px solid #1e293b;
  min-height: 180px;
}

.eeg-dock-events-trends--undocked {
  height: 100%;
  border-top: none;
  flex: 1 1 auto;
  min-height: 0;
}

.eeg-detached-shell .eeg-dock-events-trends--undocked {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.eeg-detached-shell .eeg-dock-tab-btn,
.eeg-detached-shell .eeg-dock-tab-utility-btn {
  background: transparent !important;
  border: none;
  box-shadow: none;
  color: #94a3b8;
}

.eeg-detached-shell .eeg-dock-tab-btn.active {
  color: #e2e8f0;
  border-bottom: 2px solid #3b82f6;
}

.eeg-detached-shell .eeg-dock-bottom-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.eeg-detached-shell .event-detection-panel.card {
  border: none;
  background: transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.eeg-detached-shell .event-detection-panel .card-header,
.eeg-detached-shell .event-detection-panel .event-detection-panel__title {
  color: #f8fafc;
}

.eeg-detached-shell .event-detection-panel table.event-detection-panel__table thead th,
.eeg-detached-shell .event-detection-panel table.event-detection-panel__table tbody td {
  padding: 0.08rem 0.3rem;
  line-height: 1.1;
}

.eeg-detached-shell .event-detection-panel table.event-detection-panel__table .form-check {
  min-height: 0;
  margin: 0;
  padding: 0;
}

.eeg-detached-shell .event-detection-panel .event-detection__action-btn,
.eeg-detached-shell .event-detection-panel .btn-group .btn {
  min-height: 0.85rem;
  max-height: 0.85rem;
  padding: 0.04rem 0.14rem !important;
}


.eeg-detached-shell .spectrogram-panel__header strong {
  font-size: var(--eeg-dock-panel-title-size);
}

.eeg-dock-bottom--collapsed {
  height: 28px !important;
  min-height: 28px !important;
  overflow: hidden;
}

/* Tab strip: always visible row of tab buttons + collapse chevron */

.eeg-dock-tab-strip--compact {
  gap: 0;
  padding: 0 2px;
}

.eeg-dock-tab-strip__tabs {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.eeg-dock-tab-strip--compact .eeg-dock-tab-btn {
  padding: 0 5px;
}

.eeg-dock-tab-overflow-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: calc(var(--eeg-dock-tab-height) - 2px);
  padding: 0 5px;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #0f172a;
  color: #94a3b8;
  font-size: var(--eeg-dock-tab-font-size);
  cursor: pointer;
}

.eeg-dock-tab-overflow-btn:hover {
  color: #e2e8f0;
  border-color: #475569;
  background: #1e293b;
}

.eeg-dock-tab-overflow-count {
  min-width: 0.75rem;
  text-align: center;
  font-weight: 600;
}

.eeg-dock-tab-overflow-menu {
  min-width: 148px;
  max-width: 196px;
  padding: 2px;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
  font-size: var(--eeg-dock-tab-font-size, 0.58rem);
  line-height: 1.1;
}

.eeg-dock-tab-overflow-menu--portal {
  position: fixed;
}

.eeg-dock-tab-overflow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: calc(var(--eeg-dock-tab-height, 22px) - 2px);
  padding: 1px 3px;
  border-radius: 3px;
}

.eeg-dock-tab-overflow-item:hover {
  background: #1e293b;
}

.eeg-dock-tab-overflow-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e2e8f0;
  font-size: var(--eeg-dock-tab-font-size, 0.58rem);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.eeg-dock-tab-overflow-item-actions {
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0;
}

.eeg-dock-tab-overflow-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--eeg-dock-tab-height, 22px) - 4px);
  min-width: calc(var(--eeg-dock-tab-height, 22px) + 8px);
  padding: 0 4px;
  border: 1px solid #334155;
  border-radius: 3px;
  background: transparent;
  color: #93c5fd;
  font-size: var(--eeg-dock-tab-font-size, 0.58rem);
  line-height: 1;
  cursor: pointer;
}

.eeg-dock-tab-overflow-action:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: #3b82f6;
}

.eeg-dock-tab-btn {
  height: calc(var(--eeg-dock-tab-height) - 2px);
  padding: 0 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-size: var(--eeg-dock-tab-font-size);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.12s,
    border-color 0.12s,
    background 0.12s;
  border-radius: 3px 3px 0 0;
}

.eeg-dock-tab-btn:hover {
  color: #e2e8f0;
  background: #1e293b;
}

.eeg-dock-tab-btn.active {
  color: #e2e8f0;
  border-bottom-color: #3b82f6;
}

.eeg-dock-tab-collapse-btn {
  height: 22px;
  padding: 0 7px;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  font-size: 0.7rem;
  cursor: pointer;
  transition:
    color 0.12s,
    background 0.12s;
  flex-shrink: 0;
}

.eeg-dock-tab-utilities {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.eeg-dock-tab-utility-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  font-size: 0.68rem;
  cursor: pointer;
  transition:
    color 0.12s,
    background 0.12s,
    border-color 0.12s;
  white-space: nowrap;
}

.eeg-dock-tab-utility-btn:hover {
  color: #e2e8f0;
  background: #1e293b;
}

.eeg-dock-tab-utility-btn.active {
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.55);
}

.eeg-dock-tab-utility-btn svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.eeg-dock-tab-utility-btn.eeg-ruler-toggle {
  gap: 6px;
  height: 22px;
  padding: 0 12px;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.eeg-dock-tab-collapse-btn:hover {
  color: #e2e8f0;
  background: #1e293b;
}

.eeg-dock-bottom-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--eeg-dock-content-padding);
  display: flex;
  flex-direction: column;
  font-size: var(--eeg-dock-tab-font-size);
}

.eeg-dock-bottom-content .event-detection-panel .event-detection-panel__filters {
  gap: 0.3rem;
}

.eeg-dock-bottom-content .event-detection-panel .event-detection-panel__filter-select,
.eeg-dock-bottom-content .event-detection-panel .event-detection-panel__search-input {
  font-size: var(--eeg-dock-tab-font-size);
  min-height: 1.35rem;
  height: 1.35rem;
}


.eeg-dock-bottom-content .spectrogram-panel__header strong {
  font-size: var(--eeg-dock-panel-title-size);
}

.eeg-dock-bottom-content .spectrogram-panel__header {
  padding: 0.35rem 0.45rem;
}

.eeg-dock-bottom-content .spectrogram-panel__controls {
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.eeg-dock-bottom-content .spectrogram-panel__select,
.eeg-dock-bottom-content .spectrogram-panel__input,
.eeg-dock-bottom-content .spectrogram-panel__label,
.eeg-dock-bottom-content .spectrogram-panel__field-hint,
.eeg-dock-bottom-content .spectrogram-panel__settings-btn {
  font-size: var(--eeg-dock-tab-font-size);
}

.eeg-dock-bottom-content .spectrogram-panel__select,
.eeg-dock-bottom-content .spectrogram-panel__input {
  min-height: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  line-height: 1.2;
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}

.eeg-dock-bottom-content .spectrogram-panel__content {
  padding: 0.35rem 0.45rem;
}

.eeg-dock-bottom-content .spectrogram-panel__settings {
  padding: 0.35rem 0.45rem;
}

.eeg-detached-shell .spectrogram-panel__select,
.eeg-detached-shell .spectrogram-panel__input,
.eeg-detached-shell .spectrogram-panel__label,
.eeg-detached-shell .spectrogram-panel__field-hint,
.eeg-detached-shell .spectrogram-panel__settings-btn {
  font-size: var(--eeg-dock-tab-font-size);
}

.eeg-detached-shell .spectrogram-panel__select,
.eeg-detached-shell .spectrogram-panel__input {
  min-height: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  line-height: 1.2;
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}

.eeg-dock-bottom-content .spectral-analysis-panel__channel-select,
.eeg-dock-bottom-content .spectral-analysis-panel__scope,
.eeg-dock-bottom-content .spectral-analysis-panel__dominant {
  font-size: var(--eeg-dock-tab-font-size);
}

.eeg-dock-bottom-content .spectral-analysis-panel__channel-select,
.eeg-detached-shell .spectral-analysis-panel__channel-select {
  min-height: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  line-height: 1.2;
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}


html[data-font-size="large"] .eeg-viewer .eeg-dock-bottom-content .spectrogram-panel__header strong,
html[data-font-size="extra-large"] .eeg-viewer .eeg-dock-bottom-content .spectrogram-panel__header strong,
html[data-font-size="xlarge"] .eeg-viewer .eeg-dock-bottom-content .spectrogram-panel__header strong {
  font-size: var(--eeg-dock-panel-title-size);
}

.eeg-dock-bottom-content .event-detection-panel .card-header {
  padding: 0.3rem 0.4rem;
}

.eeg-dock-bottom-content .event-detection-panel table.event-detection-panel__table thead th,
.eeg-dock-bottom-content .event-detection-panel table.event-detection-panel__table tbody td {
  padding: 0.08rem 0.3rem;
  font-size: var(--eeg-dock-tab-font-size);
  line-height: 1.1;
}

.eeg-dock-bottom-content .event-detection-panel table.event-detection-panel__table .form-check {
  min-height: 0;
  margin: 0;
  padding: 0;
}

.eeg-dock-bottom-content .event-detection-panel table.event-detection-panel__table .form-check-input {
  width: 0.7rem;
  height: 0.7rem;
  margin: 0;
}

.eeg-dock-bottom-content .event-detection-panel .badge {
  font-size: calc(var(--eeg-dock-tab-font-size) - 0.04rem);
  padding: 0.04rem 0.22rem;
  line-height: 1.05;
}

.eeg-dock-bottom-content .event-detection-panel .event-detection__action-btn,
.eeg-dock-bottom-content .event-detection-panel .btn-group .btn {
  min-height: 0.85rem;
  max-height: 0.85rem;
  padding: 0.04rem 0.14rem !important;
}

.eeg-dock-bottom-content > .annotation-timeline {
  flex: 1;
}

.eeg-waveform {
  flex: 1;
  position: relative;
  background: #000;
  padding: 5px 5px 0 5px;
  min-height: 0; /* Critical for flexbox to allow shrinking */
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent scrolling */
}

#eeg-canvas {
  background: #000;
  display: block;
  margin: 0;
  width: 100%;
  height: 100%;
  /* Canvas fills entire container */
}

/* Annotations Overlay */

/* Annotation Panel Toggle — vertical dock rail */
.annotation-panel-toggle {
  width: 34px;
  background: var(--eeg-chrome-bg);
  border-left: 1px solid var(--eeg-chrome-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 3px;
}

.annotation-panel-toggle button,
.annotation-panel-toggle__btn {
  width: 100%;
  min-height: 88px;
  background: var(--eeg-chrome-btn-bg);
  color: var(--eeg-chrome-text);
  border: 1px solid var(--eeg-chrome-btn-border);
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.1;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  position: relative;
  /* Clear gap below status dot so first letter stays readable */
  padding-top: 22px;
  padding-bottom: 8px;
}

.annotation-panel-toggle button::before,
.annotation-panel-toggle__btn::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: var(--eeg-chrome-text-subtle);
  pointer-events: none;
}

.annotation-panel-toggle__btn--clinical::before {
  background: var(--eeg-dock-clinical-accent);
}

.annotation-panel-toggle__btn--trend::before {
  background: var(--eeg-dock-trend-accent);
}

.annotation-panel-toggle__btn--analysis {
  min-height: 64px;
  padding-top: 18px;
  font-size: 0.6rem;
}

.annotation-panel-toggle button:hover,
.annotation-panel-toggle__btn:hover {
  background: var(--eeg-chrome-bg-elevated);
  border-color: #64748b;
  color: #f8fafc;
}

.annotation-panel-toggle button[aria-pressed="true"],
.annotation-panel-toggle__btn[aria-pressed="true"] {
  background: var(--eeg-accent-muted-bg);
  border-color: var(--eeg-accent-muted-border);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.annotation-panel-toggle__btn--clinical[aria-pressed="true"] {
  border-left: 3px solid var(--eeg-dock-clinical-accent);
}

.annotation-panel-toggle__btn--trend[aria-pressed="true"] {
  border-left: 3px solid var(--eeg-dock-trend-accent);
}

.annotation-panel-toggle__btn--analysis[aria-pressed="true"] {
  border-left: 3px solid var(--eeg-dock-events-accent);
}

.eeg-segment-selection-draft {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 11;
  border: 1px solid rgba(125, 211, 252, 0.92);
  background: rgba(14, 165, 233, 0.16);
  pointer-events: none;
}

.eeg-segment-inspector {
  position: absolute;
  right: 46px;
  top: 44px;
  z-index: 24;
  width: min(380px, calc(100% - 64px));
  max-height: calc(100% - 88px);
  overflow: auto;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46);
  padding: 10px;
}

.eeg-segment-inspector__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.eeg-segment-inspector__header strong {
  font-size: 0.86rem;
}

.eeg-segment-inspector__header button,
.eeg-segment-inspector__actions button {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
  font-size: 0.72rem;
}

.eeg-segment-inspector__header button {
  width: 24px;
  height: 24px;
  line-height: 1;
}

.eeg-segment-inspector__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
}

.eeg-segment-inspector__grid div {
  min-width: 0;
  border: 1px solid rgba(51, 65, 85, 0.88);
  border-radius: 4px;
  padding: 5px 6px;
  background: rgba(2, 6, 23, 0.34);
}

.eeg-segment-inspector__grid dt {
  margin: 0;
  color: #93c5fd;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.eeg-segment-inspector__grid dd {
  margin: 1px 0 0;
  color: #f8fafc;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eeg-segment-inspector__metric,
.eeg-segment-inspector__channels,
.eeg-segment-inspector__bands,
.eeg-segment-inspector__clinical {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-bottom: 7px;
}

.eeg-segment-inspector__bands,
.eeg-segment-inspector__clinical {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.eeg-segment-inspector__clinical {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.eeg-segment-inspector__bands span,
.eeg-segment-inspector__clinical span {
  min-width: 0;
  border: 1px solid rgba(51, 65, 85, 0.82);
  border-radius: 4px;
  padding: 4px 5px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eeg-segment-inspector__status {
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 4px;
  background: rgba(20, 83, 45, 0.32);
  color: #bbf7d0;
  font-size: 0.72rem;
  margin-bottom: 7px;
  padding: 5px 7px;
}

.eeg-segment-inspector__spectrum {
  height: 48px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 1px;
  border: 1px solid rgba(51, 65, 85, 0.82);
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.42);
  margin-bottom: 7px;
  padding: 4px;
}

.eeg-segment-inspector__spectrum span {
  min-height: 4px;
  border-radius: 1px 1px 0 0;
  background: #7dd3fc;
}

.eeg-segment-inspector__spectrogram {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 6px;
  gap: 2px;
  margin-bottom: 8px;
}

.eeg-segment-inspector__spectrogram span {
  border-radius: 1px;
}

.eeg-segment-inspector__similar {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.eeg-segment-inspector__similar strong {
  color: #bfdbfe;
  font-size: 0.72rem;
}

.eeg-segment-inspector__similar button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  padding: 5px 7px;
  text-align: left;
}

.eeg-segment-inspector__similar button:hover {
  border-color: #60a5fa;
  background: rgba(30, 64, 175, 0.72);
}

.eeg-segment-inspector__similar small {
  grid-column: 1 / -1;
  color: #93c5fd;
}

.eeg-segment-inspector__channels {
  color: #a7f3d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eeg-segment-inspector__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eeg-segment-inspector__actions button {
  padding: 5px 8px;
  min-height: 26px;
}

.eeg-segment-inspector__actions button:hover,
.eeg-segment-inspector__header button:hover {
  border-color: #60a5fa;
  background: #1d4ed8;
}

/* Annotation Panel - sized to keep review and consensus controls readable */
.annotation-panel {
  width: 320px;
  min-width: 288px;
  max-width: 440px;
  background: #2a2a2a;
  border-left: 2px solid #333;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

.annotation-panel h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #fff;
  font-size: 1rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.annotation-panel > p {
  flex-shrink: 0;
  margin-bottom: 4px;
}

.annotation-panel-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.annotation-panel-tab {
  border: 1px solid #475569;
  background: #1f2937;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.annotation-panel-tab:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.annotation-panel-tab.active {
  background: #0f766e;
  border-color: #14b8a6;
  color: #f8fafc;
}

.annotation-panel-tab__video-status {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
  animation: video-warmup-pulse 1.4s ease-in-out infinite;
}

.annotation-panel-tab__video-status--ready {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  animation: none;
}

.annotation-panel-tab--video-ready:not(.active) {
  border-color: rgba(34, 197, 94, 0.45);
}

.video-toggle-btn--warming:not(.active) {
  border-color: rgba(245, 158, 11, 0.55);
}

.video-toggle-btn--ready:not(.active) {
  border-color: rgba(34, 197, 94, 0.45);
}

@keyframes video-warmup-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.eeg-toolbar-filter-toggle--video {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}


.eeg-toolbar-filter-toggle svg {
  flex-shrink: 0;
}

.annotation-panel-tabpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  padding-bottom: 6px;
  outline: none;
}

.annotation-panel-tabpanel[hidden] {
  display: none;
}

.annotation-panel-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.72);
  background: rgba(15, 23, 42, 0.82);
  min-width: 0;
}

.annotation-panel-group__header,
.annotation-panel-group__header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.annotation-panel-group__header--with-actions {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.annotation-panel-group__header h4,
.annotation-panel-group__header-copy h4 {
  margin: 0;
  color: #f8fafc;
  font-size: 1rem;
  line-height: 1.2;
}

.annotation-panel-group__header p,
.annotation-panel-group__header-copy p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.annotation-panel-group__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.annotation-panel-group__actions button {
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
  padding: 6px 10px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.annotation-panel-group__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.annotation-panel-group__actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.annotation-panel-group__actions-grid button {
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.9);
  color: #dbeafe;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: left;
  min-height: 40px;
}

.annotation-panel-group__actions-grid button:hover {
  background: rgba(37, 99, 235, 0.22);
}

.annotation-panel-group__actions-grid button:disabled {
  opacity: 0.55;
}

.annotation-panel-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
  font-size: 0.74rem;
  line-height: 1.2;
  font-weight: 600;
}

.annotation-panel-pill--accent {
  background: rgba(8, 145, 178, 0.18);
  border-color: rgba(34, 211, 238, 0.35);
  color: #cffafe;
}

.annotation-panel-status-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.annotation-panel-group--annotation-tools {
  order: 0;
  border-left: 3px solid #38bdf8;
  background: rgba(2, 132, 199, 0.12);
}

.annotation-panel-group--annotation-actions {
  order: 10;
  border-left: 3px solid #f59e0b;
  background: rgba(120, 53, 15, 0.22);
}

.annotation-panel-group--annotation-shortcuts {
  order: 20;
  position: relative;
  margin-top: 20px;
  padding-top: 14px;
  border-left: 3px solid #94a3b8;
  background: rgba(30, 41, 59, 0.72);
}

.annotation-panel-group--annotation-shortcuts::before {
  content: "";
  position: absolute;
  top: -48px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.78);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.95);
  pointer-events: none;
}

.annotation-panel-group--review-assignment {
  border-left: 3px solid #22c55e;
  background: rgba(20, 83, 45, 0.22);
}

.annotation-panel-group--review-status {
  border-left: 3px solid #60a5fa;
  background: rgba(30, 64, 175, 0.14);
}

.annotation-panel-group--consensus {
  border-left: 3px solid #f59e0b;
  background: rgba(120, 53, 15, 0.22);
}

.customization-entry-section {
  order: 1;
}

.viewer-montage-editor-section {
  order: 2;
}

.smart-suggestions-section {
  order: 12;
}

.rapid-event-section {
  order: 13;
}

.trend-section {
  order: 14;
}

.selected-channel-details-section {
  order: 4;
}

.smart-suggestions-section,
.rapid-event-section,
.trend-section,
.customization-entry-section,
.viewer-montage-editor-section,
.channels-section,
.selected-channel-details-section {
  margin-bottom: 0;
}

.annotation-quick-buttons {
  flex-shrink: 0;
}

.annotation-panel h4 {
  margin-top: 8px;
  margin-bottom: 6px;
  color: #aaa;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Flex sections for proportional height within annotation panel */
.panel-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel-section h4 {
  flex-shrink: 0;
}

.channels-section {
  order: 3;
  flex: 2;
}

.annotations-section {
  flex: 3 1 0;
  min-height: 0;
  overflow: hidden;
}

.annotation-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.annotation-review-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
}

.annotation-review-toolbar__controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.annotation-review-toolbar__controls > * {
  min-width: 0;
}

.annotation-review-toolbar__controls .annotation-tool-btn {
  padding: 5px 8px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}

.annotation-bulk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #cbd5e1;
  grid-column: 1 / -1;
}

.annotation-bulk-toggle input {
  margin: 0;
}

.annotation-review-filter-select {
  min-width: 0;
  margin-bottom: 0;
  font-size: 0.78rem;
}

.annotation-item {
  padding: 8px;
  margin-bottom: 8px;
  background: #333;
  border-radius: 4px;
  font-size: 0.85rem;
  border-left: 3px solid #4a90e2;
}

.annotation-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.annotation-select-checkbox {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.annotation-select-checkbox input {
  margin: 0;
}

.annotation-type {
  background: #4a90e2;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}

.annotation-time {
  margin-left: auto;
  color: #ccc;
  font-size: 0.8rem;
  font-family: "Courier New", monospace;
}

.annotation-bulk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  align-items: stretch;
}

.annotation-bulk-actions__count {
  font-size: 0.76rem;
  color: #cbd5e1;
  grid-column: 1 / -1;
  margin-right: 0;
}

.annotation-bulk-actions button {
  width: 100%;
}

.annotation-bulk-extended-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.annotation-bulk-extended-actions__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.annotation-bulk-extended-actions__row button {
  width: 100%;
  white-space: nowrap;
}

.consensus-assigned-reviewers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.annotation-panel-group--review-status .annotations-section {
  flex: initial;
  overflow: visible;
}

.annotation-panel-group--review-status .annotation-list {
  max-height: min(48vh, 520px);
}

.annotation-item--compact-row {
  display: grid;
  grid-template-columns: auto 3.1rem minmax(0, 1fr) 2.25rem auto;
  align-items: center;
  column-gap: 6px;
  padding: 2px 4px;
  margin-bottom: 1px;
  min-height: 22px;
  border-radius: 3px;
}

.annotation-item--compact-row .annotation-item__checkbox,
.annotation-item--compact-row .annotation-item__time,
.annotation-item--compact-row .annotation-item__label,
.annotation-item--compact-row .annotation-item__channels,
.annotation-item--compact-row .annotation-item__actions {
  display: flex;
  align-items: center;
  min-height: 22px;
  min-width: 0;
}

.annotation-item--compact-row .annotation-item__checkbox {
  justify-content: center;
}

.annotation-item--compact-row .annotation-item__time {
  justify-content: flex-end;
  font-family: "Courier New", monospace;
  color: #cbd5e1;
  white-space: nowrap;
}

.annotation-item--compact-row .annotation-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: #e2e8f0;
}

.annotation-item--compact-row .annotation-item__channels {
  justify-content: flex-end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #94a3b8;
}

.annotation-item--compact-row .annotation-item__actions {
  justify-content: flex-end;
  gap: 2px;
}

.annotation-item--compact-row .annotation-select-checkbox {
  flex-shrink: 0;
  margin: 0;
}

.annotation-item--compact-row .annotation-review-btn,
.annotation-item--compact-row .delete-annotation-btn {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 4px;
  margin: 0;
  font-size: inherit;
  line-height: 1.1;
}

.annotation-item--compact-row .delete-annotation-btn {
  width: 22px;
  min-width: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.consensus-assigned-reviewer-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.5);
}

.consensus-assigned-reviewer-card__identity {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.consensus-assigned-reviewer-card__identity strong {
  font-size: 0.82rem;
  color: #f8fafc;
}

.consensus-assigned-reviewer-card__identity span {
  font-size: 0.7rem;
  color: #93c5fd;
}

.consensus-assigned-reviewer-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 0.74rem;
  color: #94a3b8;
}

.consensus-section-label {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-weight: 600;
}

.consensus-reviewer-results {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.66);
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.consensus-reviewer-results__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.35;
  cursor: pointer;
}

.consensus-reviewer-results__item:last-child {
  border-bottom: 0;
}

.consensus-reviewer-results__item:hover {
  background: rgba(59, 130, 246, 0.2);
}

.consensus-reviewer-results__empty {
  padding: 7px 8px;
  color: #94a3b8;
  font-size: 0.72rem;
}

.consensus-selected-reviewers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.consensus-selected-reviewer-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #dbeafe;
  font-size: 0.74rem;
}

.consensus-selected-reviewer-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.consensus-selected-reviewers__empty {
  font-size: 0.72rem;
  color: #94a3b8;
}

.consensus-blind-toggle {
  margin-top: 2px;
}

.consensus-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.consensus-metric-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.consensus-metric-card strong {
  font-size: 1.15rem;
  line-height: 1.15;
  color: #f8fafc;
  overflow-wrap: anywhere;
}

.consensus-metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.consensus-metric-meta {
  font-size: 0.74rem;
  color: #cbd5e1;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.consensus-recommendations {
  margin-bottom: 10px;
}

.consensus-recommendation-item {
  font-size: 0.75rem;
  color: #e2e8f0;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.14);
  margin-top: 4px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.consensus-disagreement-actions {
  margin-bottom: 8px;
}

.consensus-disagreement-actions__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.consensus-disagreement-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.consensus-disagreement-item {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
}

.consensus-disagreement-item__title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #f8fafc;
}

.consensus-disagreement-item__meta {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.annotation-label {
  color: #fff;
  margin-bottom: 4px;
  font-weight: 500;
}

.annotation-channels {
  color: #aaa;
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.annotation-review-btn {
  padding: 4px 8px;
  background: #0ea5e9;
  color: #fff;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.72rem;
}

.annotation-review-btn:hover {
  background: #0284c7;
}

.annotation-review-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.delete-annotation-btn {
  padding: 4px 8px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  align-self: flex-start;
  margin-top: 4px;
}

.delete-annotation-btn:hover {
  background: #c82333;
}

.delete-annotation-btn:disabled {
  background: #4b5563;
  cursor: not-allowed;
  opacity: 0.7;
}

.no-annotations {
  color: #aaa;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Playback Controls - Fixed at bottom of viewer */
.playback-controls {
  --eeg-playback-control-height: 28px;
  display: flex;
  gap: 8px;
  padding: 3px 12px;
  background: var(--eeg-chrome-bg);
  border-top: 1px solid var(--eeg-chrome-border);
  align-items: center;
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: visible;
  flex-wrap: nowrap;
  min-height: 28px;
}

.playback-controls__trail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 0;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 1440px) {
  .playback-controls {
    flex-wrap: wrap;
    row-gap: 6px;
    padding-bottom: 6px;
  }

  .playback-controls .eeg-playback-control__label {
    display: none;
  }

  .playback-controls__trail {
    flex: 1 1 100%;
    justify-content: flex-end;
    margin-left: 0;
    padding-top: 2px;
    border-top: 1px solid var(--eeg-chrome-border-subtle);
  }
}

.playback-controls__metrics {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.playback-controls__metrics-sep {
  color: #334155;
}

.playback-controls__perf-hint {
  color: #475569;
  font-size: 0.6rem;
  white-space: nowrap;
}

.playback-controls__perf-hint kbd {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid #334155;
  border-radius: 2px;
  padding: 0 3px;
  font-size: 0.58rem;
  font-family: inherit;
}

.eeg-playback-cluster {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.22);
}

.eeg-playback-cluster--transport {
  flex-wrap: nowrap;
}

.eeg-playback-cluster--transport {
  flex: 0 0 auto;
}

.eeg-playback-cluster--position {
  margin-left: 0;
}

/* Tighten spacing when video panel is open */
.eeg-viewer-body--with-video .playback-controls {
  gap: 5px;
  padding: 5px 8px;
  overflow-x: hidden;
}

.eeg-viewer-body--with-video .playback-controls .eeg-playback-control__label {
  display: none;
}

.eeg-viewer-body--with-video .playback-controls button {
  padding: 0 8px;
}

.eeg-viewer-body--with-video .eeg-playback-cluster {
  padding: 3px;
}

.playback-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: var(--eeg-playback-control-height);
  padding: 0 10px;
  background: var(--eeg-chrome-btn-bg);
  color: var(--eeg-chrome-btn-text);
  border: 1px solid var(--eeg-chrome-btn-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.76rem;
  font-family: "Segoe UI", "Segoe UI Symbol", system-ui, sans-serif;
  line-height: 1;
  box-sizing: border-box;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
  min-height: auto;
  min-width: auto;
  white-space: nowrap;
}

.playback-controls .eeg-playback-control__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  line-height: 1;
}

.playback-controls .eeg-playback-control__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.playback-controls .eeg-playback-control__label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.playback-controls button:hover {
  background: var(--eeg-chrome-bg-elevated);
  border-color: #64748b;
  color: #f8fafc;
}

.playback-controls .eeg-playback-control--primary {
  background: linear-gradient(180deg, #4d93ef 0%, var(--eeg-accent-strong) 100%);
  border-color: var(--eeg-accent-strong);
  color: #ffffff;
}

.playback-controls .eeg-playback-control--primary:hover {
  background: linear-gradient(180deg, #6aa8f2 0%, #3b82f6 100%);
  border-color: var(--eeg-accent-hover);
  color: #ffffff;
}

.playback-controls .eeg-playback-btn-event {
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0 8px;
}

.eeg-playback-btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  flex: 0 0 auto;
}

.playback-controls .eeg-playback-btn-event .eeg-playback-btn-count {
  margin-left: 0;
}

@media (max-width: 1100px) {
  .playback-controls button {
    padding: 0 7px;
    font-size: 0.72rem;
  }

  .playback-controls .eeg-speed-btn {
    min-width: 2rem;
    padding: 0 5px;
  }
}

.eeg-channel-range-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  min-height: var(--eeg-playback-control-height);
}

.eeg-channel-range-label--toolbar {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.eeg-go-to-time-input {
  width: 84px;
  max-width: 132px;
  min-width: 84px;
  height: var(--eeg-playback-control-height);
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid #4b5563;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.75rem;
  line-height: 1;
  box-sizing: border-box;
}

.eeg-go-to-time-input--compact {
  width: 72px;
  min-width: 72px;
  max-width: 88px;
  color: #64748b;
  background: rgba(248, 250, 252, 0.92);
}

.eeg-macro-overview-zoom-select {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: var(--eeg-playback-control-height, 28px);
  margin: 0;
  align-self: center;
}

.eeg-macro-overview-zoom-select select {
  appearance: none;
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0 20px 0 6px;
  height: var(--eeg-playback-control-height, 28px);
  min-height: 0;
  box-sizing: border-box;
  max-width: 7.5rem;
}

.playback-controls .eeg-macro-overview-zoom-select--playback select {
  font-size: 0.7rem;
  background-color: #0f172a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

@media (max-width: 1280px) {
  .eeg-speed-zone-sep {
    display: none;
  }
}

.eeg-go-to-time-input--modal {
  width: min(100%, 260px);
  max-width: 260px;
  height: 32px;
  font-size: 0.85rem;
}

/* Timeline ruler toggle button */
.timeline-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  color: #888;
  height: var(--eeg-playback-control-height);
  min-width: var(--eeg-playback-control-height);
  padding: 0 8px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 0;
  line-height: 1;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.timeline-toggle-btn:hover {
  background: #444;
  color: #aaa;
}

.timeline-toggle-btn.active {
  background: #4a90e2;
  border-color: #4a90e2;
  color: #fff;
}

.timeline-toggle-btn.eeg-ruler-toggle {
  min-width: 0;
  padding: 0 12px;
  gap: 6px;
  color: #cbd5e1;
}

/* Configuration Panel Modal */
.config-panel-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.keyboard-shortcuts-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}

.keyboard-shortcuts-modal__dialog {
  width: min(840px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: #101927;
  border: 1px solid #1e293b;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.65);
  padding: 16px 18px 18px;
}

.keyboard-shortcuts-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.keyboard-shortcuts-modal__header h3 {
  margin: 0;
  color: #e2e8f0;
}

.keyboard-shortcuts-modal__close {
  border: 1px solid #334155;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.keyboard-shortcuts-modal__close:hover {
  color: #fff;
  border-color: #475569;
}

.keyboard-shortcuts-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.keyboard-shortcuts-modal__grid section {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 10px;
}

.keyboard-shortcuts-modal__grid h4 {
  margin: 0 0 8px 0;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.keyboard-shortcuts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.keyboard-shortcuts-list li {
  display: grid;
  grid-template-columns: minmax(130px, auto) 1fr;
  gap: 10px;
  align-items: center;
  color: #a8b3c4;
  font-size: 0.78rem;
}

.keyboard-shortcuts-list kbd {
  background: #1f2937;
  border: 1px solid #374151;
  color: #f8fafc;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.72rem;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  line-height: 1.25;
}

.config-panel {
  background: #2a2a2a;
  border-radius: 8px;
  max-width: 920px;
  max-height: min(80vh, 760px);
  display: flex;
  flex-direction: column;
  position: relative;
  width: min(90vw, 920px);
}

.config-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 10px;
  border-bottom: 1px solid #3a3a3a;
  flex-shrink: 0;
}

.config-panel__header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.1rem;
}

.config-panel__header .close-btn {
  position: static;
}

/* Config Tab Bar */
.config-tab-bar {
  display: flex;
  gap: 6px;
  padding: 8px 24px;
  background: linear-gradient(180deg, #202733 0%, #182130 100%);
  border-bottom: 1px solid #3a3a3a;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.config-tab-bar::-webkit-scrollbar {
  display: none;
}

.config-tab--active {
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.76);
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.config-panel__content-area {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.config-panel__body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 14px 20px;
}

.config-panel__body .config-section {
  padding: 0;
  border: none;
  background: none;
  margin: 0 0 16px;
}

.config-panel__body--balanced > .config-section {
  padding: 12px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #262626;
}

.config-panel__footer {
  flex-shrink: 0;
  border-top: 1px solid #3a3a3a;
  padding: 14px 20px;
  background: #222;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.config-panel__footer .config-actions {
  display: flex;
  gap: 8px;
  width: auto;
  padding: 0;
  background: none;
  border: none;
  margin: 0;
}

.config-panel h3 {
  margin-top: 0;
  color: #fff;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
}

.config-section {
  margin-bottom: 25px;
  font-size: small;
}

.config-section h4 {
  color: #aaa;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.config-section select {
  width: 100%;
  padding: 0px 4px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
}

.config-input {
  width: 100%;
  padding: 0px 4px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
}

.config-input--numeric {
  max-width: 96px;
}

.config-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-range-row input[type="range"] {
  flex: 1;
  accent-color: #3b82f6;
}

.config-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.config-control-grid {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.config-control-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.config-control-grid .config-subsection {
  min-width: 0;
  margin: 0;
}

.config-control-grid .config-range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
}

.config-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #444;
  border-radius: 5px;
  background: #262626;
  color: #e5e7eb;
  cursor: pointer;
}

.config-toggle-row:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.config-toggle-row input {
  accent-color: #3b82f6;
}

.config-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.config-panel__body .config-section.config-layout-panel {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #262626;
}

.config-layout-panel--wide {
  grid-column: 1 / -1;
}

.config-confirm-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.config-confirm-dialog {
  width: min(420px, 100%);
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #1f2937;
  color: #e5e7eb;
  padding: 18px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.45);
}

.config-confirm-dialog h4 {
  margin: 0 0 8px;
  color: #fff;
}

.config-confirm-dialog p {
  margin: 0;
  color: #cbd5e1;
}

.config-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.config-actions-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.config-inline-btn {
  background: #1f4f8f;
  border: 1px solid #3b82f6;
  color: #fff;
  border-radius: 4px;
  padding: 0px 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.config-inline-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.config-inline-btn--danger {
  background: #7f1d1d;
  border-color: #ef4444;
}

.config-inline-btn--subtle {
  background: #374151;
  border-color: #4b5563;
}

.config-message {
  margin: 6px 0 10px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.config-message--success {
  color: #86efac;
}

.config-message--error {
  color: #fca5a5;
}

.config-message--conflict {
  color: #fcd34d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.config-select--spaced {
  margin-bottom: 10px;
}

.config-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 10px;
  cursor: pointer;
}

.config-label--stacked {
  align-items: flex-start;
}

.config-label__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.config-label__hint {
  color: #94a3b8;
  font-size: 0.76rem;
  line-height: 1.35;
}

.config-review-mode {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.config-review-mode__label {
  color: #d1d5db;
  font-size: 0.82rem;
  font-weight: 650;
}

.config-segmented-control {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.72);
}

.config-subsection {
  margin-top: 10px;
  color: #ccc;
  font-size: 0.9rem;
}

.config-subsection__label {
  display: block;
  margin-bottom: 3px;
  margin-top: 6px;
}

.config-subsection__hint {
  margin-top: 6px;
  color: #9aa3af;
}

.config-calibration-guide-list {
  margin: 8px 0 8px 18px;
  color: #cbd5e1;
  font-size: 0.78rem;
  display: grid;
  gap: 3px;
}

.config-screen-calibration {
  border-top: 1px solid #4b5563;
  padding-top: 10px;
}

.config-calibration-bars {
  margin: 10px 0;
  min-height: 260px;
  background: #111827;
  border: 1px solid #4b5563;
  border-radius: 6px;
  padding: 14px;
  position: relative;
}

.config-calibration-bars__vertical {
  position: absolute;
  left: 24px;
  top: 14px;
  width: 6px;
  background: #111111;
  border-radius: 2px;
}

.config-calibration-bars__horizontal {
  position: absolute;
  left: 24px;
  top: 134px;
  height: 6px;
  background: #111111;
  border-radius: 2px;
}

.config-calibration-bars__vertical-cap {
  position: absolute;
  left: 18px;
  width: 18px;
  height: 3px;
  background: #111111;
  border-radius: 2px;
}

.config-calibration-bars__vertical-cap--top {
  top: 14px;
}

.config-calibration-bars__vertical-cap--bottom {
  top: 251px;
}

.config-calibration-bars__horizontal-cap {
  position: absolute;
  top: 128px;
  width: 3px;
  height: 18px;
  background: #111111;
  border-radius: 2px;
}

.config-calibration-bars__horizontal-cap--left {
  left: 24px;
}

.config-calibration-bars__horizontal-cap--right {
  left: 261px;
}

.config-calibration-bars__vertical-label {
  position: absolute;
  left: 40px;
  top: 16px;
  color: #cbd5e1;
  font-size: 0.72rem;
}

.config-calibration-bars__horizontal-label {
  position: absolute;
  left: 24px;
  top: 146px;
  color: #cbd5e1;
  font-size: 0.72rem;
}

.config-calibration-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 4px;
  flex-wrap: wrap;
}

.config-calibration-overall-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
  color: #cbd5e1;
  margin-top: 8px;
}

.config-calibration-status {
  border-radius: 999px;
  border: 1px solid #475569;
  padding: 2px 8px;
  font-size: 0.66rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(51, 65, 85, 0.45);
}

.config-calibration-status--pass {
  border-color: rgba(34, 197, 94, 0.55);
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
}

.config-calibration-status--fail {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
}

.config-channel-tools {
  border-top: 1px solid #4b5563;
  padding-top: 10px;
}

.config-color-editor {
  margin-top: 12px;
}

.config-offset-editor {
  margin-top: 12px;
}

.config-offset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.config-offset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
}

.config-offset-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #1f2937;
}

.config-offset-item__header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 40px;
}

.config-offset-item__label {
  color: #d1d5db;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.config-offset-item__controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.config-offset-item__controls input[type="range"] {
  flex: 1;
  min-width: 60px;
  max-width: none;
  height: 18px;
  margin: 0;
}

.config-offset-item__controls .config-input--numeric {
  max-width: 56px;
  padding: 2px 6px;
  font-size: 0.78rem;
  height: 26px;
  flex-shrink: 0;
}

.config-offset-item__controls .config-inline-btn {
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 0.7rem;
}

.config-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.config-color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #1f2937;
}

.config-color-item__label {
  flex: 1;
  color: #d1d5db;
  font-size: 0.82rem;
}

.config-color-input {
  width: 36px;
  height: 26px;
  border: none;
  padding: 0;
  background: transparent;
}

.config-actions {
  display: flex;
  gap: 10px;
}

.config-actions__button {
  flex: 1;
}

.config-actions__button--secondary {
  background: #6c757d;
}

.config-item {
  margin-bottom: 8px;
}

.config-item button {
  width: 100%;
  padding: 10px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.config-item button:hover {
  background: #3a3a3a;
  border-color: #4a90e2;
}

.save-config-btn {
  width: 100%;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s;
}

.save-config-btn:hover {
  background: #218838;
}

/* Scrollbar Styling */
.annotation-panel::-webkit-scrollbar,
.annotation-panel-tabpanel::-webkit-scrollbar,
.annotation-list::-webkit-scrollbar,
.config-panel::-webkit-scrollbar {
  width: 8px;
}

.annotation-panel::-webkit-scrollbar-track,
.annotation-panel-tabpanel::-webkit-scrollbar-track,
.annotation-list::-webkit-scrollbar-track,
.config-panel::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.annotation-panel::-webkit-scrollbar-thumb,
.annotation-panel-tabpanel::-webkit-scrollbar-thumb,
.annotation-list::-webkit-scrollbar-thumb,
.config-panel::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.annotation-panel::-webkit-scrollbar-thumb:hover,
.annotation-panel-tabpanel::-webkit-scrollbar-thumb:hover,
.annotation-list::-webkit-scrollbar-thumb:hover,
.config-panel::-webkit-scrollbar-thumb:hover {
  background: #666;
}

@media (max-width: 768px) {
  .config-panel {
    max-height: 88vh;
    width: 94vw;
  }

  .config-grid-two {
    grid-template-columns: 1fr;
  }

  .config-control-grid--three {
    grid-template-columns: 1fr;
  }

  .config-layout-grid {
    grid-template-columns: 1fr;
  }

  .config-offset-header {
    flex-direction: column;
    align-items: stretch;
  }

  .config-offset-item {
    grid-template-columns: 1fr;
  }

  .keyboard-shortcuts-modal {
    padding: 12px;
  }

  .keyboard-shortcuts-modal__grid {
    grid-template-columns: 1fr;
  }

  .keyboard-shortcuts-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Waveform Display Container - Maximize space like Plotly.js */
.waveform-display {
  width: 100%;
  flex: 1;
  min-height: 0; /* Critical for flexbox to allow shrinking */
  background-color: #000;
  position: relative;
  overflow: hidden;
  padding: 5px 10px; /* Minimal padding for maximum canvas space */
  display: flex;
  flex-direction: column;
}

/* Loading Overlay */
.waveform-loading-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Subtle corner indicator for background buffer fetches */
.waveform-fetching-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  opacity: 0.6;
  pointer-events: none;
}

/* Error Overlay */
.waveform-error-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff4444;
  text-align: center;
}

/* Canvas - Use maximum space like Plotly.js */
.waveform-canvas {
  width: 100%;
  flex: 1;
  min-height: 0; /* Critical for flexbox shrinking */
  display: block;
  background: #000; /* Prevent transparent-canvas grey bleed from body background before first render */
}

/* Channel vertical scrollbar — absolutely positioned over the right edge of the
   canvas so it never participates in flex layout (which would squeeze the canvas
   and cause a ResizeObserver ↔ visibleChannelCount oscillation loop). */
.eeg-channel-scrollbar {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  z-index: 20;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

.eeg-channel-scrollbar-thumb {
  position: absolute;
  left: 0;
  width: 100%;
  background: rgba(100, 116, 139, 0.7);
  border-radius: 4px;
  transition: background 0.15s;
}

.eeg-channel-scrollbar:hover .eeg-channel-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.9);
}

/* Small Input Fields */
.small-input {
  width: 60px;
}

.small-input--half {
  width: 30px;
}

/* Right Panel Styles */

.annotation-quick-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.annotation-panel .annotation-tool-actions button,
.annotation-panel .annotation-quick-buttons button,
.annotation-panel .annotation-review-btn,
.annotation-panel .consensus-disagreement-actions__controls button {
  min-height: 32px;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.25;
}

.annotation-panel .annotation-inline-select,
.annotation-panel .annotation-inline-input,
.annotation-panel .annotation-inline-textarea {
  margin-bottom: 0;
  font-size: 0.78rem;
}

.annotation-panel .annotation-inline-select,
.annotation-panel .annotation-inline-input {
  min-height: 38px;
}

.annotation-toolbar-migration-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.annotation-toolbar-position {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #9ca3af;
}

.annotation-toolbar-position select {
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #1f2937;
  color: #f9fafb;
  padding: 4px 6px;
  font-size: 0.78rem;
}

.annotation-quick-buttons button {
  --annotation-action-color: #8b5cf6;
  padding: 4px 10px;
  font-size: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-left: 4px solid var(--annotation-action-color);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--annotation-action-color);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.annotation-action-catalog {
  display: grid;
  gap: 10px;
}

.annotation-action-catalog__search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #4b5563;
  border-radius: 7px;
  background: #111827;
  color: #f9fafb;
  padding: 5px 9px;
  font-size: 0.8rem;
}

.annotation-action-catalog__search input:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.annotation-action-catalog__frequent h5 {
  margin: 0 0 6px;
  color: #fbbf24;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.annotation-action-catalog__group {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  overflow: visible;
}

.annotation-action-catalog__group-toggle {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
}

.annotation-action-catalog__group .annotation-quick-buttons {
  padding: 6px;
  background: rgba(15, 23, 42, 0.45);
  gap: 1px;
}

.annotation-panel .annotation-action-catalog .annotation-quick-buttons button {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
  border-radius: 3px;
}

.annotation-quick-dynamic-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.annotation-action-catalog__action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 4px;
}

.annotation-action-catalog__action-row > .annotation-quick-dynamic-btn {
  min-width: 0;
}

.annotation-action-catalog__action-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
}

.annotation-action-catalog__pin {
  min-height: 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 3px;
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  padding: 2px;
  font-size: 0.62rem;
}

.annotation-action-catalog__pin[aria-pressed="true"] {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}

.annotation-quick-dynamic-btn kbd {
  min-width: 16px;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 3px;
  font: 600 0.58rem/1.1 ui-monospace, monospace;
  text-align: center;
  opacity: 0.72;
}

.annotation-action-catalog__empty {
  margin: 0;
  color: #94a3b8;
  font-size: 0.78rem;
}

/* Clinical Dock tabs: compact typography aligned with floating Annotation Set */
.annotation-panel {
  --clinical-dock-font-size: 0.62rem;
  --clinical-dock-line-height: 1.1;
  --clinical-dock-control-height: 24px;
}

.annotation-panel .annotation-panel-tab {
  font-size: 0.68rem;
  padding: 6px 8px;
}

.annotation-panel .annotation-panel-tabpanel {
  font-size: var(--clinical-dock-font-size);
  line-height: var(--clinical-dock-line-height);
}

.annotation-panel .annotation-panel-tabpanel .annotation-panel-group__header h4,
.annotation-panel .annotation-panel-tabpanel .annotation-panel-group__header-copy h4,
.annotation-panel .annotation-panel-tabpanel .panel-section > h4,
.annotation-panel .annotation-panel-tabpanel h4 {
  font-size: 0.68rem;
  line-height: 1.15;
}

.annotation-panel .annotation-panel-tabpanel .annotation-panel-pill,
.annotation-panel .annotation-panel-tabpanel .annotation-panel-group__actions button,
.annotation-panel .annotation-panel-tabpanel .annotation-panel-group__actions-grid button,
.annotation-panel .annotation-panel-tabpanel .annotation-tool-actions button,
.annotation-panel .annotation-panel-tabpanel .annotation-tool-btn,
.annotation-panel .annotation-panel-tabpanel .annotation-review-btn,
.annotation-panel .annotation-panel-tabpanel .consensus-disagreement-actions__controls button,
.annotation-panel .annotation-panel-tabpanel .annotation-bulk-actions button,
.annotation-panel .annotation-panel-tabpanel .annotation-bulk-extended-actions__row button,
.annotation-panel .annotation-panel-tabpanel .consensus-reviewer-results__item,
.annotation-panel .annotation-panel-tabpanel .annotation-inline-select,
.annotation-panel .annotation-panel-tabpanel .annotation-inline-input,
.annotation-panel .annotation-panel-tabpanel .annotation-inline-textarea,
.annotation-panel .annotation-panel-tabpanel .annotation-bulk-toggle,
.annotation-panel .annotation-panel-tabpanel .annotation-review-filter-select,
.annotation-panel .annotation-panel-tabpanel .annotation-bulk-actions__count,
.annotation-panel .annotation-panel-tabpanel .consensus-section-label,
.annotation-panel .annotation-panel-tabpanel .consensus-assigned-reviewer-card__identity strong,
.annotation-panel .annotation-panel-tabpanel .consensus-assigned-reviewer-card__identity span,
.annotation-panel .annotation-panel-tabpanel .consensus-assigned-reviewer-card__meta,
.annotation-panel .annotation-panel-tabpanel .consensus-reviewer-results__empty,
.annotation-panel .annotation-panel-tabpanel .consensus-selected-reviewer-chip,
.annotation-panel .annotation-panel-tabpanel .consensus-selected-reviewers__empty,
.annotation-panel .annotation-panel-tabpanel .consensus-metric-label,
.annotation-panel .annotation-panel-tabpanel .consensus-metric-card strong,
.annotation-panel .annotation-panel-tabpanel .consensus-metric-meta,
.annotation-panel .annotation-panel-tabpanel .consensus-recommendation-item,
.annotation-panel .annotation-panel-tabpanel .consensus-disagreement-item__title,
.annotation-panel .annotation-panel-tabpanel .consensus-disagreement-item__meta,
.annotation-panel .annotation-panel-tabpanel .annotation-item,
.annotation-panel .annotation-panel-tabpanel .annotation-type,
.annotation-panel .annotation-panel-tabpanel .annotation-time,
.annotation-panel .annotation-panel-tabpanel .annotation-channels,
.annotation-panel .annotation-panel-tabpanel .annotation-label,
.annotation-panel .annotation-panel-tabpanel .delete-annotation-btn,
.annotation-panel .annotation-panel-tabpanel .no-annotations,
.annotation-panel .annotation-panel-tabpanel .annotation-inline-hint,
.annotation-panel .annotation-panel-tabpanel .annotation-inline-error,
.annotation-panel .annotation-panel-tabpanel .annotation-inline-success,
.annotation-panel .annotation-panel-tabpanel .annotation-action-catalog__search input,
.annotation-panel .annotation-panel-tabpanel .annotation-action-catalog__frequent h5,
.annotation-panel .annotation-panel-tabpanel .annotation-action-catalog__group-toggle,
.annotation-panel .annotation-panel-tabpanel .annotation-action-catalog__empty,
.annotation-panel .annotation-panel-tabpanel .smart-suggestions-section__header span,
.annotation-panel .annotation-panel-tabpanel .smart-suggestion-card__title,
.annotation-panel .annotation-panel-tabpanel .smart-suggestion-card__explanation,
.annotation-panel .annotation-panel-tabpanel .smart-suggestion-card__meta,
.annotation-panel .annotation-panel-tabpanel .rapid-event-timeline-item,
.annotation-panel .annotation-panel-tabpanel .annotation-toolbar-position,
.annotation-panel .annotation-panel-tabpanel .annotation-toolbar-position select,
.annotation-panel .annotation-panel-tabpanel .annotation-toolbar-migration-controls button,
.annotation-panel .annotation-panel-tabpanel .viewer-inline-message {
  font-size: var(--clinical-dock-font-size);
  line-height: var(--clinical-dock-line-height);
}

.annotation-panel .annotation-panel-tabpanel .annotation-panel-group__actions-grid button,
.annotation-panel .annotation-panel-tabpanel .annotation-tool-actions button,
.annotation-panel .annotation-panel-tabpanel .annotation-tool-btn,
.annotation-panel .annotation-panel-tabpanel .annotation-review-btn,
.annotation-panel .annotation-panel-tabpanel .consensus-disagreement-actions__controls button,
.annotation-panel .annotation-panel-tabpanel .annotation-bulk-actions button,
.annotation-panel .annotation-panel-tabpanel .annotation-bulk-extended-actions__row button,
.annotation-panel .annotation-panel-tabpanel .annotation-toolbar-migration-controls button {
  min-height: var(--clinical-dock-control-height);
  padding: 2px 6px;
  border-radius: 3px;
}

.annotation-panel .annotation-panel-tabpanel .annotation-inline-select,
.annotation-panel .annotation-panel-tabpanel .annotation-inline-input {
  min-height: var(--clinical-dock-control-height);
  padding: 2px 6px;
}

.annotation-panel .annotation-panel-tabpanel .annotation-action-catalog__search input {
  min-height: var(--clinical-dock-control-height);
  padding: 2px 6px;
}

.annotation-panel .annotation-panel-tabpanel .annotation-action-catalog__group-toggle {
  min-height: 22px;
  padding: 2px 6px;
}

.annotation-panel .annotation-panel-tabpanel .consensus-assigned-reviewer-card {
  padding: 6px 8px;
}

.annotation-panel .annotation-panel-tabpanel .annotation-item--compact-row {
  padding: 2px 4px;
  margin-bottom: 1px;
}

.annotation-panel .annotation-panel-tabpanel .annotation-panel-group {
  padding: 8px;
  gap: 8px;
}

.annotation-quick-buttons button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.channel-selector {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px;
}

.channel-selection-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.channel-selection-actions button,
.channel-selection-region-row button,
.channel-selection-jump-row button {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid #3a7bc8;
  border-radius: 4px;
  background: #2b5ea5;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.15;
  cursor: pointer;
}

@media (max-width: 720px) {
  .channel-selection-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.channel-selection-region-row,
.channel-selection-jump-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-bottom: 6px;
}

.channel-selection-shortcut-hint {
  margin-bottom: 8px;
}

/* Keep footer channel actions compact: ~40% smaller than default panel buttons */

.channel-checkbox {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
}

.channel-checkbox input {
  margin-right: 8px;
}

/* Realtime Tab Content */
.realtime-tab-content {
  padding: 20px;
}

/* Main EEG Viewer Container */
.eeg-viewer-container {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* EEG-UX-007: Status bar — replaces data-metrics-bar */
.eeg-status-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 1px 8px 4px;
  background: #080e1a;
  border-top: 1px solid #0f172a;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  overflow: hidden;
  white-space: nowrap;
}

.eeg-renderer-mode-badge {
  border: 1px solid #334155;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.1;
}

.eeg-renderer-badge {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 600;
}

/* Main workspace: EEG content + optional video panel */

.eeg-viewer-body--with-video {
  flex-direction: row;
}

.eeg-viewer-body--with-video .eeg-tab-content {
  flex: 1;
  min-width: 0;
}

.eeg-viewer-body--with-video .video-panel-container--compact {
  width: 260px;
  min-width: 220px;
}

.video-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: var(--eeg-playback-control-height);
  padding: 0 10px;
  margin-right: 0;
  background: var(--eeg-chrome-btn-bg);
  color: var(--eeg-chrome-btn-text);
  border: 1px solid var(--eeg-chrome-btn-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1;
  box-sizing: border-box;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.video-toggle-btn:hover {
  background: var(--eeg-chrome-bg-elevated);
  border-color: #64748b;
  color: #f8fafc;
}

.video-toggle-btn.active {
  background: var(--eeg-accent-muted-bg);
  border-color: var(--eeg-accent-muted-border);
  color: #eff6ff;
}

.video-toggle-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 992px) {
  .eeg-viewer-body--with-video {
    flex-direction: column;
  }
}

.control-group--dual-montage {
  flex: 0 0 auto !important;
  width: auto;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
  align-items: center;
}

.control-group--dual-montage select {
  min-width: 132px;
  max-width: 180px;
  flex: 0 0 auto;
}

.control-group--dual-montage > button,
.control-group--dual-montage > .control-inline-check {
  flex-shrink: 0;
}

.control-group--dual-montage > button {
  min-height: 28px;
  padding-inline: 12px;
  border-radius: 4px;
}

.eeg-toolbar-cluster--tools .eeg-toolbar-cluster__content {
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.eeg-toolbar-cluster--tools > .eeg-toolbar-cluster__content > button,
.eeg-toolbar-cluster--tools > .eeg-toolbar-cluster__content > .control-group {
  align-self: center;
}

.eeg-toolbar-cluster--tools .eeg-toolbar-filter-toggle {
  min-height: 28px;
}

.eeg-toolbar-cluster--tools .control-group--channel-review {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  flex: 0 0 auto !important;
  min-width: max-content !important;
  width: auto;
  max-width: none;
  flex-wrap: nowrap;
  overflow: visible;
}

.eeg-toolbar-cluster--tools .control-group--channel-review > *,
.eeg-toolbar-cluster--tools > .eeg-toolbar-cluster__content > button,
.eeg-toolbar-cluster--tools > .eeg-toolbar-cluster__content > .eeg-toolbar-filter-toggle,
.eeg-toolbar-cluster--tools .eeg-channel-manager-anchor,
.eeg-toolbar-cluster--tools .eeg-channel-range-label--toolbar {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 900px) {

  .eeg-toolbar-row:not(.eeg-toolbar-row--primary) {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .eeg-toolbar-cluster {
    width: 100%;
  }

  .eeg-toolbar-cluster--actions {
    margin-left: 0;
  }

  .eeg-toolbar-cluster__content > .control-group,
  .eeg-toolbar-cluster__content > .eeg-toolbar-filter-toggle,
  .eeg-toolbar-cluster__content > button {
    width: 100%;
  }

  .eeg-toolbar-cluster--actions .eeg-toolbar-cluster__content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .eeg-toolbar-cluster--actions .eeg-output-row {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .eeg-toolbar-cluster--actions .eeg-output-row > .eeg-toolbar-filter-toggle,
  .eeg-toolbar-cluster--actions .eeg-output-row > .eeg-toolbar-shortcuts-btn {
    width: 100%;
  }

  .control-group--dual-montage select {
    flex: 1 1 180px;
  }
}

.control-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #cfd8e3;
  font-size: 0.72rem;
}

.annotation-tool-btn {
  background: #4f46e5;
  color: #fff;
  border-radius: 8px;
}

.annotation-tool-btn.active {
  background: #312e81;
  border-color: rgba(165, 180, 252, 0.55);
}

.annotation-inline-select {
  width: 100%;
  padding: 6px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: x-small;
}

.annotation-inline-input,
.annotation-inline-textarea {
  width: 100%;
  padding: 6px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 0.75rem;
}

.annotation-inline-textarea {
  min-height: 46px;
  resize: vertical;
}

.annotation-tool-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.annotation-tool-actions button {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid #3a7bc8;
  border-radius: 4px;
  background: #2b5ea5;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
}

.annotation-tool-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.annotation-inline-error {
  color: #fca5a5;
  font-size: 0.75rem;
}

.annotation-inline-success {
  color: #86efac;
  font-size: 0.75rem;
}

.annotation-inline-hint {
  color: #93c5fd;
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.eeg-note-composer-modal {
  width: min(430px, 92vw);
}

.eeg-note-composer-modal__textarea {
  min-height: 94px;
  font-size: 0.86rem;
}

.eeg-note-composer-modal__meta {
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: right;
  margin-top: -2px;
  margin-bottom: 6px;
}

.trend-section,
.customization-entry-section {
  margin-bottom: 8px;
}

.rapid-event-section {
  margin-bottom: 8px;
}

.smart-suggestions-section {
  margin-bottom: 10px;
}

.smart-suggestions-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.smart-suggestions-section__header span {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.smart-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.smart-suggestion-card {
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.65);
  padding: 8px;
}

.smart-suggestion-card__title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: #f8fafc;
}

.smart-suggestion-card__confidence {
  color: #facc15;
  font-weight: 600;
}

.smart-suggestion-card__explanation {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.smart-suggestion-card__meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.68rem;
  color: #94a3b8;
}

.smart-suggestion-card__timing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.rapid-event-timeline-list {
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 6px;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 6px;
}

.rapid-event-timeline-item {
  font-size: 0.74rem;
  color: #dbeafe;
  margin-bottom: 4px;
}

.trend-correlation-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.trend-correlation-panel__status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.trend-correlation-panel__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 6px;
  border: 1px solid #334155;
  border-radius: 999px;
  background: #111827;
  color: #94a3b8;
  font-size: var(--eeg-dock-tab-font-size, 0.625rem);
  line-height: 1.25;
  white-space: nowrap;
}

.trend-correlation-panel__chip--title {
  color: #e2e8f0;
  border-color: #475569;
}

.trend-correlation-panel__chip strong {
  color: #f8fafc;
  font-weight: 600;
}

.trend-correlation-panel__summary {
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.76rem;
}

.trend-correlation-panel__delta-grid {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.trend-correlation-panel__actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.trend-correlation-panel__actions button {
  border: 1px solid #3b82f6;
  background: #1d4ed8;
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

.trend-correlation-panel__marker-list {
  border: 1px solid #1e293b;
  border-radius: 6px;
  overflow-y: auto;
  max-height: 260px;
  background: #020617;
  display: flex;
  flex-direction: column;
}

.trend-correlation-panel__marker {
  text-align: left;
  border: none;
  border-bottom: 1px solid #1e293b;
  background: transparent;
  color: #d1d5db;
  font-size: 0.72rem;
  padding: 6px 8px;
  display: grid;
  gap: 2px;
}

.trend-correlation-panel__empty {
  color: #94a3b8;
  font-size: 0.74rem;
  padding: 8px;
}

.eeg-customization-modal {
  max-width: 900px;
  width: min(900px, 92vw);
}

.eeg-customization-modal--wide {
  max-width: 1100px;
  width: min(1100px, 94vw);
}

.quick-open-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-open-column {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 10px;
}

.quick-open-template-fields {
  margin-top: 8px;
}

.quick-open-template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.quick-open-template-meta span {
  font-size: 0.7rem;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 2px 8px;
}

.quick-open-template-color-chip {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.3);
}

.quick-open-template-channel-scope {
  margin-bottom: 8px;
}

.quick-open-channel-mode {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-open-channel-mode label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: #e2e8f0;
}

.quick-open-template-field {
  margin-bottom: 8px;
}

.quick-open-usage-section {
  margin-top: 8px;
  border-top: 1px solid #334155;
  padding-top: 8px;
}

.quick-open-usage-section__header {
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.quick-open-usage-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-open-usage-item--selected {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.2);
}

.quick-open-footer {
  margin-top: 10px;
  text-align: right;
}

.quick-open-footer a {
  color: #93c5fd;
}

.eeg-autofit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.eeg-autofit-banner__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.eeg-autofit-banner__btn {
  padding: 2px 10px;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #1f2937;
  color: #e2e8f0;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.eeg-autofit-banner__btn--primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

.eeg-autofit-banner__btn--secondary {
  background: #1f2937;
  border-color: #475569;
  color: #e2e8f0;
}

.eeg-autofit-banner__btn:hover {
  opacity: 0.9;
}

.viewer-inline-message {
  padding: 6px 12px;
  background: #1f2937;
  color: #d1fae5;
  border-bottom: 1px solid #334155;
  font-size: 0.8rem;
}

.viewer-inline-message--error {
  color: #fecaca;
}

.viewer-inline-message--warning {
  color: #fde68a;
  border-bottom-color: rgba(245, 158, 11, 0.4);
}

.eeg-calibration-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.eeg-toolbar-status-row .eeg-calibration-warning {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 4px;
}

.eeg-toolbar-status-row--expanded .eeg-calibration-warning {
  flex-basis: 100%;
}

.eeg-calibration-warning__actions {
  display: flex;
  gap: 6px;
}

.eeg-calibration-warning__btn {
  border: 1px solid rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  cursor: pointer;
}

.eeg-calibration-warning__btn:hover {
  background: rgba(245, 158, 11, 0.28);
}

.eeg-calibration-warning__btn--secondary {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(51, 65, 85, 0.45);
  color: #cbd5e1;
}

.selected-channel-details-section {
  margin-bottom: 8px;
}

.selected-channel-action-summary {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  color: #93c5fd;
  margin-bottom: 6px;
}

.selected-channel-action-bar {
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0f172a;
  padding: 8px;
  margin-bottom: 8px;
}

.selected-channel-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.selected-channel-highlight-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.selected-channel-highlight-input {
  width: 36px;
  height: 28px;
  border: 1px solid #475569;
  border-radius: 4px;
  background: #111827;
  padding: 0;
}

.selected-channel-highlight-row button {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid #3a7bc8;
  border-radius: 4px;
  background: #2b5ea5;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
}

.selected-channel-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.selected-channel-details-item {
  border: 1px solid #3f3f46;
  border-radius: 4px;
  background: #111827;
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #d1d5db;
}

.selected-channel-color {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.selected-channel-color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid #9ca3af;
  display: inline-block;
}

.selected-channel-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.selected-channel-flag {
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

.selected-channel-flag--bad {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.selected-channel-flag--gain {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.45);
}

.selected-channel-flag--filter {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.selected-channel-flag--highlight {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.viewer-montage-editor-section {
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
}

.viewer-montage-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.viewer-montage-editor-header h4 {
  margin: 0;
}

.viewer-montage-mobile-sheet-btn {
  border: 1px solid #60a5fa;
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  cursor: pointer;
}

.viewer-montage-conflict {
  margin-top: 8px;
}

.viewer-montage-pair-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.viewer-montage-pair-chip {
  border: 1px solid #334155;
  border-radius: 999px;
  background: #111827;
  color: #cbd5e1;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
}

.viewer-montage-pair-chip.is-selected {
  border-color: #60a5fa;
  background: rgba(59, 130, 246, 0.25);
  color: #dbeafe;
}

.viewer-montage-mobile-sheet {
  max-width: 420px;
  width: min(420px, 94vw);
}

.viewer-montage-mobile-sheet-actions {
  display: grid;
  gap: 8px;
}

.viewer-montage-mobile-sheet-actions button {
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
  color: #e2e8f0;
  padding: 7px 10px;
  text-align: left;
}

@media (max-width: 768px) {
  .quick-open-grid {
    grid-template-columns: 1fr;
  }

  .viewer-montage-editor-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* EEG-CTRL-013: Compact amplitude step buttons adjacent to sensitivity dropdown */
.ctrl-step-btn {
  padding: 2px 6px;
  font-size: 0.75rem;
  line-height: 1;
  border: 1px solid var(--bs-border-color, #ced4da);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  min-width: 22px;
}
.ctrl-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ctrl-step-btn.active {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.28);
  color: #dbeafe;
}

/* ─── EEG-CUX-001/002: Channel right-click context menu ─────────────────── */
.eeg-channel-gain-menu {
  position: fixed;
  z-index: 9999;
  min-width: 188px;
  background: #1a2233;
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.eeg-channel-gain-menu__title {
  padding: 6px 12px 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  border-bottom: 1px solid #1e2d42;
  margin-bottom: 2px;
}

.eeg-channel-gain-menu button {
  display: block;
  width: 100%;
  padding: 5px 12px;
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}

.eeg-channel-gain-menu button:hover {
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

/* Visibility action buttons — visually distinct from gain preset buttons */
.eeg-channel-gain-menu__action {
  font-weight: 500;
}

.eeg-channel-gain-menu__action--restore {
  color: #86efac !important;
}

.eeg-channel-gain-menu__action--restore:hover {
  background: rgba(134, 239, 172, 0.12) !important;
}

.eeg-channel-gain-menu__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 3px 0;
}

/* ─── EEG-CUX-002: "N hidden" badge in playback controls ────────────────── */
.eeg-hidden-channels-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
  height: var(--eeg-playback-control-height);
  line-height: 1;
  box-sizing: border-box;
}

.eeg-hidden-channels-badge:hover {
  background: rgba(251, 191, 36, 0.32);
  border-color: rgba(251, 191, 36, 0.75);
}

/* ─── EEG-CUX-003: Channel Manager anchor wrapper ──────────────────── */
.eeg-channel-manager-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.control-group--channel-review .eeg-toolbar-filter-toggle,
.control-group--channel-review .eeg-hidden-channels-badge {
  min-height: 24px;
  height: 24px;
}

.eeg-hidden-channels-badge--toolbar {
  font-size: 0.68rem;
}

/* ─── EEG-CUX-004: Dock panel pop-out button ───────────────────────── */

/* Header row with actions (Hide + pop-out) */
.eeg-dock-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Pop-out ⊞ button — appears in both right-dock header and bottom tab strip */
.eeg-dock-popout-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 3px;
  transition:
    color 0.1s,
    background 0.1s;
}
.eeg-dock-popout-btn:hover {
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.15);
}

/* Bottom tab-strip wrapper per tab (replaces bare button for pop-out support) */
.eeg-dock-tab-item {
  display: inline-flex;
  align-items: stretch;
}

.eeg-dock-tab-btn-group {
  display: inline-flex;
  align-items: stretch;
}

/* Pop-out button inside a bottom tab */
.eeg-dock-tab-popout-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0 3px;
  font-size: 0.75rem;
  line-height: 1;
  margin-left: 3px;
  border-radius: 3px;
  transition:
    color 0.1s,
    background 0.1s;
  vertical-align: middle;
}
.eeg-dock-tab-popout-btn:hover {
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.18);
}

/* Detached tab indicator */
.eeg-dock-tab-btn--detached {
  opacity: 0.5;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #64748b;
  cursor: default;
  pointer-events: none;
}
.eeg-dock-tab-btn--detached > .eeg-dock-tab-popin-btn {
  pointer-events: all;
  cursor: pointer;
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 0.75rem;
  padding: 0 2px;
  transition: color 0.1s;
}
.eeg-dock-tab-btn--detached > .eeg-dock-tab-popin-btn:hover {
  color: #bfdbfe;
}

/* Placeholder shown in the dock when a panel is popped out */
.eeg-dock-detached-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  min-height: 80px;
  color: #64748b;
  font-size: 0.8rem;
  text-align: center;
  padding: 20px;
}

.eeg-dock-popin-link {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 5px;
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.eeg-dock-popin-link:hover {
  background: rgba(96, 165, 250, 0.24);
  border-color: rgba(96, 165, 250, 0.55);
}

/* ─── EEG-CUX-004 AC#6: Popup-blocked warning toast ────────────────── */
.eeg-popup-blocked-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #1e293b;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-size: 0.82rem;
  color: #fde68a;
  max-width: 520px;
  animation: eeg-toast-in 0.2s ease-out;
}
.eeg-popup-blocked-toast__icon {
  font-size: 1rem;
  flex-shrink: 0;
  color: #f59e0b;
}
.eeg-popup-blocked-toast__text {
  flex: 1;
  line-height: 1.4;
}
.eeg-popup-blocked-toast__dismiss {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color 0.1s;
}
.eeg-popup-blocked-toast__dismiss:hover {
  color: #e2e8f0;
}
@keyframes eeg-toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Final workspace toolbar normalization. Keep the clinical controls compact,
   left-aligned, and on one row even when older toolbar rules are present. */
.event-marker-timeline {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  font-size: var(--app-ui-font-body, 0.78rem);
}

.event-marker-timeline__controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

/* Zoom level badge — sits above the buttons */
.event-marker-timeline__zoom-label-row {
  display: flex;
  align-items: center;
}

.event-marker-timeline__zoom-badge {
  font-size: var(--app-ui-font-meta, 0.72rem);
  font-weight: 600;
  padding: 2px 7px;
}

/* Row containing zoom in/out, add marker, and count */
.event-marker-timeline__action-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Zoom buttons scaled to 60% of standard sm size (≈ 40% smaller) */
.event-marker-timeline__zoom-btn {
  font-size: 0.525rem !important;
  padding: 0.15rem 0.35rem !important;
  line-height: 1.4 !important;
}

.event-marker-timeline__canvas {
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.event-marker-timeline__svg {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  cursor: crosshair;
  background: var(--bs-tertiary-bg, #f8f9fa);
}

.event-marker-timeline__playhead {
  pointer-events: none;
}

.event-marker-timeline__marker-count {
  font-size: var(--app-ui-font-meta, 0.72rem);
  color: var(--bs-secondary-color);
}

.event-marker-timeline__marker {
  cursor: pointer;
}

/* Dark mode support */
.dark-theme .event-marker-timeline {
  background: #1e1e1e;
  border-top-color: #444;
}

.dark-theme .event-marker-timeline__svg rect {
  fill: #2a2a2a !important;
}

.dark-theme .event-marker-timeline__svg {
  border-color: #444;
}
.video-event-marker-modal {
  color: var(--bs-body-color);
  font-size: var(--app-ui-font-body, 0.78rem);
  line-height: var(--user-line-height, 1.5);
}

.video-event-marker-modal .modal-header {
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.85rem 1rem;
}

.video-event-marker-modal .modal-title {
  font-size: var(--app-ui-font-subheading, 1.05rem);
  font-weight: 600;
  line-height: 1.25;
}

.video-event-marker-modal .modal-body {
  padding: 1rem;
}

.video-event-marker-modal .modal-footer {
  border-top: 1px solid var(--bs-border-color);
  padding: 0.75rem 1rem;
}

.video-event-marker-modal .form-label {
  font-size: var(--app-ui-font-meta, 0.72rem);
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 0.35rem;
}

.video-event-marker-modal .form-control,
.video-event-marker-modal .form-select {
  font-size: var(--app-ui-font-body, 0.78rem);
  min-height: calc(var(--app-ui-font-body, 0.78rem) * 2.4);
}

.video-event-marker-modal .form-text {
  font-size: var(--app-ui-font-meta, 0.72rem);
  color: var(--bs-secondary-color);
}

.video-event-marker-modal .btn {
  font-size: var(--app-ui-font-body, 0.78rem);
  min-height: calc(var(--app-ui-font-body, 0.78rem) * 2.2);
}

.video-event-marker-modal__required {
  color: var(--bs-danger);
  margin-left: 0.15rem;
}
.split-screen-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.split-screen-viewer__loading {
  padding: 12px;
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-screen-viewer__panels {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  --split-left-width: 50%;
}

.split-screen-viewer__panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.split-screen-viewer__panel--left {
  border-right: 1px solid #dee2e6;
  width: var(--split-left-width);
}

.split-screen-viewer__panel--right {
  width: calc(100% - var(--split-left-width));
}

.split-screen-viewer__panel-header {
  padding: 0.65rem 0.85rem;
  background: var(--bs-tertiary-bg, #f8f9fa);
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 3rem;
}

.split-screen-viewer__panel-title h6 {
  font-size: var(--app-ui-font-body, 0.78rem);
  font-weight: 600;
}

.split-screen-viewer__panel-meta {
  font-size: var(--app-ui-font-meta, 0.72rem);
  font-variant-numeric: tabular-nums;
}

.split-screen-viewer__video {
  flex: 1;
}

.split-screen-viewer__secondary-video {
  display: flex;
  flex-direction: column;
  min-height: 180px;
  flex: 1;
  border-bottom: 1px solid var(--bs-border-color);
}

.split-screen-viewer__sync-controls {
  padding: 0.75rem 0.85rem;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.split-screen-viewer__event-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.split-screen-viewer__event-label {
  flex: 1;
  min-width: 8rem;
  font-size: var(--app-ui-font-meta, 0.72rem);
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.split-screen-viewer__marker-badge {
  font-size: var(--app-ui-font-meta, 0.72rem);
}

.split-screen-viewer__sync-offset {
  margin-bottom: 0;
}

.split-screen-viewer__sync-label {
  font-size: var(--app-ui-font-meta, 0.72rem);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.split-screen-viewer__sync-row {
  display: flex;
  gap: 0.5rem;
}

.split-screen-viewer__sync-row .form-control {
  max-width: 8rem;
  font-size: var(--app-ui-font-body, 0.78rem);
}

/* Pop-out placeholder — shown in panel when feed is playing externally */
.split-screen-viewer__popout-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 24px;
  text-align: center;
}

.split-screen-viewer__popout-placeholder--secondary {
  min-height: 180px;
  flex: unset;
}

.split-screen-viewer__popout-icon {
  font-size: 2rem;
  color: #ffc107;
}

.split-screen-viewer__divider {
  width: 8px;
  cursor: col-resize;
  background: #dee2e6;
  position: relative;
  z-index: 10;
  transition: background 0.2s;
}

.split-screen-viewer__divider:hover {
  background: #007bff;
}

.split-screen-viewer__divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #6c757d;
  pointer-events: none;
}

.split-screen-viewer__timeline {
  border-top: 2px solid #dee2e6;
}

.dark-theme .split-screen-viewer__loading {
  background: #3d3d00;
  border-bottom-color: #666;
}

.dark-theme .split-screen-viewer__panel--left {
  border-right-color: #444;
}

.dark-theme .split-screen-viewer__panel-header {
  background: #2a2a2a;
  border-bottom-color: #444;
}

.dark-theme .split-screen-viewer__secondary-video {
  border-bottom-color: #444;
}

.dark-theme .split-screen-viewer__sync-controls {
  background: #2a2a2a;
  border-top-color: #444;
}

.dark-theme .split-screen-viewer__divider {
  background: #444;
}

.dark-theme .split-screen-viewer__timeline {
  border-top-color: #444;
}

/* ─────────────────────────────────────────────
   COMPACT LAYOUT  (ssv-compact)
   Clinical reference: ~20-30% panel width,
   feeds stacked, minimal labels per ACNS/Natus
───────────────────────────────────────────── */
.ssv-compact {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* Each video feed row */
.ssv-compact__feed {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid #333;
}

/* Minimal feed identifier bar */
.ssv-compact__feed-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
  min-height: 28px;
}

/* Stream number badge: "1", "2", "3" */
.ssv-compact__feed-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ssv-compact__feed-time {
  flex: 1;
  font-size: 0.65rem;
  color: #aaa;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ssv-compact__pip-btn {
  color: #aaa !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.ssv-compact__pip-btn:hover {
  color: #ffc107 !important;
}

/* Video element fills remaining feed height */
.ssv-compact__video {
  flex: 1;
  min-height: 0;
}

/* Popped-out placeholder inside compact feed */
.ssv-compact__popped-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #1a1a2e;
  color: #ffc107;
  font-size: 0.75rem;
}

.ssv-compact__popped-placeholder i {
  font-size: 1.4rem;
}

/* Slim control bar at the bottom */
.ssv-compact__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #111;
  border-top: 1px solid #333;
  flex-shrink: 0;
}

.ssv-compact__play-btn,
.ssv-compact__nav-btn {
  padding: 2px 6px !important;
  font-size: 0.8rem !important;
  border-color: #444 !important;
  color: #ccc !important;
}

.ssv-compact__play-btn:hover,
.ssv-compact__nav-btn:hover {
  background: #333 !important;
  color: #fff !important;
}

.ssv-compact__speed-badge {
  font-size: 0.65rem;
  margin-left: 2px;
}

.ssv-compact__marker-count {
  font-size: 0.65rem;
  color: #aaa;
  margin-left: auto;
}

/* ─── VideoPlayer in compact context ───────────────────────
   Transport lives in ssv-compact__controls; keep seek bar only. */
.ssv-compact .video-player__controls {
  padding: 4px 6px;
  overflow-x: hidden;
}

.ssv-compact .video-player__controls-row {
  display: none;
}

.ssv-compact .video-player__seek-container {
  gap: 4px;
  margin-bottom: 0;
  min-width: 0;
}

.ssv-compact .video-player__time {
  min-width: 58px;
  font-size: 0.65rem;
}

.ssv-compact .video-player__seek-bar {
  min-width: 0;
}
/**
 * Video panel — aligned with centralized app-ui tokens and EEG viewer theme.
 */

.video-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bs-body-bg);
  border-left: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  font-size: var(--app-ui-font-body, 0.78rem);
  line-height: var(--user-line-height, 1.5);
}

.video-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg, #f8f9fa);
  min-height: 2.75rem;
}

.video-panel-header__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.video-panel-header__icon {
  color: var(--bs-primary);
  flex-shrink: 0;
}

.video-panel-header h6 {
  margin: 0;
  font-size: var(--app-ui-font-subheading, 0.95rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--bs-body-color);
}

.video-panel-header__badge {
  font-size: var(--app-ui-font-meta, 0.72rem);
  font-weight: 600;
}

.video-panel-header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.video-panel-autoplay-btn {
  font-size: var(--app-ui-font-meta, 0.72rem);
  font-weight: 600;
  white-space: nowrap;
}

.video-panel-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-panel-body__state {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--bs-secondary-color);
  font-size: var(--app-ui-font-body, 0.78rem);
}

.video-panel-body__alert {
  margin: 0.75rem;
  font-size: var(--app-ui-font-body, 0.78rem);
}

.video-selector {
  padding: 0.65rem 0.85rem 0.55rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg, #f8f9fa);
}

.video-selector__feed {
  flex: 1 1 auto;
  min-width: 0;
}

.video-selector--autoplay-only {
  justify-content: flex-end;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.video-selector--autoplay-only .video-panel-autoplay-btn {
  align-self: center;
  margin-bottom: 0;
}

.video-selector .form-select {
  font-size: var(--app-ui-font-body, 0.78rem);
  min-height: calc(var(--app-ui-font-body, 0.78rem) * 2.4);
}

.video-selector .form-label {
  font-size: var(--app-ui-font-meta, 0.72rem);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.video-viewer-container {
  flex: 1;
  min-height: 0;
  position: relative;
}

.video-panel-layout-btn,
.video-panel-close-btn {
  font-size: var(--app-ui-font-body, 0.78rem);
  min-height: calc(var(--app-ui-font-body, 0.78rem) * 2.2);
  padding: 0.15rem 0.45rem;
}

.video-panel-close-btn {
  color: var(--bs-secondary-color) !important;
  text-decoration: none;
}

.video-panel-close-btn:hover,
.video-panel-close-btn:focus-visible {
  color: var(--bs-body-color) !important;
}

@media (max-width: 992px) {
  .video-panel {
    border-left: none;
    border-top: 1px solid var(--bs-border-color);
  }
}

.dark-theme .video-panel {
  background: var(--bs-body-bg);
  border-left-color: var(--bs-border-color);
}

.dark-theme .video-panel-header,
.dark-theme .video-selector {
  background: rgba(255, 255, 255, 0.04);
}
/* ─── Annotation List View ─────────────────────────────────────────────── */

.annotation-list-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.75rem;
}

/* ─── Toolbar ──────────────────────────────────────────────────────────── */

.alv-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
}

.alv-toolbar__search {
  flex: 1 1 140px;
  min-width: 0;
}

.alv-search-input {
  width: 100%;
  padding: 5px 10px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.75rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.alv-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.alv-search-input::placeholder {
  color: #475569;
}

.alv-toolbar__filters {
  flex: 0 0 auto;
}

.alv-select {
  padding: 5px 10px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
  max-width: 200px;
}

.alv-select:focus {
  outline: none;
  border-color: #3b82f6;
}

.alv-toolbar__count {
  flex: 0 0 auto;
  font-size: 0.6875rem;
  color: #64748b;
  white-space: nowrap;
}

.alv-toolbar__column-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.6875rem;
  color: #94a3b8;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.alv-toolbar__column-toggle input {
  margin: 0;
}

/* ─── Table layout ─────────────────────────────────────────────────────── */

.alv-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.alv-table-wrap::-webkit-scrollbar {
  width: 4px;
}

.alv-table-wrap::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.alv-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.alv-col--time {
  width: 3.1rem;
}

.alv-col--duration {
  width: 3rem;
}

.alv-col--type {
  width: 5.25rem;
}

.alv-col--status {
  width: 4.25rem;
}

.alv-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.28rem 0.3rem;
  background: #0b1322;
  border-bottom: 1px solid #1e293b;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  text-align: left;
  vertical-align: middle;
}

.alv-table tbody td {
  padding: 0.28rem 0.3rem;
  border-bottom: 1px solid #1a2744;
  vertical-align: middle;
  text-align: left;
}

.alv-header__btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: color 0.15s;
}

.alv-header__btn:hover {
  color: #cbd5e1;
}

.alv-header__status {
  text-align: center;
}

.alv-row {
  color: #cbd5e1;
  font-size: 0.6875rem;
  line-height: 1.15;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.alv-row:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #f1f5f9;
}

.alv-row:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.alv-row:active {
  background: rgba(59, 130, 246, 0.18);
}

.alv-row__time {
  font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  color: #94a3b8;
  white-space: nowrap;
}

.alv-row__label {
  overflow: hidden;
}

.alv-row__label-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  min-width: 0;
}

.alv-row__type {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
}

.alv-row__badge {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.alv-row__badge--inline {
  flex-shrink: 0;
}

.alv-row__type-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alv-row__label-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e2e8f0;
  font-size: 0.6875rem;
}

.alv-row__duration {
  font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  color: #94a3b8;
  white-space: nowrap;
}

.alv-row__status {
  text-align: center;
}

.alv-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.alv-status-badge--reviewed {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.alv-status-badge--pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ─── Empty State ──────────────────────────────────────────────────────── */

.alv-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 16px;
  color: #64748b;
  font-size: 0.8125rem;
  text-align: center;
}
.eeg-caliper-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  z-index: 10;
}

.eeg-measurement-overlay {
  box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.35);
}

.eeg-calipers-controls .bi-rulers {
  margin-right: 4px;
}

/* Caliper measurement tooltip styling */

/* Caliper line styling (drawn on canvas, but CSS for reference) */
/* ─── Channel Manager Panel ────────────────────────────────────── */

.ch-manager-panel {
  position: relative;
  z-index: 9998;
  width: 260px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: #1a2233;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  color: #e2e8f0;
  font-size: 0.8rem;
  user-select: none;
  overflow: hidden;
}

/* Header */
.ch-manager-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  border-bottom: 1px solid #1e2d42;
  flex-shrink: 0;
}

.ch-manager-panel__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ch-manager-panel__close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.1s;
}
.ch-manager-panel__close:hover {
  color: #e2e8f0;
}

/* Select-all row */
.ch-manager-panel__select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  flex-shrink: 0;
}

.ch-manager-panel__select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
  color: #cbd5e1;
}

.ch-manager-panel__count {
  font-size: 0.7rem;
  color: #64748b;
}

/* Divider */
.ch-manager-panel__divider {
  border: none;
  border-top: 1px solid #1e2d42;
  margin: 0;
  flex-shrink: 0;
}

/* Scrollable channel list */
.ch-manager-panel__list {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 4px 0;
  min-height: 0;
}

/* Scrollbar styling */
.ch-manager-panel__list::-webkit-scrollbar {
  width: 5px;
}
.ch-manager-panel__list::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

/* Channel row */
.ch-manager-panel__row--hidden {
  opacity: 0.55;
}

.ch-manager-panel__row-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.ch-manager-panel__row-label input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: #60a5fa;
  cursor: pointer;
}

/* Colour swatch */
.ch-manager-panel__color-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  outline: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.ch-manager-panel__color-swatch:hover,
.ch-manager-panel__color-swatch:focus {
  transform: scale(1.3);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.4);
}

/* Channel name */
.ch-manager-panel__ch-name {
  font-size: 0.78rem;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hidden badge */
.ch-manager-panel__hidden-badge {
  font-size: 0.64rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
  flex-shrink: 0;
  margin-left: 4px;
}

/* Footer actions */
.ch-manager-panel__footer {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  flex-shrink: 0;
  border-top: 1px solid #1e2d42;
}

.ch-manager-panel__btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.ch-manager-panel__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ch-manager-panel__btn--isolate {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
  color: #93c5fd;
}
.ch-manager-panel__btn--isolate:not(:disabled):hover {
  background: rgba(96, 165, 250, 0.28);
  border-color: rgba(96, 165, 250, 0.55);
}

.ch-manager-panel__btn--showall {
  background: rgba(134, 239, 172, 0.12);
  border-color: rgba(134, 239, 172, 0.28);
  color: #86efac;
}
.ch-manager-panel__btn--showall:not(:disabled):hover {
  background: rgba(134, 239, 172, 0.24);
  border-color: rgba(134, 239, 172, 0.5);
}

/* Trigger button in playback controls */

/* Wrapper that anchors the panel relative to the trigger */
.eeg-channel-manager-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* EEG-CUX-007: Save as montage variant */
.ch-manager-panel__btn--variant {
  width: 100%;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
}
.ch-manager-panel__btn--variant:not(:disabled):hover {
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(167, 139, 250, 0.55);
}

.ch-manager-panel__variant-row {
  padding: 6px 12px 8px;
}

.ch-manager-panel__variant-form {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ch-manager-panel__variant-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.ch-manager-panel__variant-input {
  background: #0d1b2e;
  border: 1px solid #1e3a5f;
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.78rem;
  padding: 4px 7px;
  outline: none;
  transition: border-color 0.12s;
}
.ch-manager-panel__variant-input:focus {
  border-color: #7c3aed;
}
.ch-manager-panel__variant-input::placeholder {
  color: #3d5a80;
}

.ch-manager-panel__variant-error {
  font-size: 0.7rem;
  color: #f87171;
  margin: 0;
}

.ch-manager-panel__variant-actions {
  display: flex;
  gap: 6px;
}

.ch-manager-panel__btn--variant-confirm {
  flex: 1;
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.5);
  color: #c4b5fd;
}
.ch-manager-panel__btn--variant-confirm:not(:disabled):hover {
  background: rgba(124, 58, 237, 0.4);
}

.ch-manager-panel__btn--variant-cancel {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}
.ch-manager-panel__btn--variant-cancel:not(:disabled):hover {
  background: rgba(100, 116, 139, 0.28);
}
/**
 * Event Detection Panel Styles
 */
.event-detection-panel .event-detection-panel__title {
  font-size: var(--eeg-dock-panel-title-size, 0.75rem);
  font-weight: 600;
  line-height: 1.2;
}
.event-detection-panel .event-detection-panel__header-row {
  margin-bottom: 0.15rem;
}
.event-detection-panel .event-detection-panel__count {
  font-size: var(--eeg-dock-tab-font-size, 0.625rem);
  padding: 0.1rem 0.35rem;
  font-weight: 500;
}
.event-detection-panel .card-header {
  padding: 0.35rem 0.45rem;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  color: #e2e8f0;
}
.event-detection-panel .event-detection-panel__title {
  color: #f8fafc;
}
.event-detection-panel .event-detection-panel__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.event-detection-panel .event-detection-panel__filter-select,
.event-detection-panel .event-detection-panel__search-input {
  font-size: var(--eeg-dock-tab-font-size, 0.625rem);
  min-height: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  line-height: 1.2;
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}
.event-detection-panel .event-detection-panel__search-input::placeholder {
  color: #64748b;
  opacity: 1;
}
.event-detection-panel .event-detection-panel__filter-select {
  flex: 0 1 7.5rem;
  min-width: 5.5rem;
  max-width: 9rem;
}
.event-detection-panel .event-detection-panel__confidence {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 9rem;
  min-width: 8rem;
  max-width: 14rem;
  padding: 0 0.2rem;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #111827;
  min-height: 1.4rem;
}
.event-detection-panel .event-detection-panel__confidence-label {
  font-size: var(--eeg-dock-tab-font-size, 0.625rem);
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}
.event-detection-panel .event-detection-panel__confidence-range {
  flex: 1 1 auto;
  min-width: 4rem;
  margin: 0;
  height: 0.9rem;
}
.event-detection-panel .event-detection-panel__search {
  flex: 1 1 8rem;
  min-width: 6rem;
  max-width: 12rem;
}
.event-detection-panel .event-detection-panel__search-clear {
  padding: 0 0.35rem;
  font-size: 0.7rem;
  line-height: 1;
}
.event-detection-panel .table-container {
  max-height: 600px;
  overflow-y: auto;
}
.event-detection-panel .table-container::-webkit-scrollbar {
  width: 8px;
}
.event-detection-panel .table-container::-webkit-scrollbar-track {
  background: var(--bs-secondary-bg);
}
.event-detection-panel .table-container::-webkit-scrollbar-thumb {
  background: var(--bs-secondary);
  border-radius: 4px;
}
.event-detection-panel .table-container::-webkit-scrollbar-thumb:hover {
  background: var(--bs-secondary-text);
}
.event-detection-panel table.event-detection-panel__table {
  --bs-table-hover-bg: var(--bs-secondary-bg);
  margin-bottom: 0;
}
.event-detection-panel table.event-detection-panel__table thead {
  position: sticky;
  top: 0;
  background-color: var(--bs-body-bg);
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.event-detection-panel table.event-detection-panel__table thead th {
  font-weight: 600;
  font-size: 0.65rem;
  padding: 0.12rem 0.3rem;
  line-height: 1.1;
  border-bottom: 1px solid var(--bs-border-color);
  vertical-align: middle;
}
.event-detection-panel table.event-detection-panel__table tbody tr {
  transition: background-color 0.15s ease;
}
.event-detection-panel table.event-detection-panel__table tbody tr:hover {
  background-color: var(--bs-secondary-bg);
}
.event-detection-panel table.event-detection-panel__table tbody tr.table-active {
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}
.event-detection-panel table.event-detection-panel__table tbody tr td {
  padding: 0.08rem 0.3rem;
  vertical-align: middle;
  font-size: 0.65rem;
  line-height: 1.1;
}
.event-detection-panel table.event-detection-panel__table .form-check {
  margin: 0;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-detection-panel table.event-detection-panel__table .form-check-input {
  margin: 0;
  width: 0.7rem;
  height: 0.7rem;
  float: none;
}
.event-detection-panel table thead {
  position: sticky;
  top: 0;
  background-color: var(--bs-body-bg);
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.event-detection-panel table thead th {
  font-weight: 600;
  font-size: 0.65rem;
  padding: 0.12rem 0.3rem;
  line-height: 1.1;
  border-bottom: 1px solid var(--bs-border-color);
}
.event-detection-panel table tbody tr {
  transition: background-color 0.15s ease;
}
.event-detection-panel table tbody tr:hover {
  background-color: var(--bs-secondary-bg);
}
.event-detection-panel table tbody tr.table-active {
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}
.event-detection-panel table tbody tr td {
  padding: 0.08rem 0.3rem;
  vertical-align: middle;
  font-size: 0.65rem;
  line-height: 1.1;
}
.event-detection-panel .badge {
  font-size: 0.58rem;
  padding: 0.04rem 0.22rem;
  line-height: 1.05;
  font-weight: 500;
}
.event-detection-panel .event-detection__sortable {
  cursor: pointer;
  user-select: none;
}
.event-detection-panel .event-detection__sortable:hover {
  background-color: var(--bs-secondary-bg);
}
.event-detection-panel .event-detection__checkbox-col {
  width: 28px;
}
.event-detection-panel .event-detection__actions-col {
  width: 40px;
}
.event-detection-panel .event-detection__action-btn {
  padding: 0.04rem 0.14rem !important;
  min-height: 0.85rem;
  max-height: 0.85rem;
  line-height: 1;
}
.event-detection-panel .event-detection__action-btn i {
  font-size: 0.5rem;
  line-height: 1;
}
.event-detection-panel .btn-group .btn {
  padding: 0.04rem 0.14rem;
  min-height: 0.85rem;
  max-height: 0.85rem;
}
.event-detection-panel .btn-group .btn i {
  font-size: 0.5rem;
}
.event-detection-panel .event-detection__row-clickable {
  cursor: pointer;
}
.event-detection-panel .event-detection__row-default {
  cursor: default;
}
.event-detection-panel .event-detection-panel__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem 0.75rem;
}
.event-detection-panel .event-detection-panel__summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}
.event-detection-panel .font-monospace {
  font-family: "JetBrains Mono", "Consolas", "Courier New", monospace;
  font-size: 0.65rem;
  line-height: 1.1;
}
.event-detection-panel .event-detection-panel__channel {
  font-size: 0.65rem;
  line-height: 1.1;
}

@media (prefers-color-scheme: dark) {
  .event-detection-panel table thead {
    box-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
  }
}
.theme-high-contrast .event-detection-panel table {
  border: 2px solid #000;
}
.theme-high-contrast .event-detection-panel table thead th {
  border-bottom: 3px solid #000;
}
.theme-high-contrast .event-detection-panel table tbody tr {
  border-bottom: 1px solid #000;
}
.theme-high-contrast .event-detection-panel table tbody tr:hover {
  background-color: #fff;
}
.theme-high-contrast .event-detection-panel table tbody tr.table-active {
  background-color: #ff0;
}
.theme-high-contrast .event-detection-panel .badge {
  border: 1px solid #000;
}