html.st-open { overflow: hidden; }
#studio {
  --st-cedar: #6f4b58;
  --st-ink: #453d3a;
  --st-muted: #665e5a;
  --st-line: #e3dad5;
  --st-paper: #fffdfa;
  position: fixed; inset: 0; width: min(640px, calc(100% - 32px)); max-width: none;
  max-height: calc(100dvh - 32px); margin: auto; padding: 0;
  border: 1px solid var(--st-line); border-radius: 18px;
  background: var(--st-paper); color: var(--st-ink);
  font: 16px/1.5 var(--sans); text-align: left;
  box-shadow: 0 24px 80px #12251f3d; overflow: auto;
  overscroll-behavior: contain; scroll-padding-top: 96px;
}
#studio::backdrop { background: rgb(92 80 73 / 37%); }
#studio:not([open]), #studio [hidden] { display: none !important; }
#studio, #studio *, #studio *::before, #studio *::after { box-sizing: border-box; }
#studio :is(h2, h3, p, figure, fieldset, legend) { margin: 0; }
#studio :is(button, input, select, textarea) { font: inherit; }
#studio button { cursor: pointer; }
#studio :is(button, input, select, textarea, summary, a, .st-step-heading):focus-visible {
  outline: 3px solid #a34024; outline-offset: 3px;
}
#studio fieldset { min-width: 0; padding: 0; border: 0; }
#studio legend { padding: 0; font-weight: 600; }
#studio .st-titlebar {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 18px 24px;
  border-bottom: 1px solid var(--st-line); background: var(--st-paper);
}
#studio .st-titlebar > div, #studio .st-titlebar > h2 { min-width: 0; }
#studio h2 { font: 600 26px/1.25 var(--sans); letter-spacing: normal; }
#studio .st-close {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto;
  min-height: 48px; padding: 10px 13px; border: 1px solid #b8aaa5; border-radius: 10px;
  background: transparent; color: var(--st-ink); font-size: 16px; font-weight: 600;
}
#studio .st-close:hover { background: #f8f3f0; }
#studio .st-progress {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin: 0; padding: 18px 24px 0; list-style: none;
}
#studio .st-progress li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; color: var(--st-muted); font-size: 16px; line-height: 1.3;
}
#studio .st-progress li > span:first-child {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px;
  width: 26px; height: 26px; border: 1px solid #b8aaa5; border-radius: 50%;
  font-size: 14px; font-weight: 600;
}
#studio .st-progress li[aria-current="step"] { color: var(--st-cedar); font-weight: 700; }
#studio .st-progress li[aria-current="step"] > span:first-child {
  background: var(--st-cedar); border-color: var(--st-cedar); color: var(--st-paper);
}
#studio .st-step { min-width: 0; padding: 22px 24px 24px; }
#studio .st-step-heading { margin-bottom: 18px; font: 600 24px/1.3 var(--sans); letter-spacing: normal; }
#studio .st-help, #studio .st-service-msg { color: var(--st-muted); font-size: 16px; line-height: 1.5; }
#studio .st-service-msg:not(:empty) { margin-top: 14px; }
#studio .st-message:not(:empty) { margin-top: 12px; color: var(--st-cedar); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
#studio .st-primary,
#studio .st-choose,
#studio .st-next-photo,
#studio .st-next-gate,
#studio .st-generate,
#studio .st-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-width: 0; min-height: 56px; padding: 14px 20px;
  border: 1px solid var(--st-cedar); border-radius: 12px;
  background: var(--st-cedar); color: var(--st-paper);
  font-size: 18px; font-weight: 600; line-height: 1.4; text-align: center;
  text-decoration: none; white-space: normal;
}
#studio :is(.st-primary, .st-choose, .st-next-photo, .st-next-gate, .st-generate, .st-download):hover:not(:disabled) {
  background: #593f47; border-color: #593f47;
}
#studio .st-secondary,
#studio .st-remove,
#studio .st-placement-reset,
#studio .st-verification-retry {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 0; min-height: 48px; padding: 11px 16px;
  border: 1px solid #b8aaa5; border-radius: 10px;
  background: var(--st-paper); color: var(--st-ink);
  font-size: 16px; font-weight: 600; line-height: 1.4; text-align: center; white-space: normal;
}
#studio :is(.st-secondary, .st-remove, .st-placement-reset, .st-verification-retry):hover:not(:disabled) { background: #f8f3f0; }
#studio :is(button, input, select, textarea):disabled { cursor: not-allowed; }
#studio button:disabled {
  background: #e8e1dc; border-color: #cfc3bd; color: #746863; box-shadow: none; opacity: 1;
}
#studio .st-step-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-top: 20px; }
#studio .st-step-actions > .st-primary,
#studio .st-step-actions > .st-next-photo,
#studio .st-step-actions > .st-next-gate { flex: 1 0 100%; }
#studio .st-step-actions > :is(.st-another, .st-new-photo) { flex: 1 1 180px; }
#studio .st-upload-card {
  display: grid; gap: 14px; padding: 20px; border: 1px dashed #b8aaa5; border-radius: 12px;
  background: #f8f3f0; text-align: center;
}
#studio .st-upload-photo { min-width: 0; }
#studio img.st-upload-photo, #studio .st-upload-photo img {
  display: block; width: 100%; height: auto; max-height: 220px; margin-inline: auto;
  border-radius: 8px; background: #f2eee7; object-fit: contain;
}
#studio .st-photo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
#studio .st-styles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#studio .st-styles legend { margin-bottom: 14px; font-size: 18px; }
#studio .st-style {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0;
  min-height: 100px; padding: 12px; border: 2px solid var(--st-line); border-radius: 12px;
  background: var(--st-paper); cursor: pointer;
}
#studio .st-style:has(input:checked) { border-color: var(--st-cedar); background: #faf0f2; }
#studio .st-style:has(input:focus-visible),
#studio .st-variant-options label:has(input:focus-visible) { outline: 3px solid #a34024; outline-offset: 3px; }
#studio .st-style:has(input:disabled),
#studio .st-variant-options label:has(input:disabled) { cursor: not-allowed; opacity: .65; }
#studio .st-style input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
#studio .st-reference {
  display: block; flex: 0 0 90px; width: 90px; height: 70px; border-radius: 6px;
  background: #f2eee7; object-fit: contain;
}
#studio .st-style > span:not(.st-choice-check) { flex: 1; min-width: 0; }
#studio .st-style strong { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
#studio .st-style small { display: block; margin-top: 4px; color: var(--st-muted); font-size: 16px; line-height: 1.35; }
#studio .st-choice-check {
  display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px;
  border: 2px solid #b8aaa5; border-radius: 50%; visibility: hidden; font-size: 16px; line-height: 1;
}
#studio .st-style:has(input:checked) .st-choice-check { visibility: visible; background: var(--st-cedar); border-color: var(--st-cedar); color: var(--st-paper); }
#studio .st-variant-field { margin-top: 18px; }
#studio .st-variant-field legend { margin-bottom: 10px; font-size: 16px; }
#studio .st-variant-options { display: flex; flex-wrap: wrap; gap: 10px; }
#studio .st-variant-options label {
  display: flex; align-items: center; justify-content: center; flex: 1 1 120px; gap: 10px;
  min-width: 0; min-height: 52px; padding: 10px 14px; border: 2px solid var(--st-line);
  border-radius: 10px; font-size: 16px; font-weight: 600; line-height: 1.4; cursor: pointer;
}
#studio .st-variant-options input { flex: 0 0 22px; width: 22px; height: 22px; margin: 0; accent-color: var(--st-cedar); }
#studio .st-variant-options label:has(input:checked) { border-color: var(--st-cedar); background: #faf0f2; }
#studio .st-review {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px;
  border: 1px solid var(--st-line); border-radius: 12px; background: #f8f3f0;
}
#studio .st-review-photo { flex: 0 0 70px; width: 70px; height: 70px; border-radius: 7px; object-fit: contain; }
#studio .st-review > div { min-width: 0; }
#studio .st-selected-gate { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
#studio .st-selected-color { display: block; margin-top: 4px; color: var(--st-muted); font-size: 16px; }
#studio .st-notes, #studio .st-placement { padding-block: 4px; border-bottom: 1px solid var(--st-line); }
#studio :is(.st-notes, .st-placement) > summary {
  display: list-item; min-height: 52px; padding-block: 14px; font-size: 16px; font-weight: 600; cursor: pointer;
}
#studio :is(.st-notes, .st-placement)[open] { padding-bottom: 16px; }
#studio .st-description-field { margin-top: 12px; }
#studio .st-description-field > label { display: block; margin-bottom: 8px; font-weight: 600; }
#studio textarea {
  display: block; width: 100%; min-width: 0; min-height: 100px; margin-top: 10px; padding: 12px;
  resize: vertical; border: 1px solid #b8aaa5; border-radius: 8px;
  background: #fff; color: var(--st-ink); font-size: 16px; line-height: 1.5;
}
#studio .st-description-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--st-muted); font-size: 14px; }
#studio #st-description-help { min-width: 0; }
#studio #st-description-count { flex: 0 0 auto; }
#studio .st-description-example { display: block; margin-top: 4px; }
#studio .st-scene { min-width: 0; margin-top: 10px; }
#studio .st-mat {
  display: grid; place-items: center; width: 100%; min-height: 120px; overflow: hidden;
  border-radius: 12px; background: #f2eee7;
}
#studio .st-plane { position: relative; width: fit-content; max-width: 100%; overflow: hidden; line-height: 0; }
#studio .st-room { display: block; width: auto; height: auto; max-width: 100%; max-height: min(42vh, 320px); pointer-events: none; }
#studio .st-gate {
  --frame: #454840;
  --light: #959c90;
  --shade: #31362d;
  position: absolute; aspect-ratio: 1.34; display: flex;
  transform: translate(-50%, -50%) skewY(-7deg);
  filter: drop-shadow(1px 2px 1px #1a1c154d); line-height: 1;
  cursor: grab; touch-action: none; user-select: none;
}
#studio .st-gate:active { cursor: grabbing; }
#studio .st-panel {
  position: relative; display: block; flex: 1; height: 100%; border-radius: 3px;
  border: clamp(2px, .32vw, 5px) solid var(--frame);
  background: repeating-linear-gradient(90deg, transparent 0% 7%, var(--light) 7% 7.8%, var(--frame) 7.8% 9%, var(--shade) 9% 10%);
  box-shadow: inset 1px 1px 0 var(--light), 1px 1px 0 var(--shade);
}
#studio .st-panel::after {
  content: ''; position: absolute; right: -1%; top: -2%; width: 11%; height: 7%;
  min-height: 3px; border-radius: 3px; background: var(--shade);
}
#studio .st-gate:not([data-shape="section-gate"]) :is(.st-left, .st-right) { display: none; }
#studio .st-gate[data-shape="retractable-mesh"] { --frame: #626057; --shade: #45463f; }
#studio .st-gate[data-shape="retractable-mesh"] .st-panel {
  border-width: 1px clamp(3px, .5vw, 8px); border-radius: 3px; background-color: #897f6a6b;
  background-image: repeating-linear-gradient(45deg, transparent 0 2px, #57534466 2px 3px), repeating-linear-gradient(-45deg, transparent 0 2px, #eee4c544 2px 3px);
}
#studio .st-gate[data-shape="retractable-mesh"] .st-panel::after { width: 5%; height: 7%; }
#studio .st-gate[data-shape="section-gate"] { --frame: #dddfd2; --light: #fffeef; --shade: #868d7a; }
#studio .st-gate[data-shape="section-gate"] .st-middle { flex: 1.8; }
#studio .st-gate[data-shape="section-gate"] :is(.st-left,.st-right) { background-size: 180% 100%; }
#studio .st-gate[data-shape="section-gate"] .st-left { transform: skewY(23deg); transform-origin: 100% 0; }
#studio .st-gate[data-shape="section-gate"] .st-right { transform: skewY(-23deg); transform-origin: 0 0; }
#studio .st-gate[data-shape="section-gate"] :is(.st-left, .st-right)::after { display: none; }
#studio .st-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; color: var(--st-muted); font-size: 14px; }
#studio .st-caption .st-source { color: var(--st-ink); font-weight: 600; }
#studio .st-placement fieldset { margin-top: 14px; }
#studio .st-placement .st-help { margin-bottom: 10px; }
#studio .st-placement label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 54%); align-items: center; gap: 12px; min-height: 48px; font-size: 16px; }
#studio input[type="range"] { width: 100%; min-width: 0; min-height: 48px; margin: 0; accent-color: var(--st-cedar); cursor: pointer; }
#studio .st-placement-reset { margin-top: 10px; }
#studio .st-ai-form { margin-top: 18px; }
#studio .st-permission {
  display: flex; align-items: flex-start; gap: 12px; min-height: 52px; margin-bottom: 8px; padding: 12px;
  border: 1px solid var(--st-line); border-radius: 10px; color: var(--st-ink); font-size: 16px; line-height: 1.5; cursor: pointer;
}
#studio .st-permission input { flex: 0 0 24px; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--st-cedar); }
#studio .st-privacy { display: inline-flex; align-items: center; min-height: 48px; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; }
#studio .st-verification { min-width: 0; margin-block: 8px 12px; }
#studio .st-challenge { min-width: 0; }
#studio .st-verification-status { margin-top: 8px; color: var(--st-muted); font-size: 16px; }
#studio .st-verification-retry { margin-top: 8px; }
#studio .st-action-hint { margin-block: 12px; color: var(--st-cedar); font-size: 16px; font-weight: 600; }
#studio .st-action-hint:empty { display: none; }
#studio .st-disclaimer { margin-top: 14px; color: var(--st-muted); font-size: 14px; line-height: 1.5; }
#studio .st-footnote { padding: 14px 24px; border-top: 1px solid var(--st-line); color: var(--st-muted); font-size: 14px; }
#studio .st-result { scroll-margin-top: 100px; }
#studio .st-result img { display: block; width: 100%; height: auto; max-height: 60dvh; border-radius: 10px; background: #f2eee7; object-fit: contain; }
#studio .st-result figcaption { margin-top: 10px; color: var(--st-muted); font-size: 14px; line-height: 1.5; }
#studio .st-download { margin-top: 18px; }
@media (max-width: 680px) {
  #studio { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding-bottom: env(safe-area-inset-bottom, 0px); border: 0; border-radius: 0; }
  #studio .st-titlebar { padding: max(14px, env(safe-area-inset-top, 0px)) 16px 14px; }
  #studio h2 { font-size: 22px; }
  #studio .st-progress { padding: 16px 16px 0; }
  #studio .st-step { padding: 20px 16px 24px; }
  #studio .st-step-heading { font-size: 22px; }
  #studio .st-upload-card { padding: 16px; }
  #studio .st-style { gap: 10px; padding: 10px; }
  #studio .st-reference { flex-basis: 78px; width: 78px; height: 66px; }
  #studio .st-footnote { padding-inline: 16px; }
}
@media (max-height: 500px) and (min-width: 681px) {
  #studio { max-height: calc(100dvh - 16px); }
  #studio .st-titlebar { padding-block: 10px; }
  #studio .st-progress { padding-top: 12px; }
  #studio .st-step { padding-top: 16px; }
}
