/* Shared rules: the containing panel, rather than the window, owns its layout. */
.intro-style-editor,
.space-sharing,
[data-photo-region] {
  container-type: inline-size;
  min-width: 0;
}
.intro-style-editor {
  margin-block: 20px;
  border-block: 1px solid var(--line);
  padding-block: 12px;
}
.intro-style-editor summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 10px;
}
.text-style-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-block: 16px;
}
.text-style-fields label {
  min-width: 0;
}
.text-style-fields input,
.text-style-fields select,
.space-copy-row input,
.space-copy-row textarea,
.legacy-code-form input,
.photo-card-controls select,
.auth-card input {
  min-width: 0;
  max-width: 100%;
  font-size: max(16px, 1rem);
}
.text-style-fields button,
.space-sharing button,
.photo-manager button {
  white-space: normal;
  overflow-wrap: anywhere;
  min-height: 44px;
}
.wedding-intro {
  background: var(--paper, #f8f5ee);
  container-type: inline-size;
  min-width: 0;
}
.wedding-intro p,
.draft-preview .wedding-intro p {
  font-size: var(--block-small-size, var(--block-small-auto, 28px));
  overflow-wrap: anywhere;
}
@container (min-width: 600px) {
  .text-style-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wedding-intro p,
  .draft-preview .wedding-intro p {
    font-size: var(--block-size, 32px);
  }
}
.photo-sequence {
  container: photo-sequence / inline-size;
  grid-column: 1/-1;
  width: 100%;
  min-width: 0;
}
.photo-sequence .photo-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 20px auto;
}
.photo-sequence .photo-thumbnails a {
  flex: 0 1 calc((100% - 12px) / 2);
  width: calc((100% - 12px) / 2);
  max-width: 160px;
  min-width: 0;
}
@container photo-sequence (min-width: 480px) {
  .photo-sequence .photo-thumbnails a {
    flex-basis: calc((100% - 24px) / 3);
    width: calc((100% - 24px) / 3);
  }
}
@container photo-sequence (min-width: 900px) {
  .photo-sequence .photo-thumbnails a {
    flex-basis: calc((100% - 36px) / 4);
    width: calc((100% - 36px) / 4);
  }
}
.photo-feature {
  margin: 20px auto;
}
.photo-medium {
  width: 85%;
}
.photo-large {
  width: 100%;
}
.photo-feature a {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.photo-feature img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 650px;
  object-fit: contain;
  aspect-ratio: auto;
}
.photo-medium img {
  max-height: 550px;
}
.photo-manager-card,
.photo-card-controls,
.space-copy-box {
  min-width: 0;
}
.photo-card-controls form,
.photo-card-controls label {
  min-width: 0;
}
.photo-card-controls button {
  max-width: 100%;
}
.sharing-intro {
  position: relative;
  padding-right: 64px;
}
.partner-prompt-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 28px;
  padding: 0;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.space-copy-box {
  margin-block: 24px;
}
.space-copy-box > label {
  display: block;
  margin-bottom: 8px;
}
.space-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.space-copy-row input,
.space-copy-row textarea {
  width: 100%;
}
.space-copy-row textarea {
  overflow-wrap: anywhere;
}
@container (min-width: 600px) {
  .space-copy-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
}
.photo-local-status {
  margin-block: 16px;
  overflow-wrap: anywhere;
}
.phone-frame {
  box-sizing: border-box;
  width: min(390px, 100%);
  height: min(780px, 80dvh);
}
.phone-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.phone-preview-top,
.phone-preview-actions {
  min-width: 0;
}
.phone-preview-top h1 {
  overflow-wrap: anywhere;
}
.photo-viewer {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.photo-viewer > img {
  max-height: calc(100dvh - 180px);
  object-fit: contain;
}
.photo-viewer-controls {
  flex-wrap: wrap;
}
@media (max-width: 599px) {
  .photo-manager-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .photo-card-actions {
    flex-direction: column;
  }
  .sharing-intro {
    padding-right: 56px;
  }
  .phone-preview-page {
    padding-inline: 12px;
  }
}
@media (max-height: 480px) {
  .photo-viewer > img {
    max-height: 55dvh;
  }
}
.intro-style-editor :focus-visible,
.space-sharing :focus-visible,
.partner-prompt-close:focus-visible {
  outline-offset: 3px;
}
