:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --ink: #252525;
  --muted: #716b62;
  --line: #d4ccbf;
  --accent: #59604b;
  --surface: #eee8dc;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.6; }
button, input, select { font: inherit; color: inherit; border-radius: 0; }
button, select, input[type="number"] { border: 1px solid var(--line); background: transparent; }
button { min-height: 44px; padding: 10px 17px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--ink); background: var(--surface); }
button:disabled { cursor: default; opacity: .5; }
button.primary { color: var(--paper); background: var(--ink); border-color: var(--ink); }
button.primary:hover:not(:disabled) { background: #45483b; }
select, input[type="number"] { width: 100%; min-height: 44px; padding: 9px; }
input[type="range"] { display: block; width: 100%; min-height: 30px; margin: 0; accent-color: var(--accent); cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; flex: 0 0 auto; }
input[type="color"] { width: 48px; height: 38px; padding: 3px; border: 1px solid var(--line); background: transparent; }
label { display: block; margin: 18px 0 6px; font-size: 12px; }
label output { float: right; color: var(--muted); }
.check { display: flex; gap: 9px; align-items: flex-start; line-height: 1.5; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .wordmark { font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-weight: 500; }
h1 { margin-bottom: 0; font-size: clamp(40px, 5vw, 64px); letter-spacing: -.035em; line-height: 1.1; }
h2 { font-size: 27px; line-height: 1.25; }
h3 { font-size: 21px; line-height: 1.35; margin-bottom: 14px; }
.site-header, main, .site-footer { width: min(1600px, 100% - 96px); margin-inline: auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 25px 0; border-bottom: 1px solid var(--line); }
.wordmark { text-decoration: none; font-size: 23px; }
.site-header p { color: var(--muted); font-size: 12px; margin: 0; }
.site-header p span { margin: 0 15px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; padding: 52px 0 37px; }
.page-heading > p { margin: 0 0 3px; color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 12px; }
.upload-area { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 30px; padding: 25px 28px; border: 1px dashed #a49b8a; }
.upload-area h2 { font-size: 23px; margin-bottom: 3px; }
.upload-area p { color: var(--muted); margin: 0; font-size: 12px; }
.upload-area .privacy-note { flex-basis: 100%; font-size: 11px; }
.upload-area.is-over { background: var(--surface); border-color: var(--ink); }
.studio-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 46px; margin-top: 40px; }
.settings { border-right: 1px solid var(--line); padding-right: 30px; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
legend, .settings-heading { font: 11px/1.5 Inter, sans-serif; padding: 0; margin-bottom: 16px; color: var(--muted); }
legend span, .settings-heading span { color: var(--ink); font-weight: 600; margin-left: 10px; }
.dimensions { display: block; font-size: 13px; margin-top: 15px; font-weight: 600; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 12px 0 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.colour-field { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.settings-divider { height: 1px; background: var(--line); margin: 28px 0 23px; }
.split-heading { margin: 23px 0 0; color: var(--ink); font-weight: 600; }
.preview-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.preview-modes button { font-size: 12px; }
.preview-modes button[aria-pressed="true"] { border-color: var(--ink); background: var(--surface); }
#generate { width: 100%; margin-top: 26px; }
.status { min-height: 40px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.message { padding: 10px 0; margin: 12px 0; font-size: 12px; }
.error { color: #8b3328; }
.warning { color: #7a5724; }
.workspace { min-width: 0; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.workspace-heading h2 { margin: 0; }
.workspace-heading > span { font-size: 11px; color: var(--muted); }
.empty-state { min-height: 430px; display: flex; flex-direction: column; justify-content: center; text-align: center; background: var(--surface); padding: 25px; }
.empty-state p { font-family: Georgia, serif; font-size: 25px; margin-bottom: 8px; }
.empty-state span { color: var(--muted); font-size: 12px; }
.cover-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; }
.panel-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 15px; margin-bottom: 14px; }
.panel-title h3 { margin: 0; }
.panel-title span { color: var(--muted); font-size: 10px; }
.original-stage { min-height: 180px; height: 300px; display: grid; align-items: center; justify-items: center; padding: 16px; background: var(--surface); }
.original-stage canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.editor-stage { position: relative; overflow: hidden; cursor: grab; touch-action: none; background: var(--surface); }
.editor-stage.is-dragging { cursor: grabbing; }
.editor-stage canvas { display: block; width: 100%; height: 100%; }
.cover-stage { max-width: 330px; margin-inline: auto; }
.editor-controls label { margin-top: 12px; font-size: 11px; }
.editor-controls select { font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button-row button { font-size: 11px; padding: 8px 12px; }
.panorama-panel { margin-top: 38px; padding-top: 25px; border-top: 1px solid var(--line); }
.panorama-viewport { overflow-x: auto; margin-top: 16px; padding-bottom: 10px; overscroll-behavior-x: contain; }
.panorama-stage { width: 100%; margin-inline: auto; }
.cut-lines { position: absolute; inset: 0; display: grid; pointer-events: none; }
.cut-lines span { position: relative; min-width: 0; border-right: 1px dashed rgb(255 255 255 / 90%); border-bottom: 1px dashed rgb(255 255 255 / 90%); }
.cut-lines span[data-row-end="true"] { border-right: 0; }
.cut-lines span[data-last-row="true"] { border-bottom: 0; }
.cut-lines span::before { content: attr(data-label); position: absolute; top: 4px; left: 4px; padding: 1px 4px; font-size: 10px; background: #252525; color: #f5f1e8; }
.panorama-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 25px; }
.panorama-controls .button-row { grid-column: 1 / -1; }
.results { margin-top: 45px; padding-top: 30px; border-top: 1px solid var(--line); }
.results .workspace-heading { align-items: flex-end; }
.results .eyebrow { margin-bottom: 6px; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 35px; margin-top: 25px; }
.simulation { min-width: 0; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.carousel::-webkit-scrollbar { display: none; }
.carousel figure { flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; }
.carousel img { display: block; width: 100%; height: auto; }
.carousel-navigation { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.carousel-navigation span { font-size: 11px; color: var(--muted); }
.carousel-navigation button { min-width: 44px; padding: 7px; font-size: 18px; }
.carousel-dots { display: flex; flex-wrap: wrap; justify-content: center; }
.carousel-dots button { border: 0; min-width: 28px; padding: 6px; font-size: 11px; color: var(--muted); }
.carousel-dots button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.slide-list { display: grid; gap: 15px; }
.slide-file { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; gap: 12px; }
.slide-file img { display: block; width: 64px; height: auto; }
.slide-file p { font-size: 12px; margin-bottom: 4px; }
.slide-file small { display: block; color: var(--muted); font-size: 10px; }
.row-transition { color: var(--accent); font-size: 12px; line-height: 1.6; margin: 12px 0; }
.slide-file--row-start { padding-top: 14px; border-top: 1px solid var(--line); }
.slide-file button { font-size: 11px; margin-top: 6px; min-height: 36px; padding: 5px 10px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 65px; padding-block: 23px; color: var(--muted); font-size: 11px; }
.site-footer p { margin: 0; }
.skip-link { position: fixed; z-index: 50; top: 10px; left: 10px; padding: 10px; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
@media (min-width: 1400px) { .cover-stage { max-width: 360px; } .original-stage { height: 360px; } }
@media (max-width: 1050px) {
  .site-header, main, .site-footer { width: calc(100% - 48px); }
  .studio-layout { grid-template-columns: 225px minmax(0, 1fr); gap: 26px; }
  .settings { padding-right: 22px; }
  .cover-row { gap: 20px; }
  .original-stage { height: 220px; }
  .result-layout { grid-template-columns: 1fr; }
  .simulation { max-width: 400px; }
}
@media (max-width: 740px) {
  .site-header, main, .site-footer { width: calc(100% - 36px); }
  .wordmark { font-size: 20px; }
  .page-heading { display: block; padding: 32px 0 26px; }
  .page-heading > p { margin-top: 15px; font-size: 12px; }
  .upload-area { padding: 20px; }
  .studio-layout { display: flex; flex-direction: column; gap: 30px; margin-top: 30px; }
  .settings { border-right: 0; padding: 0 0 26px; border-bottom: 1px solid var(--line); }
  #settings-fields { display: grid; grid-template-columns: minmax(0, 1fr); }
  .settings .hint { max-width: 500px; }
  .empty-state { min-height: 250px; }
  .original-stage { height: 210px; }
  .cover-row { gap: 18px; }
  .panel-title { min-height: 48px; display: block; }
  .panel-title span { display: block; margin-top: 3px; }
  .editor-controls .field-pair { grid-template-columns: 1fr; gap: 0; }
  .workspace-heading { align-items: flex-start; }
  .workspace-heading > span { max-width: 140px; text-align: right; }
  .results .workspace-heading { display: block; }
  .results .workspace-heading button { margin-top: 17px; }
  .site-footer { display: block; margin-top: 40px; }
}
@media (max-width: 420px) {
  .cover-row { grid-template-columns: 1fr; }
  .original-stage { height: 220px; }
  .cover-stage { max-width: 280px; }
  .original-panel { margin-bottom: 12px; }
  .site-header p { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
