.script-composer{max-width:960px;margin:0 auto;padding:32px!important}
.script-composer h1{font-size:28px;line-height:1.4;margin:0 0 30px}
.script-composer .stack-form{gap:0}
.script-composer .stack-form>label{display:block;margin:22px 0 10px;font-size:15px;font-weight:600}
.script-composer .stack-form>label:first-of-type{margin-top:0}
.script-composer #title{font-size:18px;padding:15px 17px;border-radius:10px;background:#fff}
.script-writing-area{border:1px solid #dce5df;border-radius:12px;overflow:hidden;background:#fff}
.script-writing-area:focus-within{border-color:#73b58f;box-shadow:0 0 0 3px #18764f12}
.script-composer .script-editor-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;background:#f5f9f6;border:0;border-bottom:1px solid #e0ebe4;border-radius:0;padding:12px}
.script-composer .script-editor-tools button,.script-composer .script-editor-tools select{display:inline-flex;align-items:center;justify-content:center;gap:7px;width:auto;min-height:38px;padding:7px 12px;background:#fff;border:1px solid #d3e3d9;border-radius:7px;color:#18764f;font-family:inherit;font-size:14px;line-height:1.4;cursor:pointer;transition:background .15s,border-color .15s}
.script-composer .script-editor-tools select{min-width:145px;padding-right:30px}
.script-composer .script-editor-tools button:hover{background:#e4f2e9;border-color:#8bbfa0}
.script-composer .script-editor-tools button:focus-visible,.script-composer .script-editor-tools select:focus-visible{outline:2px solid #18764f;outline-offset:2px}
.script-composer .script-editor-tools .preview-tool{margin-left:auto}
.script-composer #body{display:block;width:100%;min-height:320px;padding:22px;margin:0;border:0;border-radius:0;box-shadow:none;outline:none;resize:vertical;background:#fff;font-size:17px;line-height:1.85}
.script-composer .editor-status:not(:empty){padding:10px 18px;background:#eff8f2;color:#18764f;font-size:13px;margin:0}
.editor-bottom{display:flex;justify-content:flex-end;border-top:1px solid #eef2ef;padding:10px 18px;font-size:12px;color:#819087}
.script-composer .editor-preview{margin:0 18px 18px;padding:20px;border:1px solid #d7e9de;background:#f7fbf8}
.script-composer .form-actions{display:flex;align-items:center;gap:22px;margin-top:24px}
.script-composer .form-actions>a{text-decoration:none;color:#6f7f75}
.script-composer .form-actions .button{border-radius:9px;padding:12px 22px}
@media(max-width:600px){.script-composer{padding:20px!important}.script-composer h1{font-size:24px;margin-bottom:24px}.script-composer .script-editor-tools{gap:6px;padding:10px}.script-composer .script-editor-tools button,.script-composer .script-editor-tools select{font-size:13px;padding:7px 9px}.script-composer .script-editor-tools .preview-tool{margin-left:0}.script-composer #body{padding:16px;min-height:280px}}

.editor-emojis{display:flex;flex-wrap:wrap;gap:4px;padding:12px;max-height:210px;overflow:auto;background:#f5faf7;border-bottom:1px solid #dce7df}.editor-emojis[hidden]{display:none}.editor-emojis button{border:0;background:transparent;padding:5px;font-size:24px;cursor:pointer;width:38px;height:38px;border-radius:6px}.editor-emojis button:hover{background:#dcefe2}.draft-tools{display:flex;gap:10px;align-items:center;justify-content:flex-end;padding:8px 12px;font-size:12px;color:#688273}.draft-tools:has([data-draft-status]:empty){display:none}.draft-tools button{border:0;background:#edf6f0;color:#18764f;border-radius:5px;padding:5px 8px;font:inherit;cursor:pointer}.script-composer .script-editor-tools button:disabled{opacity:.4;cursor:default}

.editor-upload{display:grid;gap:8px;padding:14px 16px;border-bottom:1px solid #dce7df}.editor-upload label{font-size:14px;font-weight:600}.editor-upload input{width:100%;font-size:13px;border:1px dashed #a8cdb6;border-radius:8px;padding:10px;background:#f8fcf9}.editor-upload small{font-size:12px;color:#7a8980}.editor-upload input::file-selector-button{border:0;background:#e5f2ea;color:#18764f;padding:7px 12px;border-radius:6px;margin-right:10px;cursor:pointer}

.script-composer .stack-form>.editor-upload{margin-top:18px;padding:16px;border:1px solid #dce7df;border-radius:10px;background:#fff}

.attachment-previews{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}.attachment-preview{border:1px solid #dce7df;border-radius:8px;overflow:hidden}.attachment-preview img,.attachment-preview video{display:block;width:100%;height:140px;object-fit:contain;background:#f2f6f3}.attachment-preview button{width:100%;padding:7px;border:0;background:#edf6f0;color:#18764f;font:inherit;cursor:pointer}.attachment-status{font-size:13px;color:#18764f;margin:0}

.attachment-preview button{display:flex;align-items:center;justify-content:center;min-height:38px}.attachment-preview button svg{display:block}.attachment-preview button:hover{background:#dcefe3}

.attachment-preview img,.attachment-preview video{object-fit:contain;object-position:center center;margin:0 auto}.attachment-preview{display:flex;flex-direction:column;align-items:center}.attachment-preview button{flex-shrink:0}

.attachment-media-frame{display:flex;align-items:center;justify-content:center;width:100%;height:164px;padding:12px;box-sizing:border-box;background:#f2f6f3}.attachment-preview .attachment-media-frame img,.attachment-preview .attachment-media-frame video{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;margin:0}

.attachment-open{display:flex;align-items:center;justify-content:center;width:100%;height:100%;cursor:zoom-in;border-radius:4px}.attachment-open:focus-visible{outline:2px solid #18764f;outline-offset:3px}

.editor-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:30px}.script-composer .editor-heading h1{margin:0}.editor-heading .button{white-space:nowrap}

.editor-link-dialog{width:min(460px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:26px;border:1px solid #dce5df;border-radius:18px;background:#fff;color:#182234;box-shadow:0 24px 80px #10251b33;font-family:inherit;box-sizing:border-box}
.editor-link-dialog::backdrop{background:rgba(17,35,26,.45)}
.editor-link-form{display:flex;flex-direction:column;gap:10px;margin:0}
.editor-link-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.editor-link-heading h2{font-size:22px;margin:0}
.editor-link-dialog button{font:inherit;cursor:pointer;border-radius:9px;border:1px solid #d3e3d9;padding:10px 18px;background:#f3f9f5;color:#18764f}
.editor-link-heading button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:0}
.editor-link-form label{font-weight:600;font-size:15px}
.editor-link-form input{box-sizing:border-box;width:100%;font:inherit;border:1px solid #d3e3d9;border-radius:9px;padding:12px;margin-bottom:6px;background:#fff;color:#182234}
.editor-link-form input:focus{outline:2px solid #80c49e;outline-offset:2px;border-color:#18764f}
.editor-link-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:8px}
.editor-link-actions button[type=submit]{background:#18764f;color:#fff;border-color:#18764f}
.editor-link-dialog button:hover{filter:brightness(.95)}
.editor-link-dialog button:focus-visible{outline:2px solid #18764f;outline-offset:3px}
.editor-link-error{color:#b43529;font-size:14px;margin:0}.editor-link-error:empty{display:none}

.script-composer{width:100%;max-width:none;margin:0;min-width:0}

.editor-bottom{align-items:center;gap:14px;flex-wrap:wrap}
.editor-bottom .preview-tool{font:inherit;font-size:14px;padding:8px 14px;border:1px solid #d3e3d9;border-radius:8px;background:#f5f9f6;color:#18764f;cursor:pointer}
.editor-bottom .preview-tool:hover{background:#e4f2e9}.editor-bottom .preview-tool:focus-visible{outline:2px solid #18764f;outline-offset:2px}

.script-composer #body{overflow-y:hidden;max-height:none}

/* Keep formatting tools available while scrolling long articles. */
.script-composer .script-writing-area{overflow:visible}
.script-composer .script-editor-tools{position:sticky;top:0;z-index:20;border-radius:12px 12px 0 0;box-shadow:0 3px 8px #163d2510}
@media(max-width:600px){.script-composer .script-editor-tools{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain}.script-composer .script-editor-tools>button,.script-composer .script-editor-tools>select{flex-shrink:0}}
