:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: #34273c;
  background: #fffdf9;
  --ink: #432b52;
  --text: #34273c;
  --muted: #716579;
  --accent: #8062a6;
  --teal: #287a76;
  --gold: #c89a52;
  --accent-soft: #f1ecf5;
  --teal-soft: #e8f4f2;
  --line: #ddd3e3;
  --surface: #ffffff;
  --success: #2d7169;
  --danger: #924f55;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 8% 5%, rgba(49,138,134,.13) 0, transparent 24%), radial-gradient(circle at 92% 2%, rgba(128,98,166,.17) 0, transparent 30%), #fffdf9; }
button, input, textarea, select { font: inherit; }
button, label, input, textarea, select { touch-action: manipulation; }

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(22px, calc((100vw - 1180px) / 2));
  background: rgba(255,253,249,.91);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 50px; height: 44px; border-radius: 16px; background: linear-gradient(145deg,#4b315a,#35233f); box-shadow: 0 9px 22px rgba(67,43,82,.2); }
.brand-mark svg { width: 39px; height: 33px; fill: none; overflow: visible; }
.brand-mark rect { stroke: #f7f0fa; stroke-width: 2; }
.brand-mark circle { fill: var(--gold); filter: drop-shadow(0 0 4px rgba(200,154,82,.7)); }
.brand-name { display: grid; line-height: 1; }
.brand-name strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.14rem; font-weight: 600; letter-spacing: .01em; }
.brand-name small { margin-top: 5px; color: var(--teal); font-size: .68rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.topbar p { margin: 0; color: var(--muted); font-size: .9rem; }
.studio-nav { display: flex; align-items: center; gap: 8px; }
.studio-nav a { padding: 9px 13px; border-radius: 999px; color: var(--muted); font-size: .86rem; font-weight: 750; text-decoration: none; }
.studio-nav a:hover { background: var(--accent-soft); color: var(--ink); }
.studio-nav a.current { background: var(--ink); color: white; }

.app-shell { width: min(1180px, calc(100% - 34px)); margin: 0 auto; padding: 52px 0 36px; }
.intro { position: relative; max-width: 1180px; min-height: 290px; padding: 18px 390px 12px 24px; border-left: 3px solid var(--gold); }
.intro::after { content: ""; position: absolute; z-index: -1; left: -34px; top: -38px; width: 250px; height: 170px; border-radius: 50%; background: radial-gradient(ellipse,rgba(49,138,134,.12),transparent 70%); }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; max-width: 800px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.45rem, 5vw, 4.7rem); font-weight: 500; line-height: 1.02; letter-spacing: -.045em; }
.intro > p:last-child { max-width: 720px; margin: 22px 0 0; color: var(--muted); font-size: 1.06rem; line-height: 1.7; }
.intro-art { position: absolute; right: 0; top: -28px; width: min(390px,35vw); max-height: 285px; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(67,43,82,.14)); }

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 44px 0 18px; }
.step-button { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.76); color: var(--muted); text-align: left; cursor: pointer; transition: transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
.step-button:hover { transform: translateY(-2px); border-color: rgba(128,98,166,.52); box-shadow: 0 9px 22px rgba(67,43,82,.08); }
.step-button span:first-child { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--ink); font-weight: 750; }
.step-button strong { font-size: .85rem; line-height: 1.2; }
.step-button.active { border-color: var(--ink); background: linear-gradient(135deg,var(--ink),#604275); color: white; box-shadow: 0 12px 25px rgba(67,43,82,.2); }
.step-button.active span:first-child { background: var(--gold); color: #38263f; }

.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.workspace, .project-summary { background: rgba(255,255,255,.94); border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(67,43,82,.09); }
.workspace { min-height: 610px; border-radius: 24px; padding: clamp(24px, 4vw, 48px); }
.project-summary { position: sticky; top: 18px; border-radius: 20px; padding: 24px; }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 30px; }
.panel-heading h2 { margin: 0 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; line-height: 1.12; }
.panel-heading p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.6; }
.step-kicker { flex: none; color: var(--teal); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 8px; color: #4e4454; font-size: .86rem; font-weight: 760; }
.field small, .helper { display: block; margin-top: 7px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.text-input, textarea, select { width: 100%; border: 1px solid #cbc3ca; border-radius: 12px; background: #fff; color: var(--ink); padding: 13px 14px; line-height: 1.45; }
textarea { min-height: 105px; resize: vertical; }
.text-input:focus, textarea:focus, select:focus, button:focus-visible, .upload-zone:focus-within { outline: 3px solid rgba(128,98,166,.24); outline-offset: 2px; border-color: var(--accent); }
.colour-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.colour-field { padding: 12px; border: 1px solid var(--line); border-radius: 13px; }
.colour-field input { width: 100%; height: 42px; padding: 0; border: 0; background: transparent; cursor: pointer; }

.upload-zone { position: relative; display: grid; place-items: center; min-height: 180px; padding: 28px; border: 1.5px dashed #a994b8; border-radius: 18px; background: linear-gradient(145deg,#fbf8fd,#f0f7f5); text-align: center; overflow: hidden; transition: border-color .2s ease,transform .2s ease; }
.upload-zone:hover { border-color: var(--teal); transform: translateY(-2px); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone strong { display: block; margin-bottom: 8px; font-size: 1rem; }
.upload-zone p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.back-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 30px; align-items: center; }
.card-preview { width: 210px; aspect-ratio: 11 / 19; display: grid; place-items: center; margin: auto; border: 1px solid #d7ccd4; border-radius: 17px; overflow: hidden; background: linear-gradient(145deg,#e8e1e8,#faf8f4); box-shadow: 0 20px 35px rgba(48,39,56,.14); color: var(--muted); text-align: center; padding: 16px; }
.card-preview img { width: 100%; height: 100%; object-fit: cover; }

.tool-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.button, .button-secondary, .button-quiet, .danger-button { border-radius: 999px; padding: 12px 20px; cursor: pointer; font-weight: 760; }
.button { border: 1px solid var(--ink); background: linear-gradient(135deg,var(--ink),#604275); color: white; box-shadow: 0 8px 18px rgba(67,43,82,.14); }
.button:hover { background: linear-gradient(135deg,#50345f,#73518a); }
.button-secondary { border: 1px solid #b9aeb8; background: white; color: var(--ink); }
.button-secondary:hover { background: #f7f3f5; }
.button-quiet { border: 0; background: transparent; color: var(--ink); padding-inline: 8px; text-decoration: underline; text-underline-offset: 4px; }
.danger-button { border: 1px solid #dabec1; background: #fff7f7; color: var(--danger); }
.file-button { position: relative; overflow: hidden; display: inline-flex; align-items: center; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.button:disabled, .button-secondary:disabled { opacity: .42; cursor: not-allowed; }

.card-editors { display: grid; gap: 14px; }
.card-editor { display: grid; grid-template-columns: 98px minmax(0,1fr) auto; gap: 16px; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fdfcfc; }
.card-editor img { width: 98px; aspect-ratio: 11/19; object-fit: cover; border-radius: 9px; border: 1px solid #d8cfd5; }
.card-editor-fields { display: grid; gap: 10px; }
.card-editor textarea { min-height: 82px; }
.card-actions { display: grid; gap: 8px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); cursor: pointer; }
.icon-button:hover { border-color: var(--accent); }
.empty-state { padding: 44px 20px; border: 1px dashed #cfc6cd; border-radius: 17px; text-align: center; color: var(--muted); }

.question-list { display: grid; gap: 13px; }
.question-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; }
.question-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal-soft); color: #245f5c; font-weight: 800; }

.creator-preview { min-height: 420px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); padding: 28px 20px; text-align: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.creator-preview h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; }
.creator-preview p { margin: 9px auto 0; max-width: 600px; }
.preview-arc { position: relative; height: 250px; margin: 30px auto 4px; max-width: 760px; }
.preview-card { position: absolute; left: 50%; bottom: 4px; width: 90px; aspect-ratio: 11/19; border: 2px solid var(--preview-accent, #8062a6); border-radius: 10px; overflow: hidden; background: #eee; box-shadow: 0 9px 18px rgba(30,25,34,.16); transform-origin: 50% 115%; cursor: pointer; transition: transform .25s ease, filter .25s ease; }
.preview-card:hover { filter: brightness(1.05); z-index: 100!important; }
.preview-card img { width: 100%; height: 100%; object-fit: cover; }
.preview-selected { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 22px; max-width: 600px; margin: 24px auto 0; text-align: left; }
.preview-selected img { width: 150px; aspect-ratio: 11/19; object-fit: cover; border-radius: 12px; }
.preview-selected h4 { margin: 12px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; }
.preview-selected p { margin: 0; line-height: 1.55; }

.export-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 22px; }
.export-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fbfaf9; }
.export-card h3 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.export-card p { min-height: 66px; margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.validation-box { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: #fff7ea; color: #765634; line-height: 1.5; }
.validation-box.ready { background: #edf6f1; color: var(--success); }

.actions { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.actions-right { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.project-summary h2 { margin: 0 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; }
.summary-list { display: grid; gap: 13px; margin: 0; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid #eee9ed; }
.summary-row dt { color: var(--muted); font-size: .84rem; }
.summary-row dd { margin: 0; max-width: 150px; text-align: right; font-size: .86rem; font-weight: 730; overflow-wrap: anywhere; }
.privacy-card { margin-top: 20px; padding: 15px; border-radius: 14px; background: linear-gradient(145deg,var(--accent-soft),var(--teal-soft)); color: #5d5165; font-size: .82rem; line-height: 1.5; }
.status { min-height: 22px; margin: 15px 0 0; color: var(--success); font-size: .88rem; }

footer { padding: 20px 24px 42px; color: var(--muted); text-align: center; font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 940px) {
  .intro { min-height: 250px; padding-right: 315px; }
  .intro-art { width: 310px; }
  .studio-layout { grid-template-columns: 1fr; }
  .project-summary { position: static; order: -1; }
  .summary-list { grid-template-columns: repeat(4, 1fr); }
  .summary-row { display: block; border: 0; padding: 0; }
  .summary-row dd { margin-top: 4px; max-width: none; text-align: left; }
}
@media (max-width: 720px) {
  .intro { min-height: 0; padding-right: 0; }
  .intro-art { position: static; display: block; width: min(100%,430px); max-height: 210px; margin: -8px auto 18px; }
  .studio-nav a { padding: 8px 10px; font-size: .76rem; }
  .brand-name small { display: none; }
  .app-shell { width: min(100% - 22px, 1180px); padding-top: 34px; }
  .stepper { grid-template-columns: repeat(5, minmax(56px,1fr)); overflow-x: auto; }
  .step-button { justify-content: center; padding: 10px 6px; }
  .step-button strong { display: none; }
  .workspace { min-height: 0; padding: 23px 18px; border-radius: 18px; }
  .form-grid, .colour-row, .back-layout, .export-grid { grid-template-columns: 1fr; }
  .card-editor { grid-template-columns: 74px minmax(0,1fr); }
  .card-editor img { width: 74px; }
  .card-actions { grid-column: 1 / -1; display: flex; }
  .preview-selected { grid-template-columns: 110px 1fr; }
  .preview-selected img { width: 110px; }
  .summary-list { grid-template-columns: repeat(2,1fr); }
  .actions { align-items: stretch; flex-direction: column-reverse; }
  .actions-right, .actions .button, .actions .button-secondary { width: 100%; }
  .actions-right > * { flex: 1; }
}
