:root {
  color-scheme: light;
  --pine: #102221;
  --pine-light: #173631;
  --deep: #071512;
  --jade: #bce9d3;
  --ink: #132b25;
  --muted: #52635e;
  --paper: #f2f3ee;
  --white: #fcfdf9;
  --line: #d7ded6;
  --orange: #ffad77;
  font: 16px/1.5 "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
[hidden] { display: none !important; }
a { color: inherit; }
button, textarea, select, input { font: inherit; }
button, select, .button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled, select:disabled, textarea:disabled, input:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #268772; outline-offset: 3px; }
.direction :focus-visible { outline-color: var(--orange); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: .6rem; left: .6rem; padding: .5rem 1rem; background: white; }
.shell { width: min(1250px, 100% - 80px); margin: 0 auto; }
.top { background: var(--pine); color: var(--white); }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 1rem; }
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; text-underline-offset: .3em; }
.top .brand { display: flex; align-items: center; gap: .75rem; font-weight: 750; white-space: nowrap; }
.brand img { object-fit: contain; background: white; border-radius: 6px; }
.top nav { display: flex; gap: clamp(.85rem, 3vw, 2rem); font-size: .88rem; color: #dde9e2; }
.intro { padding: clamp(2.4rem, 6vw, 5.1rem) 0 clamp(1.8rem, 4vw, 3.2rem); }
.section-name { margin: 0 0 .4rem; color: #316759; font-size: .8rem; letter-spacing: .105em; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { line-height: 1.05; letter-spacing: -.055em; font-weight: 760; }
h1 { font-size: clamp(2.65rem, 6.5vw, 6rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.3rem); }
h3 { font-size: 1rem; }
.intro > p:not(.section-name) { margin-top: 1.05rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 580px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 1.05rem; align-items: start; }
.panel { min-width: 0; padding: clamp(1.15rem, 3vw, 1.85rem); border: 1px solid var(--line); border-radius: 1.25rem; background: var(--white); }
.panel-head, .references-row, .section-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.panel-head { margin-bottom: 1.35rem; }
.direction { background: var(--pine); color: var(--white); border-color: var(--pine); }
.direction .section-name { color: var(--jade); }
.direction .quiet { border: 0; background: transparent; color: var(--jade); text-decoration: underline; text-underline-offset: .25em; padding: .35rem 0; }
textarea, input:not([type=file]), select { min-width: 0; width: 100%; border: 1px solid #c8d3ca; border-radius: .55rem; background: var(--white); color: var(--ink); padding: .6rem .7rem; }
textarea { resize: vertical; }
#prompt { display: block; min-height: 138px; padding: 1rem; border: 1px solid #52716a; background: var(--deep); color: var(--white); font-size: 1.05rem; }
#prompt::placeholder { color: #a8bcb2; opacity: 1; }
.composer-tools { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; margin-top: .8rem; }
.options { display: flex; flex-wrap: wrap; gap: .6rem; }
.options label, .project-fields label, .scene-fields label { display: grid; gap: .25rem; font-size: .875rem; font-weight: 660; }
.direction select { background: var(--pine-light); color: var(--white); border-color: #52716a; }
.button, .primary { display: inline-flex; justify-content: center; align-items: center; width: fit-content; min-height: 41px; padding: .55rem .8rem; border-radius: .6rem; font-size: .875rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.primary { border: 1px solid var(--orange); background: var(--orange); color: #201710; }
.primary:hover { background: #ffc499; }
.secondary { background: var(--white); border: 1px solid #bccbc1; color: var(--ink); }
.secondary:hover { background: #e7f2ea; }
.direction .secondary { background: var(--pine-light); border-color: #52716a; color: var(--white); }
.direction .secondary:hover { background: #245047; }
.help { margin-top: .7rem; font-size: .875rem; color: var(--muted); }
.help:empty { display: none; }
.direction .help, .references-row p { color: #b3c9bd; }
.ai-control { display: inline-flex; align-items: center; gap: .35rem; margin-top: .7rem; color: var(--jade); font-size: .875rem; }
.ai-control input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--jade); }
.references { border-top: 1px solid #36534b; margin-top: 1.1rem; padding-top: .9rem; }
.references-row p { font-size: .875rem; }
.add-photos:has(+ input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 3px; }
.add-photos[aria-disabled="true"] { opacity: .65; cursor: wait; }
.photo-list { display: flex; gap: .55rem; flex-wrap: wrap; }
.photo-tile { position: relative; margin-top: .7rem; }
.photo-tile img { display: block; width: 66px; height: 56px; object-fit: cover; border-radius: .35rem; }
.photo-tile button { position: absolute; top: -.3rem; right: -.3rem; display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 1px solid #769086; background: var(--deep); color: white; border-radius: 50%; line-height: 1; }
.conversation { display: grid; gap: .6rem; max-height: 230px; overflow-y: auto; margin-bottom: .8rem; padding: .25rem .15rem .5rem; }
.message { width: fit-content; max-width: 93%; overflow-wrap: anywhere; padding: .55rem .7rem; border-radius: .55rem; font-size: .92rem; white-space: pre-wrap; }
.message.user { justify-self: end; background: #23453d; }
.message.studio { color: var(--jade); background: #152f29; }
.format { border: 1px solid #d1dfd3; border-radius: 99px; background: #eff6ee; padding: .28rem .65rem; white-space: nowrap; font-size: .875rem; font-weight: 700; }
.monitor { display: grid; place-items: center; overflow: hidden; border-radius: .8rem; background: var(--deep); height: clamp(245px, 28vw, 335px); }
.sample { width: 100%; height: 100%; position: relative; color: white; overflow: hidden; }
.sample img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sample::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, rgba(8,24,20,.94), transparent 75%); pointer-events: none; }
.sample figcaption { position: absolute; z-index: 1; bottom: 1rem; left: 1rem; right: 1rem; display: grid; justify-items: start; }
.sample figcaption span { color: #d0f2de; font-size: .875rem; }
.sample figcaption strong { font-weight: 750; font-size: 1.3rem; }
.sample figcaption a { font-size: .875rem; text-underline-offset: .25em; margin-top: .25rem; }
#canvas { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.preview-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.download { display: inline-block; margin-top: .4rem; font-weight: 700; text-underline-offset: .25em; }
.storyboard, .starters { margin: clamp(2rem, 5vw, 4rem) 0; }
.section-head { flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.project-fields { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 1rem; align-items: start; padding: 1rem; margin-bottom: .85rem; border: 1px solid var(--line); background: var(--white); border-radius: .8rem; }
.scenes { display: grid; gap: .55rem; }
.scene { padding: 1rem; border-radius: .8rem; background: var(--white); border: 1px solid var(--line); }
.scene[open], .scene.current { border-color: #45937a; }
.scene summary { cursor: pointer; }
.scene summary strong { padding: 0 .6rem; overflow-wrap: anywhere; }
.scene summary small { color: var(--muted); font-size: .875rem; }
.scene-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .85rem; }
.scene-fields .button { align-self: end; }
.starter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.starter { display: block; width: 100%; color: var(--ink); padding: 0; text-align: left; border: 1px solid var(--line); border-radius: .8rem; background: var(--white); overflow: hidden; }
.starter:hover { border-color: #489680; }
.starter img { display: block; width: 100%; height: clamp(108px, 15vw, 165px); object-fit: cover; }
.starter span { display: grid; gap: .15rem; padding: .8rem 1rem .9rem; }
.starter small { color: var(--muted); font-size: .875rem; }
.footer { font-size: .875rem; }
@media (max-width: 890px) {
  .shell { width: min(100% - 40px, 700px); }
  .workspace { grid-template-columns: 1fr; }
  .monitor { height: clamp(245px, 55vw, 360px); }
}
@media (max-width: 550px) {
  .shell { width: calc(100% - 28px); }
  .top-inner { min-height: 57px; gap: .5rem; }
  .top nav a:last-child { display: none; }
  .top .brand { font-size: .9rem; gap: .45rem; }
  .brand img { width: 35px; height: 29px; }
  .workspace { gap: .8rem; }
  .panel { border-radius: 1rem; }
  .composer-tools .primary { width: 100%; }
  .options { width: 100%; }
  .options label { flex: 1; }
  .project-fields, .scene-fields { grid-template-columns: 1fr; }
  .starter-grid { grid-template-columns: 1fr; gap: .55rem; }
  .starter { display: grid; grid-template-columns: 100px minmax(0, 1fr); }
  .starter img { height: 100%; min-height: 75px; }
  .starter span { align-content: center; }
}

.intro-link { display: inline-block; margin-top: .75rem; color: #246855; font-weight: 750; text-underline-offset: .22em; }
