/* Shared sample viewer: the source is maintained with the sample collection. */
.sample-preview {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  padding: 0;
  margin: auto;
  width: min(1440px, calc(100vw - 48px));
  height: min(1000px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  border: 1px solid #38424e;
  border-radius: 18px;
  background: #10171f;
  color: #edf1f5;
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow: hidden;
  box-shadow: 0 30px 100px #0009;
}
.sample-preview[open] {
  display: flex;
  flex-direction: column;
}
.sample-preview::backdrop {
  background: #060b12dc;
  backdrop-filter: blur(10px);
}
.sample-preview * {
  box-sizing: border-box;
}
.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid #303944;
  flex-shrink: 0;
}
.preview-top p {
  margin: 0 0 3px;
  color: #bce394;
  font: 10px/1.5 monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.preview-top h2 {
  margin: 0;
  font:
    500 22px/1.2 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.5px;
  color: #fff;
}
.preview-close {
  font: inherit;
  cursor: pointer;
  padding: 9px 16px;
  border: 1px solid #576372;
  border-radius: 8px;
  background: #222d39;
  color: #fff;
  min-height: 44px;
}
.preview-stage {
  min-height: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: radial-gradient(ellipse at 50% 30%, #2d3943, #151e29);
  overflow: hidden;
}
.preview-device {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #fff;
  overflow: hidden;
  border: 1px solid #485560;
  border-radius: 8px;
  box-shadow: 0 12px 40px #0006;
}
.preview-device iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.sample-preview[data-platform="mobile"] .preview-device {
  width: min(390px, 100%);
  border: 7px solid #0a0e13;
  border-radius: 30px;
  box-shadow:
    0 0 0 1px #56616b,
    0 18px 50px #0007;
}
.preview-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 14px 24px;
  flex-shrink: 0;
  border-top: 1px solid #303944;
}
.preview-bottom p {
  max-width: 700px;
  margin: 0;
  color: #abb9c8;
  font-size: 12px;
}
.preview-actions {
  display: flex;
  gap: 20px;
  white-space: nowrap;
}
.preview-actions a {
  color: #d5edb5;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.preview-close:focus-visible,
.preview-actions a:focus-visible {
  outline: 3px solid #bee595;
  outline-offset: 4px;
}
a[data-preview-image] {
  position: relative;
  cursor: zoom-in;
}
a[data-preview-image]::after {
  content: "↗  Open interactive preview";
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 1px solid #ffffff45;
  border-radius: 30px;
  background: #101923ee;
  color: #fff;
  font:
    12px/1.4 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  white-space: nowrap;
  box-shadow: 0 3px 12px #0004;
}
a[data-preview-image]:hover::after {
  background: #e0edcb;
  color: #14211b;
}
a[data-preview-image]:focus-visible {
  outline: 3px solid #bee595;
  outline-offset: -4px;
}
@media (max-width: 700px) {
  .sample-preview {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .preview-top {
    padding: 12px 16px;
    gap: 10px;
  }
  .preview-top h2 {
    font-size: 18px;
  }
  .preview-stage {
    padding: 10px;
  }
  .preview-bottom {
    padding: 10px 16px;
    display: block;
  }
  .preview-bottom p {
    font-size: 10px;
  }
  .preview-actions {
    margin-top: 8px;
    justify-content: space-between;
  }
  .sample-preview[data-platform="mobile"] .preview-device {
    border-width: 3px;
    border-radius: 18px;
  }
  .preview-close {
    padding: 8px 12px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .sample-preview[open] {
    animation: preview-in 0.18s ease-out;
  }
  @keyframes preview-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
