.story-text-layers { position: absolute; inset: 0; pointer-events: none; }
.story-composer--direct .story-composer-preview { overflow: visible; }
.story-composer-preview > .story-composer-media,
.story-composer-preview > .story-text-layers,
.story-composer-preview > .story-drawing-mount { overflow: hidden; border-radius: inherit; }
.story-composer-preview > .story-text-layers { z-index: 7; }
.story-composer-floating-tools { top: 10px; right: 10px; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 20px); gap: 6px; }
.story-canvas-button { width: var(--story-ui-target,36px); height: var(--story-ui-target,36px); }
.story-source-chip { top: 58px; right: 12px; }
.story-background-popover { top: 58px; right: 12px; }
.story-composer-preview.is-editing-text > .story-composer-floating-tools,
.story-composer-preview.is-drawing > .story-composer-floating-tools,
.story-composer-preview.is-editing-text > .story-source-chip,
.story-composer-preview.is-drawing > .story-source-chip { visibility: hidden; }
.story-composer-preview .is-editing-layer { visibility: hidden; }
.story-composer-preview.is-editing-text > .story-composer-placeholder,
.story-composer-preview.is-drawing > .story-composer-placeholder { visibility: hidden; }
.story-composer-preview .story-text-popover { z-index: 30; inset: 0; padding: 0; border: 0; border-radius: inherit; overflow: hidden; background: rgba(24,28,35,.94); box-shadow: none; backdrop-filter: blur(5px); }
.story-type-toolbar { position: absolute; z-index: 2; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: clamp(6px,2cqw,12px); }
.story-type-control { display: grid; place-items: center; flex-shrink: 0; width: var(--story-ui-target,36px); height: var(--story-ui-target,36px); padding: 3px; border: 0; border-radius: 8px; color: #fff; background: transparent; font-size: 22px !important; line-height: 1; cursor: pointer; }
.story-type-control:hover, .story-type-control[aria-pressed="true"] { background: rgba(255,255,255,.16); }
.story-type-toolbar .story-canvas-done, .story-draw-toolbar .story-canvas-done { flex-shrink: 0; min-height: var(--story-ui-target,36px); margin-left: auto; border: 0; font-size: var(--story-ui-font,13px) !important; font-weight: 600; line-height: 1.2; padding: 8px 5px; }
.story-type-align { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.story-type-align span { display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.story-type-align span:nth-child(2) { width: 14px; }
.story-type-align[data-align="left"] { align-items: flex-start; }
.story-type-align[data-align="right"] { align-items: flex-end; }
.story-type-align[data-align="center"] { align-items: center; }
.story-text-color-symbol { width: 22px; height: 22px; border: 3px solid currentColor; border-radius: 50%; background: conic-gradient(#f08a99,#ead080,#88bc97,#7ca9d4,#b49cda,#f08a99); }
.story-type-highlight svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.story-type-highlight[data-mode="solid"] { color: #242831; background: #fff; }
.story-type-highlight[data-mode="translucent"] { background: rgba(255,255,255,.25); }
.story-text-popover textarea { position: absolute; top: 44%; left: 50%; box-sizing: border-box; width: 82%; min-height: 1.5em; max-height: 58%; padding: 7px; transform: translate(-50%,-50%); border: 0 !important; outline: 0 !important; box-shadow: none !important; border-radius: 8px; background: none; text-align: center; resize: none; overflow-y: auto; scrollbar-width: none; }
.story-text-popover textarea::placeholder { color: rgba(255,255,255,.45); }
.story-type-size { position: absolute; left: 4px; top: 27%; height: 35%; width: 28px; margin: 0; writing-mode: vertical-lr; direction: rtl; accent-color: #fff; cursor: ns-resize; }
.story-type-fonts { position: absolute; bottom: 31px; left: 10px; right: 10px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: stretch; gap: 4px; padding: 0; }
.story-type-fonts button { min-width: 0; min-height: 40px; padding: 6px 4px; border: 1px solid transparent; border-radius: 18px; color: #fff; background: rgba(255,255,255,.1); font-size: clamp(11px,3.4cqw,12px) !important; line-height: 1.2; white-space: normal; }
.story-type-fonts button[aria-pressed="true"] { background: #fff; color: #252a33; }
.story-type-fonts [data-text-font="strong"] { font-weight: 800; }
.story-type-fonts [data-text-font="serif"] { font-family: Georgia,serif; }
.story-type-fonts [data-text-font="mono"] { font-family: "Courier New",monospace; }
.story-type-colors { position: absolute; bottom: 80px; left: 10px; right: 10px; display: flex; justify-content: flex-start; align-items: center; gap: 4px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.story-type-colors > div, .story-draw-colors { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.story-ink-swatch { position: relative; flex-shrink: 0; width: 36px; height: 36px; padding: 5px; border: 0; border-radius: 50%; background-clip: content-box; cursor: pointer; }
.story-ink-swatch::after, .story-custom-ink::after { position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; content: ""; pointer-events: none; }
.story-ink-swatch[aria-pressed="true"]::after { inset: 1px; border: 2px solid #fff; }
.story-custom-ink { position: relative; flex-shrink: 0; width: 36px; height: 36px; padding: 5px; overflow: hidden; border: 0; border-radius: 50%; background: conic-gradient(#ed91b3,#ead17a,#85b69a,#81b1d5,#ed91b3); background-clip: content-box; }
.story-custom-ink input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.story-type-counter { position: absolute; bottom: 10px; left: 0; right: 0; color: rgba(255,255,255,.65); font-size: var(--story-ui-small,11px); line-height: 1.3; text-align: center; }
.story-sticker-sheet { inset: auto 0 0; padding: 15px 20px 24px; border: 0; border-radius: 18px 18px 0 0; background: rgba(31,35,43,.96); }
.story-sheet-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.story-sheet-heading strong { font-size: 13px; font-weight: 500; }
.story-sticker-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 17px; }
.story-sticker-grid button { border: 0; border-radius: 12px; background: transparent; font-size: 36px !important; line-height: 1.5; cursor: pointer; }
.story-sticker-grid button:hover { background: rgba(255,255,255,.1); }
.story-composer-preview .story-draw-panel { position: absolute; z-index: 35; inset: 0; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; pointer-events: none; }
.story-draw-toolbar { position: absolute; left: 8px; right: 8px; top: 10px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 4px; border-radius: 16px; background: rgba(28,32,39,.65); pointer-events: auto; }
.story-draw-size { position: absolute; top: 27%; left: 4px; height: 35%; width: 28px; writing-mode: vertical-lr; direction: rtl; accent-color: #fff; pointer-events: auto; }
.story-draw-colors { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 6px; overflow-x: auto; scrollbar-width: none; border-radius: 25px; background: rgba(28,32,39,.65); pointer-events: auto; }
.story-drop-trash { position: absolute; z-index: 25; bottom: 24px; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 7px; transform: translateX(-50%); color: #fff; pointer-events: none; }
.story-drop-trash svg { width: 43px; height: 43px; padding: 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(25,28,35,.65); stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; transition: transform .14s,background .14s; }
.story-drop-trash span { font-size: var(--story-ui-small,11px); white-space: nowrap; text-shadow: 0 1px 5px #000; }
.story-drop-trash.is-hot svg { transform: scale(1.22); color: #fff; background: #b75159; }
@media(pointer:coarse) {
    .story-type-fonts button { min-height: 44px; }
    .story-type-size, .story-draw-size { width: 32px; }
    .story-ink-swatch, .story-custom-ink { width: 44px; height: 44px; padding: 8px; }
    .story-ink-swatch::after, .story-custom-ink::after { inset: 8px; }
    .story-ink-swatch[aria-pressed="true"]::after { inset: 3px; }
}
@media(prefers-reduced-motion:reduce) { .story-drop-trash svg { transition:none; } }
