.my-story-avatar{position:relative;flex:none}.story-add{position:absolute;right:-5px;bottom:-3px;width:25px;height:25px;padding:0;border:2px solid var(--bg);border-radius:50%;background:#78e4bb;color:#10221c;font:26px/20px system-ui;z-index:3;cursor:pointer}.story-strip{display:flex;align-items:center;gap:13px;overflow-x:auto;scrollbar-width:none;min-width:0;flex:1;padding:9px 7px;margin:0 12px}.story-strip:empty{padding:0}.story-person{border:0;background:none;padding:0;border-radius:50%;flex:none;position:relative}.story-person .avatar{width:42px;height:42px}.has-stories{position:relative;isolation:isolate;cursor:pointer}.has-stories:before{content:'';position:absolute;inset:-5px;border-radius:50%;background:var(--story-ring);padding:2px;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}.story-dialog{color:#eef7f3;background:#10201c;border:1px solid #2c4840;box-sizing:border-box;padding:20px;max-width:calc(calc(100 * var(--ui-vw)) - 24px);max-height:calc(var(--viewport-height,calc(100 * var(--ui-vh))) - 24px);border-radius:24px}.story-dialog::backdrop{background:#000b;backdrop-filter:blur(12px)}.story-dialog button{cursor:pointer}.story-editor{width:780px}.story-editor-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.story-editor-head h2{font-size:21px;margin:0}.story-close{width:40px;height:40px;flex:none;border:0;border-radius:50%;background:#ffffff18;color:inherit;font:32px/1 system-ui}.story-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}.story-preview{min-width:0}.story-stage{position:relative;width:100%;height:100%;aspect-ratio:9/16;background:#000;overflow:hidden;container-type:inline-size}.story-preview .story-stage{height:auto;max-height:calc(var(--viewport-height,calc(100 * var(--ui-vh))) * 0.7);border-radius:16px}.story-placeholder{aspect-ratio:9/16;border:1px dashed #547a6c;border-radius:16px;display:grid;place-items:center;color:#a9c4b8;text-align:center}.story-media{width:100%;height:100%;position:absolute;inset:0;object-fit:cover}.story-caption{position:absolute;width:max-content;max-width:90%;white-space:pre-wrap;overflow-wrap:anywhere;text-align:center;transform:translate(-50%,-50%);line-height:1.22;font-weight:600;text-shadow:0 2px 6px #000b;pointer-events:none}.story-editor .story-caption{pointer-events:auto;touch-action:none;cursor:move}.story-tools{display:grid;align-content:start;gap:12px;min-width:0}.story-tools label{display:grid;gap:6px;font-size:13px;color:#c8ded4}.story-tools input,.story-tools select,.story-tools textarea{box-sizing:border-box;max-width:100%;min-width:0;width:100%;background:#0b1613;color:#f2fff8;border:1px solid #36564a;border-radius:10px;padding:8px;font:16px system-ui}.story-tools input[type=range]{padding:0;accent-color:#78e4bb}.story-tools input[type=color]{padding:3px;height:39px}.story-tool-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.story-tools .story-keep{display:flex;align-items:center;gap:9px;line-height:1.4}.story-keep input{width:19px;height:19px;accent-color:#78e4bb;flex:none}.story-hint{font:12px/1.4 system-ui;color:#95b2a5;margin:0}.story-error{font:14px/1.4 system-ui;color:#ffacac;margin:0}.story-secondary{border:1px solid #426758;border-radius:10px;background:transparent;color:#ccebdd;padding:9px}.story-publish{width:100%;justify-content:center}.story-viewer{padding:0;border:0;border-radius:0;position:fixed;inset:0;width:calc(100 * var(--ui-vw));max-width:none;height:var(--viewport-height,calc(100 * var(--ui-vh)));max-height:none;margin:0;background:#000;overflow:hidden}.story-view-body{position:absolute;inset:0;display:flex;justify-content:center;touch-action:none}.story-view-body>.story-stage{max-width:calc(var(--viewport-height,calc(100 * var(--ui-vh))) * 9 / 16);height:100%;aspect-ratio:auto}.story-view-head{position:absolute;top:0;left:0;right:0;padding:calc(var(--ui-safe-top) + 12px) 15px 22px;background:linear-gradient(#0009,transparent);pointer-events:none}.story-view-head button{pointer-events:auto}.story-view-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}.story-progress{display:flex;gap:4px}.story-progress>span{height:3px;flex:1;background:#ffffff45;border-radius:3px;overflow:hidden}.story-progress i{display:block;height:100%;background:white}.story-archive-label{font-size:12px;color:#bed5ca}.story-view-error{position:absolute;top:110px;left:12px;right:12px;text-align:center;color:#ffbbbb;pointer-events:none}.story-archive{width:640px}.story-archive>p{color:#aac5b8;font-size:14px}.story-archive-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:20px}.story-archive-item{padding:0;border:0;background:transparent;color:inherit;overflow:hidden;border-radius:12px}.story-archive-item .story-stage{height:auto;pointer-events:none}.story-archive-item>span{font-size:11px;display:block;padding:8px 2px}.story-profile-link{font-size:12px;color:var(--accent,#78e4bb);background:transparent;border:0;padding:10px}.app-header>.story-strip{min-width:0}.app-header .header-profile{flex:none}
@media(max-width:600px){.story-editor{padding:14px;width:calc(calc(100 * var(--ui-vw)) - 16px);max-width:none}.story-form{grid-template-columns:1fr;gap:16px}.story-preview{width:min(100%,225px);margin:auto}.story-editor-head{position:sticky;top:-14px;background:#10201c;z-index:2;padding:10px 0}.story-preview .story-stage{max-height:none}.story-strip{margin:0 10px;padding:7px 5px;gap:12px}.story-person .avatar{width:36px;height:36px}.story-archive-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.story-view-body>.story-stage{max-width:none}}
@media(prefers-reduced-motion:reduce){.story-dialog *{scroll-behavior:auto}}
/* Keep the preview visible while changing captions and framing on a phone. */
.story-dialog h2,.story-dialog strong{color:#eef7f3}.story-tools label+label{margin-top:0}.story-editor{display:none;overflow:hidden}.story-editor[open]{display:flex;flex-direction:column}.story-editor-head{flex:none}.story-form{min-height:0;overflow:hidden}.story-tools{overflow-y:auto;padding:0 3px 4px;max-height:calc(var(--viewport-height,calc(100 * var(--ui-vh))) * 0.72);overscroll-behavior:contain}.story-tools input,.story-tools textarea{margin-top:0}.story-tools textarea{min-height:65px}.story-caption{user-select:none;-webkit-user-select:none}
@media(max-width:600px){.story-editor{height:calc(var(--viewport-height,calc(100 * var(--ui-vh))) - 24px)}.story-editor-head{position:static;padding:0;margin-bottom:10px}.story-form{display:flex;flex-direction:column;flex:1;gap:12px}.story-preview{height:calc(var(--viewport-height,calc(100 * var(--ui-vh))) * 0.28);width:auto;aspect-ratio:9/16;flex:none}.story-preview .story-stage,.story-placeholder{height:100%;width:100%;max-height:none}.story-tools{flex:1;max-height:none;gap:12px}.story-tools .story-pick input{font-size:13px}}
.story-dialog [hidden]{display:none!important}
/* A button line box must not add height to circular avatars. */
.story-person{display:grid;place-items:center;width:42px;height:42px;min-width:42px;min-height:42px;aspect-ratio:1;line-height:1;align-self:center}
.story-person .avatar{display:flex;width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:1;object-fit:cover;border-radius:50%;margin:0}
.story-view-count{position:absolute;left:16px;bottom:calc(var(--ui-safe-bottom) + 16px);width:46px;height:46px;border:1px solid #ffffff65;border-radius:50%;background:#142c24df;color:#fff;display:grid;place-items:center;font:600 16px/1 system-ui;z-index:2;padding:0}
.story-viewers-shade{position:absolute;inset:0;background:#0007;z-index:3}
.story-viewers-sheet{position:absolute;bottom:0;left:0;right:0;max-height:72%;background:#10201c;color:#edf7f1;z-index:4;border:1px solid #426357;border-bottom:0;border-radius:26px 26px 0 0;padding:10px 20px calc(var(--ui-safe-bottom) + 20px);display:flex;flex-direction:column;box-shadow:0 -10px 50px #0005}
.story-viewers-handle{height:4px;width:36px;border-radius:4px;background:#7c998c;margin:0 auto 8px;flex:none}
.story-viewers-sheet header{display:flex;justify-content:space-between;align-items:center;gap:10px;touch-action:none;flex:none}
.story-viewers-sheet h2{font:600 19px/1.3 system-ui;margin:0}.story-viewers-sheet h2 span{color:#91b9a5;font-weight:400;margin-left:6px}
.story-viewers-list{overflow-y:auto;overscroll-behavior:contain;min-height:0;touch-action:pan-y}
.story-viewer-row{display:flex;align-items:center;gap:14px;padding:12px 0;border-bottom:1px solid #ffffff12}
.story-viewer-row .avatar{width:44px;height:44px;min-width:44px;min-height:44px;aspect-ratio:1;border-radius:50%;object-fit:cover;display:flex;cursor:default}
.story-viewer-row strong{font:500 16px/1.4 system-ui;overflow-wrap:anywhere}
.story-viewers-status{font:14px/1.5 system-ui;color:#b9cfc4;margin:8px 0}.story-viewers-status:empty{display:none}
.story-viewers-more{color:#8cebc4;padding:14px;font-size:15px;flex:none}
.story-viewers-open>.story-view-head,.story-viewers-open>.story-view-controls,.story-viewers-open>.story-view-count{pointer-events:none}
.story-viewer.story-opening::backdrop{animation:story-backdrop-in .3s both}.story-viewer.story-closing::backdrop{animation:story-backdrop-out .24s both}
@keyframes story-backdrop-in{from{background:transparent;backdrop-filter:blur(0)}to{background:#000b;backdrop-filter:blur(12px)}}
@keyframes story-backdrop-out{to{background:transparent;backdrop-filter:blur(0)}}
@media(max-width:600px){.story-person{width:36px;height:36px;min-width:36px;min-height:36px}.story-person .avatar{width:100%;height:100%}}
@media(prefers-reduced-motion:reduce){.story-viewer.story-opening::backdrop,.story-viewer.story-closing::backdrop{animation:none}}
.story-viewer .story-media{-webkit-user-drag:none;user-select:none;-webkit-user-select:none}
.story-view-controls{position:absolute;right:16px;bottom:calc(var(--ui-safe-bottom) + 16px);z-index:2}
.story-more{display:grid;place-items:center;width:46px;height:46px;padding:0;border:1px solid #ffffff65;border-radius:50%;background:#142c24df;color:#fff;backdrop-filter:blur(16px)}
.story-more svg{width:24px;height:24px;fill:currentColor}
.story-more[aria-expanded=true]{background:#284b3e;border-color:#78e4bb}
.story-view-actions{position:absolute;right:0;bottom:60px;display:flex;flex-direction:column;gap:2px;width:224px;max-width:calc(calc(100 * var(--ui-vw)) - 32px);max-height:calc(var(--viewport-height,calc(100 * var(--ui-vh))) - var(--ui-safe-top) - var(--ui-safe-bottom) - 170px);overflow-y:auto;overscroll-behavior:contain;padding:8px;background:#142920ed;border:1px solid #ffffff26;border-radius:20px;box-shadow:0 12px 40px #0006;backdrop-filter:blur(20px);transform-origin:bottom right;opacity:0;transform:translateY(10px) scale(.94);visibility:hidden;transition:opacity .18s ease,transform .22s cubic-bezier(.2,.75,.2,1),visibility 0s .22s}
.story-menu-open .story-view-actions{opacity:1;transform:none;visibility:visible;transition-delay:0s}
.story-view-actions button{flex:none;min-height:44px;border:0;border-radius:12px;background:transparent;padding:11px 14px;color:#eef7f3;text-align:left;font-size:15px}
.story-view-actions button:hover,.story-view-actions button:focus-visible{background:#ffffff12}
.story-view-actions .story-archive-label{padding:8px 14px;font-size:12px}
@media(prefers-reduced-motion:reduce){.story-view-actions{transition:none;transform:none}}
.story-reactions{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:6px 0}
.story-reactions button{padding:8px!important;text-align:center!important;font-size:26px!important;border-radius:12px;background:#ffffff0a}
.story-reactions [aria-pressed=true]{background:#72e5b533;box-shadow:inset 0 0 0 1px #72e5b5}
.story-viewer-row strong{flex:1;min-width:0}.story-viewer-reaction{font-size:26px;flex-shrink:0;margin-left:auto}
.story-start{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#152a23e6;color:white;border-radius:20px;padding:16px;z-index:2}

.story-viewer{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.story-view-head button,.story-more,.story-view-count{touch-action:none}

/* A dedicated gesture surface keeps iOS image previews out of moment playback. */
.story-view-body{isolation:isolate}
.story-view-body>.story-stage{pointer-events:none}
.story-touch-surface{position:absolute;inset:0;z-index:1;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.story-viewer .story-media{-webkit-touch-callout:none;pointer-events:none}
.story-view-head{z-index:1}

.story-feedback{position:absolute;left:50%;bottom:calc(110px + var(--ui-safe-bottom));transform:translateX(-50%);z-index:5;max-width:85%;padding:12px 18px;border-radius:24px;background:#10221ced;color:#e9fff5;font:500 15px/1.4 system-ui;text-align:center;pointer-events:none;box-shadow:0 4px 24px #0005}.story-feedback:empty{display:none}
/* Music tools share the moment palette and keep audio lazy-loaded. */
.music-picker{width:min(calc(94 * var(--ui-vw)),520px);max-height:calc(90 * var(--ui-dvh));overflow:auto;padding:18px;border-radius:24px;background:var(--panel);color:var(--ink)}
.music-search{display:grid;gap:8px;margin:14px 0}.music-search input{width:100%;box-sizing:border-box}.music-list{max-height:calc(32 * var(--ui-dvh));overflow:auto}.music-row{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #81968b33}.music-row img,.music-cover{width:46px;height:46px;object-fit:cover;border-radius:10px;flex-shrink:0}.music-cover{display:grid;place-items:center;background:#81968b22}.music-info{display:grid;gap:4px;text-align:left;flex:1;min-width:0;background:none;border:0;color:inherit}.music-info strong,.music-info small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.music-info small,.music-artist{opacity:.65}.music-row>button:last-child{width:42px;height:42px;border-radius:50%;background:#71ddba33;color:inherit;border:0}/* Separate upper/lower grips stay reachable even when a 7-second range is narrow. */
.music-trim{margin-top:20px}.music-timeline{height:132px;position:relative;margin:10px 24px 0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;overflow:visible}
.music-rail{position:absolute;inset:44px 0;border-radius:9px;background:repeating-linear-gradient(90deg,#81968b66 0 2px,transparent 2px 7px);pointer-events:none}
.music-window{position:absolute;top:44px;height:44px;background:#71ddba66;border:2px solid #71ddba;border-radius:4px;box-sizing:border-box;touch-action:none;cursor:grab;z-index:1}
.music-handle{position:absolute!important;transform:translateX(-50%);width:48px!important;min-width:48px;min-height:44px;height:44px;padding:0!important;border:0!important;border-radius:12px;background:#71ddba!important;color:#0b2720!important;touch-action:none;z-index:3;font-size:12px!important;font-weight:700;cursor:ew-resize;overflow:visible}
.music-handle-start{top:0}.music-handle-end{bottom:0}.music-handle:after{content:"";position:absolute;width:3px;height:44px;background:#71ddba;left:calc(50% - 1.5px);pointer-events:none}.music-handle-start:after{top:44px}.music-handle-end:after{bottom:44px}
.music-cursor{position:absolute;top:44px;height:44px;width:2px;background:#fff;box-shadow:0 0 3px #000;pointer-events:none;z-index:2}.music-scale{display:flex;justify-content:space-between;margin:0 24px;font-size:12px;opacity:.7;font-variant-numeric:tabular-nums}
.music-player{display:flex;align-items:center;gap:12px;margin:14px 0}.music-play{width:48px;height:48px;border:0;border-radius:50%;background:var(--green,#71ddba);color:var(--bg,#0b2720);font-size:22px;flex-shrink:0}.music-bounds{margin:0;font-size:15px;font-variant-numeric:tabular-nums}.music-position-label{display:block;font-size:13px;opacity:.7;margin-top:5px;font-variant-numeric:tabular-nums}.music-use{width:100%;margin-top:8px}.music-window:focus-visible,.music-handle:focus-visible{outline:2px solid white;outline-offset:2px}
.music-error{color:#e88}.story-music-tools{display:grid;gap:8px;margin:12px 0}.story-music-label{position:absolute;top:98px;left:20px;right:20px;color:white;text-shadow:0 1px 5px #000;font-size:13px;pointer-events:none;z-index:3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.story-music-selected{font-size:14px;overflow-wrap:anywhere}
.music-picker h2,.music-picker strong,.music-picker .story-secondary{color:var(--ink)}.music-picker .story-hint{color:var(--muted)}.music-picker .story-editor-head{position:sticky;top:-18px;z-index:5;margin:-18px -18px 14px;padding:18px;background:var(--panel)}.music-picker .story-close{background:var(--soft)}
/* A single 9:16 scene is shared by the visual editor and the published moment. */
.story-objects,.story-drawing{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.story-drawing{z-index:1}.story-objects{z-index:2}
.story-object{position:absolute;width:max-content;max-width:82%;padding:.12em .2em;margin:0;border:0;border-radius:.25em;background:transparent;color:white;line-height:1.2;font-weight:650;white-space:pre-wrap;overflow-wrap:anywhere;text-shadow:0 2px 5px #0006;transform-origin:center;pointer-events:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none;min-width:0;min-height:0}
.story-object.object-backed{background:#10241ed9;box-shadow:0 1px 8px #0003}.story-object.object-sticker{padding:.18em;border:.035em solid currentColor;background:#132d28;border-radius:24%;text-shadow:none;box-shadow:0 .06em .16em #0004}.story-object[data-type=bubble]{font-size:8cqw}
.story-viewer .story-object[data-type=mention]{pointer-events:auto}.story-stage[data-scene="2"] .story-caption{z-index:3;pointer-events:none}
.story-view-body>.story-stage[data-scene="2"]{width:min(100%,calc(var(--viewport-height,calc(100 * var(--ui-vh))) * 9 / 16));height:auto;max-width:none;max-height:100%;aspect-ratio:9/16;align-self:center;flex:none}
.scene-editor.story-dialog,.keyboard-open .scene-editor.story-dialog[open]{position:fixed;inset:var(--viewport-top,0px) 0 auto;margin:0 auto;width:100%;max-width:650px;height:var(--viewport-height,calc(100 * var(--ui-vh)));max-height:var(--viewport-height,calc(100 * var(--ui-vh)));padding:0;border:0;border-radius:0;background:#0b1916;overflow:hidden}
.scene-editor .story-editor-head{position:absolute;inset:0 0 auto;z-index:8;margin:0;padding:calc(var(--ui-safe-top) + 8px) 12px 20px;display:flex;background:linear-gradient(#0008,transparent);pointer-events:none}
.scene-editor .story-editor-head h2{font-size:14px;flex:1;text-align:left;text-shadow:0 1px 3px #000}.scene-editor .story-editor-head button{pointer-events:auto;width:40px;height:40px;border:0;border-radius:50%;background:#102a23c9;color:#eafff6;font-size:26px}.scene-editor button:disabled{opacity:.35}
.scene-editor .story-form{display:flex;flex-direction:column;position:relative;flex:1;height:100%;gap:0;min-height:0;overflow:hidden}
.scene-editor .story-preview{display:grid;place-items:center;flex:1;min-height:0;width:100%;height:auto;aspect-ratio:auto;margin:0;overflow:hidden}
.scene-editor .story-preview .story-stage{width:min(100%,calc(var(--canvas-height,700px) * 9 / 16));height:auto;max-height:none;aspect-ratio:9/16;border-radius:0;flex:none;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.scene-editor .story-placeholder{width:100%;height:100%;aspect-ratio:auto;border:0;background:radial-gradient(ellipse at 50% 40%,#204d40,#0b1916 70%)}.scene-editor .story-pick{padding:22px;border:1px solid #79e8bb66;border-radius:24px;color:#b1f8d6;cursor:pointer}
.scene-toolbar{position:absolute;top:calc(var(--ui-safe-top) + 70px);right:10px;display:flex;flex-direction:column;gap:5px;z-index:5;max-height:calc(100% - 180px);overflow-y:auto;scrollbar-width:none}.scene-toolbar button{display:grid;place-items:center;gap:2px;border:0;border-radius:16px;background:#10251dc4;color:#ecfff5;width:58px;min-height:48px;padding:6px 2px;backdrop-filter:blur(12px)}.scene-toolbar span{font:600 23px/1 system-ui}.scene-toolbar small{font:10px/1.2 system-ui}
.scene-editor:not(.scene-has-media) .scene-toolbar{display:none}.scene-panel-open .scene-toolbar{display:none}
.scene-editor .story-object{pointer-events:auto;cursor:grab}.scene-editor .object-active{outline:1px dashed #baffdf;outline-offset:5px}.scene-editor .drawing-mode .story-object{pointer-events:none}.scene-editor .story-media{pointer-events:none}
.scene-selection{position:absolute;left:12px;top:calc(var(--ui-safe-top) + 62px);z-index:6;display:flex;gap:5px;max-width:calc(100% - 88px);flex-wrap:wrap}.scene-selection button{min-height:36px;padding:6px 9px;border-radius:14px;background:#123228db;color:#c4ffe0;border:1px solid #70cfac55;font-size:12px}
.scene-trash{position:absolute;bottom:118px;left:50%;transform:translateX(-50%);width:124px;height:64px;display:grid;place-items:center;border:1px solid #ffa1a1;border-radius:28px;background:#651f30e8;color:#fff;z-index:10;pointer-events:none}.scene-trash.over-trash{background:#db3052;box-shadow:0 0 25px #f666}
.scene-editor .story-stage:before,.scene-editor .story-stage:after{content:'';position:absolute;z-index:9;pointer-events:none;display:none;background:#90ffd3aa}.scene-editor .story-stage.guide-x:before{display:block;top:0;bottom:0;left:50%;width:1px}.scene-editor .story-stage.guide-y:after{display:block;top:50%;left:0;right:0;height:1px}.scene-editor .unsafe-object{box-shadow:inset 0 60px 30px -30px #ffd58a66,inset 0 -75px 30px -30px #ffd58a66}.scene-editor .object-dragging .story-objects{z-index:4}
.scene-footer{position:relative;flex:none;z-index:6;padding:8px 12px calc(var(--ui-safe-bottom) + 8px);background:linear-gradient(#102a23,#10201c);display:grid;gap:6px}.scene-caption-label{margin:0}.scene-caption-label textarea{box-sizing:border-box;width:100%;min-height:40px;max-height:85px;resize:none;padding:10px 12px;margin:0;border:1px solid #78e4bb33;border-radius:16px;background:#ffffff0b;color:#fff;font:16px/1.25 system-ui}.scene-publish-row{display:flex;align-items:center;gap:10px}.scene-publish-row label{display:flex;align-items:center;gap:6px;font-size:11px;flex:1;color:#aec7bb}.scene-publish-row select{width:100%;min-width:0;background:#1a3a2f;color:#e6fff0;border:0;border-radius:16px;padding:10px 6px;font:13px system-ui}.scene-publish-row .story-publish{width:auto;min-height:42px;padding:10px 18px;border-radius:20px;font-size:14px}.scene-footer .story-error:empty,.scene-footer .story-queue:empty{display:none}
.scene-panel.story-tools{position:absolute;z-index:7;bottom:0;left:0;right:0;max-height:55%;padding:0;background:#10251ff5;backdrop-filter:blur(16px);border:1px solid #466a5b;border-bottom:0;border-radius:24px 24px 0 0;overflow:auto;display:block}.scene-panel>header{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;padding:10px 16px;z-index:2;background:#16372d}.scene-panel>header button{min-height:38px;background:#78e4bb;color:#123125;border:0;border-radius:18px;padding:8px 16px}.scene-panel-body{display:grid;gap:10px;padding:12px 16px calc(var(--ui-safe-bottom) + 12px)}.scene-options{display:grid;gap:12px}.scene-panel-open .scene-footer{visibility:hidden}.scene-panel .story-keep{display:flex;gap:8px;align-items:center}.scene-stickers,.scene-emojis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.scene-stickers button,.scene-emojis button{background:#214a3f;border:0;border-radius:18px;min-height:58px;font-size:32px;padding:8px}.scene-stickers [data-sticker=bubble]{font-size:18px}.scene-people{display:grid;gap:5px}.scene-people button{min-height:44px;text-align:left;background:#244c3e;color:#dbffed;border:0;border-radius:12px;padding:10px}
.keyboard-open .scene-editor .story-editor-head{padding-top:8px}.keyboard-open .scene-editor .scene-toolbar,.keyboard-open .scene-editor .scene-selection{display:none}.keyboard-open .scene-editor .scene-footer{padding-bottom:8px}.keyboard-open .scene-editor .scene-panel{max-height:calc(100% - 54px)}.keyboard-open .scene-editor .scene-panel-body{padding-bottom:12px}.keyboard-open .scene-caption-label textarea{max-height:65px}.keyboard-open .scene-editor .scene-panel .story-publish{position:static}
@media(max-height:550px){.scene-toolbar{flex-direction:row;left:65px;right:10px;top:8px;max-height:55px}.scene-toolbar button{min-width:48px}.scene-editor .story-editor-head h2{visibility:hidden}.scene-panel.story-tools{max-height:70%}}
@media(prefers-reduced-motion:no-preference){.scene-panel{animation:scene-panel-in .18s ease-out}@keyframes scene-panel-in{from{transform:translateY(20%);opacity:0}to{transform:none;opacity:1}}}
.moment-mention-notice{position:fixed;left:12px;right:12px;top:calc(var(--ui-safe-top) + 14px);z-index:10000;max-width:500px;margin:auto;background:#214b3e;color:#e0fff0;border:1px solid #79e8bb;border-radius:18px;padding:16px;font:15px/1.4 system-ui;box-shadow:0 6px 30px #0005}
.scene-safe-zones{display:none;position:absolute;left:0;right:0;top:12%;bottom:15%;z-index:8;border-top:1px dashed #ffe6a7;border-bottom:1px dashed #ffe6a7;pointer-events:none}.unsafe-object.object-dragging .scene-safe-zones{display:block}.scene-safe-zones:before{content:'Панели просмотра';position:absolute;top:-20px;left:8px;color:#ffe6a7;background:#12271ca8;font:11px system-ui;padding:2px 5px;border-radius:5px}
.moment-mention-notice{display:flex;align-items:center;padding:5px}.moment-mention-notice button{background:transparent;color:inherit;border:0;padding:12px;font:inherit;text-align:left}.moment-mention-notice button:first-child{flex:1}.moment-mention-notice button:last-child{font-size:24px;min-width:44px}
/* Video selection uses the same large handles as music, outside the canvas gesture layer. */
.story-video-trim{position:relative;flex:none;z-index:5;padding:5px 14px;background:#10241ef2;color:#effff7;border-top:1px solid #426758;max-height:36%;overflow:auto;overscroll-behavior:contain}
.story-video-trim[hidden]{display:none}.story-video-trim .music-timeline{height:116px;margin-top:2px}.story-video-trim .music-rail{inset:36px 0}.story-video-trim .music-window,.story-video-trim .music-cursor{top:36px}.story-video-trim .music-handle{height:44px;min-height:44px}.story-video-trim .music-handle-start{top:0}.story-video-trim .music-handle-end{bottom:0}.story-video-trim .music-handle:after{height:28px}.story-video-trim .music-player{margin:3px 0;gap:10px}.story-video-trim .music-play{width:44px;height:44px}.video-bounds{font-size:14px;font-variant-numeric:tabular-nums}.video-load-status{font-size:14px;padding:12px}.scene-panel-open .story-video-trim,.keyboard-open .story-video-trim{display:none}
.story-video-trim .music-play,.story-viewer button{touch-action:manipulation}
.music-preview-button,.music-picker .music-play{display:grid;place-items:center;touch-action:manipulation}.music-control-icon{width:21px;height:21px;fill:currentColor;pointer-events:none}.music-preview-button[aria-pressed=true]{background:var(--green,#78e4bb)!important;color:var(--bg,#10251f)!important}.music-preview-button:active,.music-picker .music-play:active{transform:scale(.94)}.music-control-icon.is-loading{animation:music-control-spin 1s linear infinite}@keyframes music-control-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.music-control-icon.is-loading{animation:none}}
.story-batch{display:flex;gap:6px;align-items:center;min-width:0}.story-batch[hidden]{display:none}.story-batch-items{display:flex;gap:6px;overflow-x:auto;min-width:0;flex:1;padding:2px;scrollbar-width:thin}.story-batch button{border:1px solid #78e4bb44;background:#214a3f;color:#e6fff0;min-height:44px;min-width:40px;border-radius:12px;touch-action:manipulation}.story-batch .story-batch-item{position:relative;flex:0 0 42px;width:42px;height:54px;padding:0;overflow:hidden;font-size:10px}.story-batch-item img{width:100%;height:100%;object-fit:cover}.story-batch-item small{position:absolute;bottom:1px;right:2px;min-width:15px;border-radius:7px;background:#10251fe0;color:#fff;font:11px/15px system-ui}.story-batch-item.selected{outline:2px solid #78e4bb;outline-offset:0}.story-batch button:disabled{opacity:.5}

.repost-base{position:absolute!important;inset:0;pointer-events:none}.story-repost-author{position:absolute;z-index:100;top:14%;left:4%;right:4%;border-radius:15px;background:#16382ff0;color:white;display:flex;gap:8px;align-items:center;padding:10px;font-size:14px;pointer-events:auto}.story-repost-author img{width:34px;height:34px;object-fit:cover;border-radius:50%}.story-touch-surface~.story-repost-author{z-index:100}.story-view-error button{margin:8px;padding:8px;border:1px solid currentColor;border-radius:10px}

.repost-base{width:100%!important;height:100%!important;max-width:none!important;border-radius:0!important}.story-viewer .story-stage>.story-repost-author{visibility:hidden}.story-view-body>.story-repost-author{z-index:10}
.story-view-error:not(:empty){z-index:20;pointer-events:auto;background:#142c28ed;padding:12px;border-radius:16px}
.story-view-error button{min-height:44px;color:inherit;background:transparent}
.repost-base *{pointer-events:none!important}
.repost-base .story-repost-author{display:none}
.scene-editor .story-repost-author{right:78px}
.repost-author-avatar{width:34px;height:34px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;background:#376153;color:#f2fff9;font-size:12px}
.story-repost-author>span:last-child{overflow-wrap:anywhere}

/* Same canvas and badge proportions in the editor and player. */
.story-repost-author,.scene-editor .story-repost-author{right:auto;width:76%;max-width:100%;box-sizing:border-box;gap:2cqw;padding:2.5cqw;border-radius:3.8cqw;font-size:3.6cqw;line-height:1.2;touch-action:none;user-select:none;-webkit-user-select:none}
.story-repost-author img,.story-repost-author .repost-author-avatar{width:8.7cqw;height:8.7cqw;flex:0 0 8.7cqw;pointer-events:none}
.story-repost-author>span:last-child{min-width:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.story-view-body>.story-credit-layer{position:absolute;left:50%;top:0;transform:translateX(-50%);background:none;z-index:2;pointer-events:none}
.story-viewer .story-credit-layer>.story-repost-author{visibility:visible;pointer-events:auto}
.scene-editor .story-repost-author{cursor:grab}.scene-editor .story-repost-author:active{cursor:grabbing}
/* Pointer movement must not lag behind the global button transform transition. */
.story-repost-author{transition:none}

.story-stage>.video-loading-note{top:auto;bottom:18%;transform:translateX(-50%);z-index:2}.story-stage:has(>.video-preview){background:#10201c}
.story-reviewing .scene-toolbar,.story-reviewing .scene-selection,.story-reviewing .scene-caption-label,.story-reviewing .scene-publish-row>label,.story-reviewing .story-video-trim,.story-reviewing .story-editor-head [data-undo],.story-reviewing .story-editor-head [data-redo],.story-reviewing .story-batch [name=addMedia],.story-reviewing .story-batch [name=removeDraft]{display:none!important}
.story-reviewing .scene-publish-row{justify-content:space-between}

/* Hide native broken/loading image decorations until the actual photo is ready. */
.story-media.story-image-pending{visibility:hidden}
