/* Content library and Story layer-editor authority. */
#menuContentButton{grid-column:1/-1!important;min-height:62px!important;padding:10px 12px!important;border-color:color-mix(in srgb,var(--ui-accent) 62%,var(--ui-border))!important;background:color-mix(in srgb,var(--ui-accent) 15%,var(--ui-surface))!important}#menuContentButton>span:first-child{display:grid;width:34px;height:34px;place-items:center;border-radius:7px;background:var(--ui-accent);color:var(--ui-accent-contrast);font-size:18px}#menuContentButton strong{font-size:13px}#menuContentButton small{font-size:10px}
.auth-search-results{gap:5px!important;padding:5px!important;border-radius:8px!important}.auth-search-row{grid-template-columns:40px minmax(0,1fr) 42px!important;gap:7px!important;min-height:54px!important;padding:6px!important;border-radius:8px!important}.auth-search-avatar{width:40px!important;height:40px!important;border-radius:7px!important}.auth-search-main{overflow:hidden}.auth-search-main .name-with-badge{display:grid!important;grid-template-columns:minmax(0,max-content) minmax(0,1fr);flex-wrap:nowrap!important}.auth-search-main .profile-badge{min-width:0;max-width:100%;padding:2px 5px!important}.auth-search-select{padding:6px!important;text-align:center;font-size:10px!important}
.content-library-view .content-tab-panel{padding:8px!important}.content-library-view .content-stats{gap:5px!important}.content-library-view .content-stats article{min-height:48px!important;padding:6px 4px!important}.content-story-list{gap:8px!important}.content-story-card{grid-template-columns:74px minmax(0,1fr)!important;gap:8px!important;padding:7px!important;border-radius:8px!important}.content-story-preview{width:74px!important;min-width:74px!important;border-radius:6px!important}.content-story-details{gap:5px!important}.content-story-details>strong{overflow-wrap:anywhere}.content-story-summary{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px!important}.content-story-summary span{min-width:0;padding:3px 4px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-story-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px!important}.content-story-actions button,.content-story-actions a{min-width:0!important;padding:4px!important;text-align:center}
.story-composer-workspace{display:grid!important;grid-template-columns:minmax(0,1fr) 38px!important;align-items:start!important;gap:5px!important;overflow:visible!important}.story-composer-preview{grid-column:1!important}.story-composer-tool-rail{position:relative!important;top:auto!important;right:auto!important;grid-column:2;max-height:100%;padding:2px!important;overflow:visible!important;background:transparent!important;border:0!important;backdrop-filter:none!important}.story-composer-tool-rail .icon-command{position:relative;z-index:2;border-radius:50%!important}.story-composer-tool-rail .icon-command::after{position:absolute;right:40px;top:50%;width:max-content;max-width:110px;padding:5px 7px;border:1px solid rgba(255,255,255,.2);border-radius:6px;background:rgba(5,10,16,.94);color:#fff;content:attr(aria-label);font-size:9px;font-weight:750;line-height:1;opacity:0;pointer-events:none;transform:translate(5px,-50%);transition:opacity 110ms ease,transform 110ms ease;white-space:nowrap}.story-composer-tool-rail .icon-command:hover::after,.story-composer-tool-rail .icon-command:focus-visible::after{opacity:1;transform:translate(0,-50%)}.story-layer-panel{padding:6px;border:1px solid var(--ui-border);border-radius:7px;background:var(--ui-surface-soft)}.story-layer-controls{display:grid;grid-template-columns:minmax(0,1fr) 32px minmax(70px,1fr) auto;align-items:center;gap:5px}.story-layer-controls input{min-width:0;height:30px!important}.story-layer-controls input[type=color]{width:32px!important;padding:2px!important}.story-layer-controls button{min-height:30px!important;padding:4px 7px!important}.story-editor-layer{position:absolute;z-index:4;left:calc(var(--layer-x)*1%);top:calc(var(--layer-y)*1%);transform:translate(-50%,-50%);touch-action:none;cursor:move;user-select:none}.story-editor-layer.selected{outline:2px solid var(--ui-accent);outline-offset:3px}.story-editor-text{max-width:78%;padding:3px 6px;color:var(--layer-color,#fff);font-size:clamp(14px,calc(var(--layer-size)*.45px),34px);font-weight:800;line-height:1.15;text-align:center;overflow-wrap:anywhere;text-shadow:0 1px 4px #000}.story-editor-image-layer{width:calc(var(--layer-width)*1%);max-height:70%}.story-editor-image-layer>img{display:block;width:100%;height:auto;max-height:100%;object-fit:contain;pointer-events:none}.story-layer-resize{position:absolute!important;z-index:2;width:12px!important;min-width:12px!important;height:12px!important;min-height:12px!important;padding:0!important;border:2px solid #fff!important;border-radius:50%!important;background:var(--ui-accent)!important;box-shadow:0 1px 4px #000}.story-layer-resize[data-resize=left]{left:-7px;top:50%;transform:translateY(-50%)}.story-layer-resize[data-resize=right]{right:-7px;top:50%;transform:translateY(-50%)}.story-layer-resize[data-resize=top]{top:-7px;left:50%;transform:translateX(-50%)}.story-layer-resize[data-resize=bottom]{bottom:-7px;left:50%;transform:translateX(-50%)}.story-drawing-canvas{position:absolute;z-index:3;inset:0;width:100%;height:100%;touch-action:none;pointer-events:none}.story-composer-preview.is-drawing .story-drawing-canvas{z-index:7;pointer-events:auto;cursor:crosshair}.story-interactive-draft{position:absolute;z-index:5;right:9%;bottom:9%;left:9%;display:grid;gap:5px;padding:8px;border-radius:8px;background:rgba(4,8,14,.78);color:#fff;text-align:center;backdrop-filter:blur(6px)}.story-interactive-draft strong{font-size:11px}.story-interactive-draft span{padding:5px;border:1px solid rgba(255,255,255,.35);border-radius:6px;font-size:9px}.story-composer-preview .story-draft-count{display:none!important}.story-layer-panel>.story-interactive-fields{display:grid!important;gap:5px!important}.story-layer-panel>.story-interactive-fields.hidden{display:none!important}.story-layer-panel .story-poll-options{display:grid;grid-template-columns:1fr 1fr;gap:5px}.story-layer-panel input{width:100%;min-width:0}
@media(max-width:320px){.story-layer-controls{grid-template-columns:minmax(0,1fr) 30px}.story-layer-controls input[type=range]{grid-column:1/-1}.story-layer-controls button{grid-column:auto}.content-story-card{grid-template-columns:64px minmax(0,1fr)!important}.content-story-preview{width:64px!important;min-width:64px!important}.story-composer-workspace{grid-template-columns:minmax(0,1fr) 34px!important}.story-composer-tool-rail .icon-command::after{right:36px}}

/* The editor owns one scroll area; header and publishing controls stay reachable. */
.story-composer-card{display:block!important;overflow-x:hidden!important;overflow-y:auto!important;scrollbar-gutter:stable}
.story-composer-card>.story-dialog-heading{position:sticky;z-index:20;top:0;margin:-2px -2px 6px;padding:2px;background:var(--ui-surface)}
.story-composer-card>.story-composer-workspace{height:clamp(250px,58dvh,410px);margin-bottom:6px}
.story-composer-card>.story-composer-editing,.story-composer-card>.story-composer-advanced,.story-composer-card>#storyComposerFeedback,.story-composer-card>.social-upload-progress{margin-bottom:6px}
.story-composer-footer{position:sticky;z-index:20;bottom:0;padding-top:6px;background:var(--ui-surface)}
.story-composer-preview{grid-column:1!important;width:auto!important;height:100%!important;max-width:100%!important;max-height:100%!important;aspect-ratio:9/16!important;justify-self:center}
.story-composer-tool-rail{z-index:15!important}
.story-composer-tool-rail .icon-command{overflow:visible!important}
.story-composer-tool-rail .icon-command::after{left:auto!important;right:calc(100% + 6px)!important;max-width:170px!important;white-space:normal!important;text-align:left!important}

/* Keep each resize handle centred on its edge during pointer interaction. */
.story-layer-resize{transition:background-color 100ms ease,border-color 100ms ease!important}
.story-layer-resize[data-resize=left]:hover,
.story-layer-resize[data-resize=left]:focus-visible,
.story-layer-resize[data-resize=left]:active,
.story-layer-resize[data-resize=right]:hover,
.story-layer-resize[data-resize=right]:focus-visible,
.story-layer-resize[data-resize=right]:active{transform:translateY(-50%)!important}
.story-layer-resize[data-resize=top]:hover,
.story-layer-resize[data-resize=top]:focus-visible,
.story-layer-resize[data-resize=top]:active,
.story-layer-resize[data-resize=bottom]:hover,
.story-layer-resize[data-resize=bottom]:focus-visible,
.story-layer-resize[data-resize=bottom]:active{transform:translateX(-50%)!important}

.story-interactive-draft{left:calc(var(--interactive-x)*1%)!important;right:auto!important;bottom:auto!important;top:calc(var(--interactive-y)*1%)!important;width:calc(var(--interactive-width)*1%)!important;transform:translate(-50%,-50%);touch-action:none;cursor:move;user-select:none}
.story-interactive-resize{position:absolute!important;z-index:2;top:50%;width:12px!important;min-width:12px!important;height:22px!important;min-height:22px!important;padding:0!important;border:2px solid #fff!important;border-radius:7px!important;background:var(--ui-accent)!important;box-shadow:0 1px 4px #000;transform:translateY(-50%)!important;touch-action:none}.story-interactive-resize[data-interactive-resize=left]{left:-7px}.story-interactive-resize[data-interactive-resize=right]{right:-7px}.story-interactive-resize:hover,.story-interactive-resize:focus-visible,.story-interactive-resize:active{transform:translateY(-50%)!important}
.story-layer-image-viewport{width:100%;overflow:hidden;background:#080b10}.story-layer-image-viewport>img{display:block;width:100%;height:auto;pointer-events:none}
.story-editor-image-layer.is-cropping .story-layer-image-viewport,.story-editor-image-layer.is-cropped .story-layer-image-viewport{aspect-ratio:1}
.story-editor-image-layer.is-cropping .story-layer-image-viewport>img,.story-editor-image-layer.is-cropped .story-layer-image-viewport>img{width:100%;height:100%;object-fit:cover;object-position:var(--crop-x) var(--crop-y);transform:scale(var(--crop-zoom));transform-origin:var(--crop-x) var(--crop-y)}
.story-editor-image-layer.is-cropping{z-index:9;cursor:move;outline-color:#fff}
.story-editor-image-layer.is-cropping .story-layer-resize{display:none!important}
.story-crop-controls{position:absolute;z-index:4;left:50%;top:calc(100% + 8px);display:grid;grid-template-columns:minmax(76px,1fr) auto auto;align-items:center;gap:4px;width:min(230px,90vw);padding:5px;border:1px solid var(--ui-border);border-radius:7px;background:var(--ui-surface-strong);box-shadow:0 8px 24px rgba(0,0,0,.35);transform:translateX(-50%)}
.story-crop-controls label{display:grid;grid-template-columns:auto minmax(44px,1fr);align-items:center;gap:4px;font-size:9px}.story-crop-controls input{min-width:0;width:100%}.story-crop-controls button{min-height:28px!important;padding:4px 7px!important;font-size:9px!important}

/* Viewer navigation belongs only to the media stage and is never painted. */
.story-viewer-stage>.story-nav{top:0!important;bottom:0!important;width:26%!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:transparent!important;font-size:0!important;opacity:0!important;outline:0!important;appearance:none!important}
.story-viewer-stage>.story-nav-previous{left:0!important;right:auto!important}.story-viewer-stage>.story-nav-next{right:0!important;left:auto!important}
.story-viewer-stage>.story-interactive-viewer{position:absolute!important;z-index:8;left:calc(var(--interactive-x)*1%)!important;right:auto!important;top:calc(var(--interactive-y)*1%)!important;bottom:auto!important;width:calc(var(--interactive-width)*1%)!important;margin:0!important;transform:translate(-50%,-50%);box-sizing:border-box}
.story-poll-view{display:grid;gap:5px}.story-poll-view button{position:relative;display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;min-height:30px!important;overflow:hidden;padding:5px 8px!important;text-align:left}.story-poll-view button>i{position:absolute;z-index:0;inset:0 auto 0 0;width:var(--poll-fill,0%);background:color-mix(in srgb,var(--ui-accent) 38%,transparent);transition:width 180ms ease;pointer-events:none}.story-poll-view button>span,.story-poll-view button>b{position:relative;z-index:1}.story-poll-view button>b{font-size:9px}.story-poll-view button.active{border-color:var(--ui-accent)!important}.story-interactive-viewer>small{font-size:9px;color:rgba(255,255,255,.78)}
