#preview-compare {
  width: min(100%, 960px);
  margin: 12px auto 0;
}
#compare-loading, #compare-help, #compare-fallback {
  color: var(--dim);
  font-size: 14px;
}
#compare-fallback { margin-top: 8px; }
#compare-stage {
  --split: 50%;
  position: relative;
  width: 100%;
  max-width: var(--stage-limit, 960px);
  aspect-ratio: var(--panel-ratio, 16 / 9);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 10px;
  background: #142119;
}
#compare-media {
  position: absolute;
  width: 2px;
  height: 2px;
  pointer-events: none;
}
#compare-canvas { position: relative; display: block; width: 100%; height: 100%; }
#compare-stage.is-zoomed { cursor: grab; touch-action: none; }
#compare-stage.is-panning { cursor: grabbing; }
#compare-stage.is-positioning { cursor: crosshair; }
#compare-stage.is-spotting { cursor: crosshair; touch-action: none; }
#compare-stage.is-spotting :is(.compare-after, .compare-divider, #compare-wipe) { visibility: hidden; }
#spot-overlay { position: absolute; inset: 0; pointer-events: none; }
.compare-spot-marker {
  position: absolute;
  min-width: 9px;
  aspect-ratio: 1;
  border: 1px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px #142119, 0 0 5px #142119aa;
}
.compare-spot-marker.spot-cursor { border-style: dashed; opacity: .8; }
.compare-badge {
  position: absolute;
  top: 9px;
  z-index: 1;
  padding: 3px 9px;
  border-radius: 6px;
  background: #122018da;
  color: white;
  font-size: clamp(12px, 1.18vw, 15px);
  font-weight: 650;
  pointer-events: none;
}
.compare-before { left: 9px; }
.compare-after { right: 9px; }
.compare-divider {
  position: absolute;
  inset: 0 auto 0 var(--split);
  width: 2px;
  transform: translateX(-50%);
  background: white;
  box-shadow: 0 0 4px #10241cbb;
  pointer-events: none;
}
#compare-wipe {
  position: absolute;
  top: calc(50% - 24px);
  left: clamp(0px, var(--split) - 24px, 100% - 48px);
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #153c27;
  cursor: ew-resize;
  touch-action: none;
}
#compare-wipe span {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid #a7c2a8;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 9px #10241c66;
  font: 700 23px/1 system-ui, sans-serif;
}
#compare-controls {
  display: grid;
  gap: 8px;
  width: min(100%, 680px);
  margin: 10px auto 0;
}
.compare-controls-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.compare-controls-row button {
  flex: none;
  min-height: 40px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fbf5;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.compare-controls-row button:hover:enabled,
.compare-controls-row button[aria-pressed=true] { background: #e4f0df; border-color: var(--green); }
.compare-controls-row button:disabled { opacity: .6; }
.compare-controls-row input {
  min-width: 45px;
  flex: 1;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}
.compare-controls-row output { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare-playback, .compare-zoom-row { flex-wrap: wrap; }
.compare-zoom-row label { font-size: 14px; font-weight: 600; }
.compare-zoom-row input { max-width: 175px; }
#spot-controls {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.spot-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.spot-heading h3, #spot-status { margin: 0; }
.spot-heading h3 { font-size: 15px; }
#spot-count, #spot-status { color: var(--dim); font-size: 13px; }
.spot-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.spot-options label { color: var(--ink); font-size: 14px; font-weight: 600; }
.spot-options output { float: right; }
.spot-options input { display: block; margin-top: 4px; }
.spot-actions { flex-wrap: wrap; }
.spot-entry { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
#spot-mode[aria-pressed="true"] { color: #fff; background: #153c27; border-color: #153c27; }
#spot-open-preview { width: fit-content; min-height: 38px; font-size: 14px; padding: 6px 11px; }
@media (max-width: 420px) {
  .compare-controls-row { column-gap: 6px; }
  .compare-controls-row button { font-size: 13px; padding-inline: 7px; }
  #compare-clock { font-size: 11px; }
}
