.has-js .switch {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
}
.switch button, .copy-command, .return-top {
  font: inherit;
  font-size: 18px;
  line-height: 1.5;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}
.switch button { flex: 1; }
.switch button[aria-pressed="true"], .copy-command {
  background: var(--green);
  color: white;
}
.switch button:hover, .return-top:hover { box-shadow: inset 0 0 0 1px var(--green); }
.has-js .chapter[data-view="compare"] .photos,
.has-js .chapter[data-view="before"] .after,
.has-js .chapter[data-view="after"] .before { display: none; }
.chapter[data-view="before"] .photos, .chapter[data-view="after"] .photos {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin-inline: auto;
}
.comparison-area { max-width: 760px; margin: auto; }
.comparison-area[hidden] { display: none; }
.comparison {
  --split: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
  background: #eeede8;
}
.comparison > img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.comparison-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.comparison-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 56px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: ew-resize;
}
.comparison-divider::before {
  content: '';
  position: absolute;
  inset-block: 0;
  width: 3px;
  background: white;
  box-shadow: 0 0 5px #0009;
}
.comparison-grip {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 30px;
  box-shadow: 0 2px 10px #0005;
}
.comparison-divider:focus-visible .comparison-grip { outline: 4px solid #c27c28; outline-offset: 3px; }
.comparison-label {
  position: absolute;
  top: 14px;
  padding: 5px 12px;
  border-radius: 4px;
  background: #fffef5ed;
  color: #24362c;
  font-size: 16px;
  font-weight: 600;
  pointer-events: none;
}
.label-before { left: 14px; }
.label-after { right: 14px; }
.compare-help { color: var(--muted); font-size: 16px; margin: 10px 0 0; }
.command-panel {
  background: #eaf0e8;
  border: 1px solid #cdd8ca;
  border-radius: 7px;
  padding: 20px;
  margin-top: 24px;
}
.command-panel label { display: block; font-size: 18px; margin-bottom: 12px; }
.command-row { display: flex; align-items: center; gap: 12px; }
.command-row input {
  min-width: 0;
  flex: 1;
  font: 19px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--ink);
  background: white;
  border: 1px solid #aebcac;
  border-radius: 5px;
  padding: 12px;
}
.command-row input:focus-visible { outline: 3px solid #af6823; outline-offset: 3px; }
.copy-command { white-space: nowrap; }
.copy-status { font-size: 16px; color: var(--green); margin: 8px 0 0; }
.copy-status:empty { display: none; }
.return-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  margin-top: 24px;
  text-decoration: none;
  background: #fffdfa;
}
@media (max-width: 760px) {
  .has-js .switch .desktop-only { display: none; }
  .switch button { padding: 11px 5px; font-size: 17px; }
  .command-panel { padding: 16px; }
  .command-row { flex-wrap: wrap; }
  .command-row input { flex-basis: 100%; }
  .copy-command, .return-top { width: 100%; }
}
