/* Amber light and glass, with motion limited to transform and opacity. */
body { background: #090a0c; isolation: isolate; }
.ambient-lights { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.light-orb { position: absolute; width: 864px; height: 864px; border-radius: 50%; background: radial-gradient(circle,rgba(255,204,0,.19) 0%,rgba(255,177,12,.08) 30%,rgba(255,187,12,.025) 49%,transparent 70%); }
.orb-one { left: 8%; top: -410px; animation: float-light-one 14s -3s ease-in-out infinite alternate; }
.orb-two { width: 1008px; height: 1008px; right: -390px; top: 8%; opacity: .7; animation: float-light-two 18s -7s ease-in-out infinite alternate; }
.orb-three { width: 768px; height: 768px; left: -330px; bottom: -260px; opacity: .55; animation: float-light-one 17s -9s ease-in-out infinite alternate-reverse; }
.orb-center { left: calc(50% - 432px); top: calc(50% - 432px); opacity: .65; animation: float-light-center 16s -4s ease-in-out infinite alternate; }
@keyframes float-light-center { from { transform: translate3d(-70px,45px,0); } to { transform: translate3d(80px,-55px,0); } }
@keyframes float-light-one { from { transform: translate3d(-55px,-30px,0) scale(.96); } to { transform: translate3d(130px,95px,0) scale(1.12); } }
@keyframes float-light-two { from { transform: translate3d(45px,-70px,0); } to { transform: translate3d(-130px,100px,0); } }
.site-header { background: rgba(10,11,13,.38); backdrop-filter: blur(18px); }
.glass { background: linear-gradient(145deg,rgba(255,255,255,.065),rgba(255,255,255,.012)),rgba(22,23,25,.4); border-color: rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.08),0 8px 30px rgba(0,0,0,.1); backdrop-filter: blur(24px) saturate(130%); }
.effect-card { background: linear-gradient(145deg,rgba(255,255,255,.04),transparent),rgba(17,19,21,.66); backdrop-filter: blur(16px); }
.gallery-section { margin-top: 28px; }

/* Restore the original flat yellow while keeping current controls and interactions. */
.copy-full, .toolbar .collection-button, .copy-icon, .close-dialog {
  transition: transform .3s cubic-bezier(.2,.85,.25,1.2);
}
.copy-full, .toolbar .collection-button.is-active {
  border: 0;
  background: #ffd400;
  color: #211600;
  box-shadow: none;
}
.copy-full { border-radius: 16px; }
@media (hover:hover) {
  .copy-full:hover { transform: translateY(-2px); filter: brightness(1.04); }
  .toolbar .collection-button:hover { transform: translateY(-1px); }
  .copy-icon:hover, .close-dialog:hover { transform: translateY(-2px); }
}
.copy-full:active, .toolbar .collection-button:active, .copy-icon:active, .close-dialog:active { transform: translateY(1px) scale(.96); }
.copy-icon { border: 1px solid rgba(255,177,29,.38); background: rgba(255,178,13,.05); color: #ffd400; box-shadow: none; }
.copy-icon:hover { background: rgba(255,178,13,.12); }
.copy-icon[data-copied="true"] .icon { animation: copy-confirm .35s cubic-bezier(.2,.9,.25,1.3); }
@keyframes copy-confirm { from { transform: scale(.65); opacity: .2; } to { transform: scale(1); opacity: 1; } }
.toolbar .collection-button { font-weight: 600; }
.toolbar .collection-button.is-active .collection-count { background: rgba(75,42,0,.11); color: #462b05; }
.close-dialog { background: linear-gradient(145deg,rgba(255,255,255,.1),transparent),rgba(23,25,27,.9); border-color: rgba(255,255,255,.22); }
.related-grid:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* The entire detail sheet scrolls; recommendations live below both columns. */
dialog {
  width: calc(100vw - 40px); max-width: 1680px;
  height: calc(100dvh - 40px); max-height: calc(100dvh - 40px);
  border-radius: 24px; border-color: rgba(255,218,102,.25);
  background: radial-gradient(ellipse at 100% 0,rgba(255,190,15,.055),transparent 40%),rgba(14,16,18,.96);
}
dialog::backdrop { background: rgba(3,4,5,.77); backdrop-filter: blur(10px); }
.detail-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 24px; scrollbar-width: thin; scrollbar-color: #5b5238 transparent; }
.detail-layout { display: grid; grid-template-columns: minmax(0,2.15fr) minmax(340px,1fr); gap: 24px; height: auto; overflow: visible; padding: 0; }
.image-panel { position: relative; overflow: hidden; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); padding: 0; }
.viewer-stage { position: relative; min-height: 460px; width: 100%; aspect-ratio: auto; }
.detail-art, .detail-art.is-single { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.detail-art .catalog-image { object-fit: contain; }
.image-caption { position: static; height: 40px; padding: 0 18px; border: 0; border-radius: 0; background: transparent; font-size: 11px; color: #a3a4ac; }
.prompt-panel { position: static; overflow: visible; padding: 24px; border: 1px solid rgba(255,255,255,.11); border-radius: 16px; background: linear-gradient(150deg,rgba(255,255,255,.035),transparent),rgba(27,28,29,.52); }
.breadcrumb { margin-bottom: 14px; }
.prompt-panel h2 { font-size: 26px; margin-bottom: 12px; overflow-wrap: anywhere; }
.detail-tags .tag { padding: 6px 10px; font-size: 10px; }
.effect-description { font-size: 12px; line-height: 1.75; margin: 14px 0 18px; }
.prompt-box { height: 200px; background: rgba(7,8,9,.56); border-color: rgba(255,255,255,.14); }
.copy-full { min-height: 52px; margin-top: 16px; }
.prompt-hint { margin: 10px 0 18px; }
.how-to { padding-top: 14px; }
.source-link { margin-top: 12px; }
.close-dialog { top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; }
.related-section { margin-top: 28px; }
.related-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.related-heading h3 { margin: 0; font-weight: 600; font-size: 17px; letter-spacing: -.3px; }
.related-heading > span { color: #96979e; font-size: 11px; }
.related-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px,calc((100% - 60px)/4)); align-items: start; gap: 20px; overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x proximity; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #645525 transparent; }
.related-grid .effect-card { scroll-snap-align: start; }
.related-grid .card-footer { display: grid; grid-template-columns: minmax(0,1fr) 40px; grid-template-rows: 22px 18px; min-height: 76px; gap: 4px 8px; padding: 12px; }
.related-grid .card-name { grid-column: 1; grid-row: 1; margin: 0; padding: 2px 0; font-size: 13px; }
.related-grid .card-tags { grid-column: 1; grid-row: 2; }
.related-grid .card-tags .tag { padding: 4px 6px; font-size: 8px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.related-grid .copy-icon { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; }
@media (min-width:1800px) { .related-grid { grid-auto-columns: calc((100% - 100px)/6); } }
@media (min-width:701px) and (max-width:1000px) {
  dialog { width: calc(100vw - 24px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); }
  .detail-scroll { padding: 16px; }
  .detail-layout { grid-template-columns: minmax(0,1.2fr) minmax(300px,1fr); gap: 16px; }
  .prompt-panel { padding: 24px 18px 18px; }
  .viewer-stage { min-height: 420px; }
  .related-grid { grid-auto-columns: 230px; gap: 14px; }
}
@media (max-width:700px) {
  .light-orb { width: 624px; height: 624px; }
  .orb-one { left: -140px; top: -240px; }
  .orb-two { right: -330px; top: 28%; }
  .orb-three { left: -330px; bottom: -140px; }
  .orb-center { left: calc(50% - 312px); top: calc(50% - 312px); opacity: .5; }
  .gallery-section { margin-top: 22px; }
  dialog { inset: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; margin: 0; }
  .mobile-detail-header { background: rgba(20,21,23,.9); }
  .detail-scroll {
    height: calc(100% - 58px - env(safe-area-inset-top,0px));
    padding: 0 0 calc(140px + env(safe-area-inset-bottom,0px));
    scroll-padding-bottom: calc(140px + env(safe-area-inset-bottom,0px));
  }
  .detail-layout { display: block; height: auto; overflow: visible; padding: 0; }
  .image-panel { border: 0; border-radius: 0; }
  .viewer-stage { flex: none; min-height: 0; height: auto; aspect-ratio: 16/9; }
  .detail-art, .detail-art.is-single { width: 100%; height: 100%; margin: 0; }
  .image-caption { display: none; }
  .prompt-panel { padding: 22px 18px; border: 0; border-radius: 0; background: transparent; }
  .prompt-panel h2 { margin: 0; font-size: 25px; }
  .effect-description { margin: 18px 0 24px; font-size: 12px; }
  .prompt-box { height: clamp(170px,24dvh,220px); background: rgba(17,19,22,.9); }
  .copy-dock { background: rgba(21,22,23,.9); box-shadow: inset 0 1px 0 rgba(255,220,100,.08),0 -12px 40px rgba(0,0,0,.35); }
  .copy-dock .copy-full { border-radius: 16px; }
  .close-dialog { top: calc(8px + env(safe-area-inset-top,0px)); right: 12px; width: 42px; height: 42px; }
  .related-section { margin: 8px 0 0; padding: 0 18px; }
  .related-heading { margin-bottom: 12px; }
  .related-heading h3 { font-size: 16px; }
  .related-grid { grid-auto-columns: 190px; gap: 12px; margin-right: -18px; padding-right: 18px; padding-bottom: 16px; }
  .related-grid .card-footer { min-height: 70px; padding: 9px; }
}
@media (max-width:700px) and (orientation:landscape) {
  .viewer-stage { height: 42dvh; aspect-ratio: auto; }
  .detail-art, .detail-art.is-single { width: min(100%,74.667dvh); margin-inline: auto; }
}
@media (prefers-reduced-motion:reduce) {
  .light-orb, .copy-full::after, .collection-button::after, .copy-icon .icon { animation: none; }
  .copy-full:hover, .copy-icon:hover, .collection-button:hover, .close-dialog:hover { transform: none; }
}
@media (prefers-reduced-transparency:reduce) {
  .ambient-lights { display: none; }
  .glass, .effect-card, .prompt-panel, .copy-dock { background: #17191b; backdrop-filter: none; }
}

/* Image-only cards: reveal actions with a pointer or keyboard focus. */
.effect-card {
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 16px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}
.effect-card:hover { box-shadow: none; }
.effect-card .preview-button { border-radius: inherit; }
.effect-card .preview-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: rgba(0,0,0,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.effect-card .preview-button:hover .effect-art { transform: none; }
.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .25s cubic-bezier(.2,.85,.25,1.1);
}
.card-actions .icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  backdrop-filter: blur(12px);
}
.card-actions .view-icon {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(20,21,22,.64);
  color: #f7f7f7;
  transition: transform .25s ease;
}
.card-actions .copy-icon {
  background: rgba(20,21,22,.72);
  color: #ffd400;
}
.card-actions .icon { width: 21px; height: 21px; }
.card-actions .copy-icon::before { display: none; }
.effect-card:focus-within .card-actions {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.effect-card:focus-within .preview-button::after { opacity: 1; }
@media (hover:hover) {
  .effect-card:hover .card-actions { opacity: 1; transform: none; pointer-events: auto; }
  .effect-card:hover .preview-button::after { opacity: 1; }
  .card-actions .view-icon:hover { background: rgba(45,46,47,.85); transform: translateY(-2px); }
}
/* Touch users can open the image directly; copying remains immediately available. */
@media (hover:none) {
  .card-actions { opacity: 1; transform: none; pointer-events: auto; }
  .card-actions .view-icon { display: none; }
  .effect-card:focus-within .preview-button::after { opacity: 0; }
}
@media (max-width:700px) {
  .effect-card { border-radius: 12px; }
  .card-actions { top: 7px; right: 7px; }
}
@media (prefers-reduced-transparency:reduce) {
  .card-actions .icon-button { backdrop-filter: none; background: #242424; }
}
.skeleton { aspect-ratio: 16/9; }

/* Natural-ratio masonry. One-pixel tracks reserve measured heights without cropping images. */
.gallery-grid {
  --gallery-gap: 20px;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-auto-rows: 1px;
  column-gap: var(--gallery-gap);
  row-gap: 0;
  align-items: start;
}
.gallery-grid > .effect-card { align-self: start; margin-bottom: var(--gallery-gap); }
.preview-button .effect-art { aspect-ratio: var(--image-ratio,1.7777778); }
.preview-button .catalog-image { object-fit: contain; }
.gallery-grid > .skeleton { grid-row: span 240; margin-bottom: var(--gallery-gap); }
.related-grid { display: flex; gap: 20px; align-items: flex-start; }
.related-grid > .effect-card {
  --related-height: 180px;
  flex: 0 0 calc(var(--image-ratio,1.7777778) * var(--related-height));
  width: calc(var(--image-ratio,1.7777778) * var(--related-height));
}
@media (min-width:701px) and (max-width:1099px) {
  .gallery-grid { --gallery-gap: 16px; grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width:700px) {
  .gallery-grid { --gallery-gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .related-grid { gap: 12px; }
  .related-grid > .effect-card { --related-height: 140px; }
}

/* Center the full image with equal padding; keep Close beyond the detail frame. */
dialog {
  width: calc(100vw - 128px);
  max-width: 1680px;
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  overflow: visible;
}
.detail-scroll { border-radius: inherit; }
.detail-layout { align-items: stretch; height: clamp(440px,64dvh,720px); }
.image-panel { min-height: 0; padding: 18px; }
.image-panel .viewer-stage { flex: 1; min-height: 0; height: auto; aspect-ratio: auto; }
.detail-art .catalog-image { object-fit: contain; object-position: center; }
.prompt-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 28px; }
.prompt-panel h2 { margin: 0 0 24px; padding: 0; }
.prompt-heading { flex-shrink: 0; }
.prompt-box { flex: 1 1 0; height: auto; min-height: 0; overflow: auto; }
.copy-dock { flex-shrink: 0; }
.close-dialog { left: calc(100% + 12px); right: auto; top: 0; width: 40px; height: 40px; }
.page-shell { padding-bottom: 24px; }
@media (min-width:701px) and (max-width:1000px) {
  dialog { width: calc(100vw - 112px); }
  .detail-layout { grid-template-columns: minmax(0,1.2fr) minmax(280px,1fr); }
  .image-panel { padding: 14px; }
  .prompt-panel { padding: 24px 18px; }
}
@media (max-width:700px) {
  dialog { inset: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; overflow: hidden; }
  .detail-scroll { padding-bottom: calc(104px + env(safe-area-inset-bottom,0px)); scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom,0px)); }
  .image-panel { min-height: 0; padding: 12px; }
  .image-panel .viewer-stage { flex: none; width: 100%; height: auto; aspect-ratio: 16/9; }
  .detail-art, .detail-art.is-single { width: 100%; height: 100%; margin: 0; }
  .detail-layout { height: auto; }
  .prompt-panel { padding: 22px 18px; overflow: visible; }
  .prompt-panel h2 { margin-bottom: 24px; }
  .prompt-box { flex: none; min-height: 0; height: clamp(220px,35dvh,340px); }
  .copy-dock { gap: 0; }
  .close-dialog { left: auto; right: 12px; top: calc(8px + env(safe-area-inset-top,0px)); width: 42px; height: 42px; }
  .dialog-toast { bottom: calc(100px + env(safe-area-inset-bottom,0px)); }
}
@media (max-width:700px) and (orientation:landscape) {
  .image-panel .viewer-stage { height: 42dvh; aspect-ratio: auto; }
}

/* Copy and links sit in the page flow immediately below the prompt. */
.copy-dock {
  position: static; inset: auto; z-index: auto;
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  align-items: center; gap: 12px; margin-top: 16px; padding: 0;
  border: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
.copy-dock .copy-full { position: static; width: 100%; min-width: 0; min-height: 52px; margin: 0; gap: 8px; font-size: 14px; }
.copy-dock .copy-full .icon { width: 20px; height: 20px; }
.ai-tools { display: flex; gap: 6px; }
.ai-link {
  position: relative; display: grid; place-items: center; flex: 0 0 44px;
  width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px; background: rgba(255,255,255,.035); transition: transform .2s ease;
}
.ai-link img { display: block; width: 24px; height: 24px; object-fit: contain; }
.ai-chatgpt img { filter: invert(1); }
.ai-link .external-arrow { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; padding: 1px; border-radius: 3px; color: #dedee2; background: #252628; }
@media (hover:hover) { .ai-link:hover { transform: translateY(-2px); border-color: rgba(255,212,0,.65); background: rgba(255,212,0,.06); } }
.ai-link:active { transform: scale(.95); }

/* Both related rows share one horizontal scroll position. */
.related-grid { display: block; margin: 0; padding: 2px 2px 14px; }
.related-row { display: flex; align-items: flex-start; gap: 16px; width: max-content; }
.related-row + .related-row { margin-top: 16px; }
.related-row > .effect-card { --related-height: 180px; flex: 0 0 calc(var(--image-ratio,1.7777778) * var(--related-height)); width: calc(var(--image-ratio,1.7777778) * var(--related-height)); }
.related-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
.related-more { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 10px 16px; border-radius: 10px; background: #ffd400; color: #211600; font-size: 13px; font-weight: 600; transition: transform .2s ease; }
.related-more .icon { width: 16px; height: 16px; }
@media (hover:hover) { .related-more:hover { transform: translateY(-1px); } }
.related-more:active { transform: scale(.97); }
@media (min-width:701px) and (max-width:1099px) {
  .copy-dock { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .ai-tools { justify-content: flex-end; }
}
@media (max-width:700px) {
  .detail-scroll { padding-bottom: calc(24px + env(safe-area-inset-bottom,0px)); scroll-padding-bottom: 20px; }
  .image-panel .viewer-stage { height: clamp(210px,34dvh,300px); aspect-ratio: auto; }
  .prompt-panel { padding: 20px 18px 24px; }
  .prompt-panel h2 { margin-bottom: 20px; font-size: 23px; }
  .copy-dock { grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin-top: 14px; }
  .copy-dock .copy-full { height: 36.4px; min-height: 36.4px; font-size: 13px; gap: 8px; border-radius: 11px; }
  .copy-dock .copy-full .icon { width: 16.8px; height: 16.8px; }
  .card-actions { align-items: center; }
  .card-actions .copy-icon { width: 28px; height: 28px; }
  .card-actions .copy-icon .icon { width: 14.7px; height: 14.7px; }
  .ai-link { flex-basis: 36.4px; width: 36.4px; height: 36.4px; border-radius: 10px; }
  .ai-link img { width: 20px; height: 20px; }
  .ai-link .external-arrow { top: 3px; right: 3px; width: 8px; height: 8px; }
  .related-section { margin-top: 0; }
  .related-grid { margin-right: -18px; padding-right: 18px; }
  .related-row { gap: 10px; }
  .related-row + .related-row { margin-top: 10px; }
  .related-row > .effect-card { --related-height: 132px; }
  .related-more { min-height: 36px; padding: 8px 13px; font-size: 12px; }
  .dialog-toast { bottom: calc(16px + env(safe-area-inset-bottom,0px)); }
}
@media (max-width:700px) and (orientation:landscape) { .image-panel .viewer-stage { height: 42dvh; } }
@media (prefers-reduced-motion:reduce) { .ai-link:hover, .ai-link:active, .related-more:hover, .related-more:active { transform: none; } }

/* A soft reflected light follows the selected flat-yellow tab. */
.filters { position: relative; z-index: 3; }
.toolbar { position: relative; isolation: isolate; }
.toolbar > .search-field, .toolbar > .collection-tabs { position: relative; z-index: 1; }
.toolbar > .sort-field { position: relative; z-index: 5; }
.collection-glow {
  position: absolute; z-index: 0; height: 13px; transform: translateX(-50%);
  border-radius: 50%; background: rgba(255,205,0,.48); filter: blur(12px);
  opacity: 0; pointer-events: none;
}
.toolbar .collection-button.is-active { background: #ffd400; box-shadow: 0 4px 14px rgba(255,212,0,.18); }

/* A custom listbox replaces the operating-system select menu. */
.sort-field { border-radius: 16px; }
.sort-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; height: 100%; padding: 0 18px; border-radius: inherit;
  background: transparent; color: #eeeef1; font-size: 13px;
}
.sort-trigger .sort-chevron { width: 16px; height: 16px; color: #b5b6bd; transition: transform .2s ease; }
.sort-trigger[aria-expanded="true"] .sort-chevron { transform: rotate(180deg); }
.sort-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 20;
  width: 208px; padding: 7px; border: 1px solid rgba(255,231,148,.22); border-radius: 16px;
  background: linear-gradient(145deg,rgba(255,255,255,.075),transparent),rgba(19,21,24,.94);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12),0 18px 50px rgba(0,0,0,.5);
}
.sort-option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid transparent;
  border-radius: 10px; background: transparent; color: #c9cbd2; text-align: left; font-size: 13px;
}
.sort-option .icon { width: 16px; height: 16px; opacity: 0; }
.sort-option[aria-selected="true"] { border-color: rgba(255,212,0,.2); background: rgba(255,212,0,.1); color: #ffe27d; }
.sort-option[aria-selected="true"] .icon { opacity: 1; }
.sort-option:hover { background: rgba(255,255,255,.075); color: #f4f4f5; }
.sort-option:focus-visible { outline-offset: -2px; }

/* Tinted glass surfaces with a polished top edge and a lit lower rim. */
.ai-link, .related-arrow {
  --glass-rgb: 255,211,69;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.32);
  background: radial-gradient(ellipse at 50% 120%,rgba(var(--glass-rgb),.23),transparent 68%),
    linear-gradient(150deg,rgba(255,255,255,.13),rgba(255,255,255,.015) 47%),rgba(19,21,24,.76);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5),inset 0 -2px 5px rgba(var(--glass-rgb),.22),0 6px 18px rgba(0,0,0,.3);
  backdrop-filter: blur(18px) saturate(140%);
}
.ai-gemini { --glass-rgb: 137,157,255; }
.ai-chatgpt { --glass-rgb: 143,220,179; }
.ai-flow { --glass-rgb: 255,211,69; }
.ai-link::before, .related-arrow::before {
  content: ""; position: absolute; inset: 1px; border-radius: inherit;
  background: linear-gradient(155deg,rgba(255,255,255,.14),transparent 35%); pointer-events: none;
}
.ai-link::after, .related-arrow::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px;
  border-radius: 50%; background: rgba(var(--glass-rgb),.8); filter: blur(3px); opacity: .7;
  pointer-events: none; transition: opacity .2s ease;
}
.ai-link img { position: relative; z-index: 1; }
.ai-link .external-arrow { z-index: 2; background: rgba(25,28,33,.8); }
@media (hover:hover) {
  .ai-link:hover { border-color: rgba(var(--glass-rgb),.65); background: radial-gradient(ellipse at 50% 110%,rgba(var(--glass-rgb),.3),transparent 70%),rgba(27,30,35,.85); }
  .ai-link:hover::after, .related-arrow:hover::after { opacity: 1; }
}

/* Navigate both related rows with arrows, with the scrollbar hidden. */
.related-viewport { position: relative; }
.related-grid { margin: 0; padding: 2px 0; scrollbar-width: none; -ms-overflow-style: none; }
.related-grid::-webkit-scrollbar { display: none; width: 0; height: 0; }
.related-arrow {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border-radius: 50%; color: #fff;
  transition: transform .2s ease, opacity .2s ease;
}
.related-arrow .icon { position: relative; z-index: 1; width: 23px; height: 23px; }
.related-previous { left: 8px; }
.related-next { right: 8px; }
.related-arrow:disabled { opacity: .25; cursor: default; }
@media (hover:hover) { .related-arrow:not(:disabled):hover { transform: translateY(-50%) scale(1.06); } }
.related-arrow:not(:disabled):active { transform: translateY(-50%) scale(.94); }
@media (max-width:700px) {
  .sort-trigger { justify-content: center; padding: 0; }
  #sort-label, .sort-trigger .sort-chevron { display: none; }
  .sort-trigger .mobile-sort-icon { display: block; position: static; width: 21px; height: 21px; }
  .sort-menu { width: 200px; }
  .related-viewport { margin-right: -18px; }
  .related-grid { margin-right: 0; }
  .related-arrow { width: 38px; height: 38px; }
  .related-arrow .icon { width: 20px; height: 20px; }
  .collection-glow { height: 10px; filter: blur(10px); }
}
@media (prefers-reduced-motion:reduce) {
  .related-arrow:not(:disabled):hover, .related-arrow:not(:disabled):active { transform: translateY(-50%); }
}
@media (prefers-reduced-transparency:reduce) {
  .collection-glow { display: none; }
  .ai-link, .related-arrow, .sort-menu { backdrop-filter: none; background: #202226; }
}
