.presets-page {
  --preset-ink: #1d1d1f;
  --preset-paper: #f5f1e9;
  --preset-surface: #fffcf6;
  --preset-rule: rgba(71, 58, 39, .14);
  --preset-muted: #565a61;
  --preset-accent: var(--blue);
  background: var(--preset-paper);
  color: var(--preset-ink);
}
.presets-page [hidden] { display: none !important; }
.presets-page ::selection { background: var(--blue); color: #fff; }
.presets-page :focus-visible { outline: 3px solid var(--blue-focus); outline-offset: 4px; }
.presets-page button { font: inherit; cursor: pointer; }
.presets-page button:disabled { opacity: .5; cursor: not-allowed; }
.presets-page button.primary-pill { min-height: 44px; }
.presets-page main { max-width: 1320px; margin-inline: auto; padding: 0 clamp(20px, 4vw, 64px); }
.preset-opening { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding: 64px 0 40px; }
.preset-opening h1 { margin: 0 0 12px; font-size: clamp(40px, 4.8vw, 68px); line-height: 1.02; font-weight: 700; letter-spacing: -.035em; }
.preset-format { margin: 0 0 18px; color: var(--preset-muted); font-size: 16px; }
.preset-plugins { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; font-size: 13px; }
.preset-plugins > span { color: var(--preset-muted); }
.preset-plugins strong { font-weight: 500; }
.preset-offer { flex: 0 0 230px; display: grid; justify-items: end; gap: 8px; text-align: right; }
.preset-price { font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
[data-preset-price-note] { max-width: 28ch; font-size: 12px; color: var(--preset-muted); line-height: 1.4; }
[data-catalog-status]:empty { display: none; }
[data-catalog-status] { margin: 0; font-size: 13px; max-width: 30ch; }
.preset-offer .primary-pill { margin-top: 4px; min-width: 156px; }
.preset-text-link { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
.preset-gallery { padding: 28px; border: 1px solid var(--preset-rule); border-radius: 24px; background: var(--preset-surface); scroll-margin-top: 90px; }
.preset-gallery-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(24px, 3vw, 44px); align-items: start; }
.preset-screen-column { position: static; min-width: 0; }
.preset-screen { width: min(100%, calc(100svh - 180px)); margin: 0; scroll-margin-top: 90px; }
.preset-screen-media { border-radius: 14px; aspect-ratio: 1; background: #111214; overflow: hidden; position: relative; }
.preset-screen-media video, .preset-screen-media img, .preset-dialog-media video, .preset-dialog-media img { width: 100%; height: 100%; object-fit: contain; display: block; background: #111214; }
.preset-media-placeholder { display: grid; place-content: center; gap: 14px; height: 100%; padding: 24px; color: #c9cbd0; text-align: center; font-size: 14px; }
.preset-media-placeholder button, [data-media-retry] { min-height: 44px; padding: 9px 15px; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 6px; }
.preset-screen.is-changing .preset-screen-media { animation: preset-handoff 160ms ease-out; }
@keyframes preset-handoff { from { opacity: .8; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.preset-screen figcaption { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0 12px; }
.preset-screen figcaption > div { min-width: 0; }
#activePresetCount { font-size: 11px; color: var(--preset-muted); font-variant-numeric: tabular-nums; }
.preset-screen figcaption h3 { margin: 3px 0 0; font-size: clamp(18px, 1.8vw, 24px); line-height: 1.15; font-weight: 600; }
#activePreviewNote { font-size: 11px; color: var(--preset-muted); text-align: right; max-width: 13ch; }
.preset-player-controls { display: flex; gap: 6px; border-top: 1px solid var(--preset-rule); padding-top: 10px; }
.preset-player-controls button, .preset-preview-dialog footer button { min-width: 44px; min-height: 44px; padding: 8px 11px; border: 1px solid var(--preset-rule); border-radius: 6px; color: inherit; background: transparent; font-size: 13px; }
.preset-player-controls button:last-child { margin-left: auto; }
.preset-player-controls button:hover:not(:disabled) { background: var(--preset-ink); color: var(--preset-paper); }
.preset-index {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-content: start;
}
.preset-index-button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--preset-ink);
  text-align: left;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.preset-index-button:hover { background: rgba(128, 117, 98, .09); }
.preset-index-button[aria-current="true"] {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(0, 102, 204, .05);
}
.preset-index-number {
  color: var(--preset-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.preset-index-name { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.preset-index-button[aria-current="true"] .preset-index-name { font-weight: 600; }
html[data-upload120-theme="dark"] .preset-index-button[aria-current="true"] {
  color: var(--blue-dark);
  border-color: var(--blue-dark);
  background: rgba(41, 151, 255, .08);
}
.preset-details { padding: 48px 0; font-size: 13px; }
.preset-detail-line { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.preset-detail-line p { margin: 0; }
#topazPreviewState { color: var(--preset-muted); }
#topazPreview:empty { display: none; }
#topazPreview { flex-basis: 100%; }
#topazPreview video, #topazPreview img { display: block; width: min(100%, 320px); height: auto; aspect-ratio: 1; object-fit: contain; background: #111214; }
.preset-details details { margin-top: 20px; border-top: 1px solid var(--preset-rule); border-bottom: 1px solid var(--preset-rule); }
.preset-details summary { padding: 17px 0; cursor: pointer; font-weight: 500; }
.preset-practical { max-width: 68ch; padding: 0 0 20px; color: var(--preset-muted); line-height: 1.65; }
.preset-practical p { margin: 0 0 12px; }
.preset-practical a, .preset-creator a { color: inherit; text-underline-offset: 4px; }
.preset-creator { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding-top: 22px; }
.preset-creator span { color: var(--preset-muted); }
.preset-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 4vw, 64px); border-top: 1px solid var(--preset-rule); }
.preset-footer > div { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.preset-footer a { color: inherit; font-size: 12px; }
.preset-preview-dialog, .preset-checkout-dialog { padding: 0; border: 0; color: #f4f4f6; background: #151618; max-height: calc(100svh - 24px); overflow: auto; }
.preset-preview-dialog { width: min(94vw, calc(100svh - 110px), 900px); }
.preset-preview-dialog::backdrop, .preset-checkout-dialog::backdrop { background: rgba(8, 9, 10, .8); }
.preset-dialog-media { aspect-ratio: 1; background: #111214; }
.preset-dialog-close { position: absolute; z-index: 3; top: 10px; right: 10px; width: 44px; height: 44px; background: #151618; color: #fff; border: 1px solid #666; border-radius: 6px; font-size: 24px !important; }
.preset-preview-dialog footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; }
.preset-preview-dialog footer strong { font-size: 14px; }
.preset-preview-dialog footer > div { display: flex; gap: 6px; }
.preset-preview-dialog footer button { border-color: #62656b; }
.preset-checkout-dialog { width: min(94vw, 520px); border-radius: 10px; }
.preset-checkout-shell { padding: 32px; display: grid; gap: 20px; }
.preset-checkout-summary { padding-right: 36px; }
.preset-checkout-summary h2 { margin: 0 0 10px; font-size: 28px; }
.preset-checkout-summary strong { font-size: 24px; }
.preset-checkout-requirements { padding-block: 14px; border-block: 1px solid #55585e; }
.preset-checkout-requirements p { margin: 0; font-size: 13px; line-height: 1.7; color: #c4c6ca; }
.preset-license-consent { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: 14px; line-height: 1.6; }
.preset-license-consent input { width: 20px; height: 20px; margin: 3px 0; accent-color: var(--blue); }
.preset-license-consent a { color: #fff; text-underline-offset: 3px; }
#presetCheckoutStatus { margin: 0; color: #ffb4a7; font-size: 13px; line-height: 1.5; }
#presetCheckoutStatus:empty { display: none; }
.preset-license-main { max-width: 940px !important; padding-block: 60px !important; }
.preset-license-main header { padding-bottom: 24px; border-bottom: 1px solid var(--preset-rule); }
.preset-license-main h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.05; letter-spacing: -.03em; margin: 0; }
.preset-license-main article { max-width: 74ch; padding: 24px 0; font-size: 16px; line-height: 1.75; }
.preset-license-main article h2 { font-size: 22px; }
.preset-kicker { font-size: 13px; color: var(--preset-muted); }
.preset-thanks { min-height: 70svh; display: grid; align-content: center; gap: 24px; padding-block: 60px !important; }
.preset-thanks h1 { max-width: 15ch; font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -.03em; margin: 0; }
.preset-thanks > p { max-width: 55ch; color: var(--preset-muted); line-height: 1.6; }
.preset-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
html[data-upload120-theme="dark"] .presets-page { --preset-ink: #ecebe7; --preset-paper: #171715; --preset-surface: #22221f; --preset-rule: rgba(255, 255, 255, .18); --preset-muted: #aeb1b8; }
@media (max-width: 900px) {
  .preset-opening { padding-top: 36px; }
  .preset-gallery-layout { grid-template-columns: 1fr; gap: 32px; }
  .preset-screen-column { position: static; }
  .preset-screen { width: min(100%, 620px); margin-inline: auto; }
  .preset-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
}
@media (max-width: 620px) {
  .preset-opening { display: grid; gap: 24px; padding-bottom: 26px; }
  .preset-opening h1 { font-size: 38px; }
  .preset-offer { grid-template-columns: 1fr auto; align-items: center; justify-items: start; text-align: left; gap: 4px 16px; }
  .preset-offer .primary-pill { grid-column: 2; grid-row: 1 / span 2; min-width: 136px; margin: 0; }
  .preset-offer [data-preset-price-note] { grid-column: 1; }
  .preset-offer [data-catalog-status] { grid-column: 1 / -1; }
  .preset-price { font-size: 26px; }
  .preset-plugins { font-size: 12px; }
  .preset-gallery { padding: 12px; border-radius: 20px; }
  .preset-index { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .preset-player-controls { flex-wrap: wrap; }
  .preset-player-controls button { padding-inline: 9px; }
  .preset-checkout-shell { padding: 28px 20px; }
  .preset-preview-dialog { width: min(94vw, calc(100svh - 160px)); }
  .preset-footer { align-items: start; }
  .preset-footer > div { gap: 12px; justify-content: end; }
}
@media (prefers-reduced-motion: reduce) {
  .preset-screen-column { position: static; }
  .preset-screen.is-changing .preset-screen-media { animation: none; }
  .presets-page * { scroll-behavior: auto !important; transition: none !important; }
}

.preset-upload-link { display: inline-flex; align-items: center; gap: 12px; margin: 2px 0 22px; min-height: 40px; }
.preset-upload-link span { font-size: 17px; }
.preset-topaz { max-width: 720px; margin: 0 auto 48px; }
.preset-topaz-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.preset-topaz-heading h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.025em; font-weight: 600; }
.preset-topaz-heading > span { color: var(--preset-muted); }
.preset-comparison { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--preset-surface); cursor: col-resize; touch-action: pan-y; user-select: none; }
.preset-comparison img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.preset-comparison-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--comparison-position)); }
.preset-comparison-labels { position: absolute; inset: 16px 16px auto; display: flex; justify-content: space-between; pointer-events: none; }
.preset-comparison-labels span { padding: 6px 10px; border-radius: 6px; color: #fff; background: rgba(20, 20, 20, .78); font-size: 12px; }
.preset-comparison-divider { position: absolute; top: 0; bottom: 0; left: var(--comparison-position); width: 2px; background: #fff; pointer-events: none; }
.preset-comparison-divider span { position: absolute; top: calc(50% - 20px); left: -19px; display: grid; place-items: center; width: 40px; height: 40px; color: #242321; background: #fff; border-radius: 50%; font-size: 20px; }
.preset-comparison-control { display: grid; gap: 10px; margin-top: 18px; color: var(--preset-muted); font-size: 13px; }
.preset-comparison-control input { width: 100%; min-height: 44px; margin: 0; accent-color: var(--blue); cursor: ew-resize; }
.preset-comparison-error { color: var(--preset-muted); }
.presets-page .site-footer { margin-top: 12px; }
@media (max-width: 620px) {
  .preset-screen figcaption { padding-block: 12px; }
  .preset-topaz { margin-bottom: 32px; }
  .preset-topaz-heading { display: block; }
  .preset-topaz-heading h2 { margin-bottom: 8px; }
  .presets-page .site-footer { margin-top: 0; }
}

/* Sona button reference, adapted to the existing native checkout control. */
.presets-page .preset-buy-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 20px; min-height: 44px; border: 0; border-radius: 12px;
  background: var(--preset-ink); color: var(--preset-paper); font-size: 14px; font-weight: 500;
  box-shadow: none; white-space: nowrap; transition: transform 180ms ease-out, opacity 140ms ease;
}
.presets-page .preset-buy-button:hover:not(:disabled) { background: var(--preset-ink); opacity: .9; transform: scale(1.02); }
.presets-page .preset-buy-button:active:not(:disabled) { transform: scale(.97); }
.preset-pack-description { max-width: 49ch; margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--preset-muted); }
.preset-compatibility { margin: 0 0 18px; font-size: 13px; color: var(--preset-muted); }
.presets-page .preset-nav { display: flex; align-items: center; justify-content: space-between; padding-inline: max(24px, calc((100vw - 1192px) / 2)); }
.presets-page .preset-nav .brand { display: inline-flex !important; visibility: visible; position: static; transform: none; margin-right: auto; }
.presets-page .preset-nav .nav { position: static; transform: none; margin-inline: 24px; }
.preset-screen.is-waiting figcaption, .preset-screen.is-waiting .preset-player-controls { display: none; }
.preset-welcome { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 64px); color: #f5f1e9; }
.preset-welcome-mark { font-size: 42px; line-height: 1; margin-bottom: 28px; color: #a7bfff; animation: preset-invite 600ms cubic-bezier(.22,1,.36,1) both; }
.preset-welcome p { margin: 0; font-size: clamp(28px, 3.5vw, 48px); font-weight: 500; line-height: 1.12; letter-spacing: -.035em; }
.preset-welcome p span { display: block; animation: preset-invite 700ms cubic-bezier(.22,1,.36,1) both; }
.preset-welcome p span:last-child { color: #a5a5a2; animation-delay: 120ms; }
.preset-welcome small { margin-top: 24px; font-size: 13px; color: #b9babd; animation: preset-invite 600ms 240ms both; }
@keyframes preset-invite { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.preset-screen-media:has(.preset-topaz) { overflow: visible; background: transparent; }
.preset-screen-media .preset-topaz { width: 100%; margin: 0; max-width: none; }
.preset-screen-media .preset-topaz-heading { display: none; }
.preset-screen-media .preset-comparison { aspect-ratio: 1; border-radius: 14px; }
.preset-screen-media .preset-comparison img { background: transparent; }
@media (max-width: 620px) {
  .presets-page .preset-nav { padding-inline: 20px; gap: 12px; }
  .presets-page .preset-nav .nav { margin: 0; }
  .presets-page .preset-nav .nav-item[href*="tiktok.com"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .preset-welcome *, .preset-welcome { animation: none !important; }
  .presets-page .preset-buy-button:hover:not(:disabled), .presets-page .preset-buy-button:active:not(:disabled) { transform: none; }
}
html[data-upload120-theme] .presets-page .preset-offer .preset-buy-button { background: var(--preset-ink); color: var(--preset-paper); }
.preset-screen.is-topaz #presetPlay, .preset-screen.is-topaz #presetReplay { display: none; }
.preset-screen.is-topaz #presetNext { margin-left: auto; }
.preset-topaz-dialog { padding: 20px; width: min(94vw, 900px, calc(90svh + 100px)); max-height: 94svh; border: 1px solid var(--preset-rule); border-radius: 16px; color: var(--preset-ink); background: var(--preset-surface); overflow: hidden; }
.preset-topaz-dialog::backdrop { background: rgba(8, 9, 10, .8); }
.preset-topaz-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.preset-topaz-dialog h2 { margin: 0; font-size: 20px; }
.preset-topaz-dialog button { border: 1px solid var(--preset-rule); border-radius: 8px; min-width: 44px; min-height: 44px; padding: 8px 12px; background: transparent; color: inherit; }
.preset-topaz-zoom-controls { display: flex; align-items: center; gap: 10px; padding-block: 12px; }
#topazZoomLevel { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
#topazZoomReset { margin-left: auto; }
.preset-topaz-viewport { height: min(68svh, 750px); overflow: auto; overscroll-behavior: contain; border-radius: 10px; background: var(--preset-paper); }
.preset-topaz-viewport .preset-comparison { min-width: 100%; max-width: none; border-radius: 0; }
@media (max-width: 620px) { .preset-topaz-dialog { padding: 12px; } .preset-topaz-viewport { height: min(60svh, 90vw); } }
.preset-topaz-viewport { width: min(100%, 68svh, 750px); height: auto; aspect-ratio: 1; margin-inline: auto; contain: size; }
@media (max-width: 620px) { .preset-topaz-viewport { width: min(100%, 60svh); height: auto; } }
.preset-topaz-viewport .preset-comparison { touch-action: pan-x pan-y; }
