:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    sans-serif;
  background: #fff;
  color: #1d1d1f;
}
* {
  box-sizing: border-box;
}
html,
body,
#out {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
button,
a {
  touch-action: manipulation;
}
button,
a:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 4px;
}
a {
  color: #007aff;
}
button {
  background: #f1f2f5;
  color: #007aff;
  border: 0;
  border-radius: 18px;
  padding: 9px 16px;
  font: inherit;
  cursor: pointer;
}
button:hover {
  background: #e5e9f1;
}
#splash {
  position: fixed;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  background: #fff;
  z-index: 3;
  gap: 16px;
}
#splash h1 {
  font-size: 27px;
  letter-spacing: -0.7px;
  margin: 0;
}
#splash p {
  color: #6e6e73;
  font-size: 14px;
  margin: 0;
}
.loading {
  width: 140px;
  height: 3px;
  border-radius: 4px;
  margin: 10px;
  background: linear-gradient(90deg, #e9edf5, #007aff, #e9edf5);
  background-size: 200%;
  animation: loading 1.6s linear infinite;
}
@keyframes loading {
  to {
    background-position: 200%;
  }
}
dialog {
  padding: 0;
  position: fixed;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  max-width: 1500px;
  max-height: 1100px;
  margin: auto;
  background: #fff;
  color: #1d1d1f;
  border: 1px solid #dcdce2;
  border-radius: 18px;
  box-shadow: 0 24px 100px #18243d25;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: #e4e8f0b8;
  backdrop-filter: blur(16px);
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 22px;
  border-bottom: 1px solid #e9e9ee;
}
dialog h2 {
  font-size: 17px;
  letter-spacing: -0.3px;
  margin: 0 0 5px;
}
dialog p {
  font-size: 12px;
  color: #6e6e73;
  margin: 0;
}
.dialog-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-shrink: 0;
  font-size: 13px;
}
#dialog-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}
#dialog-content:has(iframe) {
  padding: 0;
}
iframe {
  border: 0;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 250px;
  background: #fff;
}
.media-item {
  margin: 0;
  display: grid;
  gap: 12px;
}
.media-item img,
.media-item video {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: #f5f5f7;
  margin: auto;
  box-shadow: 0 8px 30px #18243d12;
}
.media-item figcaption {
  color: #6e6e73;
  font-size: 13px;
}
.no-script {
  position: fixed;
  inset: 0;
  z-index: 5;
  padding: 40px;
  background: #fff;
}
@media (max-width: 600px) {
  dialog {
    inset: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border-radius: 12px;
  }
  dialog header {
    padding: 12px;
    align-items: flex-start;
    gap: 8px;
  }
  .dialog-actions {
    gap: 10px;
    flex-direction: column;
    font-size: 11px;
  }
  dialog p {
    max-width: 190px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading {
    animation: none;
  }
  dialog::backdrop {
    backdrop-filter: none;
  }
}
