.theme-preview .section-head { position: relative; margin-bottom: 24px; }
.theme-comparison { --theme-reveal: 50%; min-width: 0; }
.theme-comparison__expand { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--blue-700); font-size: 14px; font-weight: 650; cursor: pointer; }
.theme-comparison__expand[hidden] { display: none; }
.theme-comparison__expand:hover { background: var(--blue-50); border-color: var(--line); }
.theme-comparison__viewport { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 192 / 106; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface-alt); box-shadow: var(--shadow-md); }
.theme-comparison__viewport img { width: 100%; height: auto; user-select: none; }
.theme-comparison__dark { display: none; }
.theme-comparison[data-ready] .theme-comparison__dark { display: block; }
.theme-comparison[data-ready] .theme-comparison__light { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--theme-reveal)) 0 0); }
.theme-comparison[data-ready] .theme-comparison__viewport { cursor: ew-resize; touch-action: pan-y; }
.theme-comparison__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.theme-comparison__divider { position: absolute; top: 0; bottom: 0; left: var(--theme-reveal); width: 2px; transform: translateX(-50%); background: #fff; box-shadow: 0 0 0 1px rgba(13, 26, 51, .2); pointer-events: none; }
.theme-comparison__handle { position: absolute; top: 50%; left: clamp(24px, var(--theme-reveal), calc(100% - 24px)); display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--navy-800); box-shadow: 0 3px 12px rgba(8, 18, 37, .25); pointer-events: none; }
.theme-comparison__range:focus-visible ~ .theme-comparison__handle { outline: 3px solid var(--blue-500); outline-offset: 3px; }
.theme-comparison[data-input-mode="pointer"] .theme-comparison__handle { outline: none; }
.theme-comparison__hint { margin: 15px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.theme-comparison [hidden] { display: none; }

.theme-preview-dialog { width: min(1640px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 22px; overflow: auto; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lg); }
.theme-preview-dialog::backdrop { background: rgba(4, 10, 22, .86); }
.theme-preview-dialog__heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.theme-preview-dialog__heading h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.theme-preview-dialog__close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.theme-preview-dialog__close:hover { background: var(--surface-alt); color: var(--ink); }
.theme-preview-dialog .theme-comparison__viewport { border-radius: 10px; box-shadow: none; }
.theme-preview-dialog .theme-comparison__hint { margin-top: 12px; }
.theme-preview-dialog__originals { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.theme-preview-dialog__originals a { color: var(--blue-700); font-weight: 650; }
.theme-preview-dialog__originals a:hover { color: var(--navy-900); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 650px) {
  .theme-preview .section-head .eyebrow { margin-right: 116px; }
  .theme-comparison__viewport { border-radius: 10px; }
  .theme-comparison__expand { position: absolute; top: -6px; right: 0; padding-inline: 6px; font-size: 13px; }
  .theme-preview-dialog { width: calc(100vw - 16px); padding: 14px; border-radius: 14px; }
  .theme-preview-dialog__heading { gap: 12px; }
  .theme-preview-dialog__heading h2 { font-size: 16px; }
}
