#studio-dialog {
  width: min(1260px, 96vw);
  max-width: 1260px;
  max-height: 94dvh;
  padding: 0;
  border: 1px solid #f9ebff;
  border-radius: 26px;
  background: #fffbff;
  color: #44205f;
  overflow: auto;
  box-shadow: 0 25px 100px #25103570;
  font-family: system-ui, sans-serif;
}
#studio-dialog::backdrop {
  background: #241136aa;
  backdrop-filter: blur(7px);
}
.studio-shell {
  padding: 26px;
}
.studio-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.studio-top h2 {
  font-family: Georgia, serif;
  font-size: clamp(25px, 3vw, 36px);
  margin: 6px 0 0;
  line-height: 1.15;
}
.studio-eyebrow {
  font-size: 11px !important;
  color: #a3287f;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
}
#studio-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #eee3f8;
  color: #5f247e;
  font-size: 29px;
  flex: none;
}
#studio-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0 13px;
}
#studio-switcher a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #d9c7e6;
  border-radius: 20px;
  color: #5e327c;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  background: #fff;
}
#studio-switcher a:hover {
  background: #f2e7fb;
}
#studio-description {
  font-size: 14px;
  line-height: 1.6;
  max-width: 900px;
  color: #715b80;
  margin: 0 0 10px;
}
.studio-privacy {
  font-size: 11px !important;
  color: #6d527b;
  padding: 10px 0 17px;
  margin: 0 !important;
  border-bottom: 1px solid #eadff0;
}
.studio-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.2fr);
  gap: 28px;
  padding-top: 23px;
}
.studio-settings {
  min-width: 0;
}
.studio-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 650;
  color: #4e2d66;
}
.studio-field small,
.studio-help,
.studio-drop small {
  font:
    12px/1.5 system-ui,
    sans-serif;
  color: #766183;
  font-weight: 400;
}
.studio-field input:not([type="checkbox"]):not([type="range"]),
.studio-field textarea,
.studio-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  border: 1px solid #cbb5db;
  border-radius: 11px;
  background: #fff;
  color: #45285c;
  font:
    14px/1.5 system-ui,
    sans-serif;
  min-height: 44px;
}
.studio-field textarea {
  resize: vertical;
}
.studio-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  min-height: 44px;
  margin-bottom: 6px;
}
.studio-check input {
  width: 18px;
  height: 18px;
  accent-color: #7727a9;
  flex: none;
}
.studio-drop {
  display: grid;
  gap: 14px;
  border: 2px dashed #c79ee1;
  border-radius: 18px;
  background: linear-gradient(120deg, #edf5ff, #fff0f9);
  padding: 20px;
  margin: 17px 0;
  cursor: pointer;
  font-size: 14px;
}
.studio-drop input {
  width: 100%;
  font-size: 13px;
  min-height: 44px;
}
.studio-page-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.studio-page-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid #e8dcef;
  border-radius: 14px;
  padding: 10px;
  background: white;
}
.studio-page-list img {
  width: 48px;
  height: 60px;
  object-fit: contain;
  background: #f4edf9;
  border-radius: 5px;
}
.studio-page-list li > span {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.studio-page-actions {
  grid-column: 1/-1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.studio-page-actions button,
.studio-settings button:not(#photo-download-png) {
  padding: 9px 13px;
  border: 1px solid #d7c3e5;
  border-radius: 10px;
  background: #f8f0fc;
  color: #642f85;
  font-size: 12px;
  min-height: 40px;
}
.studio-page-actions button:disabled {
  opacity: 0.4;
}
.studio-preview-pane {
  min-width: 0;
  background: #f1edf7;
  border: 1px solid #e8dfef;
  border-radius: 20px;
  padding: 16px;
  align-self: start;
}
.studio-preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.studio-preview-toolbar h3 {
  font-size: 14px;
  margin: 0;
}
.studio-preview-toolbar div {
  display: flex;
  gap: 6px;
}
.studio-preview-toolbar button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #d4c5e0;
  background: #fff;
  color: #5c347c;
  font-size: 20px;
}
.studio-preview-toolbar button:disabled {
  opacity: 0.35;
}
.studio-paper {
  min-height: 330px;
  background: #fff;
  box-shadow: 0 3px 16px #4c2b6b15;
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
#studio-preview {
  width: 100%;
  height: auto;
  display: block;
}
#studio-preview[hidden] {
  display: none;
}
#studio-empty {
  padding: 30px;
  text-align: center;
  color: #8c749c;
}
#studio-empty strong {
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.3;
}
#studio-empty p {
  font-size: 13px;
  line-height: 1.7;
  margin: 14px 0 0;
}
#studio-page-label {
  font-size: 12px;
  text-align: center;
  color: #715b80;
  margin: 14px 0 0;
}
.studio-bottom {
  padding-top: 22px;
  border-top: 1px solid #eaddf0;
  margin-top: 23px;
}
.studio-main-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.studio-main-actions button,
#photo-download-png {
  min-height: 46px;
  border: 1px solid #ba94d3;
  border-radius: 24px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 650;
  color: #682d8b;
  background: #f7edf9;
}
#studio-download {
  background: linear-gradient(#a942cb, #69239f);
  color: #fff;
  border-color: #8f42b9;
}
.studio-main-actions button:disabled,
#photo-download-png:disabled {
  opacity: 0.45;
  cursor: default;
}
#studio-status {
  font-size: 13px;
  line-height: 1.6;
  color: #654c78;
  min-height: 21px;
  margin: 0 0 15px;
  overflow-wrap: anywhere;
}
#studio-status[data-error="true"] {
  color: #a11853;
  font-weight: 600;
}
.studio-notice {
  font:
    12px/1.6 system-ui,
    sans-serif !important;
  background: #fff1de;
  border: 1px solid #f0d1a8;
  border-radius: 12px;
  padding: 13px;
  color: #765426 !important;
  margin: 0 0 20px;
}
.studio-range {
  display: flex;
  align-items: center;
  gap: 16px;
}
.studio-range input {
  flex: 1;
  min-width: 0;
  accent-color: #8a32b7;
}
.studio-range output {
  font:
    13px system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}
.studio-source-canvas {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin: 0 0 16px;
  border: 1px solid #e5d6ed;
  border-radius: 10px;
}
.studio-source-canvas[hidden] {
  display: none;
}
.studio-launch {
  display: inline-block;
  padding: 10px 0;
  min-height: 44px;
}
.creative-grid .badge {
  margin-bottom: 14px;
}
body:has(#studio-dialog[open]) {
  overflow: hidden;
}
@media (max-width: 800px) {
  .studio-shell {
    padding: 20px;
  }
  .studio-workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .studio-preview-pane {
    max-width: 590px;
    width: 100%;
    justify-self: center;
  }
  .studio-paper {
    min-height: 200px;
  }
  #studio-dialog {
    width: 96vw;
    max-height: 94dvh;
    border-radius: 20px;
  }
  #studio-switcher {
    gap: 6px;
  }
  #studio-switcher a {
    font-size: 11px;
    padding: 9px 11px;
  }
  .studio-main-actions {
    justify-content: stretch;
  }
  .studio-main-actions button {
    flex: 1;
  }
  .studio-field input:not([type="checkbox"]):not([type="range"]),
  .studio-field textarea,
  .studio-field select {
    font-size: 16px;
  }
  .studio-page-actions button {
    min-height: 44px;
  }
  .studio-top h2 {
    font-size: 27px;
  }
}
/* Keep the workspace identity, close control, and export actions within reach. */
.studio-top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fffbff;
  padding: 8px 0;
  box-shadow: 0 -20px 0 20px #fffbff;
}
.studio-bottom {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fffbff;
  padding-bottom: 4px;
  box-shadow: 0 18px 0 18px #fffbff;
}
@media (max-width: 800px) {
  .studio-top h2 {
    font-size: 24px;
  }
  .studio-bottom {
    padding-top: 12px;
  }
  #studio-status {
    margin-bottom: 9px;
  }
}
.badge[hidden] {
  display: none;
}
#studio-empty {
  color: #705581;
}
.studio-age-field {
  max-width: 480px;
  margin-top: 18px;
  margin-bottom: 0;
}
.studio-check[hidden] {
  display: none;
}
