/* Reference thumbnails retain their original size; preview and removal are separate controls. */
.studio-main #page .cup-material-thumb{position:relative;display:grid;place-items:center;flex:none;padding:0;margin:0;border:0;border-radius:inherit;background:transparent;color:inherit;cursor:zoom-in;overflow:hidden;box-shadow:none;min-width:0;min-height:0;}
.studio-main #page .cup-material-thumb img{display:block;width:100%;height:100%;object-fit:contain;}
.studio-main #page .cup-material-thumb::after{content:'↗';position:absolute;right:4px;bottom:3px;width:18px;height:18px;display:grid;place-items:center;border-radius:5px;background:rgba(7,11,17,.8);color:#fff;font:14px/1 system-ui;opacity:0;transition:opacity .15s;pointer-events:none;}
.studio-main #page .cup-material-thumb:hover::after,.studio-main #page .cup-material-thumb:focus-visible::after{opacity:1;}
.studio-main #page .cup-material-thumb:focus-visible{outline:2px solid #8bbcff;outline-offset:-2px;}
.studio-main #page .ref>.cup-material-thumb{position:relative;inset:auto;width:100%;height:100%;border-radius:inherit;font-size:11px;}
.studio-main #page .ref>.cup-material-thumb img{object-fit:cover;}
.studio-main #page .agent-attachment>.cup-material-thumb{width:100%;height:64px;border-radius:0;background:var(--panel);}
.studio-main #page .cup-workshop-asset>.cup-material-thumb{width:44px;height:44px;border-radius:5px;background:var(--raised);font-size:21px;}
.cup-material-preview{--material-bg:#10151d;--material-line:#354151;--material-text:#f2f5fa;--material-muted:#9faebf;box-sizing:border-box;width:min(1120px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 40px);margin:auto;padding:0;border:1px solid var(--material-line);border-radius:22px;background:var(--material-bg);color:var(--material-text);box-shadow:0 30px 100px rgba(0,0,0,.45);color-scheme:dark;overflow:hidden;}
.cup-material-preview::backdrop{background:rgba(3,6,10,.78);backdrop-filter:blur(6px);}
.cup-material-preview-header{display:flex;align-items:center;gap:20px;min-width:0;padding:17px 20px;border-bottom:1px solid var(--material-line);}
.cup-material-preview-header h2{flex:1;min-width:0;margin:0;font:600 16px/1.5 system-ui,sans-serif;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}
.cup-material-preview-close{display:grid;place-items:center;flex:none;width:36px;height:36px;padding:0;border:1px solid var(--material-line);border-radius:11px;background:transparent;color:var(--material-text);font:25px/1 system-ui;cursor:pointer;}
.cup-material-preview-close:hover{background:rgba(140,170,205,.12);}
.cup-material-preview-close:focus-visible{outline:2px solid #8bbcff;outline-offset:3px;}
.cup-material-preview-stage{position:relative;display:grid;place-items:center;min-height:180px;height:min(72dvh,780px);padding:20px;background:#090c11;}
.cup-material-preview-media{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:8px;}
.cup-material-preview-stage img,.cup-material-preview-stage video{width:100%;height:100%;min-width:0;min-height:0;}
.cup-material-preview-stage[data-kind="audio"]{height:200px;}
.cup-material-preview-stage audio{width:min(600px,100%);}
.cup-material-preview-status{position:absolute;inset:0;display:grid;place-items:center;margin:0;padding:28px;text-align:center;color:var(--material-muted);font:14px/1.6 system-ui,sans-serif;pointer-events:none;}
.cup-material-preview-status[hidden]{display:none;}
html[data-cup-theme="day"] .cup-material-preview{--material-bg:#fff;--material-line:#d7dfe9;--material-text:#1b2b40;--material-muted:#65758a;color-scheme:light;}
html[data-cup-theme="day"] .cup-material-preview-stage{background:#f0f3f7;}
@media(max-width:760px){.studio-main #page .agent-attachment>.cup-material-thumb{height:52px;}.cup-material-preview{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:16px;}.cup-material-preview-header{padding:12px 14px;}.cup-material-preview-stage{padding:10px;height:68dvh;}}
@media(prefers-reduced-motion:reduce){.studio-main #page .cup-material-thumb::after{transition:none;}}
