/* Shared layout contract. Descriptions expand on demand; headings do not use forced breaks. */
:root { --radius: 14px; }
body { line-height: 1.65; }
main p, .description, .muted:not(button):not(a), .help-dialog li, .cap > span,
.feature p, .look-note, .secure span { text-align: justify; text-justify: inter-word; }
h1, h2, h3, h4 { text-wrap: balance; overflow-wrap: anywhere; }
main.wrap h1 { font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.25rem); line-height: 1.3; max-width: none; }
main.wrap h2 { font-size: clamp(1.1rem, 1rem + .3vw, 1.35rem); line-height: 1.4; }
main.wrap h3 { font-size: 1rem; line-height: 1.45; }
.pagehead { gap: 12px; margin-bottom: 0; }
.pagehead p { margin-top: 6px; font-size: .9rem; }
.grid > *, .row > *, .card, .step, .pcol, .home-intro { min-width: 0; }
button, .btn { text-wrap: balance; }
.help-hint { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 28px;
  padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); box-shadow: none; font: 600 14px/1 var(--font); vertical-align: middle; }
.help-hint:hover { color: var(--accent); border-color: var(--accent); box-shadow: none; transform: none; }
.help-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 64px); overflow: auto; padding: 24px; margin: auto;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.help-dialog::backdrop { background: #17233d66; backdrop-filter: blur(3px); }
.help-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-dialog p, .help-dialog .row { margin-top: 16px; }
.help-dialog li { margin-bottom: 10px; }
/* The home page only introduces the product. Catalog, help, plans and creation have their own routes. */
.home-minimal { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, .7fr); align-items: center; gap: clamp(24px, 5vw, 72px); padding: clamp(24px, 5vh, 60px) 0; }
.home-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.home-minimal h1 { font-size: clamp(1.65rem, 2.6vw, 2.4rem); letter-spacing: -.035em; }
.home-intro > p { max-width: 48ch; font-size: 1rem; }
.home-intro .cta { display: flex; flex-wrap: wrap; gap: 10px; }
.home-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.home-preview { margin: 0; justify-self: center; width: min(280px, 100%); padding: 9px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 12px 40px #17315c0d; }
.home-preview canvas, .home-preview video, .home-preview img { width: 100%; display: block; border-radius: 10px; aspect-ratio: 9/16; object-fit: contain; }
.home-preview figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px 2px; font-size: .7rem; color: var(--muted); }
.home-preview figcaption button { font-size: .7rem; padding: 4px 8px; min-height: 32px; }
body[data-page="home"] .topsearch { display: none; }
body[data-page="home"] main.wrap { gap: 0; width: 100%; }
footer.site { margin-top: 20px; padding-top: 24px; }
/* Creation: one input, one visual decision, one output decision. Extras stay collapsed. */
form.create { width: min(100%, 1040px); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
form.create > .step:first-child { grid-row: span 2; align-self: stretch; }
.field-caption, .look-control { display: flex; align-items: center; gap: 8px; }
.field-group { display: flex; flex-direction: column; gap: 6px; font-size: .875rem; color: var(--muted); font-weight: 600; }
.look-control > .nv-select { flex: 1; min-width: 0; }
.create .step { gap: 12px; }
.create .step { padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; background: var(--card); }
.create .step > header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.create .step > header > div { display: flex; align-items: center; gap: 10px; }
.create .stepno { width: 30px; height: 30px; font-size: .85rem; flex-shrink: 0; }
.create .step > label + label { margin-top: 4px; }
.create .lookpick { grid-template-columns: minmax(0, 1fr) 130px; gap: 24px; align-items: start; }
.create .look-demo { width: 130px; max-height: 245px; margin: 0; }
.create .look-demo canvas { max-height: 220px; object-fit: contain; }
.lookpick-side > label { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.look-note:empty { display: none; }
.create .summary { font-size: .85rem; margin-block: 16px; }
.create .grid.wide-2 { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.create .voice-field .listen { width: 40px; min-width: 40px; padding-inline: 8px; }
.advanced > summary { font-size: .875rem; font-weight: 600; }
.advanced[open] > summary { margin-bottom: 16px; }
.direction-editor { display: flex; flex-direction: column; gap: 14px; }
.direction-editor .advanced { margin: 0; }
.catalog-title, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.catalog-title h3, .section-title h2 { min-width: 0; }
.catalog-title h3 { flex: 1; }
.fcard .help-hint { width: 28px; min-width: 28px; flex: 0 0 28px; min-height: 28px; padding: 0; }
.fcard { display: flex; flex-direction: column; }
.fcard > button { margin-top: auto; }
main small:not(.tag):not(.pill) { text-align: justify; text-justify: inter-word; }
.sbar .help-hint { flex-shrink: 0; }
@media (min-width: 1101px) {
  .create .step:first-child > label[for="f-topic"] { flex: 1; }
  .create #f-topic { flex: 1; min-height: 300px; }
  .create .lookpick { grid-template-columns: minmax(0, 1fr) 86px; gap: 12px; }
  .create .look-demo { width: 86px; max-height: 172px; }
  .create .look-demo canvas { max-height: 150px; }
}
@media (max-width: 1100px) {
  form.create { display: flex; width: min(100%, 760px); }
}
@media (max-width: 760px) {
  main.wrap { width: 100%; }
  .home-minimal { grid-template-columns: 1fr; gap: 28px; padding: 24px 0; }
  .home-intro { gap: 16px; }
  .home-preview { width: min(240px, 72vw); }
  .home-minimal h1 { font-size: clamp(1.5rem, 6.2vw, 2rem); }
  .home-intro .cta { width: 100%; }
  .home-intro .cta > * { flex: 1; padding-inline: 12px; }
  .create .lookpick { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; }
  .create .look-demo { width: 96px; max-height: 190px; }
  .create .look-demo canvas { max-height: 165px; }
  .create .step { padding: 16px; }
  .sbar { flex-wrap: wrap; }
  .help-hint { width: 32px; height: 32px; min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* Full frames and a single composed home stage. */
.home-minimal { grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr); gap: 44px; padding: 34px 0 20px; min-height: 640px; }
.home-intro { gap: 24px; padding: 24px 0; }
main.wrap .home-minimal h1 { font-size: clamp(1.8rem, 3.1vw, 2.8rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.2; text-transform: none; overflow-wrap: normal; text-wrap: balance; max-width: 17ch; }
.home-intro .description { max-width: 42ch; font-size: 1rem; color: var(--muted); }
.home-intro .cta { gap: 10px; flex-wrap: wrap; }
.home-intro .cta .btn { min-height: 48px; border-radius: 10px; padding-inline: 22px; }
.home-meta { border-top: 1px solid var(--line); padding-top: 20px; width: 100%; max-width: 400px; letter-spacing: .02em; }
.home-stage { background: #18293a; background-image: radial-gradient(ellipse at 80% 30%, #31556b 0, transparent 65%); border-radius: 24px; padding: 22px; display: grid; justify-items: center; gap: 20px; position: relative; color: #edf4f9; box-shadow: 0 22px 50px #16314814; }
.stage-heading { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; font-size: .65rem; letter-spacing: .13em; font-weight: 600; color: #c6d4df; }
.stage-dot { width: 7px; height: 7px; background: #bdeca3; border-radius: 50%; box-shadow: 0 0 0 5px #bdeca314; }
.home-stage .home-preview { width: 230px; border: 1px solid #ffffff32; background: #f7f6f2; padding: 6px; margin: 0; border-radius: 14px; box-shadow: 0 14px 32px #07152255; transform: rotate(-2deg); }
.home-stage .home-preview figcaption { color: #44586b; font-size: .65rem; }
.home-stage .home-preview canvas { border-radius: 8px; }
.stage-steps { display: flex; justify-content: space-between; gap: 14px; width: 100%; padding-top: 16px; border-top: 1px solid #ffffff24; }
.stage-steps > span { display: flex; align-items: center; gap: 7px; font-size: .7rem; white-space: nowrap; }
.stage-steps i { font: 500 .6rem/1 var(--font); color: #a8cbdc; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.gallery-toolbar .tabs { margin: 0; }
.gallery-toolbar > select { width: auto; min-width: 170px; }
.gallery-toolbar > .nv-select { width: 190px; flex: 0 0 190px; min-width: 0; }
.ratio-tabs { background: var(--card); border: 1px solid var(--line); padding: 4px; border-radius: 12px; }
.fgrid { grid-template-columns: repeat(auto-fill, minmax(min(235px, 100%), 1fr)); align-items: start; gap: 22px; }
.fgrid.landscape { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.fcard { padding: 12px; gap: 12px; }
.fthumb { width: 100%; aspect-ratio: 9/16; background: #eff2f5; }
.fthumb.wide { aspect-ratio: 16/9; }
.fthumb canvas, .fthumb.wide canvas { width: 100%; height: 100%; max-width: 100%; object-fit: contain; }
.community { grid-template-columns: repeat(auto-fill, minmax(min(235px, 100%), 1fr)); align-items: start; gap: 22px; }
.community.landscape { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.vthumb { aspect-ratio: 9/16; background: #172534; }
.vcard.wide .vthumb { aspect-ratio: 16/9; }
.vthumb video { object-fit: contain; }
@media (max-width: 1000px) and (min-width: 761px) {
  .home-minimal { gap: 24px; grid-template-columns: 1fr 1fr; min-height: 590px; }
  .home-stage { padding: 18px; }
  .home-stage .home-preview { width: 205px; }
  .stage-steps { gap: 8px; }
  .stage-steps > span { font-size: .6rem; }
}
@media (max-width: 760px) {
  .home-minimal { min-height: 0; grid-template-columns: 1fr; padding-top: 8px; gap: 20px; }
  .home-intro { padding: 14px 0 4px; gap: 18px; }
  main.wrap .home-minimal h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); max-width: 24ch; }
  .home-intro .description { font-size: .9rem; }
  .home-meta { padding-top: 12px; }
  .home-stage { padding: 18px; gap: 18px; }
  .home-stage .home-preview { width: min(220px, 66vw); }
  .gallery-toolbar { align-items: stretch; }
  .gallery-toolbar .tabs { flex-wrap: wrap; }
  .fgrid, .community { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fgrid.landscape, .community.landscape { grid-template-columns: 1fr; }
  .fcard { padding: 8px; gap: 10px; }
  .fcard .catalog-title h3 { font-size: .8rem; overflow-wrap: normal; }
  .fcard > button { font-size: .75rem; padding-inline: 4px; }
}

/* A stable stage keeps portrait and landscape clips fully visible without layout jumps. */
.home-stage { background-image: radial-gradient(ellipse at 80% 25%, #31556b 0, transparent 65%), linear-gradient(145deg, #18293a, #10212f); }
.home-stage .home-gallery { transform: none; width: 255px; }
.hero-viewport { width: 100%; aspect-ratio: 9/16; overflow: hidden; border-radius: 8px; background: #101923; }
.hero-track { display: flex; width: 100%; height: 100%; transition: transform .45s ease; }
.hero-slide { flex: 0 0 100%; width: 100%; min-width: 0; height: 100%; }
.home-gallery .hero-slide video, .home-gallery .hero-slide img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; border-radius: 0; }
.home-gallery figcaption { min-width: 0; gap: 10px; padding: 10px 3px 5px; }
.hero-caption { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-count { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.hero-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px; }
.hero-dots, .hero-controls { display: flex; align-items: center; gap: 3px; }
.hero-dot { width: 16px; height: 28px; min-height: 28px; padding: 0; box-shadow: none; background: transparent; border: 0; display: grid; place-items: center; }
.hero-dot::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #a7b2c1; }
.hero-dot.on::after { width: 13px; border-radius: 4px; background: var(--blue); }
.hero-controls button { min-width: 30px; min-height: 30px; padding: 3px 6px; font-size: .75rem; }
.hero-dots { max-width: 145px; flex-wrap: wrap; }
.hero-nav button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.home-minimal { isolation: isolate; }
@media(max-width:760px) { .home-stage .home-gallery { width: min(255px, 76vw); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.home-contact { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.home-contact:hover { color: var(--blue); }

.browser-render { padding: 24px; }
.browser-render > p { margin-block: 12px; }
.browser-render-preview { display: flex; justify-content: center; max-height: 38vh; margin-block: 12px; }
.browser-render-preview canvas { max-width: 100%; max-height: 38vh; width: auto; object-fit: contain; }
.browser-render progress { width: 100%; margin-block: 12px; }
.browser-render .browser-result { width: 100%; max-height: 48vh; object-fit: contain; background: #14202d; margin-top: 12px; }
.browser-render > .row { flex-wrap: wrap; margin-top: 12px; }

.creative-hints{gap:8px;flex-wrap:wrap;margin:12px 0}.creative-plan{margin-bottom:12px;padding:16px}.creative-plan>summary{font-weight:700;cursor:pointer}.creative-plan .description{text-align:justify;font-size:14px;line-height:1.65}.creative-plan textarea{width:100%;min-height:90px}.creative-plan label{display:block;margin:12px 0}.creative-plan details{margin:10px 0}.creative-plan .row{flex-wrap:wrap}

.pcol>.creative-plan{flex:0 0 auto;max-height:30vh;overflow:auto}@media(max-width:1099px){.pcol>.creative-plan{max-height:none}}
