.story-media-editor-viewport.has-editable-media { cursor: grab; touch-action: none; }
.story-media-editor-viewport.is-moving-media { cursor: grabbing; }
.story-media-editor-viewport.has-editable-media img,
.story-media-editor-viewport.has-editable-media video { pointer-events: none; user-select: none; -webkit-user-drag: none; transition: none !important; }
.story-media-editor-viewport:focus-visible { outline: 2px solid #a1aaba; outline-offset: 4px; }
.story-media-editor-selection { position: absolute; z-index: 6; inset: 0; overflow: visible; pointer-events: none; }
.story-media-editor-selection > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; fill: none; stroke: rgba(255,255,255,.88); stroke-width: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.story-media-editor-selection > svg polygon { vector-effect: non-scaling-stroke; }
.story-media-handle { position: absolute; z-index: 2; display: grid; place-items: center; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #3f4650; transform: translate(-50%,-50%); pointer-events: auto; cursor: nwse-resize; touch-action: none; -webkit-tap-highlight-color: transparent; }
.story-media-handle::after { content: ""; width: 6px; height: 6px; border: 1px solid #fff; border-radius: 1px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .12s ease; }
.story-media-handle:hover::after, .story-media-handle:focus-visible::after { transform: scale(1.25); }
.story-media-handle--ne, .story-media-handle--sw { cursor: nesw-resize; }
.story-media-corner-rotate { position: absolute; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #fff; text-shadow: 0 1px 3px #151719; font: 22px/1 Arial,sans-serif !important; transform: translate(-50%,-50%); opacity: 0; pointer-events: auto; cursor: crosshair; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M21 12a8 8 0 1 0 0 7M21 5v7h-7' fill='none' stroke='%23151719' stroke-width='5'/%3E%3Cpath d='M21 12a8 8 0 1 0 0 7M21 5v7h-7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 14 14, crosshair; touch-action: none; transition: opacity .12s ease; }
.story-media-corner-rotate:hover, .story-media-corner-rotate:focus-visible, .story-media-corner-rotate.is-near-corner, .story-media-corner-rotate.is-active { opacity: 1; }
.story-media-corner-rotate:focus-visible { outline: 1px solid #fff; outline-offset: 1px; }
.story-media-editor-viewport.is-moving-media .story-media-handle { cursor: grabbing; }
.story-media-handle:focus-visible { outline: 2px solid #c8d8ee; outline-offset: 2px; }
.story-media-snap-guide { position: absolute; z-index: 2; pointer-events: none; box-shadow: 0 0 3px rgba(0,0,0,.28); background: #c3d8ed; }
.story-media-snap-guide--x { top: 0; bottom: 0; width: 1px; }
.story-media-snap-guide--y { left: 0; right: 0; height: 1px; }
.story-media-angle { position: absolute; z-index: 3; top: 64px; left: 50%; min-width: 40px; padding: 5px 9px; border-radius: 15px; background: rgba(20,23,29,.6); color: #fff; transform: translateX(-50%); text-align: center; font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; backdrop-filter: blur(8px); }
.story-media-editor-toolbar-mount { position: absolute; z-index: 8; bottom: 18px; left: 50%; width: max-content; max-width: calc(100% - 30px); transform: translateX(-50%); pointer-events: auto; transition: opacity .12s ease; }
.story-media-editor-toolbar { display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid rgba(255,255,255,.15); border-radius: 28px; background: rgba(25,28,34,.65); box-shadow: 0 4px 18px rgba(0,0,0,.13); backdrop-filter: blur(14px); }
.story-media-editor-button { display: grid; place-items: center; flex: 0 0 auto; width: var(--story-ui-target,36px); height: var(--story-ui-target,36px); padding: 0; border: 0; border-radius: 50%; color: #fff; background: transparent; font-size: 22px !important; line-height: 1; transition: background-color .12s ease; -webkit-tap-highlight-color: transparent; }
.story-media-editor-button:hover:not(:disabled) { background: rgba(255,255,255,.15); }
.story-media-editor-button[aria-pressed="true"] { background: rgba(255,255,255,.22); }
.story-media-editor-button:focus-visible { outline: 2px solid #d2e1f2; outline-offset: 2px; }
.story-media-editor-viewport.is-moving-media .story-media-editor-toolbar-mount { opacity: 0; pointer-events: none; }
@media (pointer: coarse) {
    .story-media-handle { width: 24px; height: 24px; }
    .story-media-corner-rotate { opacity: 0 !important; pointer-events: none; }
    .story-media-corner-rotate:focus-visible { opacity: 1 !important; }
}
@media (prefers-reduced-motion: reduce) {
    .story-media-editor-button, .story-media-handle::after, .story-media-editor-toolbar-mount, .story-media-corner-rotate { transition: none; }
}
