.story-editor{display:none;position:fixed;inset:0;max-width:440px;margin:auto;background:#111b16;color:white;overflow:hidden;isolation:isolate}
.story-editor.open{display:block}
.story-editor .media{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform-origin:center;pointer-events:none}
.story-editor .shade{position:absolute;inset:0;background:linear-gradient(#0008,transparent 25%,transparent 72%,#0008);pointer-events:none}
.story-editor .top{position:absolute;top:max(12px,env(safe-area-inset-top));left:12px;right:12px;z-index:3}
.story-editor .row{display:flex;align-items:center;gap:9px}
.story-editor .row img{width:36px;height:36px;border-radius:50%;object-fit:cover}
.story-editor .row strong{display:block}
.story-editor .row small{letter-spacing:0;font-weight:400;color:#eee}
.story-editor .spacer{flex:1}
.story-editor .round{width:42px;height:42px;background:#12251fba;border-radius:50%;color:white;font-size:21px;display:grid;place-items:center}
.story-editor .caption{position:absolute;left:8%;top:calc((100% - var(--preview-inset,0px)) * var(--caption-y,.69));font-size:29px;font-weight:850;font-style:italic;letter-spacing:-.6px;text-shadow:0 2px 9px #000a;max-width:84%;white-space:pre-wrap;overflow-wrap:anywhere}
.story-editor .bottom{position:absolute;bottom:max(18px,env(safe-area-inset-bottom));left:16px;right:16px;z-index:4;display:flex;align-items:center;gap:8px}
.story-editor .tools{position:absolute;right:12px;top:78px;display:grid;gap:10px;z-index:5}
.story-editor .edittext{touch-action:none;cursor:grab;z-index:4}
.story-editor .panel{position:absolute;left:12px;right:12px;bottom:80px;background:#12382bef;padding:14px;border-radius:9px;z-index:6;display:none}
.story-editor .panel.open{display:block}
.story-editor .panel input[type=text]{width:100%;padding:10px;border:0;border-radius:5px}
.story-editor .panel label{display:block;margin:9px 0}
.story-editor .panel input[type=range]{width:100%;accent-color:#d1bf93}
.story-editor .colors{display:flex;gap:10px}
.story-editor .colors button{border:2px solid white;border-radius:50%;width:34px;min-height:34px}
.story-editor .bottom select{background:#12382b;color:white;border:1px solid #ffffff55;border-radius:5px;padding:10px;min-width:0;flex:1}
.story-editor .publish{background:#d1bf93;color:#12382b;padding:0 18px;border-radius:5px;font-weight:800}
.story-editor .media{will-change:transform}
.story-editor #editmedia{position:absolute;inset:0;touch-action:none}
.story-editor .caption{touch-action:none}
.story-editor .top small{font-size:10px;letter-spacing:1.6px;font-weight:700}
.story-editor .status{position:absolute;bottom:70px;left:16px;right:16px;z-index:7;background:#12382bef;padding:8px;border-radius:6px;margin:0}
.story-editor .status:empty{display:none}
.story-editor .panel{max-height:55dvh;overflow:auto}
.story-editor .panel select{width:100%}
.story-editor .bottom select{background:#12382b;color:white}

.story-editor .top.tools{display:flex;gap:5px;left:10px;right:10px;top:max(8px,env(safe-area-inset-top))}
.story-editor .top strong{margin-right:auto;font-size:12px}
.story-editor .top .round{flex:none;width:34px;height:34px;min-height:34px;font-size:16px;padding:0}
.story-editor .bottom{bottom:max(10px,env(safe-area-inset-bottom));left:10px;right:10px}
.story-editor .bottom select,.story-editor .publish{min-height:34px;padding:5px 10px}
.story-editor .bottom select{flex:0 1 auto;max-width:55%}
.story-editor .publish{margin-left:auto}
.story-editor .panel{padding:8px 10px;bottom:max(53px,calc(env(safe-area-inset-bottom) + 45px))}
.story-editor .panel button{min-height:27px}
.story-editor .panel input[type=text]{padding:6px 8px}
.story-editor .text-options{display:flex;align-items:center;gap:8px}
.story-editor .text-options label{flex:1;margin:3px 0;font-size:11px}
.story-editor .text-options select{width:auto}
.story-editor .colors{gap:5px;flex-wrap:wrap;align-items:center}
.story-editor .colors button,.story-editor .colors input{width:21px;height:21px;min-height:21px;padding:0;border-radius:50%}
.story-editor .colors input{width:30px;border:0;background:transparent}
.story-editor .colors input::-webkit-color-swatch-wrapper{padding:0}
.story-editor .colors input::-webkit-color-swatch{border-radius:50%;border:2px solid #d1bf93}
.story-editor .story-input{z-index:5;box-sizing:border-box;width:min(84%,30ch);min-height:1.5em;max-height:32%;field-sizing:content;resize:none;overflow:auto;padding:0;border:0;outline:none;background:transparent;color:inherit;line-height:1.4;caret-color:#fff}
.story-editor .story-input:focus{outline:none}
.story-editor .text-tools{position:absolute;z-index:6;left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom));display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:5px 7px;background:#12382be5;border-radius:8px}
.story-editor .text-tools .text-options{flex:1;min-width:0}
.story-editor .text-tools .colors{order:1;flex:0 0 100%;flex-wrap:nowrap;overflow-x:auto;padding:2px 0}
.story-editor .text-tools .colors>*{flex:none}
.story-editor [data-text-done]{min-width:34px;min-height:34px;background:#d1bf93;color:#12382b;border-radius:50%}
.story-editor.editing-text .bottom{display:none}
.story-editor.keyboard-open{--preview-inset:78px;top:var(--keyboard-top,0px);bottom:auto;height:var(--keyboard-height);margin-inline:auto;margin-block:0}
.story-editor.keyboard-open #editmedia{bottom:var(--preview-inset)}
.story-editor.keyboard-open .text-tools{bottom:0}
.story-editor.editing-text .story-input{top:min(calc((100% - var(--preview-inset,78px)) * var(--caption-y,.69)),calc(100% - var(--preview-inset,78px) - 2.2em))}
:is(.story-editor .caption,.storyview .movie-words .story-layer)[data-style=classic]{font-family:Georgia,serif;font-style:normal;font-weight:700;letter-spacing:0}
:is(.story-editor .caption,.storyview .movie-words .story-layer)[data-style=heavy]{font-family:system-ui,sans-serif;font-style:normal;font-weight:950;letter-spacing:.03em;text-transform:uppercase}
:is(.story-editor .caption,.storyview .movie-words .story-layer)[data-style=mono]{font-family:monospace;font-style:normal;letter-spacing:0}
.storyview .movie-words .story-layer{font-weight:850;text-shadow:0 2px 9px #000a}
/* The same 9:16 composition surface is used in the editor and published story. */
.story-editor .story-canvas,.storyview .media .story-canvas-frame{position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(100%,calc(var(--story-height,100dvh) * .5625));height:auto;aspect-ratio:9/16;container-type:inline-size;overflow:hidden}
.story-editor.keyboard-open .story-canvas{--story-height:calc(var(--keyboard-height) - 78px);top:calc((100% - 78px) / 2)}
.story-editor.keyboard-open #editmedia{bottom:0}
.story-editor .caption{top:calc(100% * var(--caption-y,.69))}
.story-editor.editing-text .story-input{top:min(calc(100% * var(--caption-y,.69)),calc(100% - 2.2em))}
.story-editor .shade{background:none}
