@font-face{font-family:Qabin;src:url('./assets/NotoSansArabic-Regular.ttf') format('truetype');font-weight:400;font-display:swap}@font-face{font-family:Qabin;src:url('./assets/NotoSansArabic-Bold.ttf') format('truetype');font-weight:700;font-display:swap}
:root{color-scheme:light;--bg:#ffffff;--panel:#f7f9f4;--raised:#f0f3eb;--line:#dce1d6;--fg:#252826;--muted:#636760;--accent:#b8cf9e;--on-accent:#252826;--danger:#963b39;--success:#36502d;--radius:12px;font-family:Qabin,system-ui,sans-serif;font-size:14px;line-height:1.65;background:var(--bg);color:var(--fg)}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,a,input,textarea,select{touch-action:manipulation}button,.file-button{cursor:pointer;min-height:44px;padding:7px 12px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--fg);font-weight:700;line-height:1.5}button:hover{background:#e3e5e1}button:active{transform:translateY(1px)}button:disabled{opacity:.5;cursor:not-allowed;transform:none}button.primary{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}button.primary:hover{background:#adc58e;color:#ffffff}button.danger{color:var(--danger)}button.quiet{border-color:transparent;background:transparent;font-weight:400}button.quiet:hover{background:var(--panel)}button.selected,button[aria-pressed=true]{border-color:var(--accent);background:#eef4e5;color:#334a2b}:focus-visible{outline:2px solid var(--accent);outline-offset:3px}a{color:#334a2b}input,select,textarea{width:100%;min-width:0;min-height:44px;border:1px solid var(--line);border-radius:9px;padding:7px 10px;background:#ffffff;color:var(--fg);font-size:16px;line-height:1.7}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#72766e;opacity:1}input[type=checkbox]{width:20px;min-height:20px;accent-color:var(--accent)}label{display:block;font-size:12px;color:var(--muted);margin-bottom:3px}h1,h2,h3,p{margin:0}h1{font-size:20px}h2{font-size:16px}h3{font-size:14px}small,.hint{font-size:12px;color:var(--muted)}.hint{line-height:1.8}.app{max-width:1000px;height:100dvh;min-height:500px;margin:auto;display:flex;flex-direction:column;padding:env(safe-area-inset-top) 12px env(safe-area-inset-bottom)}.header{height:56px;flex:none;display:flex;align-items:center;gap:8px;border-bottom:1px solid #e3e5e1}.brand{display:flex;gap:7px;align-items:center;text-decoration:none;color:var(--fg);font-size:22px}.brand img{width:31px;height:31px}.project-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;border:0;background:transparent;font-weight:400}.icon-button{width:44px;padding:0;font-size:24px;flex:none;background:transparent;border-color:transparent}.tabs{height:47px;display:flex;flex:none;border-bottom:1px solid #e3e5e1}.tabs button{flex:1;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);font-weight:400}.tabs button[aria-current]{color:var(--accent);border-bottom-color:var(--accent);font-weight:700}.tabs button:hover{background:#f7f9f4;color:var(--fg)}#main{min-height:0;overflow:auto;overscroll-behavior:contain;flex:1;padding:10px 0;scrollbar-width:thin;scrollbar-color:#555 transparent}.stack{display:grid;gap:8px}.row{display:flex;gap:8px;align-items:center}.row>*{min-width:0}.between{justify-content:space-between}.grow{flex:1}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.panel{background:var(--panel);border:1px solid #e3e5e1;border-radius:var(--radius);padding:10px}.toolbar{margin-bottom:8px}.toolbar select{font-size:14px;flex:1}.section-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.section-title button{font-size:12px}.script-area{height:clamp(150px,30dvh,270px);min-height:130px}.bottom{display:flex;gap:8px;padding:8px 0 2px;flex:none;border-top:1px solid #e3e5e1}.bottom>button{flex:1}.bottom>.primary{flex:1.6}.statusbar{display:flex;gap:8px;align-items:center;justify-content:space-between;font-size:10px;color:#636760;min-height:30px;flex:none}.statusbar button{font-size:11px;min-height:28px;border:0;padding:0 6px;background:none;color:var(--muted);font-weight:400}.chips{display:flex;flex-wrap:wrap;gap:6px}.chip{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:400;padding:4px 9px}.chip img{width:27px;height:27px;border-radius:50%;object-fit:cover}.badge{font-size:10px;white-space:nowrap;color:var(--muted);padding:2px 7px;border:1px solid var(--line);border-radius:20px}.badge.processing{color:#334a2b;border-color:#b8cf9e}.badge.closed,.badge.approved{color:#36502d;border-color:#9bb884}.badge.error{color:#963b39;border-color:#c99b95}.scene-card{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:8px;text-align:right;width:100%;font-weight:400;background:var(--panel)}.scene-card.active{border-color:var(--accent)}.scene-num{color:var(--accent);font:18px system-ui;text-align:center}.scene-card strong{display:block;font-size:14px}.scene-card small{font-size:11px}.empty{padding:28px 14px;text-align:center;border:1px dashed var(--line);border-radius:12px;display:grid;gap:8px;color:var(--muted)}.empty strong{color:var(--fg)}.cast-card{border:1px solid var(--line);border-radius:10px;overflow:hidden;min-width:0}.cast-card .cast-face{width:100%;height:88px;object-fit:cover;display:block;background:#ffffff}.cast-placeholder{height:60px;display:grid;place-items:center;font-size:24px;color:#636760;background:#ffffff}.cast-card .row{padding:3px 7px}.cast-card .row strong{flex:1;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cast-card .row button{font-size:12px;padding:4px;min-width:44px}.cast-card>button{border:0;border-top:1px solid var(--line);border-radius:0;width:100%;font-size:12px;font-weight:400}.thumbs{display:flex;gap:6px;overflow-x:auto;padding:3px 0;min-width:0}.thumb{position:relative;min-width:74px;width:74px;height:64px;padding:0;border-radius:8px;overflow:hidden;flex:none}.thumb img{width:100%;height:100%;object-fit:cover}.thumb span{position:absolute;bottom:0;left:0;right:0;background:#000b;color:#fff;font-size:10px;padding:1px}.thumb.active{border:2px solid var(--accent)}.thumb.add{display:grid;place-content:center;border-style:dashed;color:var(--muted);font-size:22px}.frame{background:#111;border:1px solid #dce1d6;border-radius:10px;overflow:hidden;aspect-ratio:16/9;display:grid;place-items:center;max-height:36dvh}.frame img{width:100%;height:100%;max-height:36dvh;object-fit:contain}.frame .placeholder{font-size:12px;text-align:center;color:var(--muted);padding:12px}.shot-strip{display:flex;gap:6px;overflow-x:auto;scrollbar-width:thin}.shot-strip button{flex:none;min-width:48px;font-size:12px;padding:5px}.shot-strip .ok::after{content:' ✓';color:var(--success)}details{border:1px solid #dce1d6;border-radius:9px;padding:0 10px}summary{cursor:pointer;min-height:44px;display:flex;align-items:center;justify-content:space-between;font-size:13px;list-style:none}summary::after{content:'⌄';color:var(--muted)}details[open]>summary::after{content:'⌃'}details>.stack{padding-bottom:10px}.check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--fg);min-height:36px;margin:0}.check input{flex:none}.error-box{border:1px solid #c99b95;background:#fff4f1;border-radius:9px;padding:8px;color:#963b39;font-size:12px}.notice{border:1px solid #d3ddc8;background:#f3f7ec;border-radius:9px;padding:8px;font-size:12px;color:#334a2b}.job{display:flex;align-items:center;gap:8px;font-size:12px;color:#334a2b}.spinner{width:15px;height:15px;border:2px solid #dce1d6;border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.action-edit{min-height:70px;max-height:180px;height:76px}dialog{width:calc(100% - 24px);max-width:580px;max-height:88dvh;border:1px solid #dce1d6;border-radius:16px;padding:0 12px 12px;background:#ffffff;color:var(--fg);overflow:auto}dialog::backdrop{background:#000a;backdrop-filter:blur(4px)}.dialog-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;background:#ffffff;min-height:52px;border-bottom:1px solid #e3e5e1;margin-bottom:10px}.dialog-header strong{font-size:16px}.menu-grid{display:grid;gap:7px}.menu-grid button{text-align:right;font-weight:400}.dialog-body-image{width:100%;max-height:240px;object-fit:contain;background:#ffffff;border-radius:8px}.danger-zone{border-top:1px solid #555;padding-top:12px;margin-top:12px}.muted{color:var(--muted)}.full{width:100%}.hidden,[hidden]{display:none!important}#toast{position:fixed;z-index:30;bottom:calc(70px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100% - 28px);width:max-content;background:#f0f4ea;color:#ffffff;padding:10px 14px;border-radius:10px;box-shadow:0 8px 30px #0008;font-size:13px}.ref-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.ref-item{display:grid;gap:6px;border:1px solid var(--line);border-radius:9px;padding:7px}.ref-item img{width:100%;height:90px;object-fit:contain;background:#111}.ref-item button{font-size:11px;padding:6px}.code{direction:ltr;text-align:left;font-family:monospace;font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}.prompt-box{height:280px;font:12px/1.6 monospace;direction:ltr}.meta-info{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.export-cover{border-radius:10px;border:1px solid var(--line);padding:14px;background:#252826;color:#ffffff;display:flex;gap:12px;align-items:center}.export-cover img{width:90px;flex:none}.desktop-aside{display:none}
@media(min-width:760px){.app{padding-left:24px;padding-right:24px}.header{height:64px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}.desktop-aside{display:block}.script-area{height:330px}.frame,.frame img{max-height:45dvh}.cast-card .cast-face{height:110px}.bottom{justify-content:flex-end}.bottom>button{max-width:260px}.ref-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-height:640px){.app{min-height:470px}.header{height:48px}.script-area{height:150px}.frame,.frame img{max-height:30dvh}.statusbar{min-height:26px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}}@media print{body{background:white;color:black}.app,dialog,#toast{display:none}}
