#filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  overflow-x: auto;
}
#filters .filter {
  flex: 1 0 auto;
  padding-inline: 2px;
  font-size: 10px;
  white-space: nowrap;
}
.review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 5px;
  padding: 0 8px 6px;
}
.review-filter-buttons { display: flex; gap: 3px; }
.review-filter-buttons button, .review-actions summary, .review-actions-panel button,
.review-actions-panel select, .context-editor button, .timeline-modes button {
  font: inherit;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--line, #cbd8d1);
  border-radius: 4px;
  background: var(--chart-surface, #fff);
  color: inherit;
}
.review-filter-buttons button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.review-actions { position: relative; }
.review-actions summary {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  cursor: pointer;
  line-height: 14px;
}
.review-actions summary::-webkit-details-marker { display: none; }
.review-actions summary > span:last-child { font-size: 17px; }
.review-actions-panel {
  position: absolute;
  z-index: 8;
  right: 0;
  top: calc(100% + 4px);
  width: min(244px, calc(var(--events-width, 250px) - 16px));
  max-height: 58vh;
  overflow: auto;
  display: grid;
  gap: 5px;
  padding: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 22px #12203324;
}
.review-actions-panel label, .review-actions-panel small { font-size: 11px; }
.review-actions-panel select { display: block; width: 100%; margin-top: 3px; }
.review-menu-checkbox { display: flex; align-items: center; gap: 4px; }
.event-row[aria-pressed="true"] {
  background: var(--accent-soft, #e6eef9);
  box-shadow: inset 3px 0 var(--accent, #275aab);
}
.timeline-modes { display: flex; flex: none; gap: 2px; margin-left: auto; }
.timeline-modes .record-icon-button, .tool.record-icon-button {
  display: grid; place-items: center; flex: none;
  width: 27px; height: 27px; min-height: 27px; padding: 0;
  cursor: pointer;
}
.tool.record-icon-button[hidden] { display: none; }
.record-icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.timeline-modes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: white; }
.viewer-head .record-heading { flex: 1; }
.analysis-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--ink);
}
.analysis-progress[hidden] { display: none; }
#analysisProgressTitle { color: var(--muted); font-size: 11px; }
#analysisPercent {
  min-width: 3.2em;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
#analysisProgressBar {
  appearance: none;
  display: block;
  flex: 1;
  min-width: 0;
  height: 14px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--line);
}
#analysisProgressBar::-webkit-progress-bar { background: var(--line); }
#analysisProgressBar::-webkit-progress-value { background: var(--accent); }
#analysisProgressBar::-moz-progress-bar { background: var(--accent); }
@media (forced-colors: active) {
  #analysisProgressBar { appearance: auto; }
}
.analysis-progress .analysis-cancel { flex: none; background: var(--surface); }
#timelineWrap[data-mode="navigate"] { cursor: crosshair; }
#timelineWrap[data-mode="navigate"] [data-timeline-action] { cursor: grab; }
#timelineWrap[data-mode="night"], #timelineWrap[data-mode="sport"] { cursor: crosshair; }
#timelineWrap[data-drag="move"], #timelineWrap[data-drag="move"] [data-timeline-action], #timelineWrap[data-drag="pan"] { cursor: grabbing; }
#timelineLegend[hidden], #timelineLegend [hidden] { display: none; }
@media (max-width: 700px) {
  .record-heading .record-context { flex-wrap: wrap; }
}
#timelineWrap { height: 150px; min-height: 100px; max-height: 400px; }
#timelineSvg { height: 100%; width: 100%; }
.context-track { cursor: pointer; }
.context-bar { fill: #d9e3fa; stroke: #718cba; stroke-width: .7; }
.context-track.sport .context-bar { fill: #f8e2af; stroke: #9b691e; }
.context-track.selected .context-bar, .context-track:focus .context-bar { stroke-width: 1.7; }
.context-track text { fill: #23354f; font-size: 7px; pointer-events: none; }
.context-edge { fill: #647fad; cursor: ew-resize; }
.context-track.sport .context-edge { fill: #ad7828; }
.context-edge:hover { fill: #364d76; }
.context-editor:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 4px 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
#contextSelection { font-weight: 600; }
#contextTachycardiaLabel:not([hidden]) { display: flex; align-items: center; gap: 4px; }
#closeContextEditor { margin-left: auto; }
.chart-resize { height: 9px; cursor: ns-resize; touch-action: none; border-top: 1px solid var(--line); position: relative; flex: none; }
.chart-resize:after { content: ''; position: absolute; top: 3px; left: 45%; width: 10%; border-top: 3px solid var(--muted, #9daea3); border-radius: 3px; }
.chart-resize:hover:after, .chart-resize:focus-visible:after { border-color: var(--accent); }
.chart-resize:focus-visible { outline-offset: -2px; }
.viewer { overflow-y: auto; }
.signal-stack { min-height: 265px; }
.signal-stack .signal-shell { min-height: 110px; }
.signal-stack .segment-tachogram {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  height: var(--tachogram-height, 120px);
  max-height: none;
  border-top: 0;
  resize: none;
}
.signal-stack .tachogram-head { flex: none; }
.signal-stack .tachogram-controls { margin-right: 0; }
.signal-stack #tachogramSvg { flex: 1 1 auto; min-height: 0; height: auto; }
.chart-axis-label { fill: var(--chart-label, #506575); font-variant-numeric: tabular-nums; pointer-events: none; }
.chart-time-label { fill: var(--muted); }
.chart-axis-grid { stroke: var(--chart-grid, #e6eeea); vector-effect: non-scaling-stroke; stroke-width: 1; }
.chart-axis-tick { stroke: var(--chart-grid-major, #ccd9df); vector-effect: non-scaling-stroke; stroke-width: 1; }
.signal-lead-label, .timeline-plot-label {
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--chart-surface, #fff);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.tool.chart-scale-lock { display: inline-grid; place-items: center; flex: none; width: 28px; padding: 0; }
.tool.chart-scale-lock > svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-scale-lock[aria-pressed="false"] .lock-closed,
.chart-scale-lock[aria-pressed="true"] .lock-open { display: none; }
.tachogram-head .chart-scale-lock { height: 23px; }
.tachogram-head .chart-scale-lock.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart-scale-lock:disabled { opacity: .55; cursor: default; }
@media (max-width: 700px) {
  .signal-stack .segment-tachogram { height: var(--tachogram-height, 112px); }
}
#contextIntervals>div { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; font-size: 12px; }
.settings-popover { max-height: 85vh; overflow-y: auto; }
.viewer>.overview { height: auto; flex: none; min-height: 0; }
.overview #timelineWrap { flex: none; }
.overview:has(.timeline-minimap:not([hidden])) #timelineWrap { border-top: 0; }
.side .events-list { min-height: 0; }

.timeline-minimap {
  position: relative;
  flex: 0 0 14px;
  height: 14px;
  margin-inline: 32px 6px;
  background: var(--surface-soft, #eef2f8);
  border: 1px solid var(--line);
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}
.timeline-minimap[hidden] { display: none; }
.timeline-minimap, .timeline-minimap * {
  -webkit-user-select: none;
  user-select: none;
}
.timeline-minimap[aria-disabled="true"] { cursor: default; }
.timeline-minimap:focus-visible { outline: 2px solid var(--accent, #275aab); }
#timelineMinimapScale, #timelineMinimapScale span {
  position: absolute;
  inset-block: 0;
  pointer-events: none;
}
#timelineMinimapScale { inset-inline: 0; }
.minimap-night { background: var(--chart-muted, #64748b); opacity: .42; }
.minimap-midnight { width: 1px; background: var(--chart-label, #516785); opacity: .65; }
.minimap-hour {
  padding-inline-start: 3px;
  color: var(--ink, #30445b);
  opacity: .65;
  font-size: 8px;
  line-height: 12px;
}
.minimap-hour::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 4px;
  background: currentColor;
}
.minimap-date {
  box-sizing: border-box;
  padding-inline-start: 3px;
  overflow: hidden;
  white-space: nowrap;
  color: var(--ink, #30445b);
  opacity: .65;
  font-size: 9px;
  line-height: 12px;
}
#timelineMinimapThumb {
  position: absolute;
  inset-block: 0;
  border: 1px solid var(--accent, #275aab);
  border-radius: 2px;
  background: var(--accent-soft, #c7ddfb);
  background: color-mix(in srgb, var(--accent, #275aab) 24%, transparent);
  cursor: grab;
}
.timeline-minimap[aria-disabled="true"] #timelineMinimapThumb { border-color: transparent; background: transparent; cursor: default; }
#timelineMinimapThumb:hover, #timelineMinimapThumb:active { background: var(--accent-soft, #c7ddfb); }
#timelineMinimapThumb:active { cursor: grabbing; }
