:root {
  color-scheme: light;
  --ink: #1d2023;
  --muted: #70757a;
  --line: #d7d4ce;
  --paper: #f3f0e9;
  --white: #fbfaf7;
  --ice: #a9cbd2;
  --ice-dark: #416b75;
  --focus: #126b7d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper); }
button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 62px; padding: 0 32px;
  border-bottom: 1px solid rgba(85, 86, 84, .16);
  background: rgba(243, 240, 233, .9); backdrop-filter: blur(16px);
}
.wordmark { color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 850; letter-spacing: .16em; }
.wordmark i { padding: 0 5px; color: var(--ice-dark); font-family: Georgia, serif; font-weight: 400; }
.compute-status { color: var(--ice-dark); font-size: 11px; font-weight: 700; }

main { min-height: calc(100vh - 62px); }
.screen { width: min(1440px, 100%); margin: 0 auto; padding: 36px 32px 110px; }
.eyebrow { margin: 0 0 8px; color: var(--ice-dark); font-size: 10px; font-weight: 850; letter-spacing: .18em; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.06; }
h1 { font-size: clamp(40px, 6vw, 78px); letter-spacing: -.035em; }
h2 { font-size: clamp(31px, 4vw, 52px); letter-spacing: -.025em; }

.progress {
  display: flex; align-items: center; justify-content: center;
  max-width: 780px; margin: 0 auto; padding: 24px 24px 0;
}
.progress span {
  display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px;
  border: 1px solid var(--line); border-radius: 999px;
  color: #999a97; background: var(--paper); font-size: 10px; font-weight: 800;
}
.progress span.active { border-color: var(--ink); color: white; background: var(--ink); }
.progress span.done { border-color: var(--ice-dark); color: var(--ice-dark); background: #dcebed; }
.progress i { flex: 1; height: 1px; background: var(--line); }

.start-screen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .65fr); gap: clamp(36px, 7vw, 110px); align-items: center; min-height: calc(100vh - 140px); }
.intro-copy p:last-child { max-width: 620px; margin: 28px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.brief-card { padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: 0 24px 60px rgba(44, 45, 43, .07); }
.brief-card > label:first-child { display: grid; gap: 3px; margin-bottom: 10px; }
.brief-card label b, .comment-field b { font-size: 13px; }
.brief-card label span { color: var(--muted); font-size: 11px; line-height: 1.4; }
textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; }
textarea { resize: vertical; padding: 12px; line-height: 1.45; }
select { height: 42px; padding: 0 10px; }
.brief-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 13px 0; }
.brief-options label { display: grid; gap: 6px; }
.microcopy, .warning { color: var(--muted); font-size: 10.5px; line-height: 1.5; }

.primary, .model-actions button, .quiet {
  min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px;
  background: transparent; font-size: 12px; font-weight: 800;
}
.primary { border-color: var(--ink); color: white; background: var(--ink); }
.primary:disabled { border-color: #bbb; color: #eee; background: #bbb; cursor: not-allowed; }
.primary.large { width: 100%; min-height: 50px; margin-top: 4px; }
.quiet { border-color: transparent; color: var(--ice-dark); }
.align-left { padding-left: 0; }
button:not(:disabled):hover { transform: translateY(-1px); }

.round-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 12px 0 28px; }
.round-head > div { min-width: 0; }
.round-head h2 { overflow-wrap: anywhere; }
.round-head p:last-child { max-width: 680px; margin: 13px 0 0; color: var(--muted); line-height: 1.5; }
.round-head.centered { justify-content: center; text-align: center; }
.round-head.centered p:last-child { margin-inline: auto; }

.variant-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.variant-card {
  position: relative; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 15px;
  background: var(--white); text-align: left; transition: border-color .16s, box-shadow .16s, transform .16s;
}
.variant-card:hover { border-color: #aaa8a2; box-shadow: 0 12px 30px rgba(43, 47, 48, .08); }
.variant-card.selected { border-color: var(--ice-dark); box-shadow: 0 0 0 2px var(--ice-dark), 0 14px 32px rgba(65, 107, 117, .13); }
.variant-card img { display: block; width: 100%; aspect-ratio: 1.18 / 1; object-fit: cover; background: radial-gradient(circle, #fff, #e5e2dc); }
.card-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px 12px; }
.card-body span { display: grid; gap: 2px; }
.card-body strong { font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.card-body small { color: var(--muted); font-size: 9.5px; }
.choice-mark { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 50%; color: transparent; font-size: 13px; }
.selected .choice-mark { border-color: var(--ice-dark); color: white; background: var(--ice-dark); }
.inspect-button { position: absolute; top: 9px; right: 9px; min-height: 29px; padding: 0 10px; border: 1px solid rgba(80,82,81,.2); border-radius: 999px; background: rgba(251,250,247,.82); backdrop-filter: blur(8px); font-size: 10px; font-weight: 800; }

.selection-dock {
  position: fixed; left: 50%; bottom: 18px; z-index: 15; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  width: min(680px, calc(100% - 32px)); padding: 12px 13px 12px 18px;
  border: 1px solid rgba(65, 67, 66, .2); border-radius: 16px;
  background: rgba(251,250,247,.92); box-shadow: 0 16px 45px rgba(36,39,40,.16); backdrop-filter: blur(16px);
}
.selection-dock > div { display: grid; gap: 2px; }
.selection-dock strong { font-size: 12px; }
.selection-dock span { color: var(--muted); font-size: 10px; }

.final-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1120px; margin: 0 auto; }
.final-card { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.final-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.final-card footer { display: grid; gap: 9px; padding: 17px; }
.final-card footer strong { font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.final-card footer span { color: var(--muted); font-size: 11px; }
.final-card footer button { width: 100%; }

.model-screen { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 0; width: 100%; max-width: none; min-height: calc(100vh - 140px); padding: 0; }
.model-stage { position: sticky; top: 118px; align-self: start; height: calc(100vh - 118px); min-height: 560px; overflow: hidden; background: radial-gradient(circle at 45% 42%, #fff 0, #ebe8e1 48%, #d8d5ce 100%); }
.model-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.model-stage > p { position: absolute; left: 50%; bottom: 15px; transform: translateX(-50%); margin: 0; color: var(--muted); font-size: 10px; }
.view-actions { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border: 1px solid rgba(80,82,81,.16); border-radius: 999px; background: rgba(251,250,247,.78); backdrop-filter: blur(10px); }
.view-actions button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; font-size: 10px; font-weight: 700; }
.view-actions button:hover { background: rgba(169,203,210,.25); }
.model-summary { padding: 34px 27px; border-left: 1px solid var(--line); background: var(--white); }
.model-summary > p:not(.eyebrow):not(.warning) { color: var(--muted); font-size: 13px; line-height: 1.55; }
.model-summary dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 15px; margin: 23px 0; padding: 16px 0; border-block: 1px solid var(--line); font-size: 11px; }
.model-summary dt { color: var(--muted); }
.model-summary dd { margin: 0; font-weight: 800; }
.comment-field { display: grid; gap: 7px; }
.model-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.model-actions button { min-height: 42px; background: transparent; }
.model-actions .primary { grid-column: 1 / -1; background: var(--ink); }

dialog { width: min(780px, calc(100% - 28px)); height: min(740px, calc(100% - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 30px 100px rgba(10,15,17,.3); }
dialog::backdrop { background: rgba(18,21,22,.54); backdrop-filter: blur(5px); }
dialog canvas { display: block; width: 100%; height: calc(100% - 74px); touch-action: none; }
.dialog-close { position: absolute; top: 12px; right: 12px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(251,250,247,.86); font-size: 22px; }
.dialog-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 74px; padding: 11px 15px 11px 20px; border-top: 1px solid var(--line); background: var(--white); }
.dialog-meta > div { display: grid; gap: 2px; }
.dialog-meta span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.dialog-meta strong { font-family: Georgia, serif; font-size: 21px; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 20px; z-index: 40; transform: translate(-50%, 18px); padding: 10px 15px; border-radius: 999px; color: white; background: rgba(29,32,35,.94); opacity: 0; pointer-events: none; transition: .2s; font-size: 11px; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
button:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (max-width: 980px) {
  .start-screen { grid-template-columns: 1fr; min-height: auto; }
  .intro-copy { padding-top: 30px; }
  .brief-card { max-width: 650px; }
  .variant-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .model-screen { grid-template-columns: 1fr; }
  .model-stage { position: relative; top: auto; height: 66vh; min-height: 520px; }
  .model-summary { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 680px) {
  .topbar { min-height: 54px; padding: 0 16px; }
  .compute-status { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .progress { padding: 16px 14px 0; }
  .progress span { min-width: 23px; height: 23px; padding: 0 5px; font-size: 8px; }
  .progress i { min-width: 4px; }
  .screen { padding: 25px 15px 105px; }
  h1 { font-size: 43px; }
  .start-screen { gap: 30px; }
  .brief-card { padding: 18px; }
  .brief-options { grid-template-columns: 1fr; }
  .round-head { margin-top: 5px; }
  .round-head .quiet { display: none; }
  .variant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-body { padding: 9px; }
  .card-body strong { font-size: 15px; }
  .inspect-button { display: none; }
  .selection-dock { bottom: 9px; gap: 12px; }
  .selection-dock .primary { padding-inline: 12px; }
  .final-grid { grid-template-columns: 1fr; }
  .model-stage { height: 56vh; min-height: 420px; }
  .model-summary { padding: 27px 18px; }
  .model-actions { grid-template-columns: 1fr; }
  .model-actions .primary { grid-column: auto; }
}
