/* The snapshot shares the existing native-dialog surface and close control. */
.chart-card > .card-heading { flex-wrap: wrap; }
.chart-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}
.chart-heading-actions > button { flex: 0 0 auto; }
#chart-snapshot-dialog {
  width: min(1600px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  height: min(940px, calc(100vh - 32px));
  height: min(940px, calc(100dvh - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
}
.snapshot-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 8px;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}
.snapshot-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 8px;
}
.snapshot-toolbar .segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}
.snapshot-toolbar .segmented button {
  flex: 0 1 auto;
  min-height: 38px;
  padding: 7px 12px;
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
}
.snapshot-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.snapshot-zoom-controls button {
  min-width: 38px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(93, 255, 200, .2);
  border-radius: 10px;
  background: rgba(0, 0, 0, .2);
  color: #e8faf4;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.snapshot-zoom-controls button:hover:not(:disabled) {
  border-color: rgba(93, 255, 200, .4);
  background: rgba(93, 255, 200, .08);
}
.snapshot-plot {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
  min-height: 340px;
  border: 1px solid rgba(93, 255, 200, .14);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(2, 12, 9, .45);
}
.snapshot-canvas {
  position: relative;
  flex: 1 0 200px;
  width: 100%;
  min-width: 0;
  min-height: 200px;
}
.snapshot-chart {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.snapshot-chart.is-panning { cursor: grabbing; }
.snapshot-chart:focus-visible {
  outline: 2px solid #38f0ff;
  outline-offset: -3px;
}
.snapshot-series-legend {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 8px 12px 2px;
  font-size: 11px;
  line-height: 1.5;
  color: #b4ccbc;
}
.snapshot-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.snapshot-legend-item i { display: inline-block; width: 18px; height: 2px; background: var(--series-color); }
.snapshot-legend-item i.is-dashed { background: repeating-linear-gradient(to right, var(--series-color) 0 4px, transparent 4px 7px); }
.snapshot-event-list {
  flex: 0 0 auto;
  min-width: 0;
  max-height: 80px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px 8px;
  border-top: 1px solid rgba(211, 160, 189, .1);
  scrollbar-width: thin;
}
.snapshot-event-entries { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2px 8px; }
.snapshot-event-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b4ccbc;
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}
.snapshot-event-button::before {
  content: "";
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d3a0bd;
}
.snapshot-event-button:hover:not(:disabled),
.snapshot-event-button[aria-pressed="true"] { background: rgba(211, 160, 189, .1); color: #f1dfeb; }
.snapshot-event-button:focus-visible { outline-color: #d3a0bd; outline-offset: 0; }
.snapshot-event-marker { cursor: pointer; outline: none; }
.snapshot-event-marker:hover .snapshot-event-hit,
.snapshot-event-marker:focus-visible .snapshot-event-hit,
.snapshot-event-marker[aria-pressed="true"] .snapshot-event-hit { fill: rgba(211, 160, 189, .12); stroke: #d3a0bd; stroke-width: 1; }
.snapshot-event-details { margin: 4px 6px 0; padding: 4px 8px; border-left: 1px solid rgba(211, 160, 189, .5); }
.snapshot-event-details[hidden] { display: none; }
.snapshot-point-readout { pointer-events: none; }
.snapshot-body .snapshot-event-detail,
.snapshot-body .snapshot-no-events,
.snapshot-body .snapshot-status,
.snapshot-body .snapshot-hint { margin: 0; font-size: 12px; line-height: 1.5; color: #b4ccbc; }
.snapshot-status { flex: none; min-height: 18px; font-variant-numeric: tabular-nums; }
.snapshot-hint { flex: none; }
@media (max-width: 760px) {
  #chart-snapshot-dialog {
    width: calc(100vw - 20px); max-width: calc(100vw - 20px);
    height: calc(100vh - 20px); height: calc(100dvh - 20px);
    max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px);
  }
  .snapshot-body { padding: 8px; }
  .snapshot-toolbar .segmented { width: 100%; }
  .snapshot-toolbar .segmented button { flex: 1 1 auto; padding: 6px 8px; font-size: 12px; }
  .snapshot-plot { min-height: 320px; }
  .snapshot-series-legend { padding-inline: 8px; }
}
@media (max-height: 500px) and (min-width: 761px) {
  .snapshot-plot { min-height: 280px; }
  .snapshot-canvas { min-height: 180px; flex-basis: 180px; }
}
