/* The atelier skin. The base stylesheet retains the layout mechanics and controls. */
:root {
  --page: #f6f3eb;
  --surface: #fffcf5;
  --surface-solid: #fffcf5;
  --surface-muted: #f0ebe1;
  --stage: #eae4d8;
  --text: #24211c;
  --muted: #625b50;
  --faint: #73695e;
  --line: #dcd3c4;
  --line-strong: #aca08d;
  --accent: #9e492f;
  --accent-hover: #833a26;
  --accent-soft: #f3e3d9;
  --action: #a45035;
  --action-hover: #893e28;
  --on-action: #fff9ef;
  --success: #497351;
  --danger: #ae3b2f;
  --error-surface: #f8e6e0;
  --atelier-display: "Noto Serif SC", "Songti SC", STSong, SimSun, Georgia, serif;
  --atelier-label: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --atelier-width: 1200px;
  --atelier-gutter: clamp(22px, 5vw, 72px);
  --atelier-nav: 76px;
  --print-shadow: 0 1px 2px #30231912, 0 18px 35px -22px #4a31264a;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #211e1a;
  --surface: #29251f;
  --surface-solid: #302a23;
  --surface-muted: #322c25;
  --stage: #191714;
  --text: #f5ecdf;
  --muted: #c6b8a6;
  --faint: #b6a794;
  --line: #484034;
  --line-strong: #83735e;
  --accent: #efa888;
  --accent-hover: #ffc2a5;
  --accent-soft: #3d2c24;
  --action: #e39b79;
  --action-hover: #f4b394;
  --on-action: #251710;
  --success: #a9c3a1;
  --warning: #edc489;
  --danger: #f5a190;
  --error-surface: #472b25;
  --print-shadow: 0 1px 1px #0005, 0 19px 39px -21px #000c;
}

::selection { color: var(--text); background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:is(.welcome-experience, .welcome-hero, .welcome-page, .studio-experience) { background: var(--page); }
.welcome-hero { min-height: 0; }
.welcome-page { overflow: auto; padding: var(--atelier-nav) 0 48px; scroll-padding-top: calc(var(--atelier-nav) + 18px); transition: opacity 180ms ease; transform: none; }
:is(.welcome-nav, .topbar) {
  min-height: var(--atelier-nav);
  padding: 0 max(var(--atelier-gutter), calc((100% - var(--atelier-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--page);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.welcome-nav { --atelier-link-gap: 5px; align-items: center; }
.welcome-nav-links {
  inset: 0 auto 0 50%;
  gap: var(--atelier-link-gap);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.welcome-nav-links button {
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: .85rem;
  white-space: nowrap;
  transition: none;
}
.welcome-nav-links button:hover, .welcome-nav-links button.active {
  transform: none;
  color: var(--text);
  background: var(--surface-muted);
  box-shadow: none;
  backdrop-filter: none;
}
.welcome-nav-links button.active { font-weight: 700; }
:is(.welcome-brand, .brand) { color: var(--text); font-size: 1.01rem; font-weight: 700; gap: 9px; white-space: nowrap; }
:is(.welcome-brand-mark, .brand-mark) { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
:is(.welcome-brand-mark, .brand-mark)::before { content: none; }
.theme-picker { flex: 0 0 auto; min-height: 38px; border-radius: 6px; background: var(--page); backdrop-filter: none; }
.theme-picker select { color: var(--text); border-radius: inherit; }
.theme-picker option { background: var(--surface); }

/* Home: an asymmetric title and a single featured print on a paper field. */
.editorial-home, .welcome-page-shell {
  width: min(var(--atelier-width), calc(100% - 2 * var(--atelier-gutter)));
  margin-inline: auto;
}
.editorial-hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(26px, 5.5vw, 88px);
  padding-block: clamp(42px, 7.2vh, 92px) clamp(46px, 8vh, 102px);
}
.editorial-hero .welcome-copy {
  position: static;
  width: 100%;
  margin: 0;
  transform: none;
  text-align: left;
}
.editorial-index, .editorial-section-heading > div > p, .case-tag, .welcome-page-heading > p,
.studio-experience :is(.eyebrow, .panel-kicker) {
  margin: 0;
  color: var(--muted);
  font-family: var(--atelier-label);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.editorial-index { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; }
.editorial-index i { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.editorial-index > span { border-left: 1px solid var(--line-strong); margin-left: 3px; padding-left: 10px; }
.editorial-hero .welcome-copy h1 {
  margin: 22px 0 0;
  font: 500 clamp(2.55rem, 5.5vw, 5.2rem)/1.12 var(--atelier-display);
  letter-spacing: -.068em;
  text-wrap: initial;
  color: var(--text);
  text-shadow: none;
}
.editorial-hero .welcome-copy h1 .editorial-title-line { display: block; color: var(--text); background: none; -webkit-text-fill-color: currentColor; }
.editorial-hero .welcome-copy h1 .editorial-title-line + .editorial-title-line { margin-top: .07em; color: var(--accent); }
.editorial-hero .welcome-statement { max-width: 31em; margin: 23px 0 0; padding: 0; color: var(--muted); font-size: clamp(.96rem, 1.35vw, 1.08rem); line-height: 1.8; text-shadow: none; }
.editorial-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; }
.editorial-hero .welcome-cta {
  position: relative;
  inset: auto;
  display: inline-flex;
  justify-content: space-between;
  min-height: 46px;
  min-width: 137px;
  width: auto;
  gap: 14px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--action);
  color: var(--on-action);
  box-shadow: none;
  transform: none;
  backdrop-filter: none;
  transition: none;
}
.editorial-hero .welcome-cta:hover { background: var(--action-hover); transform: none; }
.editorial-hero .welcome-cta::before { content: none; }
.editorial-jump { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: .88rem; cursor: pointer; }
.editorial-jump:hover { color: var(--accent); }
.editorial-cover { min-width: 0; margin: 0; }
.editorial-print {
  position: relative;
  overflow: hidden;
  padding: clamp(5px, .65vw, 10px);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--print-shadow);
}
.editorial-cover .welcome-reference-art { position: static; width: 100%; height: auto; aspect-ratio: 1152 / 839; object-fit: cover; border-radius: 3px; background: var(--stage); mask-image: none; filter: none; }
.editorial-cover figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 12px; color: var(--muted); font-size: .73rem; letter-spacing: .055em; }
.editorial-cover figcaption b { margin-right: 6px; color: var(--accent); font-weight: 700; }
.editorial-shelf { padding-top: 23px; border-top: 1px solid var(--line-strong); }
.editorial-shelf:focus:not(:focus-visible) { outline: none; }
.editorial-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px 22px; margin-bottom: 20px; }
.editorial-section-heading h2 { margin: 6px 0 0; color: var(--text); font: 500 clamp(1.58rem, 3.2vw, 2.5rem)/1.2 var(--atelier-display); letter-spacing: -.045em; }
.editorial-section-heading > p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.6; }
.editorial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2.65vw, 32px); }
.editorial-case { display: grid; grid-template-rows: auto 1fr; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: border-color 160ms ease; }
.editorial-case:hover { border-color: var(--accent); }
.editorial-case img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; background: var(--stage); }
.case-body { display: grid; grid-template-rows: auto auto 1fr auto; align-content: start; padding: 15px 16px 17px; gap: 6px; }
.case-body strong { font: 600 clamp(1rem, 1.8vw, 1.22rem)/1.3 var(--atelier-display); }
.case-technique { color: var(--muted); font-size: .82rem; line-height: 1.6; }
.case-link { display: flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--accent); font-size: .78rem; font-weight: 700; }

/* Preserve the existing Explore, Gallery, Plans and About routes in the same system. */
.welcome-page-shell { padding-block-start: clamp(32px, 5vh, 70px); }
.welcome-page-heading { margin-inline: 0; text-align: left; }
.welcome-page-heading h1 { margin-top: 9px; color: var(--text); font: 500 clamp(2rem, 4.8vw, 4rem)/1.12 var(--atelier-display); letter-spacing: -.055em; }
:is(.welcome-page-heading > span, .inspiration-item small, .plan-item p, .plan-item strong, .about-copy > p, .about-copy dd) { color: var(--muted); }
:is(.inspiration-item strong, .plan-item h2, .about-copy h2, .gallery-dialog p) { color: var(--text); }
:is(.inspiration-item, .gallery-item, .plan-item, .about-visual, .about-copy dl div, .gallery-dialog, .gallery-dialog-close) {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}
:is(.inspiration-item, .gallery-item):hover { transform: none; border-color: var(--accent); box-shadow: none; }
:is(.plan-item svg, .about-copy dt) { color: var(--accent); }
.gallery-item > span { border-color: var(--line); color: var(--text); background: var(--surface); backdrop-filter: none; box-shadow: none; }
.gallery-dialog::backdrop { background: rgba(25,19,14,.7); backdrop-filter: none; }

/* Workbench: a full-width writing sheet and a print laid on a mounting board. */
.studio-experience {
  --studio-gutter: clamp(14px, 1.65vw, 34px);
  --studio-radius: 6px;
  --studio-grain: url("/assets/atelier/paper-grain.svg?v=20261127");
  --page: #eeebe2;
  --surface: #fffdf6;
  --surface-solid: #fffdf7;
  --surface-muted: #f0ebe0;
  --stage: #e7e0d3;
  --workbench-input: #fdfaf2;
  --sheet-edge: #c9bcaa;
  --sheet-cut: #e5dccd;
  --sheet-light: #fffefa;
  --sheet-shadow: #4837291e;
  --mount-light: #f5f0e5;
  --mount-edge: #cfc3b0;
  --mount-tick: #ac9a83;
  --button-edge: #7f3623;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
  background: var(--studio-grain), var(--page);
}
:root[data-theme="dark"] .studio-experience {
  --page: #22211e;
  --surface: #2e2b26;
  --surface-solid: #36312b;
  --surface-muted: #39342c;
  --workbench-input: #24221e;
  --stage: #1c1a17;
  --text: #f3ebe0;
  --muted: #cabdaf;
  --faint: #b9ab9c;
  --line: #50483e;
  --line-strong: #877967;
  --sheet-edge: #4e463b;
  --sheet-cut: #181612;
  --sheet-light: #38332b;
  --sheet-shadow: #0005;
  --mount-light: #24211c;
  --mount-edge: #433c32;
  --mount-tick: #6c5e4e;
  --button-edge: #aa6a4d;
  --action: #d79a7d;
  --action-hover: #e9ae92;
  background-blend-mode: soft-light;
}
.studio-experience .topbar {
  min-height: 60px;
  padding-inline: var(--studio-gutter);
  background: var(--page);
}
.studio-experience .theme-picker { background: var(--surface-muted); }
.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  width: calc(100% - 2 * var(--studio-gutter));
  padding-block: clamp(14px, 2.05vh, 22px) clamp(16px, 2.7vh, 32px);
}
.studio-experience .platform-stage,
#imagePlatformPane:is(.active, .entering, .leaving) { display: grid; }
.workbench-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 16px; padding: 0 0 11px; border-bottom: 1px solid var(--sheet-edge); text-align: left; animation: none; }
.workbench-heading .eyebrow { margin: 0; color: var(--accent); font: 650 .68rem/1.3 var(--atelier-label); letter-spacing: .08em; }
.workbench-heading h1 { margin: 4px 0 0; color: var(--text); font: 500 clamp(1.65rem, 2.85vw, 2.48rem)/1.16 var(--atelier-display); letter-spacing: -.045em; }
.platform-switch { display: flex; align-items: center; gap: 15px; width: auto; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; }
.platform-switch button { min-height: 36px; padding: 0 4px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); white-space: nowrap; transition: color 120ms ease; }
.platform-switch button.active { border-bottom-color: var(--accent); color: var(--text); }
.platform-switch button:disabled { cursor: not-allowed; color: var(--muted); }
.platform-switch button:active { transform: none; }
.platform-badge { flex: none; color: var(--muted); font-size: .66rem; font-weight: 500; }
.status-pill { min-height: 32px; min-width: 0; margin: 0; padding: 4px 0 4px 3px; border: 0; border-radius: 0; background: none; color: var(--muted); box-shadow: none; backdrop-filter: none; white-space: nowrap; }
.workspace {
  grid-template-columns: clamp(340px, 31.5vw, 478px) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(16px, 1.55vw, 28px);
}
:is(.control-panel, .result-panel) { min-height: 0; color: var(--text); box-shadow: none; backdrop-filter: none; animation: none; }
.control-panel {
  min-width: 0;
  gap: 14px;
  padding: 16px clamp(17px, 1.55vw, 25px) 19px;
  border: 1px solid var(--sheet-edge);
  border-radius: var(--studio-radius);
  background: var(--studio-grain), linear-gradient(162deg, var(--sheet-light), var(--surface) 65%);
  box-shadow: inset 0 1px var(--sheet-light), 0 2px var(--sheet-cut), 0 3px var(--sheet-edge), 0 5px 12px -4px var(--sheet-shadow);
}
.result-panel { gap: 10px; grid-template-rows: auto minmax(310px, 1fr); padding: 0; border: 0; border-radius: 0; background: none; }
.result-header { min-height: 39px; margin: 0; padding: 8px 1px 0; }
:is(.prompt-heading h2, .prompt-heading h2 label, .result-header h2) { margin: 0; color: var(--text); font: 600 1.24rem/1.25 var(--atelier-display); letter-spacing: -.025em; }
:is(.prompt-heading h2, #previewTitle) { display: flex; align-items: center; gap: 9px; }
.workbench-folio { border-right: 1px solid var(--sheet-edge); padding-right: 9px; color: var(--accent); font: 650 .68rem/1.4 var(--atelier-label); letter-spacing: .06em; }
.prompt-heading { align-items: center; }
.mode-label { position: static; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); box-shadow: none; backdrop-filter: none; font-size: .72rem; white-space: nowrap; }
.prompt-field { flex: 1; grid-template-rows: auto minmax(auto, 1fr) auto; gap: 7px; }
.prompt-count { justify-self: end; color: var(--faint); font: .68rem/1.15 var(--atelier-label); font-variant-numeric: tabular-nums; }
:is(.section-index, .upload-icon, .motion-mark) { border-color: var(--line); border-radius: 6px; color: var(--accent); background: var(--accent-soft); box-shadow: none; backdrop-filter: none; }
:is(.control-panel, .result-panel) :is(.field-label-row > span, .panel-kicker, .upload-copy span, .preview-copy span, .result-footer, .empty-state p, .loading-copy p) { color: var(--muted); }
:is(.control-panel .field label, .control-panel .field-label-row > label, .control-panel .group-label, .control-panel .field-control-label, .upload-copy strong, .empty-state strong, .loading-copy strong) { color: var(--text); }
.control-panel :is(textarea, select, .glass-select-trigger, .custom-dimensions input) { border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: var(--workbench-input); box-shadow: inset 0 1px 2px var(--sheet-shadow); backdrop-filter: none; transition: border-color 160ms ease; }
.control-panel textarea { min-height: 115px; max-height: none; padding: 12px 13px; line-height: 1.65; resize: vertical; }
.control-panel :is(textarea, select, .glass-select-trigger, .custom-dimensions input):hover:not(:disabled) { border-color: var(--line-strong); }
.control-panel .glass-select.open .glass-select-trigger {
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px var(--sheet-shadow);
}
.control-panel textarea::placeholder { color: var(--faint); }
.control-panel :is(textarea, select, .glass-select-trigger, .custom-dimensions input):focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: none; }
.control-panel :is(.upload-zone, .preview-row, .icon-button) { border-color: var(--line-strong); border-radius: 6px; color: var(--text); background: none; box-shadow: none; backdrop-filter: none; }
.control-panel .upload-zone { min-height: 52px; padding: 7px 10px; gap: 9px; border-radius: 4px; }
.control-panel .upload-icon { width: 30px; height: 30px; }
.control-panel .upload-icon svg { width: 16px; height: 16px; }
.control-panel :is(.upload-zone:hover, .upload-zone.dragging, .icon-button:hover) { border-color: var(--accent); background: var(--accent-soft); }
.control-panel .upload-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.settings-block { border-top: 1px solid var(--sheet-edge); padding-top: 11px; gap: 8px; }
.model-setting { min-width: 0; max-width: 62%; color: var(--muted); text-align: right; font-size: .74rem; }
.model-setting .glass-select-trigger,
.param-grid .glass-select-trigger { min-height: 42px; margin: 0; }
.param-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 10px; }
.param-grid > .field { min-width: 0; align-content: start; gap: 5px; }
.param-grid > .field > :is(label, .field-control-label) { font-size: .8rem; line-height: 1.25; }
.param-grid:has(> #resolutionField[hidden]) > .field:first-child { grid-column: 1 / -1; }
.glass-select { min-width: 0; }
.resolution-field { margin-top: 0; }
.custom-dimensions { grid-column: 1 / -1; margin: 0; border-radius: 6px; }
.control-panel .parameter-note { margin: 0; }
.glass-select.open { z-index: 22; }
.glass-select-popover {
  top: calc(100% + 6px);
  right: auto;
  width: max(100%, 204px);
  max-height: min(310px, 42svh, var(--menu-available, 310px));
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-solid);
  box-shadow: 0 6px 16px #1815101a;
  backdrop-filter: none;
  transition-property: opacity, transform;
}
.glass-select.opens-up .glass-select-popover { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.glass-select.opens-up:not(.open) .glass-select-popover { transform: translateY(5px) scale(.98); }
.glass-select-trigger { min-width: 0; gap: 5px; padding-inline: 10px; font-size: .875rem; }
.glass-select--end > .glass-select-popover { left: auto; right: 0; }
.glass-select-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glass-select-trigger > svg { flex: none; color: var(--muted); }
.glass-select-trigger:disabled { cursor: default; color: var(--muted); }
.glass-select-option {
  grid-template-columns: minmax(0, 1fr) 16px;
  column-gap: 8px;
  padding-inline: 10px;
  color: var(--muted);
  border-radius: 4px;
}
.glass-select-option strong { color: var(--text); font-size: .9375rem; font-weight: 550; line-height: 1.4; }
.glass-select-option:is(:hover, .focused, .selected) { background: var(--accent-soft); color: var(--text); box-shadow: none; }
.glass-select-option:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.primary-button { border: 1px solid var(--button-edge); border-radius: 4px; background: var(--action); color: var(--on-action); box-shadow: 0 1px 2px var(--sheet-shadow); transition: background-color 150ms ease; }
.primary-button:hover:not(:disabled) { background: var(--action-hover); box-shadow: 0 1px 2px var(--sheet-shadow); transform: none; }
.primary-button:disabled { border-color: var(--line); background: var(--surface-muted); color: var(--muted); box-shadow: none; }
.primary-button::before { content: none; }
.download-button, .download-button:hover { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); color: var(--text); box-shadow: none; transition: none; }
.download-button:hover { border-color: var(--accent); }
#resultStage {
  --print-inset: clamp(14px, 1.9vw, 32px);
  min-height: 0;
  border: 1px solid var(--mount-edge);
  border-radius: var(--studio-radius);
  background: var(--studio-grain), radial-gradient(ellipse at 38% 28%, var(--mount-light), var(--stage) 84%);
  box-shadow: inset 0 1px 3px var(--sheet-shadow), 0 1px var(--sheet-light);
}
/* Mount marks are painted behind the content, outside the print bounds. */
#resultStage::before {
  content: "";
  inset: 8px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(var(--mount-tick), var(--mount-tick)) left top / 8px 1px,
    linear-gradient(var(--mount-tick), var(--mount-tick)) left top / 1px 8px,
    linear-gradient(var(--mount-tick), var(--mount-tick)) right top / 8px 1px,
    linear-gradient(var(--mount-tick), var(--mount-tick)) right top / 1px 8px,
    linear-gradient(var(--mount-tick), var(--mount-tick)) left bottom / 8px 1px,
    linear-gradient(var(--mount-tick), var(--mount-tick)) left bottom / 1px 8px,
    linear-gradient(var(--mount-tick), var(--mount-tick)) right bottom / 8px 1px,
    linear-gradient(var(--mount-tick), var(--mount-tick)) right bottom / 1px 8px;
  background-repeat: no-repeat;
}
#resultStage::after { content: none; }
:root[data-theme="dark"] .studio-experience :is(.control-panel, #resultStage) { background-blend-mode: soft-light, normal; }
#resultImage {
  position: absolute;
  inset: var(--print-inset);
  width: calc(100% - 2 * var(--print-inset));
  height: calc(100% - 2 * var(--print-inset));
  max-height: none;
  object-fit: contain;
}
.empty-state { gap: 10px; padding: 20px; }
.empty-icon { width: 42px; height: 42px; border: 1px solid var(--mount-edge); border-radius: 4px; color: var(--accent); background: var(--mount-light); box-shadow: 0 1px 2px var(--sheet-shadow); }
.empty-state strong { font: 600 1.12rem/1.3 var(--atelier-display); }
.empty-state p { line-height: 1.5; }
#resultFooter { border-top: 1px solid var(--sheet-edge); padding-block: 8px 0; }
.progress-track { background: var(--line); }
.result-footer span:not(:last-child)::after { color: var(--line-strong); }
.message-box { border: 1px solid var(--line); background: var(--surface-muted); color: var(--text); }
.message-box.error { border-color: var(--danger); background: var(--error-surface); color: var(--danger); }

/* A print entering a frame, followed by a short turn between scenes. */
body.scene-returning .studio-experience,
body.scene-transitioning :is(.welcome-copy > *, .welcome-nav, .welcome-content-page.active) { animation: none; }
body.scene-transitioning .welcome-reference-art { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  :root { --atelier-ease: cubic-bezier(.22, .77, .23, 1); }
  .welcome-home-page.active .editorial-print .welcome-reference-art { animation: atelier-print-reveal 840ms 55ms var(--atelier-ease) both; }
  .welcome-home-page.active :is(.editorial-index, .editorial-title-line, .welcome-statement, .editorial-actions, .editorial-cover figcaption) {
    animation: atelier-rise 570ms var(--intro-delay, 65ms) var(--atelier-ease) both;
  }
  .editorial-title-line { --intro-delay: 105ms; }
  .editorial-title-line + .editorial-title-line { --intro-delay: 190ms; }
  .welcome-statement { --intro-delay: 255ms; }
  .editorial-actions { --intro-delay: 330ms; }
  .editorial-cover figcaption { --intro-delay: 440ms; }

  .editorial-case.is-revealed { animation: atelier-case-reveal 560ms var(--case-delay, 0ms) var(--atelier-ease) backwards; }
  .editorial-case:nth-child(2) { --case-delay: 75ms; }
  .editorial-case:nth-child(3) { --case-delay: 150ms; }
  .editorial-case:focus-visible { animation: none; }

  body.scene-transitioning .welcome-experience { animation: atelier-turn-out 420ms var(--atelier-ease) both; }
  body.scene-transitioning .studio-experience { animation: atelier-sheet-arrive 400ms var(--atelier-ease) both; }
  body.scene-returning .welcome-experience { animation: atelier-turn-back 360ms var(--atelier-ease) both; }
  #resultImage.reveal { animation: atelier-print-reveal 620ms var(--atelier-ease) both; }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .editorial-case img { transition: transform 450ms var(--atelier-ease); }
  .editorial-case:hover img { transform: scale(1.04); }
  .editorial-case .case-link svg, .editorial-hero .welcome-cta svg { transition: transform 220ms var(--atelier-ease); }
  .editorial-case:hover .case-link svg { transform: translate(3px, -2px); }
  .editorial-hero .welcome-cta:hover svg { transform: translateX(4px); }
}

@keyframes atelier-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes atelier-print-reveal {
  from { clip-path: inset(100% 0 0 0); opacity: .65; transform: scale(1.025); }
  to { clip-path: inset(0); opacity: 1; transform: none; }
}
@keyframes atelier-case-reveal {
  from { opacity: .42; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes atelier-turn-out {
  from { clip-path: inset(0); }
  to { clip-path: inset(0 100% 0 0); transform: translateX(-14px); }
}
@keyframes atelier-sheet-arrive {
  from { opacity: .75; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes atelier-turn-back {
  from { clip-path: inset(0 100% 0 0); transform: translateX(-14px); }
  to { clip-path: inset(0); transform: none; }
}

@media (max-width: 840px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  #imagePlatformPane .result-panel { grid-template-rows: auto minmax(clamp(270px, 49vw, 380px), 1fr); }
  .prompt-field { flex: initial; }
}
@media (max-width: 700px) {
  :root { --atelier-nav: 105px; }
  .welcome-nav { align-items: start; padding-top: 10px; }
  .welcome-nav-links { inset: 58px var(--atelier-gutter) 5px; width: auto; transform: none; gap: 2px; }
  .welcome-nav-links button { flex: 1 1 0; min-width: 0; min-height: 39px; padding: 0 5px; font-size: .81rem; }
  .editorial-hero { grid-template-columns: 1fr; gap: 28px; padding-block: 33px 37px; }
  .editorial-hero .welcome-copy h1 { font-size: clamp(2.8rem, 10vw, 4.35rem); }
  .editorial-hero .welcome-statement { margin-top: 16px; }
  .editorial-actions { margin-top: 20px; }
  .editorial-section-heading { align-items: start; flex-direction: column; }
  .editorial-grid { grid-template-columns: 1fr; gap: 14px; }
  .editorial-case:nth-child(n) { --case-delay: 0ms; }
  .studio-experience .topbar { min-height: 54px; padding-block: 6px; }
  .studio-experience { --studio-gutter: 12px; }
  .app-shell { padding-top: 13px; }
  .workbench-heading { margin-bottom: 14px; padding-bottom: 7px; }
  .workbench-heading h1 { margin: 0; }
  .workbench-heading .eyebrow { display: none; }
  .studio-top-actions { gap: 6px; }
  .status-pill { gap: 5px; font-size: .69rem; }
  .workspace { gap: 14px; }
  .control-panel { padding: 14px; gap: 12px; }
  .control-panel textarea { min-height: 103px; }
  .result-panel { gap: 8px; }
  .result-header { padding-top: 0; }
  #imagePlatformPane .result-panel { grid-template-rows: auto minmax(clamp(246px, 55vw, 380px), 1fr); }
}
@media (max-width: 400px) {
  .studio-experience .brand { font-size: .88rem; gap: 5px; }
  .studio-experience .brand-mark { width: 27px; height: 27px; }
  .studio-experience .theme-picker { padding-inline: 5px 1px; }
  .studio-experience .theme-picker > svg { display: none; }
  .platform-switch { gap: 12px; }
  .platform-switch button { gap: 4px; padding: 0 3px; }
  .glass-select-popover { max-width: calc(100vw - 58px); }
}
@media (prefers-reduced-motion: reduce) {
  .editorial-case, .glass-select-popover, .welcome-page { transition: none; }
  body.scene-transitioning :is(.welcome-experience, .studio-experience), body.scene-returning .welcome-experience,
  #resultImage.reveal { animation: none; }
}
