:root {
  --bg: #111;
  --fg: #eee;
  --muted: #aaa;
  --accent: #ddd;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.comparison h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.comparison .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.comparison .hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}
.comparison .toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.comparison button {
  background: #2a2a2a;
  color: var(--fg);
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.comparison button:hover { background: #333; }
.comparison .toolbar label {
  color: var(--muted);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.comparison .toolbar select {
  background: #2a2a2a;
  color: var(--fg);
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
  font-size: 0.85rem;
}
.comparison .zoom-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
/*
  Slider + wipe stay viewport-sized (untransformed). Zoom is applied only to
  the two images so the divider always cuts the visible crop.
*/
.comparison .viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  --z: 1;
  --x: 0px;
  --y: 0px;
}
.comparison .viewport.is-panning { cursor: grabbing; }
.comparison .viewport.is-zoomed { cursor: grab; }
.comparison .zoom-layer {
  position: absolute;
  inset: 0;
}
.comparison img-comparison-slider {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  --divider-width: 2px;
  --divider-color: #fff;
  --default-handle-width: 42px;
}
.comparison img-comparison-slider img {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--z) * 100%);
  height: auto;
  max-width: none;
  transform: translate(var(--x), var(--y));
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform, width;
}
.comparison .label {
  position: absolute;
  top: 0.6rem;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.8rem;
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;
}
.comparison .label.first { left: 0.6rem; }
.comparison .label.second { right: 0.6rem; }
.comparison .caption,
.comparison .attr {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.9rem 0 0;
}
.comparison a { color: var(--accent); }
