/* Shared Studio actions: Text, Logo and every active image/background upload. */
.motion-text-editor{min-width:0}
.composition-section{margin:16px 0 0;padding:0;border:0;border-top:1px solid var(--ui-border);min-width:0}
.composition-section>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:10px 0;list-style:none;cursor:pointer;color:var(--ui-text,#090909);font:inherit;font-size:13px;line-height:1.35;letter-spacing:normal;text-transform:none}
.composition-section>summary::-webkit-details-marker{display:none}
.composition-section>summary::after{content:"";flex:0 0 7px;width:7px;height:7px;margin:0 3px 3px 0;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg)}
.composition-section[open]>summary::after{transform:rotate(225deg);margin-top:5px;margin-bottom:0}
.composition-section-body{min-width:0;padding:0 0 2px}
body.site-design .studio-settings .composition-action{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:7px;width:100%;min-width:0;min-height:36px;margin:0;padding:8px 12px;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-field);color:var(--ui-text);font:inherit;font-size:13px;line-height:1.4;letter-spacing:0;text-transform:none;cursor:pointer;--action-hover-bg:var(--ui-raised);--action-hover-ink:var(--ui-text)}
body.site-design .studio-settings .composition-action:disabled{opacity:.4;cursor:default}
.composition-section>summary:focus-visible,body.site-design .studio-settings .composition-action:focus-visible{outline:2px solid var(--ui-text);outline-offset:3px}
.composition-action>span[aria-hidden]{font-size:18px;line-height:1}
/* Labels retain native file-picker/drag-drop behavior while sharing button styling. */
.studio-upload-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;min-width:0}
body.site-design .studio-settings .composition-action>strong{font:inherit;color:inherit}
body.site-design .studio-settings .studio-upload-action>.upload-mark{display:none}
body.site-design .studio-settings .studio-upload-action>span:not(.upload-mark){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
body.site-design .studio-settings .composition-action:has(input:disabled){opacity:.4;cursor:default}
body.site-design .studio-settings .composition-action:is(:hover,.dragging):not(:disabled):not(:has(input:disabled)){background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-raised)}
body.site-design .studio-settings .composition-action:focus-within{outline:2px solid var(--ui-text);outline-offset:3px}

.motion-text-selected{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.motion-text-help,.motion-text-status{margin:8px 0 12px;color:var(--ui-muted);font-size:12px;line-height:1.5}
.motion-text-status:empty{display:none}.motion-text-status{margin-bottom:0;overflow-wrap:anywhere;color:var(--ui-text)}
.motion-text-layer-list{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}
body.site-design .motion-text-layer{max-width:100%;min-width:0;min-height:32px;padding:6px 10px;border:1px solid var(--ui-border);border-radius:7px;background:var(--ui-field);color:var(--ui-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:inherit;font-size:12px;text-align:left;cursor:pointer}
body.site-design .motion-text-layer[aria-pressed=true]{background:var(--ui-text);border-color:var(--ui-text);color:var(--ui-page)}
.motion-text-layer.is-hidden{text-decoration:line-through;text-decoration-thickness:1px}
.motion-text-selected{margin:4px 0 8px;font-size:12px;color:var(--ui-muted)}
.motion-text-tools{display:flex;gap:2px}
body.site-design .motion-text-tools button{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;padding:6px;border:0;border-radius:6px;background:transparent;color:var(--ui-muted);cursor:pointer}
body.site-design .motion-text-tools button:hover{background:var(--ui-raised);color:var(--ui-text)}
body.site-design .motion-text-tools button[data-text-action=visible][aria-pressed=false]{opacity:.5}
body.site-design .studio-settings .motion-text-words{display:flex;flex-direction:column;align-items:stretch}
html body.site-design .studio-settings .field.motion-text-words textarea{box-sizing:border-box;min-height:60px;max-height:240px;padding:8px;resize:vertical}
.motion-text-unit{position:relative;display:block;min-width:0;width:100%}
body.site-design .studio-settings .motion-text-unit input{padding-right:36px!important}
.motion-text-unit>span{position:absolute;right:11px;top:50%;transform:translateY(-50%);color:var(--ui-muted);font-size:12px;pointer-events:none}
.motion-text-unit input[type=number]{appearance:textfield;-moz-appearance:textfield}
.motion-text-unit input::-webkit-inner-spin-button,.motion-text-unit input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
body.site-design .studio-settings .motion-text-colour{padding:5px 8px}
html body.site-design .studio-settings .motion-text-colour .motion-text-hex{min-width:0;width:100%;height:24px;min-height:24px;background:transparent;border:0;border-radius:0;padding:0;font-size:12px;text-transform:uppercase;line-height:24px}
.motion-text-align{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;border-radius:8px;padding:3px;background:var(--ui-field);min-height:36px}
body.site-design .motion-text-align button{display:flex;align-items:center;justify-content:center;min-width:0;min-height:30px;padding:5px;border:1px solid transparent;border-radius:6px;color:var(--ui-muted);background:transparent;cursor:pointer}
body.site-design .motion-text-align button[aria-pressed=true]{background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-border)}
.motion-text-range{display:flex;align-items:center;gap:9px;min-width:0;min-height:36px}
.motion-text-range input[type=range]{width:100%;min-width:0;min-height:24px;padding:0;margin:0;accent-color:var(--ui-text);cursor:pointer}
.motion-text-range output{font-size:12px;color:var(--ui-muted);min-width:34px;text-align:right;font-variant-numeric:tabular-nums}
.motion-text-more{border-top:1px solid var(--ui-border);margin-top:12px;padding-top:2px}
.motion-text-more>summary{display:flex;justify-content:space-between;align-items:center;gap:8px;list-style:none;cursor:pointer;font-size:13px;min-height:40px;line-height:1.4;color:var(--ui-text)}
.motion-text-more>summary::-webkit-details-marker{display:none}
.motion-text-more>summary>span{font-size:18px}.motion-text-more[open]>summary>span{transform:rotate(45deg)}
body.site-design .motion-text-center{background:transparent;border:0;color:var(--ui-muted);text-decoration:underline;text-underline-offset:3px;font-size:12px;min-height:36px;padding:6px 0;cursor:pointer}
body.site-design .motion-text-editor button:disabled{opacity:.4;cursor:default}
.motion-text-editor :is(button,summary):focus-visible{outline:2px solid var(--ui-text);outline-offset:3px}
.motion-text-stage{position:relative}
.motion-text-stage .play{z-index:30}
.motion-text-overlay{position:absolute;pointer-events:none;overflow:hidden;z-index:4;isolation:isolate}
.motion-text-guide{position:absolute;z-index:20;background:#2389ff;box-shadow:0 0 0 1px #0003;pointer-events:none}
.motion-text-guide-x{left:50%;top:0;width:1px;height:100%}
.motion-text-guide-y{top:50%;left:0;height:1px;width:100%}
.motion-text-selection{position:absolute;transform-origin:center;pointer-events:none}
body.site-design .motion-text-overlay .motion-text-hit{position:absolute;inset:0;display:block;min-width:0;min-height:0;width:100%;height:100%;margin:0;padding:0;border:1px solid transparent;border-radius:0;background:transparent;box-shadow:none;cursor:move;pointer-events:auto;touch-action:none;color:transparent;outline:none}
body.site-design .motion-text-overlay .motion-text-hit:hover{border-color:#fff8;background:transparent}
body.site-design .motion-text-overlay .is-selected .motion-text-hit{border-color:#2389ff;box-shadow:0 0 0 1px #0005}
body.site-design .motion-text-overlay .motion-text-hit:focus-visible{outline:2px solid #fff;outline-offset:3px}
body.site-design .motion-text-overlay .motion-text-handle{position:absolute;display:flex;align-items:center;justify-content:center;width:26px;height:26px;min-width:26px;min-height:26px;border:1px solid #fff;border-radius:5px;background:#2389ff;color:#fff;padding:4px;pointer-events:auto;touch-action:none;box-shadow:0 1px 4px #0006}
body.site-design .motion-text-overlay .motion-text-handle:focus-visible{outline:2px solid #fff;outline-offset:3px}
body.site-design .motion-text-overlay .motion-text-rotate{top:-37px;left:50%;margin-left:-13px;border-radius:50%;cursor:grab}
.motion-text-rotate::after{content:'';position:absolute;top:25px;left:11px;height:11px;width:1px;background:#2389ff;pointer-events:none}
body.site-design .motion-text-overlay .motion-text-resize{bottom:-13px;right:-13px;cursor:nwse-resize}
.motion-text-overlay[hidden],.motion-text-editor[hidden],.motion-text-properties[hidden],.motion-text-layer-list[hidden],.motion-text-handle[hidden],.motion-text-guide[hidden]{display:none!important}
@media(max-width:760px){
 .composition-section{margin-top:20px}
 .composition-section>summary{min-height:52px}
 body.site-design .studio-settings .composition-action,body.site-design .motion-text-layer{min-height:44px;font-size:13px;padding:10px 12px}
 .motion-text-selected{font-size:13px}
 body.site-design .motion-text-tools button{min-width:44px;min-height:44px;padding:12px}
 .motion-text-editor .field{display:flex;flex-direction:column;align-items:stretch;gap:7px}
 .motion-text-editor .field>span:first-child:not(.motion-text-unit):not(.motion-text-range):not(.colour-control){align-self:flex-start}
 .motion-text-range{min-height:44px}.motion-text-range input[type=range]{min-height:36px}
 .motion-text-align{min-height:44px}body.site-design .motion-text-align button{min-height:38px}
 .motion-text-more>summary,body.site-design .motion-text-center{min-height:44px}
 .motion-text-position{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 html body.site-design .studio-settings .motion-text-colour .motion-text-hex{min-height:30px;height:30px;font-size:16px}
 body.site-design .motion-text-overlay .motion-text-handle{width:44px;height:44px;min-width:44px;min-height:44px;padding:13px;border:0;background:transparent;box-shadow:none;isolation:isolate}
 .motion-text-overlay .motion-text-handle::before{content:"";position:absolute;inset:6px;border:1px solid #fff;border-radius:5px;background:#2389ff;box-shadow:0 1px 4px #0006;z-index:-1}
 .motion-text-overlay .motion-text-rotate::before{border-radius:50%}
 body.site-design .motion-text-overlay .motion-text-rotate{top:-54px;margin-left:-22px}
 .motion-text-rotate::after{top:38px;left:21px;height:16px}
 body.site-design .motion-text-overlay .motion-text-resize{bottom:-22px;right:-22px}
}

/* Hit areas must never inherit filled generic action hover, active or focus surfaces. */
body.site-design .motion-text-overlay .motion-text-hit,
body.site-design .motion-text-overlay .motion-text-hit:is(:hover,:focus,:focus-visible,:active){background:transparent!important;color:transparent!important;--action-hover-bg:transparent;--action-hover-ink:transparent}
body.site-design .motion-text-overlay .is-selected .motion-text-hit:is(:hover,:focus,:active){border-color:#2389ff!important}
body.site-design .motion-text-overlay .motion-text-handle{z-index:3;--action-hover-bg:#2389ff;--action-hover-ink:#fff}
body.site-design .motion-text-overlay .is-editing .motion-text-hit{pointer-events:none}
html body.site-design .motion-text-overlay textarea.motion-text-input,
html body.site-design .motion-text-overlay textarea.motion-text-input:is(:hover,:focus,:focus-visible,:active){position:absolute;display:block;box-sizing:content-box;min-width:0;min-height:0;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:transparent!important;box-shadow:none!important;outline:none;resize:none;overflow:hidden;white-space:pre;overflow-wrap:normal;word-break:normal;pointer-events:auto;touch-action:auto;cursor:text;z-index:2}
.motion-text-input::selection{background:#2389ff66}
@media(max-width:760px){
 body.site-design .motion-text-overlay .motion-text-handle{--action-hover-bg:transparent}
}

body.site-design .motion-text-overlay .motion-text-handle:is(:hover,:focus,:active){border-color:#fff!important}
