body.interior-page.studio-page {
  --studio-surface: #203532;
  --studio-raised: #29413b;
  --studio-deep: var(--interior-white, #182623);
  --studio-edge: #526761;
  --studio-track: #71857d;
  --studio-cream-bright: #fff9e8;
  --studio-dim: var(--interior-muted, #c9c3b5);
}
.studio-page .studio :where(h1,h2,h3) {
  font-family: var(--sans, system-ui, sans-serif);
}
.studio-page .studio :where(h1,h2,h3) { font-weight: 620; }
.studio-page .account-gate h1, .studio-page .studio-header h1 {
  font-size: clamp(2.1rem, 1.65rem + 2.5vw, 4.1rem);
  line-height: 1.04;
}
.studio-page .step-panel h3 { font-size: clamp(1.3rem, 1.12rem + .8vw, 1.75rem); line-height: 1.2; }
.studio-page .studio :focus-visible { outline: 2px solid var(--studio-cream-bright); outline-offset: 4px; }
.studio-page .studio :is(.button,.action) { min-block-size: 2.8rem; }
.studio-page .studio :is(.button,.action):hover:not(:disabled) { color: var(--studio-deep); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.visually-hidden { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; padding: 0; white-space: nowrap; }
.underlink { border: 0; padding: .2rem 0; background: transparent; color: var(--oxblood); font-weight: 650; text-decoration: underline; text-underline-offset: .2em; }
.underlink:hover { text-decoration-thickness: 2px; }
.underlink.neutral { color: var(--interior-muted); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.segmented button { padding: .5rem .7rem; min-height: 3rem; border: 1px solid var(--studio-track); border-radius: .25rem; background: transparent; font-size: .875rem; font-weight: 650; }
.segmented button:hover { background: var(--studio-raised); }
.segmented button[aria-pressed="true"] { background: var(--oxblood); color: var(--interior-white); border-color: var(--oxblood); }
.account-gate {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}
.account-gate p { margin-block: .85rem; }
.account-gate .action { margin-block-start: .25rem; }
.account-gate #auth-info { color: var(--interior-muted); font-size: .92rem; }
.studio-gate-art img { inline-size: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--matboard); }
.studio .button { gap: .75rem; }
#layer-legend p { margin-block: 0 .35rem; font-size: .8rem; font-weight: 650; }
.layer-list { display: flex; flex-wrap: wrap; gap: .3rem .8rem; padding: 0; margin: 0 0 1rem; list-style: none; color: var(--interior-muted); font-size: .86rem; }
.layer-list li { display: inline-flex; align-items: center; gap: .35rem; }
.layer-list li::before { content: ""; inline-size: 1rem; border-block-start: 2px dashed var(--layer-legend-color); }
.layer-ink { --layer-color: #41382d; --layer-legend-color: #dfd0ad; }
.layer-teal { --layer-color: #195559; --layer-legend-color: #9cd2cb; }
.layer-terracotta { --layer-color: #833c30; --layer-legend-color: #efad9f; }

.studio { padding-block: clamp(2.25rem, 5vw, 4.8rem); }
.studio-inner { max-width: 72rem; }
.studio-header { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
.draft-status { color: var(--interior-muted); font-size: .85rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; padding: 0; margin: 1.6rem 0 1.65rem; border-block: 1px solid var(--interior-line); }
.steps button { border: 0; background: transparent; width: 100%; min-height: 3.35rem; display: flex; gap: .55rem; padding: .55rem .45rem; align-items: center; text-align: start; font-weight: 650; font-size: .92rem; }
.steps button span:first-child { width: 1.55rem; height: 1.55rem; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--studio-track); font-size: .78rem; }
.steps button[aria-current="step"] { color: var(--espresso); box-shadow: inset 0 -2px var(--oxblood); }
.steps button[aria-current="step"] span:first-child { background: var(--oxblood); color: var(--interior-white); border-color: var(--oxblood); }
.steps button:disabled { color: var(--studio-dim); opacity: 1; }
.steps button:not(:disabled):hover { background: var(--studio-raised); }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1.47fr) minmax(0, .85fr); align-items: start; gap: clamp(1.25rem, 3vw, 3rem); }
.scene { position: relative; display: grid; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; isolation: isolate; background: var(--matboard); border: 1px solid var(--studio-edge); }
.scene[data-mode="edit"] { touch-action: none; cursor: grab; }
.scene[data-mode="edit"]:active { cursor: grabbing; }
.scene[data-mode="frame"] { background: #eee2d1; border: .65rem solid #ccb596; box-shadow: 0 .45rem .95rem #54351e2b; }
.scene > img { position: absolute; max-width: none; transform-origin: 0 0; pointer-events: none; user-select: none; }
.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.crop-guides { position: absolute; inset: 0; pointer-events: none; border: 1px solid #ffffffb8; box-shadow: inset 0 0 0 7px #1e1c1836; background: linear-gradient(to right, transparent 33.2%, #ffffff70 33.3%, #ffffff70 33.5%, transparent 33.6%, transparent 66.4%, #ffffff70 66.5%, #ffffff70 66.7%, transparent 66.8%), linear-gradient(to bottom, transparent 33.2%, #ffffff70 33.3%, #ffffff70 33.5%, transparent 33.6%, transparent 66.4%, #ffffff70 66.5%, #ffffff70 66.7%, transparent 66.8%); }
.scene-empty { display: grid; justify-items: center; align-content: center; gap: .6rem; color: var(--studio-dim); text-align: center; padding: .75rem; }
.scene-caption { font-size: .85rem; color: var(--interior-muted); margin-top: .65rem; }
.studio-controls { min-width: 0; padding: clamp(1rem, 2.2vw, 1.75rem); background: var(--studio-surface); border: 1px solid var(--studio-edge); }

.step-panel p { margin: .55rem 0 1rem; color: var(--interior-muted); }
.step-panel .hint { font-size: .84rem; }
.file-label { cursor: pointer; }
.step-panel:has(#photo-input:focus-visible) .file-label { outline: 2px solid var(--oxblood); outline-offset: 4px; }
#clear-photo { margin-inline-start: .7rem; }
.ranges { padding: 0; border: 0; margin: .75rem 0 0; min-width: 0; }
.ranges label, .range-label { display: flex; justify-content: space-between; gap: .25rem; font-size: .88rem; font-weight: 650; }
.ranges output, .range-label output { color: var(--oxblood); white-space: nowrap; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; min-height: 2rem; margin: .1rem 0 .38rem; cursor: pointer; }
input[type="range"]:disabled { cursor: default; opacity: .48; }
.position-controls { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.editor-actions, .step-actions { display: flex; gap: .35rem 1rem; flex-wrap: wrap; align-items: center; margin-top: .65rem; }
.editor-actions .underlink, .step-panel > .underlink, .step-actions .underlink { min-height: 3rem; }
.preview-options { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .85rem; margin-block: .5rem; }
.cut-line-toggle { display: flex; align-items: center; gap: .55rem; width: fit-content; min-height: 2.75rem; font-size: .9rem; font-weight: 650; cursor: pointer; }
.cut-line-toggle:has(:disabled) { opacity: .58; cursor: default; }
.cut-line-toggle input { margin: 0; inline-size: 1.1em; aspect-ratio: 1; accent-color: var(--oxblood); cursor: inherit; }
.cut-lines { display: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.show-cut-lines .cut-lines { display: inline; }
.cut-line-halo { stroke: #fffaf1; stroke-width: 3.2; }
.cut-line-dash { stroke: var(--layer-color); stroke-width: 1.25; stroke-dasharray: 4 3; }
#generate-layers { display: block; }
.studio-status { margin-top: .7rem; color: var(--interior-muted); }
.studio-status:empty { display: none; }
.studio-status[data-error="true"] { color: #ffc4b6; }
#order-form { display: grid; gap: .55rem; }
#order-form .button { margin-top: .35rem; }
.order-line { padding: .6rem 0 .75rem; border-block: 1px solid var(--interior-line); display: flex; justify-content: space-between; gap: .6rem; }
.order-line strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-followup { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .85rem; }
.order-followup a { display: none; min-height: 2.75rem; align-items: center; }
.order-followup:has(#download:not([hidden])) { margin-block: .6rem .25rem; }
.order-followup:has(#download:not([hidden])) a { display: inline-flex; }
.scene[data-mode="mask"] { cursor: crosshair; touch-action: none; }
.scene[data-mode="mask"]:focus-visible { outline-offset: 3px; }
.brush-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.brush-overlay path { fill: none; stroke: #2d9b76; stroke-linecap: round; stroke-linejoin: round; opacity: .72; }
.brush-overlay path[data-mode="erase"] { stroke: #f29277; }
.brush-overlay circle { fill: #30271f80; stroke: #fffdf8; stroke-width: 2; }
.mask-corrections { margin-block: .75rem; border-block: 1px solid var(--interior-line); }
.mask-corrections summary { width: fit-content; min-height: 3rem; align-content: center; cursor: pointer; font-weight: 650; color: var(--espresso); }
.mask-corrections p { margin: 0 0 .35rem; }
.mask-corrections .layer-choices, .mask-corrections .editor-actions { margin-block: 0; }

#focus-photo { min-height: 3rem; }


.studio-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .8rem; color: var(--interior-muted); font-size: .9rem; }
.layer-choices { border: 0; padding: 0; margin: 0 0 .7rem; display: flex; flex-wrap: wrap; gap: .65rem; }
.layer-choices legend { font-size: .88rem; font-weight: 650; }
.layer-choices label { display: inline-flex; min-height: 3rem; align-items: center; gap: .3rem; font-size: .9rem; cursor: pointer; }
.layer-choices input { margin: 0 .25rem 0 0; }
.layer-choices .sample-upload-hint { flex-basis: 100%; margin: 0 0 .5rem; font-size: .84rem; }
#focus-photo { min-height: 3rem; }

@media (max-width: 48rem) {
  .account-gate { grid-template-columns: 1fr; }
  .studio-layout { grid-template-columns: 1fr; gap: 1.15rem; }
  .steps button { display: grid; justify-items: center; align-content: center; min-height: 4.15rem; text-align: center; gap: .3rem; font-size: .79rem; line-height: 1.18; }
  .steps button span:first-child { width: 1.35rem; height: 1.35rem; }
  input[type="range"] { min-height: 3rem; }
}
