@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

* {
  box-sizing: border-box;
}

.studio {
  --ink: #2b1830;
  --muted: #806b7a;
  --line: #f3d9e7;
  --accent: #d60078;
  --cream: #fff0f7;
  background: #fff7fb;
  color: var(--ink);
  font-family: 'DM Sans',sans-serif;
  min-height: 100vh;
}

button,select,textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  height: 76px;
  border-bottom: 1px solid #f3d9e7;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  position: relative;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brandmark {
  height: 38px;
  width: 38px;
  flex: none;
  background: #d60078;
  border-radius: 9px;
  color: #fff;
  font-family: 'Playfair Display',serif;
  font-size: 20px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: .15em;
  line-height: 1;
}

.brand small {
  display: block;
  color: #a2a097;
  letter-spacing: .24em;
  font-size: 8px;
  margin-top: 6px;
  font-weight: 700;
}

.top-center {
  font-size: 10px;
  letter-spacing: .18em;
  color: #99988f;
  font-weight: 700;
}

.top-center span {
  color: #d60078;
  padding: 0 8px;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #797a72;
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ee65ad;
}

.status-dot.ready {
  background: #8ba36e;
}

.help-btn {
  margin-left: 14px;
  border: 1px solid #e2e0d9;
  background: #fff;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: #73736c;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(290px,340px) minmax(480px,1fr) minmax(300px,350px);
  min-height: calc(100vh - 76px);
}

.left-panel {
  border-right: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-scroll {
  padding: 34px 27px 40px;
  overflow: auto;
  flex: 1;
}

.eyebrow,.small-caps {
  font-size: 10px;
  letter-spacing: .18em;
  color: #d60078;
  font-weight: 700;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow-line {
  display: block;
  width: 18px;
  height: 1px;
  background: #d60078;
}

.left-panel h1 {
  font-family: 'Playfair Display',serif;
  font-size: 47px;
  line-height: 1.05;
  letter-spacing: -.05em;
  font-weight: 400;
  margin: 17px 0 13px;
}

.left-panel h1 em {
  color: #d60078;
  font-weight: 400;
}

.intro {
  font-size: 12px;
  line-height: 1.7;
  color: #806b7a;
  max-width: 270px;
  margin: 0 0 25px;
}

.install-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin: -7px 0 20px;
  border: 1px solid #f3bdd9;
  border-radius: 9px;
  background: #fff0f7;
}

.install-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #d60078;
  color: #fff;
  font: 700 16px 'Playfair Display',serif;
}

.install-card div { min-width: 0; flex: 1; }
.install-card strong { display: block; color: #6e1748; font-size: 11px; }
.install-card small { display: block; color: #8b6179; font-size: 10px; line-height: 1.4; margin-top: 2px; }
.install-card button {
  flex: none;
  border: 0;
  border-radius: 5px;
  padding: 9px 10px;
  background: #d60078;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.install-help {
  width: min(420px,calc(100vw - 32px));
  border: 1px solid #f3bdd9;
  border-radius: 12px;
  padding: 22px;
  color: #2b1830;
  box-shadow: 0 20px 60px rgba(67,15,45,.25);
}
.install-help::backdrop { background: rgba(30,5,22,.48); }
.install-help-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.install-help h2 { margin: 0; font: 500 23px 'Playfair Display',serif; }
.install-help-head button { border: 0; background: transparent; color: #8b6179; font-size: 26px; line-height: 1; }
.install-help p { font-size: 13px; line-height: 1.6; }
.install-help-note { color: #806b7a; border-top: 1px solid #f3d9e7; padding-top: 12px; margin-bottom: 0; }

.tab-switch {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 25px;
  margin: 0 -27px;
  padding: 0 27px;
}

.tab-switch button {
  border: 0;
  background: none;
  color: #8a8b84;
  padding: 12px 1px 13px;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.tab-switch button.active {
  color: #c90070;
  border-bottom: 2px solid #c90070;
  font-weight: 700;
}

.tab-switch b {
  font-size: 10px;
  border-radius: 8px;
  padding: 1px 5px;
  background: #fceaf3;
}

.field-section {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-heading>span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  flex: none;
  background: #ffe0ef;
  color: #cc0074;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.section-heading h2,.history-panel h2 {
  margin: 0;
  font-family: 'Playfair Display',serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.15;
}

.section-heading p,.history-panel>p {
  margin: 5px 0 0;
  color: #999990;
  font-size: 11px;
}

.upload {
  border: 1px dashed #efc9dc;
  background: #fffafd;
  min-height: 116px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  gap: 6px;
  color: #44443e;
}

.upload:hover {
  border-color: #d60078;
  background: #fff0f7;
}

.upload-icon {
  color: #c90070;
}

.upload strong {
  font-size: 12px;
}

.upload small {
  font-size: 10px;
  color: #a29e95;
}

.upload.has-image {
  min-height: 66px;
  flex-direction: row;
  padding: 7px;
  text-align: left;
  justify-content: flex-start;
}

.upload.has-image img {
  width: 46px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
}

.upload.has-image div {
  flex: 1;
  padding-left: 5px;
}

.upload.has-image strong,.upload.has-image small {
  display: block;
}

.fineprint {
  font-size: 10px;
  color: #aaa69d;
  line-height: 1.5;
  margin: 9px 0 0;
}

.field-section label {
  display: block;
  color: #5f605a;
  font-weight: 700;
  font-size: 11px;
  margin: 15px 0 9px;
}

.select-wrap {
  position: relative;
  margin-top: 8px;
}

.select-wrap select {
  appearance: none;
  width: 100%;
  height: 40px;
  border: 1px solid #f1d4e3;
  background: #fff;
  border-radius: 5px;
  padding: 0 28px 0 11px;
  font-size: 12px;
  color: #44443e;
  outline: none;
}

.select-wrap select:focus {
  border-color: #d60078;
}

.select-wrap svg {
  position: absolute;
  right: 10px;
  top: 12px;
  pointer-events: none;
  color: #8c8d85;
}

.palette-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.palette-item {
  border: 1px solid #f3d9e7;
  background: #fff;
  border-radius: 5px;
  min-height: 42px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 8px;
  font-size: 10px;
  color: #6b6c65;
}

.palette-item.chosen {
  border-color: #d60078;
  background: #fff0f7;
  color: #a90060;
}

.palette-item svg {
  margin-left: auto;
}

.swatches {
  display: flex;
  flex: none;
}

.swatches i {
  width: 13px;
  height: 22px;
  display: block;
}

.swatches i:first-child {
  border-radius: 3px 0 0 3px;
}

.swatches i:last-child {
  border-radius: 0 3px 3px 0;
}

.pose-options {
  display: flex;
  gap: 8px;
}

.pose-options button {
  border: 1px solid #f1d4e3;
  background: #fff;
  border-radius: 5px;
  height: 38px;
  flex: 1;
  font-size: 11px;
  color: #6a6b64;
}

.pose-options button.chosen {
  border-color: #d60078;
  background: #fff0f7;
  color: #b70069;
  font-weight: 700;
}

.secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.refine textarea {
  width: 100%;
  height: 76px;
  resize: vertical;
  border: 1px solid #f1d4e3;
  border-radius: 5px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.5;
  outline: none;
}

.refine textarea:focus {
  border-color: #d60078;
}

.refine>small {
  display: block;
  text-align: right;
  color: #a6a69f;
  font-size: 10px;
  margin-top: 4px;
}

.history-panel {
  padding-top: 25px;
}

.history-item {
  width: 100%;
  background: white;
  border: 1px solid #f3d9e7;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  margin-top: 11px;
  padding: 7px;
  color: #333;
}

.history-item:hover {
  border-color: #d60078;
}

.history-item img {
  width: 51px;
  height: 61px;
  object-fit: cover;
  border-radius: 3px;
}

.history-item span {
  flex: 1;
}

.history-item strong,.history-item small,.history-item em {
  display: block;
}

.history-item strong {
  font-size: 12px;
}

.history-item small {
  font-size: 10px;
  color: #898a83;
  margin-top: 3px;
}

.history-item em {
  font-size: 9px;
  color: #b1afa7;
  margin-top: 7px;
  font-style: normal;
}

.empty-history {
  border: 1px dashed #f1d4e3;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: #9b7b8e;
}

.empty-history strong {
  font-size: 12px;
  color: #676861;
}

.empty-history small {
  font-size: 10px;
}

.left-footer {
  border-top: 1px solid var(--line);
  padding: 17px 27px;
  background: #fffafd;
}

.left-footer div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #a35c83;
  font-weight: 700;
}

.left-footer small {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  color: #aaa9a1;
}

.main-panel {
  padding: 34px clamp(24px,4vw,64px) 40px;
  background: #fff7fb;
  min-width: 0;
}

.canvas-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.canvas-top h2 {
  font-family: 'Playfair Display',serif;
  font-size: 29px;
  font-weight: 400;
  margin: 6px 0 0;
  letter-spacing: -.03em;
}

.version-pill {
  background: #fceaf3;
  color: #96918a;
  border-radius: 20px;
  padding: 7px 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

.preview {
  height: min(64vh,710px);
  min-height: 460px;
  background: #fceaf3;
  position: relative;
  border: 1px solid #f3d9e7;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(57,48,40,.05);
}

.preview.image-preview {
  background: #f3d9e7;
}

.preview>img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-tag {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 8px 10px;
  background: rgba(255,255,255,.92);
  font-size: 9px;
  letter-spacing: .13em;
  font-weight: 700;
  color: #6f6d67;
}

.empty-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 52% 43%,#ffe8f4 0%,#f9d7e9 62%,#f1c8dd 100%);
}

.empty-preview:before,.empty-preview:after {
  content: '';
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255,255,255,.55);
  pointer-events: none;
}

.empty-preview:after {
  inset: 24px;
}

.halo {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  top: 9%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.33),0 0 0 45px rgba(255,255,255,.06);
}

.fashion-figure {
  position: absolute;
  left: 50%;
  top: 45px;
  transform: translateX(-50%);
  width: 230px;
  height: 300px;
  filter: drop-shadow(11px 20px 15px rgba(95,73,51,.12));
}

.fashion-figure .head {
  position: absolute;
  left: 92px;
  top: 0;
  width: 48px;
  height: 57px;
  background: #cf79a7;
  border-radius: 45% 45% 49% 49%;
  box-shadow: 0 -10px 0 2px #592543;
}

.fashion-figure .body {
  position: absolute;
  left: 70px;
  top: 49px;
  width: 92px;
  height: 106px;
  background: #d96ea5;
  clip-path: polygon(25% 0,75% 0,98% 58%,75% 100%,25% 100%,2% 58%);
}

.fashion-figure .skirt {
  position: absolute;
  left: 20px;
  top: 138px;
  width: 192px;
  height: 158px;
  background: linear-gradient(110deg,#d64b95,#f181bc 54%,#a92c70);
  clip-path: polygon(31% 0,68% 0,100% 100%,0 100%);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(181,126,90,.35);
  border-radius: 50%;
  width: 12px;
  height: 12px;
}

.orbit-one {
  left: 12px;
  top: 80px;
}

.orbit-two {
  right: 0;
  top: 140px;
  width: 7px;
  height: 7px;
  background: #e183b4;
}

.empty-copy {
  position: absolute;
  bottom: 27px;
  text-align: center;
  z-index: 1;
  background: linear-gradient(transparent,rgba(241,236,225,.88) 10%);
  width: 100%;
  padding: 25px 20px 0;
}

.empty-copy span {
  font-size: 9px;
  letter-spacing: .23em;
  color: #c90070;
  font-weight: 700;
}

.empty-copy h3 {
  font: 400 26px/1.15 'Playfair Display',serif;
  margin: 6px 0;
}

.empty-copy p {
  font-size: 11px;
  color: #77786f;
  max-width: 250px;
  line-height: 1.5;
  margin: 0 auto 12px;
}

.empty-copy button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #b70069;
  font-size: 11px;
  font-weight: 700;
}

.generating {
  position: absolute;
  inset: 0;
  background: rgba(251,249,245,.83);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: #c90070;
}

.generating strong {
  font: 400 24px 'Playfair Display',serif;
  color: #34342e;
}

.generating span {
  font-size: 12px;
  color: #898a82;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
}

.action-note {
  display: flex;
  gap: 9px;
  color: #6d6d66;
  font-size: 10px;
  line-height: 1.5;
}

.action-note small {
  color: #aaa79e;
  font-size: 10px;
}

.asterisk {
  color: #d60078;
  font-size: 22px;
  line-height: 1;
}

.generate-btn {
  background: #d60078;
  border: 1px solid #d60078;
  color: #fff;
  height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 7px 13px rgba(214,0,120,.2);
}

.generate-btn:hover {
  background: #af0063;
}

.generate-btn:disabled {
  opacity: .55;
  cursor: wait;
}

.error {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: #fff0f7;
  border: 1px solid #f5a6ce;
  color: #9f005a;
  padding: 11px 14px;
  margin-top: 15px;
  font-size: 12px;
}

.error button {
  border: 0;
  background: none;
  color: inherit;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.result-actions button {
  border: 1px solid #f1d4e3;
  background: #fff;
  color: #6c6a62;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.right-panel {
  border-left: 1px solid var(--line);
  background: #fff;
  padding: 35px 26px 35px;
  min-width: 0;
  overflow: auto;
}

.right-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.right-head h2 {
  font: 400 23px 'Playfair Display',serif;
  letter-spacing: -.03em;
  margin: 6px 0 0;
}

.json-badge {
  font-size: 9px;
  color: #c90070;
  background: #ffe5f2;
  padding: 6px 8px;
  border-radius: 3px;
  font-weight: 700;
}

.right-intro {
  font-size: 11px;
  color: #96968e;
  line-height: 1.6;
  margin: 13px 0 20px;
}

.art-tabs {
  display: flex;
  gap: 4px;
  background: #fceaf3;
  border-radius: 5px;
  padding: 4px;
}

.art-tabs span {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #aeaaa1;
  padding: 7px 2px;
  font-weight: 700;
}

.art-tabs .active {
  background: #fff;
  border-radius: 4px;
  color: #c90070;
  box-shadow: 0 1px 3px #f3d9e7;
}

.art-tabs small {
  font-size: 8px;
  letter-spacing: .08em;
  font-weight: 700;
  margin-left: 3px;
}

.art-card {
  border: 1px solid #f3d9e7;
  margin-top: 13px;
  border-radius: 5px;
  padding: 15px 15px 1px;
}

.art-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
}

.art-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffe5f2;
  color: #d60078;
  font: 500 14px 'Playfair Display',serif;
  flex: none;
}

.art-row strong {
  font-size: 11px;
}

.art-row p {
  font-size: 10px;
  color: #97978e;
  line-height: 1.5;
  margin: 3px 0 0;
}

.prompt-head {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.prompt-head h3 {
  font: 400 21px 'Playfair Display',serif;
  margin: 5px 0 0;
}

.prompt-head button {
  width: 29px;
  height: 29px;
  border: 1px solid #f3d9e7;
  background: #fff;
  color: #77776e;
  border-radius: 4px;
}

.json-box {
  border: 1px solid #f3d9e7;
  background: #fff7fb;
  margin-top: 12px;
  border-radius: 5px;
  max-height: 290px;
  overflow: auto;
}

.json-box pre {
  font: 10px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;
  color: #6d716c;
  padding: 14px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.download-json {
  width: 100%;
  margin-top: 10px;
  height: 35px;
  border: 1px solid #f3d9e7;
  background: #fff;
  color: #85536d;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}

.how-it-works {
  margin-top: 25px;
  padding: 15px;
  border-radius: 5px;
  background: #fff0f7;
  color: #c90070;
  display: flex;
  gap: 10px;
  scroll-margin-top: 20px;
}

.how-it-works svg {
  flex: none;
}

.how-it-works strong {
  font-size: 11px;
  color: #9c316c;
}

.how-it-works p {
  font-size: 10px;
  line-height: 1.55;
  color: #a88799;
  margin: 4px 0 0;
}

@media (max-width:1150px) {
  .workspace {
    grid-template-columns: 310px minmax(0,1fr);
  }
  .right-panel {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 25px;
  }
  .right-head,.right-intro,.art-tabs,.art-card {
    grid-column: 1;
  }
  .prompt-head,.json-box,.download-json,.how-it-works {
    grid-column: 2;
  }
  .prompt-head {
    grid-row: 1/3;
    margin-top: 0;
  }
  .json-box {
    grid-row: 3/5;
    max-height: 270px;
  }
  .download-json {
    grid-row: 5;
  }
  .how-it-works {
    grid-row: 6;
  }
  .main-panel {
    padding: 30px;
  }
  .preview {
    height: 620px;
  }
}

@media (max-width:760px) {
  .topbar {
    height: 64px;
    padding: 0 18px;
  }
  .top-center {
    display: none;
  }
  .workspace {
    display: block;
  }
  .left-panel {
    border-right: 0;
  }
  .panel-scroll {
    padding: 26px 20px;
  }
  .left-panel h1 {
    font-size: 38px;
  }
  .left-footer {
    display: none;
  }
  .main-panel {
    padding: 26px 18px;
  }
  .preview {
    height: 540px;
    min-height: 420px;
  }
  .action-row {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .generate-btn {
    justify-content: center;
  }
  .right-panel {
    display: block;
    padding: 28px 20px;
  }
  .prompt-head {
    margin-top: 25px;
  }
  .json-box {
    max-height: 260px;
  }
  .empty-preview .halo {
    transform: translateX(-50%) scale(.8);
    top: 2%;
  }
  .empty-copy {
    bottom: 14px;
  }
}

@media (max-width:420px) {
  .top-actions>span:not(.status-dot) {
    display: none;
  }
  .palette-list {
    grid-template-columns: 1fr 1fr;
  }
  .preview {
    height: 480px;
  }
  .empty-copy h3 {
    font-size: 23px;
  }
}

.prompt-buttons {
  display: flex;
  gap: 5px;
}

.prompt-head #copy-json {
  width: auto;
  min-width: 88px;
  padding: 0 10px;
  color: #7f2755;
  font: 600 12px Arial, sans-serif;
  cursor: pointer;
}

.json-box textarea {
  display: block;
  width: 100%;
  min-height: 290px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: #555e57;
  padding: 14px;
  font: 10px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;
}

.json-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 9px;
}

.json-edit-actions button {
  border: 1px solid #f3d9e7;
  background: #fff;
  padding: 7px 10px;
  font-size: 10px;
  color: #6f6b63;
  border-radius: 3px;
}

.json-edit-actions button:last-child {
  background: #d60078;
  border-color: #d60078;
  color: #fff;
}

.palette-groups {
  display: grid;
  gap: 12px;
}

.palette-group h3 {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: #a4a098;
  margin: 1px 0 7px;
  font-weight: 700;
}

.palette-item {
  min-width: 0;
}

.palette-item>span:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-wrap optgroup {
  font-style: normal;
  font-weight: 700;
  color: #cc0074;
}

.select-wrap option {
  color: #44443e;
  font-weight: 400;
}

.optional-label {
  font-weight: 400;
  color: #a3a099;
  font-size: 10px;
  margin-left: 4px;
}

.jewelry-preview {
  margin-top: 15px;
  padding: 13px;
  background: #fff7fb;
  border: 1px solid #f3d9e7;
  border-radius: 5px;
}

.jewelry-preview>strong {
  font-size: 10px;
  color: #a90060;
  letter-spacing: .05em;
}

.jewelry-preview dl {
  margin: 9px 0 0;
  display: grid;
  gap: 7px;
}

.jewelry-preview dl>div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  align-items: start;
}

.jewelry-preview dt {
  font-size: 10px;
  color: #a09a90;
}

.jewelry-preview dd {
  margin: 0;
  font-size: 10px;
  line-height: 1.35;
  color: #605e58;
}

.select-wrap select:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: #fceaf3;
}

.studio {
  padding-bottom: 74px;
}

.save-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8;
  min-height: 70px;
  background: #fff;
  border-top: 1px solid #f3d9e7;
  box-shadow: 0 -6px 24px rgba(40,35,30,.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px 30px;
}

.save-bar strong,.save-bar small {
  display: block;
}

.save-bar strong {
  font: 500 17px 'Playfair Display',serif;
}

.save-bar small {
  font-size: 10px;
  color: #98978f;
  margin-top: 3px;
}

.save-bar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.save-bar-actions span {
  font-size: 11px;
  color: #985678;
}

.save-bar button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #d60078;
  border: 1px solid #d60078;
  color: #fff;
  padding: 0 16px;
  height: 41px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.save-bar button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.history-entry {
  margin-top: 11px;
}

.history-color-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  border: 0;
  border-radius: 5px;
  padding: 9px 10px;
  text-align: left;
  box-shadow: 0 3px 8px rgba(40,35,30,.09);
}

.history-color-button:hover {
  filter: brightness(.96);
}

.history-short {
  min-width: 0;
  flex: 1;
}

.history-short strong,.history-short small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-short strong {
  font-size: 11px;
}

.history-short small {
  font-size: 9px;
  opacity: .84;
  margin-top: 4px;
}

.history-swatches {
  display: flex;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 20px;
  overflow: hidden;
  flex: none;
}

.history-swatches i {
  width: 9px;
  height: 18px;
}

.history-color-button svg {
  flex: none;
  transition: transform .2s;
}

.history-color-button svg.turned {
  transform: rotate(180deg);
}

.history-detail {
  border: 1px solid #f3d9e7;
  border-top: 0;
  background: #fff;
  padding: 10px;
  border-radius: 0 0 5px 5px;
}

.history-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.history-detail-head span {
  font-size: 9px;
  color: #9b938a;
}

.history-detail-head button,.history-refine {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #f3d9e7;
  background: #fff7fb;
  color: #a90060;
  padding: 6px 8px;
  font-size: 9px;
  font-weight: 700;
}

.history-detail pre {
  max-height: 270px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff7fb;
  color: #62645f;
  font: 9px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;
  padding: 10px;
  margin: 10px 0 0;
}

.history-refine {
  margin-top: 9px;
  width: 100%;
  justify-content: center;
}

@media (max-width:760px) {
  .studio {
    padding-bottom: 88px;
  }
  .save-bar {
    min-height: 83px;
    padding: 11px 16px;
  }
  .save-bar strong {
    font-size: 15px;
  }
  .save-bar small {
    max-width: 220px;
    line-height: 1.3;
  }
  .save-bar-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 4px;
  }
  .save-bar button {
    height: 36px;
    padding: 0 10px;
  }
  .save-bar-actions span {
    font-size: 9px;
  }
}

@media (max-width:430px) {
  .save-bar>div:first-child small {
    display: none;
  }
  .save-bar strong {
    font-size: 13px;
  }
  .save-bar button {
    font-size: 10px;
  }
}

.pose-fieldset {
  border: 0;
  padding: 0;
  margin: 16px 0 0;
  min-width: 0;
}

.pose-fieldset legend {
  font-size: 11px;
  font-weight: 700;
  color: #5f605a;
  margin-bottom: 9px;
}

.pose-options label {
  border: 1px solid #f1d4e3;
  background: #fff;
  border-radius: 5px;
  height: 38px;
  flex: 1;
  font-size: 11px;
  color: #6a6b64;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  margin: 0;
}

.pose-options label.chosen {
  border-color: #d60078;
  background: #fff0f7;
  color: #b70069;
  font-weight: 700;
}

.pose-options input {
  accent-color: #d60078;
  width: 13px;
  height: 13px;
  margin: 0;
}

.pose-description {
  font-size: 10px;
  line-height: 1.5;
  color: #97948d;
  margin: 7px 0 4px;
}

.pose-options button {
  display: none;
}

.dress-mode-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  min-width: 0;
}

.dress-mode-fieldset legend {
  font-size: 11px;
  font-weight: 700;
  color: #5f605a;
  margin-bottom: 9px;
}

.dress-mode-options {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 6px;
}

.dress-mode-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 8px 5px;
  min-height: 43px;
  border: 1px solid #f1d4e3;
  background: #fff;
  border-radius: 5px;
  color: #6a6b64;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  line-height: 1.2;
}

.dress-mode-options label.chosen {
  border-color: #d60078;
  background: #fff0f7;
  color: #b70069;
}

.dress-mode-options input {
  accent-color: #d60078;
  width: 12px;
  height: 12px;
  margin: 0;
  flex: none;
}

.flag-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 9px 0 17px;
  padding: 9px;
  background: #fff7fb;
  border: 1px solid #f3d9e7;
  border-radius: 5px;
  color: #77736d;
  font-size: 10px;
  line-height: 1.35;
}

.flag-stripes {
  display: block;
  width: 44px;
  height: 29px;
  flex: none;
  border: 1px solid rgba(0,0,0,.12);
  position: relative;
  box-shadow: 0 2px 5px rgba(0,0,0,.1);
}

.flag-stripes i {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 4px solid #7902aa;
  border-radius: 50%;
  left: 13px;
  top: 6px;
}

.save-bar .dont-save {
  background: #fff;
  color: #7e6173;
  border-color: #f1d4e3;
  box-shadow: none;
}

.save-bar .dont-save:hover {
  background: #fff0f7;
}

@media (max-width:760px) {
  .save-bar-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .save-bar-actions span {
    width: 100%;
    text-align: right;
  }
  .dress-mode-options {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width:430px) {
  .save-bar {
    gap: 8px;
  }
  .save-bar-actions {
    min-width: 0;
  }
  .save-bar .dont-save {
    padding: 0 7px;
  }
  .save-bar button {
    font-size: 9px;
    padding: 0 8px;
  }
  .dress-mode-options label {
    font-size: 9px;
    flex-direction: column;
    gap: 3px;
  }
}

.flag-stripes.progress::before {
  content: '';
  position: absolute;
  inset: 0 42% 0 0;
  background: linear-gradient(to right,#111 0 20%,#a90060 20% 40%,#5bcefa 40% 60%,#f5a9b8 60% 80%,#fff 80% 100%);
  clip-path: polygon(0 0,100% 50%,0 100%);
}

.hair-flower-card {
  margin-top: 15px;
  padding: 13px;
  background: #fff7fb;
  border: 1px solid #f3d9e7;
  border-radius: 5px;
}

.hair-flower-card .hair-flower-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}

.hair-flower-toggle input {
  accent-color: #d60078;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  flex: none;
}

.hair-flower-toggle strong,.hair-flower-toggle small {
  display: block;
}

.hair-flower-toggle strong {
  font-size: 11px;
  color: #9c316c;
}

.hair-flower-toggle small {
  font-size: 10px;
  line-height: 1.45;
  color: #999187;
  font-weight: 400;
  margin-top: 3px;
}

.hair-flower-card>label:not(.hair-flower-toggle) {
  margin: 16px 0 0;
}

.flower-description {
  font-size: 10px;
  line-height: 1.5;
  color: #92877e;
  margin: 8px 0 0;
}

/* Standalone HTML behavior helpers. */

[hidden] {
  display: none !important;
}

.select-chevron {
  position: absolute;
  right: 11px;
  top: 7px;
  color: #8c8d85;
  pointer-events: none;
  font-size: 20px;
}

.upload-icon {
  font-size: 22px;
}

.upload.has-image img {
  width: 46px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
}

.error[hidden],.result-actions[hidden] {
  display: none;
}

.history-list-empty {
  border: 1px dashed #f1d4e3;
  padding: 35px 15px;
  color: #8d8b82;
  font-size: 11px;
  text-align: center;
  margin-top: 15px;
}
