:root{color-scheme:light;--canvas:#f4f7f3;--surface:#fff;--ink-blue:#123349;--muted:#657884;--line:#d9e2de;--teal:#167f73;--teal-soft:#e5f3ef;--mango:#f7c94b;--coral:#bd503e;--shadow:0 18px 50px rgba(18,51,73,.09);font-family:"Aptos","Noto Sans Khmer","Segoe UI",sans-serif}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-width:320px;min-height:100vh;color:var(--ink-blue);background:var(--canvas)}button,input,textarea{font:inherit}.studio-shell{width:min(1240px,calc(100% - 40px));margin:auto;padding:24px 0 64px}.studio-header{display:flex;align-items:center;justify-content:space-between;padding-bottom:18px;border-bottom:1px solid var(--line)}.brand{display:inline-flex;align-items:center;gap:12px;color:var(--ink-blue);font-weight:800;text-decoration:none;letter-spacing:-.025em}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:12px 4px;color:#fff;background:var(--teal);font-weight:900}.header-note{margin:0;color:var(--muted);font-size:.84rem}.intro{max-width:850px;padding:58px 0 34px}.eyebrow{margin:0 0 9px;color:var(--teal);font-size:.78rem;font-weight:800;letter-spacing:.13em;text-transform:uppercase}.intro h1{max-width:820px;margin:0;font-size:clamp(2.8rem,6vw,5.4rem);font-weight:800;line-height:.98;letter-spacing:-.06em}.intro>p:last-child{max-width:610px;margin:22px 0 0;color:var(--muted);font-size:1.1rem;line-height:1.6}
.step-rail{display:grid;grid-template-columns:repeat(4,1fr);margin:0 0 26px;padding:0;overflow:hidden;border-radius:14px;box-shadow:var(--shadow);list-style:none}.step-rail li{min-height:82px;padding:17px 20px;background:#fff}.step-rail li:nth-child(2){background:#e7f4ef}.step-rail li:nth-child(3){background:#fff2c7}.step-rail li:nth-child(4){background:#e9eef7}.step-rail b,.step-rail span{display:block}.step-rail b{margin-bottom:5px;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;opacity:.65}.step-rail span{font-size:.92rem;font-weight:750}
.workspace,.video-workspace{display:grid;grid-template-columns:minmax(0,.96fr) minmax(390px,1.04fr);gap:22px;align-items:start}.editor-panel,.result-panel,.video-controls,.video-result{border:1px solid var(--line);border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}.editor-panel{padding:8px 30px 30px}.form-section{padding:26px 0;border-bottom:1px solid var(--line)}.section-heading,.result-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.section-heading>div,legend{display:flex;align-items:center;gap:9px}.section-heading h2,.result-heading h2{margin:0;font-size:1.08rem}.section-heading>span{color:var(--muted);font-size:.84rem}.section-number{display:inline-grid;place-items:center;width:27px;height:27px;margin:0;border-radius:8px;color:var(--teal);background:var(--teal-soft);font-size:.7rem;font-weight:850}.section-heading.compact{margin-bottom:18px}
.drop-zone{display:grid;justify-items:center;gap:7px;margin-top:16px;padding:32px 20px;border:2px dashed #aec8c1;border-radius:14px;background:#f8fbf9;cursor:pointer;text-align:center;transition:.18s}.drop-zone:hover{border-color:var(--teal);background:var(--teal-soft)}.drop-zone input,.segmented input,.ratio-options input{position:absolute;opacity:0}.drop-zone:focus-within{outline:3px solid rgba(22,127,115,.25);outline-offset:3px}.upload-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;color:#fff;background:var(--teal);font-size:1.45rem}.drop-zone small{color:var(--muted)}.upload-previews{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}.upload-previews figure{min-width:0;margin:0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--canvas)}.upload-previews img{display:block;width:100%;aspect-ratio:1;object-fit:cover}.upload-previews figcaption{overflow:hidden;padding:7px;color:var(--muted);font-size:.72rem;text-overflow:ellipsis;white-space:nowrap}
.field-grid{display:grid;grid-template-columns:1.35fr .65fr;gap:17px}.field-wide{grid-column:1/-1}label>span,legend{margin-bottom:8px;color:var(--ink-blue);font-size:.86rem;font-weight:720}label em{color:var(--muted);font-style:normal;font-weight:450}input[type=text],input:not([type]),textarea{width:100%;border:1px solid #cbd8d3;border-radius:10px;padding:13px 14px;color:var(--ink-blue);background:#fbfcfb;outline:none;resize:vertical}input:focus,textarea:focus{border-color:var(--teal);box-shadow:0 0 0 3px rgba(22,127,115,.12)}.choices-grid{display:grid;grid-template-columns:.8fr 1.2fr;gap:22px}fieldset{min-width:0;margin:0;padding:0;border:0}.segmented,.ratio-options{display:flex;gap:8px}.segmented label,.ratio-options label{flex:1;cursor:pointer}.segmented span{display:grid;place-items:center;min-height:50px;margin:0;border:1px solid var(--line);border-radius:10px;background:#fbfcfb}.segmented input:checked+span{border-color:var(--teal);color:var(--teal);background:var(--teal-soft);box-shadow:inset 0 0 0 1px var(--teal)}.segmented input:focus-visible+span,.ratio-options label:has(input:focus-visible){outline:3px solid rgba(22,127,115,.28);outline-offset:2px}.ratio-options label{display:grid;place-items:center;gap:6px;min-height:78px;border:1px solid var(--line);border-radius:10px;background:#fbfcfb}.ratio-options label:has(input:checked){border-color:var(--teal);color:var(--teal);background:var(--teal-soft);box-shadow:inset 0 0 0 1px var(--teal)}.ratio-options span{display:block;border:1px solid currentColor}.ratio-square{width:20px;height:20px}.ratio-four-five{width:17px;height:22px}.ratio-story{width:12px;height:22px}.ratio-options b{font-size:.75rem}
.form-message{min-height:1.4em;margin:16px 0 8px;color:var(--coral);font-size:.88rem;line-height:1.45}.generate-button,.download-button,.secondary-button{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:58px;border:0;border-radius:12px;padding:14px 18px;color:var(--ink-blue);background:var(--mango);font-weight:800;cursor:pointer;text-decoration:none}.generate-button{justify-content:space-between}.generate-button:hover{background:#ffd867}.generate-button:disabled{cursor:wait;opacity:.6}.generate-button:focus-visible,.download-button:focus-visible,.secondary-button:focus-visible,.text-button:focus-visible{outline:3px solid rgba(22,127,115,.35);outline-offset:3px}.result-panel{position:sticky;top:18px;padding:26px}.result-heading{margin-bottom:18px}.result-heading p{margin:0 0 4px;color:var(--teal);font-size:.74rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.status-pill{padding:7px 10px;border:1px solid var(--line);border-radius:99px;color:var(--muted);background:var(--canvas);font-size:.75rem}.status-pill.active{color:#80600b;border-color:#e6c458;background:#fff8d9}.status-pill.success{color:#0b6b60;border-color:#9acfc5;background:var(--teal-soft)}.status-pill.error{color:var(--coral);border-color:#e6b6ae;background:#fff1ee}
.result-stage,.video-stage{display:grid;place-items:center;min-height:560px;overflow:hidden;border-radius:12px;background:linear-gradient(145deg,#edf2ef,#e3ebe7)}.result-stage img{display:block;width:100%;max-height:72vh;object-fit:contain}.empty-result,.empty-video{display:grid;justify-items:center;gap:18px;padding:40px;color:var(--muted);text-align:center}.empty-frame{width:108px;height:136px;border:2px solid #a9bbb4;border-radius:6px;box-shadow:12px 12px 0 -2px #e3ebe7,12px 12px 0 0 #b8c8c2}.result-actions{display:grid;gap:9px;margin-top:14px}.download-button{background:var(--teal);color:#fff}.secondary-button{border:1px solid var(--line);background:#fff}.text-button{border:0;padding:8px;color:var(--teal);background:transparent;font-weight:750;cursor:pointer}
.video-workspace{margin-top:22px}.video-controls,.video-result{padding:30px}.video-controls{color:#fff;background:var(--ink-blue)}.video-controls .eyebrow{color:#75d9ca}.video-controls h2{margin:4px 0 9px;font-size:clamp(2rem,3vw,3rem);letter-spacing:-.04em}.video-note{margin:0 0 27px;color:#bed0d9;line-height:1.55}.video-controls legend{color:#fff}.video-controls .segmented span{color:#dbe7eb;border-color:#436073;background:#183e56}.video-controls .segmented input:checked+span{color:#fff;border-color:#6ad3c3;background:#1a665f}.video-source-options{margin-top:8px}.video-source-options input:disabled+span{cursor:not-allowed;opacity:.42}.video-controls .form-message{color:#ffc0b5}.video-stage{min-height:520px}.video-stage video{display:block;width:auto;max-width:100%;height:min(68vh,620px);background:#000}.empty-video>span{display:grid;place-items:center;width:70px;height:70px;border-radius:50%;color:#fff;background:var(--teal);padding-left:4px}
@media (max-width:900px){.workspace,.video-workspace{grid-template-columns:1fr}.result-panel{position:static}.result-stage{min-height:430px}}@media (max-width:720px){.studio-shell{width:min(100% - 24px,1240px);padding-top:14px}.header-note{display:none}.brand{font-size:.92rem}.intro{padding:38px 0 26px}.intro h1{font-size:clamp(2.65rem,13vw,4rem)}.step-rail{grid-template-columns:1fr 1fr}.step-rail li{min-width:0;min-height:76px;padding:14px}.editor-panel,.result-panel,.video-controls,.video-result{min-width:0}.editor-panel{padding:4px 18px 22px}.result-panel,.video-controls,.video-result{padding:20px 18px}.field-grid,.choices-grid{grid-template-columns:minmax(0,1fr)}.field-wide{grid-column:auto}.segmented label,.ratio-options label{min-width:0}.result-stage,.video-stage{min-height:350px}.segmented.video-source-options{flex-direction:column}.generate-button,.download-button,.secondary-button{min-height:54px}}@media (prefers-reduced-motion:no-preference){.result-stage img{animation:reveal 360ms ease-out}@keyframes reveal{from{opacity:0;transform:scale(.985)}}}
