/* Shared local and project asset picker for the video and image composers. */
.shared-reference-picker{position:relative;display:flex;align-items:center;gap:3px;width:100%;min-width:0}
.shared-reference-picker.is-dragging .shared-reference-upload-button{border-color:#168c83;background:#e2f3ed;box-shadow:0 0 0 3px #168c831c}
.shared-reference-upload-button{position:relative;width:100%;min-width:0;min-height:62px;padding:6px 3px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:1px solid #cfe2da;border-radius:10px;background:#edf6f2;color:#35544e;transition:background .16s,border-color .16s,transform .16s,box-shadow .16s}
.shared-reference-upload-button:hover{transform:translateY(-1px);border-color:#7fc5b9;background:#e4f4ef;color:#14776e}
.shared-reference-upload-button:focus-visible,.shared-reference-expand:focus-visible,.creative-reference-shelf button:focus-visible{outline:2px solid #168c83;outline-offset:2px}
.shared-reference-plus{width:22px;height:22px;display:grid;place-items:center;border-radius:7px;background:#d8eee7;color:#168c83}
.shared-reference-plus .icon{width:14px;height:14px}
.shared-reference-upload-button>b{max-width:100%;overflow:hidden;color:inherit;font-size:8px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}
.shared-reference-upload-button>small{position:absolute;right:3px;top:3px;padding:2px 4px;border-radius:8px;background:#dcece6;color:#617b73;font-size:7px;line-height:1}
.shared-reference-mini-stack{position:absolute;left:calc(50% + 4px);bottom:7px;width:19px;height:18px;display:block}
.shared-reference-mini{position:absolute;left:calc(var(--stack-order)*3px);top:calc(var(--stack-order)*-2px);width:14px;height:17px;overflow:hidden;border:1.5px solid #f7fbf9;border-radius:4px;background:#dcebe5;box-shadow:0 1px 3px #17251e28;transform:rotate(calc((var(--stack-order) - 1)*7deg));transform-origin:bottom center}
.shared-reference-mini>img,.shared-reference-mini>video{width:100%;height:100%;display:block;object-fit:cover}
.shared-reference-mini-icon{width:100%;height:100%;display:grid;place-items:center;color:#168c83}
.shared-reference-mini-icon .icon{width:9px;height:9px}
.shared-reference-mini-count{position:absolute;z-index:4;right:-14px;top:-8px;min-width:14px;height:14px;padding:0 3px;display:grid;place-items:center;border:1px solid #edf6f2;border-radius:10px;background:#35544e;color:white;font-size:7px;font-weight:700}
.shared-reference-expand{width:20px;height:22px;flex:0 0 20px;padding:0;border:0;border-radius:6px;background:transparent;color:#71867f;font-size:12px;line-height:1}
.shared-reference-expand:hover{background:#e8f2ee;color:#168c83}
.shared-reference-picker.is-expanded .shared-reference-expand{background:#dff0e9;color:#168c83}
.shared-reference-direct-drop{position:absolute;inset:-3px;z-index:3;display:none;place-items:center;border:1px dashed #168c83;border-radius:11px;background:#e2f3eddc;color:#14776e;font-size:9px;font-weight:650;pointer-events:none}
.shared-reference-picker.is-dragging .shared-reference-direct-drop{display:grid}

.creative-reference-shelf{position:relative;z-index:4;width:100%;min-width:0;max-height:122px;margin:0 0 7px;padding:6px 8px 7px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:5px;overflow:hidden;border:1px solid #d5e7df;border-radius:10px;background:#f1f8f5;box-shadow:0 5px 18px #223a3012;animation:creative-shelf-in .16s ease-out}
.creative-reference-shelf[hidden]{display:none!important}
.creative-reference-shelf>header{min-width:0;min-height:17px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#607a71;font-size:8px}
.creative-reference-shelf>header>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.creative-reference-shelf>header b{margin-left:4px;color:#168c83;font-size:8px;font-variant-numeric:tabular-nums}
.creative-reference-shelf>header>div{display:flex;align-items:center;gap:5px}
.creative-reference-shelf>header button{height:19px;min-width:23px;padding:0 5px;border:0;border-radius:5px;background:transparent;color:#71867f;font-size:8px}
.creative-reference-shelf>header button:hover:not(:disabled){background:#dfeee7;color:#168c83}
.creative-reference-shelf>header button:disabled{opacity:.45;cursor:not-allowed}
.creative-reference-shelf>header [data-shared-reference-close]{width:20px;font-size:14px}
.creative-reference-track{min-width:0;min-height:0;display:flex;align-items:stretch;gap:6px;overflow-x:auto;overflow-y:hidden;padding:0 1px 3px;scrollbar-color:#b9d2c7 transparent;scrollbar-width:thin;overscroll-behavior-x:contain}
.creative-reference-track::-webkit-scrollbar{height:4px}
.creative-reference-track::-webkit-scrollbar-thumb{border-radius:4px;background:#bfd3ca}
.creative-reference-item{position:relative;flex:0 0 76px;min-width:0;height:68px;padding:3px;display:grid;grid-template-rows:minmax(0,1fr) 13px 15px;gap:2px;border:1px solid #d7e6df;border-radius:7px;background:#fff;color:#49645d;box-shadow:0 1px 3px #16281e08;transition:border-color .15s,box-shadow .15s,transform .15s}
.creative-reference-item:hover{z-index:2;transform:translateY(-1px);border-color:#81c4b7;box-shadow:0 4px 12px #216b5d1c}
.creative-reference-preview{width:100%;min-width:0;min-height:0;padding:0;overflow:hidden;display:grid;place-items:center;border:0;border-radius:4px;background:#edf4f0;color:#4f756a;cursor:zoom-in}
.creative-reference-preview>img,.creative-reference-preview>video{width:100%;height:100%;display:block;object-fit:cover}
.creative-reference-audio-icon,.creative-reference-file-icon{width:100%;height:100%;display:grid;place-items:center;color:#168c83}
.creative-reference-audio-icon .icon,.creative-reference-file-icon .icon{width:17px;height:17px}
.creative-reference-name{min-width:0;overflow:hidden;color:#536b63;font-size:7px;line-height:13px;text-align:center;text-overflow:ellipsis;white-space:nowrap}
.creative-reference-actions{min-width:0;display:flex;align-items:center;justify-content:center;gap:3px}
.creative-reference-actions button{width:15px;height:15px;min-width:15px;padding:0;display:grid;place-items:center;border:0;border-radius:4px;background:#edf5f1;color:#668078;font-size:9px;line-height:1}
.creative-reference-actions button:hover{background:#d8eee7;color:#14776e}
.creative-reference-actions button[data-shared-ref-insert]{font-size:8px;font-weight:700}
.creative-reference-actions .icon{width:9px;height:9px}
.creative-reference-actions audio{display:none}
.creative-reference-empty{width:100%;margin:0;display:grid;place-items:center;color:#8da099;font-size:8px}
.shared-reference-local-panel{padding:13px 16px 5px}
.shared-reference-local-drop{min-height:230px;padding:25px 16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:1px dashed #b9d1c6;border-radius:13px;background:#f5faf7;color:#48635b;text-align:center;transition:border-color .15s,background .15s,box-shadow .15s}
.shared-reference-local-drop.is-dragging{border-color:#168c83;background:#eaf6f1;box-shadow:inset 0 0 0 2px #168c8315}
.shared-local-upload-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;background:#dff0e9;color:#168c83}
.shared-local-upload-icon .icon{width:21px;height:21px}
.shared-reference-local-drop>b{font-size:12px;font-weight:650}
.shared-reference-local-drop>small{color:#83968e;font-size:9px}
.shared-local-button{height:32px;margin-top:3px;padding:0 12px;border:1px solid #c9e1d7;border-radius:8px;background:#fff;color:#3d6a5e;font-size:10px;font-weight:600}
.shared-local-button:hover{border-color:#84c6b8;background:#e9f6f0;color:#14776e}
.shared-reference-local-panel>p{margin:9px 2px 0;color:#899992;font-size:9px;line-height:1.5;text-align:center}

.shared-reference-dialog{width:min(820px,calc(100vw - 28px));max-width:none;max-height:min(690px,calc(100dvh - 28px));padding:0;overflow:hidden;border:1px solid #d9e6df;border-radius:18px;background:#fff;color:#32483e;box-shadow:0 24px 90px #12281f38}
.shared-reference-dialog::backdrop{background:#17271f78;backdrop-filter:blur(5px)}
.shared-reference-dialog[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto}
.shared-reference-dialog-header{min-width:0;padding:20px 22px 14px;display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
.shared-reference-dialog-header .eyebrow{color:#81948a;font-size:8px}
.shared-reference-dialog-header h2{margin:4px 0;color:#30473d;font-size:17px;font-weight:680;letter-spacing:-.02em}
.shared-reference-dialog-header p{margin:0;color:#82938c;font-size:10px;line-height:1.5}
.shared-reference-dialog-close{width:30px;height:30px;flex:0 0 30px;padding:0;border:0;border-radius:8px;background:#f0f5f2;color:#71867f;font-size:20px;line-height:1}
.shared-reference-dialog-close:hover{background:#e2efe9;color:#168c83}
.shared-reference-source-tabs{min-height:43px;padding:0 22px;display:flex;align-items:stretch;gap:20px;border-bottom:1px solid #edf1ee}
.shared-reference-source-tabs button{position:relative;padding:0 3px;display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;color:#81918b;font-size:10px;font-weight:580}
.shared-reference-source-tabs button .icon{width:14px;height:14px}
.shared-reference-source-tabs button:hover,.shared-reference-source-tabs button.is-active{color:#168c83}
.shared-reference-source-tabs button.is-active{font-weight:680}
.shared-reference-source-tabs button.is-active::after{position:absolute;right:0;bottom:-1px;left:0;height:2px;border-radius:2px;background:#168c83;content:''}
.shared-reference-dialog-content{min-height:0;overflow:auto;overscroll-behavior:contain}
.shared-reference-asset-browser{min-height:320px;height:100%;display:grid;grid-template-columns:172px minmax(0,1fr)}
.shared-reference-folders{padding:14px 10px;display:flex;flex-direction:column;gap:5px;border-right:1px solid #edf1ee;background:#fafcfb}
.shared-reference-folder{min-width:0;min-height:43px;padding:0 9px;display:grid;grid-template-columns:25px minmax(0,1fr) auto;align-items:center;gap:7px;border:1px solid transparent;border-radius:8px;background:transparent;color:#71827a;text-align:left}
.shared-reference-folder>span{width:24px;height:24px;display:grid;place-items:center;border-radius:7px;background:#edf4ef;color:#728d7a}
.shared-reference-folder .icon{width:13px;height:13px}
.shared-reference-folder>b{overflow:hidden;font-size:9px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.shared-reference-folder>small{color:#96a39d;font-size:8px;white-space:nowrap}
.shared-reference-folder:hover{background:#f0f6f2;color:#557267}
.shared-reference-folder.is-active{border-color:#d6e9e0;background:#eaf5ef;color:#24796f}
.shared-reference-folder.is-active>span{background:#d7eee5;color:#168c83}
.shared-reference-asset-content{min-width:0;min-height:0;padding:13px 15px;display:flex;flex-direction:column}
.shared-reference-asset-content>header{min-height:31px;margin-bottom:9px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.shared-reference-asset-content>header>div{min-width:0;display:flex;flex-direction:column;gap:3px}
.shared-reference-asset-content>header b{color:#465e54;font-size:10px}
.shared-reference-asset-content>header small{overflow:hidden;color:#8b9a93;font-size:8px;text-overflow:ellipsis;white-space:nowrap}
.shared-select-category{height:25px;flex:0 0 auto;padding:0 8px;border:1px solid #dce9e3;border-radius:6px;background:#fff;color:#557268;font-size:8px}
.shared-select-category:hover:not(:disabled){border-color:#91c9b8;background:#edf7f2;color:#14776e}
.shared-select-category:disabled{opacity:.45;cursor:not-allowed}
.shared-reference-assets-grid{min-height:0;flex:1;display:grid;grid-template-columns:repeat(auto-fill,minmax(116px,1fr));align-content:start;gap:9px;overflow:auto;padding:1px 3px 5px 1px;scrollbar-color:#bfd3ca transparent;scrollbar-width:thin}
.shared-asset-choice{position:relative;min-width:0;padding:5px;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:5px;aspect-ratio:1/1.05;overflow:hidden;border:1px solid #e0e9e4;border-radius:9px;background:#fff;cursor:pointer;transition:border-color .14s,box-shadow .14s,transform .14s}
.shared-asset-choice:hover{transform:translateY(-1px);border-color:#9fcbbb;box-shadow:0 5px 15px #285d4a12}
.shared-asset-choice.is-selected{border-color:#57ac9b;background:#f0f8f4;box-shadow:0 0 0 2px #168c831a}
.shared-asset-choice.is-added{opacity:.55;cursor:not-allowed}
.shared-asset-choice>input{position:absolute;z-index:2;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}
.shared-asset-choice>img{width:100%;height:100%;min-height:0;display:block;object-fit:cover;border-radius:5px;background:#eff4f1}
.shared-asset-choice-check{position:absolute;z-index:1;top:9px;right:9px;width:17px;height:17px;display:grid;place-items:center;border:1px solid #d9e4de;border-radius:5px;background:#ffffffeb;color:transparent;font-size:10px;font-weight:750;box-shadow:0 1px 3px #12231a15}
.shared-asset-choice.is-selected .shared-asset-choice-check{border-color:#168c83;background:#168c83;color:white}
.shared-asset-choice-copy{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:5px}
.shared-asset-choice-copy>b{min-width:0;overflow:hidden;color:#536b61;font-size:8px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}
.shared-asset-choice-copy>small{flex:0 0 auto;color:#9ba9a3;font-size:7px}
.shared-reference-empty-state{grid-column:1/-1;min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:#86968e;text-align:center}
.shared-reference-empty-state>span{width:37px;height:37px;display:grid;place-items:center;border-radius:12px;background:#eef5f1;color:#83a396}
.shared-reference-empty-state .icon{width:18px;height:18px}
.shared-reference-empty-state>b{color:#61766d;font-size:10px;font-weight:620}
.shared-reference-empty-state>small{max-width:250px;color:#92a099;font-size:8px;line-height:1.5}
.shared-reference-dialog-notice{min-height:17px;margin:0;padding:0 22px;color:#b05b4d;font-size:9px}
.shared-reference-dialog-footer{min-height:52px;padding:9px 22px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #edf1ee;background:#fbfcfb}
.shared-reference-dialog-footer>span{color:#84958c;font-size:8px}
.shared-reference-dialog-footer>div{display:flex;align-items:center;gap:7px}
.shared-reference-cancel,.shared-reference-confirm{height:31px;padding:0 11px;border:1px solid #dce7e1;border-radius:7px;background:white;color:#63766d;font-size:9px;font-weight:600}
.shared-reference-cancel:hover{background:#f1f6f3}
.shared-reference-confirm{border-color:#168c83;background:#168c83;color:white}
.shared-reference-confirm:hover:not(:disabled){border-color:#117a72;background:#117a72}
.shared-reference-confirm:disabled{border-color:#dfe8e3;background:#e8efeb;color:#9caaa3;cursor:not-allowed}
.shared-reference-preview-play{width:39px;height:39px;padding:0;display:grid;place-items:center;border:1px solid #ffffffa8;border-radius:50%;background:#eaf5f0;color:#168c83;box-shadow:0 4px 14px #10271d33;pointer-events:auto;cursor:pointer}
.shared-reference-preview-play .icon{width:17px;height:17px;fill:currentColor}
.shared-reference-preview-play.is-playing{background:#168c83;color:#fff}
.asset-hover-preview--audio.shared-reference-audio-preview{pointer-events:auto}
.shared-reference-hover-preview{z-index:var(--z-preview);box-sizing:border-box}
.shared-reference-hover-preview>img,.shared-reference-hover-preview>video{min-width:0;min-height:0}
.asset-hover-preview--audio.shared-reference-audio-preview>span{font-size:10px;color:#536b61}
.asset-hover-preview--audio.shared-reference-audio-preview .shared-reference-preview-play{pointer-events:auto}
@keyframes creative-shelf-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:none}}

:root[data-theme=dark] .shared-reference-upload-button{border-color:#405457;background:#293a3d;color:#c9dbd6}
:root[data-theme=dark] .shared-reference-upload-button:hover{border-color:#62b9ad;background:#30474a;color:#d7f2eb}
:root[data-theme=dark] .shared-reference-plus{background:#365053;color:#73ded2}
:root[data-theme=dark] .shared-reference-upload-button>small{background:#30473f;color:#b6cfc4}
:root[data-theme=dark] .shared-reference-mini{border-color:#192528;background:#2a3e40}
:root[data-theme=dark] .shared-reference-mini-icon{color:#78ded2}
:root[data-theme=dark] .shared-reference-mini-count{border-color:#293a3d;background:#b9dc91;color:#182411}
:root[data-theme=dark] .shared-reference-expand{color:#a1b5ad}
:root[data-theme=dark] .shared-reference-expand:hover,:root[data-theme=dark] .shared-reference-picker.is-expanded .shared-reference-expand{background:#30474a;color:#78ded2}
:root[data-theme=dark] .shared-reference-direct-drop{border-color:#62d8cb;background:#1e3434e8;color:#8ce9db}
:root[data-theme=dark] .creative-reference-shelf{border-color:#3a5351;background:#1b2a2b;box-shadow:0 5px 18px #0003}
:root[data-theme=dark] .creative-reference-shelf>header{color:#a8bbb5}
:root[data-theme=dark] .creative-reference-shelf>header b{color:#82ddd2}
:root[data-theme=dark] .creative-reference-shelf>header button{color:#a1b5ad}
:root[data-theme=dark] .creative-reference-shelf>header button:hover:not(:disabled){background:#2c4544;color:#82ddd2}
:root[data-theme=dark] .creative-reference-track{scrollbar-color:#48605b transparent}
:root[data-theme=dark] .creative-reference-track::-webkit-scrollbar-thumb{background:#48605b}
:root[data-theme=dark] .creative-reference-item{border-color:#3a5351;background:#223437;color:#ccdfd9}
:root[data-theme=dark] .creative-reference-item:hover{border-color:#62b9ad;box-shadow:0 4px 12px #0004}
:root[data-theme=dark] .creative-reference-preview{background:#304548;color:#82ddd2}
:root[data-theme=dark] .creative-reference-name{color:#c2d6ce}
:root[data-theme=dark] .creative-reference-actions button{background:#304548;color:#a7c3ba}
:root[data-theme=dark] .creative-reference-actions button:hover{background:#3b5d58;color:#9aeee0}
:root[data-theme=dark] .creative-reference-empty{color:#a0b4ac}
:root[data-theme=dark] .shared-reference-local-drop{border-color:#405c53;background:#1c2b2a;color:#d1e2dc}
:root[data-theme=dark] .shared-reference-local-drop.is-dragging{border-color:#62d8cb;background:#1c3835}
:root[data-theme=dark] .shared-local-upload-icon{background:#304d46;color:#82ddd2}
:root[data-theme=dark] .shared-reference-local-drop>small,:root[data-theme=dark] .shared-reference-local-panel>p{color:#a0b4ac}
:root[data-theme=dark] .shared-local-button{border-color:#405b52;background:#263a38;color:#c9ded7}
:root[data-theme=dark] .shared-local-button:hover{border-color:#62b9ad;background:#304d46;color:#a2f0e1}
:root[data-theme=dark] .shared-reference-dialog{border-color:#3b5046;background:#19221c;color:#e0ebe0;box-shadow:0 24px 90px #0008}
:root[data-theme=dark] .shared-reference-dialog::backdrop{background:#030a06b8}
:root[data-theme=dark] .shared-reference-dialog-header h2{color:#e0ebe0}
:root[data-theme=dark] .shared-reference-dialog-header p,:root[data-theme=dark] .shared-reference-dialog-header .eyebrow{color:#9eafa4}
:root[data-theme=dark] .shared-reference-dialog-close{background:#28392e;color:#b3c5b8}
:root[data-theme=dark] .shared-reference-dialog-close:hover{background:#334a39;color:#9de2d7}
:root[data-theme=dark] .shared-reference-source-tabs{border-color:#334239}
:root[data-theme=dark] .shared-reference-source-tabs button{color:#a3b4a8}
:root[data-theme=dark] .shared-reference-source-tabs button:hover,:root[data-theme=dark] .shared-reference-source-tabs button.is-active{color:#8ae2d3}
:root[data-theme=dark] .shared-reference-source-tabs button.is-active::after{background:#82ddd2}
:root[data-theme=dark] .shared-reference-folders{border-color:#334239;background:#151d18}
:root[data-theme=dark] .shared-reference-folder{color:#a6b7aa}
:root[data-theme=dark] .shared-reference-folder>span{background:#283a2e;color:#a8c398}
:root[data-theme=dark] .shared-reference-folder>small{color:#94a79a}
:root[data-theme=dark] .shared-reference-folder:hover{background:#1e2e23;color:#d1e1d1}
:root[data-theme=dark] .shared-reference-folder.is-active{border-color:#47644a;background:#26392b;color:#d6e8c5}
:root[data-theme=dark] .shared-reference-folder.is-active>span{background:#334a35;color:#c5e79f}
:root[data-theme=dark] .shared-reference-asset-content>header b{color:#d6e5d7}
:root[data-theme=dark] .shared-reference-asset-content>header small{color:#a0b1a4}
:root[data-theme=dark] .shared-select-category{border-color:#3d5143;background:#243229;color:#cadbc9}
:root[data-theme=dark] .shared-select-category:hover:not(:disabled){border-color:#82a56c;background:#2b3e2e;color:#def0c8}
:root[data-theme=dark] .shared-reference-assets-grid{scrollbar-color:#48604d transparent}
:root[data-theme=dark] .shared-asset-choice{border-color:#35483a;background:#1b261e}
:root[data-theme=dark] .shared-asset-choice:hover{border-color:#718c5e;box-shadow:0 5px 15px #0004}
:root[data-theme=dark] .shared-asset-choice.is-selected{border-color:#91bb72;background:#223124;box-shadow:0 0 0 2px #b9dc9120}
:root[data-theme=dark] .shared-asset-choice>img{background:#26372a}
:root[data-theme=dark] .shared-asset-choice-check{border-color:#57665a;background:#18221c;color:transparent}
:root[data-theme=dark] .shared-asset-choice.is-selected .shared-asset-choice-check{border-color:#b9dc91;background:#b9dc91;color:#192411}
:root[data-theme=dark] .shared-asset-choice-copy>b{color:#d0dfd1}
:root[data-theme=dark] .shared-asset-choice-copy>small,:root[data-theme=dark] .shared-reference-empty-state>small{color:#9eafa4}
:root[data-theme=dark] .shared-reference-empty-state{color:#a3b4a8}
:root[data-theme=dark] .shared-reference-empty-state>span{background:#28392e;color:#a8c398}
:root[data-theme=dark] .shared-reference-empty-state>b{color:#d1e0d0}
:root[data-theme=dark] .shared-reference-dialog-notice{color:#f0a795}
:root[data-theme=dark] .shared-reference-dialog-footer{border-color:#334239;background:#151d18}
:root[data-theme=dark] .shared-reference-dialog-footer>span{color:#a1b3a5}
:root[data-theme=dark] .shared-reference-cancel{border-color:#3d5143;background:#243229;color:#d4e2d6}
:root[data-theme=dark] .shared-reference-cancel:hover{background:#2d4032}
:root[data-theme=dark] .shared-reference-confirm{border-color:#b9dc91;background:#b9dc91;color:#182411}
:root[data-theme=dark] .shared-reference-confirm:hover:not(:disabled){border-color:#d0eaa8;background:#d0eaa8}
:root[data-theme=dark] .shared-reference-confirm:disabled{border-color:#35483a;background:#28392e;color:#93a597}
:root[data-theme=dark] .shared-reference-preview-play{border-color:#405c53;background:#233632;color:#82ddd2}
:root[data-theme=dark] .shared-reference-preview-play.is-playing{background:#168c83;color:#fff}
:root[data-theme=dark] .asset-hover-preview--audio.shared-reference-audio-preview>span{color:#d2e2d8}

@media(max-width:700px){
 .shared-reference-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:14px}
 .shared-reference-dialog-header{padding:15px 14px 11px}
 .shared-reference-source-tabs{padding:0 14px;gap:15px}
 .shared-reference-dialog-content{min-height:0}
 .shared-reference-asset-browser{min-height:320px;grid-template-columns:105px minmax(0,1fr)}
 .shared-reference-folders{padding:10px 6px}
 .shared-reference-folder{min-height:42px;padding:0 5px;grid-template-columns:22px minmax(0,1fr);gap:5px}
 .shared-reference-folder>small{display:none}
 .shared-reference-folder>b{font-size:8px}
 .shared-reference-asset-content{padding:9px 8px}
 .shared-reference-assets-grid{grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:6px}
 .shared-asset-choice{padding:4px}
 .shared-asset-choice-copy>b{font-size:7px}
 .shared-asset-choice-copy>small{font-size:6px}
 .shared-reference-dialog-footer{min-height:48px;padding:8px 12px}
 .shared-reference-dialog-footer>span{max-width:40%;line-height:1.4}
 .shared-reference-dialog-notice{padding:0 13px}
 .shared-reference-local-panel{padding:10px}
 .shared-reference-local-drop{min-height:210px;padding:18px 11px}
 .creative-reference-shelf{max-height:110px;padding:5px 6px}
 .creative-reference-item{flex-basis:67px;height:62px}
}

@media(prefers-reduced-motion:reduce){.creative-reference-shelf,.shared-reference-upload-button,.creative-reference-item{animation:none;transition:none}}

/* Definite thumbnail rows prevent images overflowing into the next grid row. */
:root[data-theme] .shared-reference-dialog { height: min(690px,calc(100dvh - 28px)); }
.shared-reference-dialog-content { overflow: hidden; }
.shared-reference-asset-browser { min-height: 0; height: 100%; }
.shared-reference-folders { min-height: 0; overflow-y: auto; }
.shared-reference-asset-content > header { flex: 0 0 auto; }
.shared-reference-assets-grid { flex: 1 1 0%; height: 0; min-height: 0; grid-auto-rows: max-content; align-items: start; align-content: start; overflow-y: auto; overflow-x: hidden; }
.shared-asset-choice { display: flex; flex-direction: column; align-self: start; height: auto; min-height: 0; aspect-ratio: auto; }
.shared-asset-choice:hover { transform: none; }
.shared-asset-choice-visual { display: block; flex: 0 0 auto; width: 100%; aspect-ratio: 4/3; min-height: 0; overflow: hidden; border-radius: 5px; background: var(--color-field); }
.shared-asset-choice-visual > :is(img,.project-audio-thumb) { display: block; width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; object-fit: cover; border-radius: 5px; }
.shared-asset-choice-visual > .project-audio-thumb { display: grid; }
.shared-asset-choice-copy { flex: 0 0 26px; min-height: 26px; }
.shared-asset-choice-copy > b { flex: 1 1 0%; }
@media(max-width:700px) {
 :root[data-theme] .shared-reference-dialog { height: calc(100dvh - 16px); }
 .shared-reference-asset-browser { min-height: 0; }
 .shared-asset-choice-copy { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 30px; flex-basis: 30px; }
 .shared-asset-choice-copy > b { flex: 0 0 auto; max-width: 100%; }
}

.shared-reference-clear-all { flex: 0 0 auto; height: 31px; padding: 0 10px; border: 1px solid var(--color-border); border-radius: 7px; background: var(--color-surface); color: var(--color-danger); font-size: 9px; font-weight: 600; cursor: pointer; }
.shared-reference-clear-all:hover:not(:disabled) { border-color: var(--color-danger); background: var(--color-danger-bg); }
.shared-reference-clear-all:disabled { opacity: .4; cursor: not-allowed; }
:root[data-theme] .creative-reference-shelf.is-expanded.ui-floating-shelf { max-height: 150px; }
.creative-reference-shelf .creative-reference-track { min-height: 0; padding: 0 1px 3px; }
.creative-reference-shelf .creative-reference-item { display: grid; flex: 0 0 96px; width: 96px; min-width: 96px; min-height: 0; height: 94px; padding: 4px; gap: 3px; grid-template-rows: minmax(0,1fr) 13px 15px; }
.creative-reference-shelf .creative-reference-preview { height: 100%; min-height: 0; border-radius: 5px; }
.creative-reference-shelf .creative-reference-actions { position: static; display: flex; height: 15px; gap: 3px; align-items: center; justify-content: center; }
.creative-reference-shelf .creative-reference-actions button { height: 15px; min-height: 15px; width: 17px; }
@media(max-width:700px) {
 .shared-reference-dialog-footer { flex-wrap: wrap; }
 .shared-reference-dialog-footer > span { max-width: none; flex-basis: 100%; }
 .shared-reference-dialog-footer > div { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
 .shared-reference-clear-all { margin-right: auto; }
}
