/* Portrait-stage framing adapted from dafeiyu-ai-vtuber Live2D/stage-portrait.html
 * (GPL-3.0); speech bubble adapted from WaleTalk (MIT). See licenses/ and NOTICE. */
.avatar-body .live-workspace{max-width:1320px}.avatar-body .live-layout{grid-template-columns:minmax(330px,.9fr) minmax(340px,1.1fr);align-items:start}
.avatar-body .live-preview-column{position:sticky;top:18px}.avatar-preview{overflow:hidden}.avatar-hint{font-size:12px;color:#788899;line-height:1.6;margin:0 0 12px}.avatar-body details label{margin-top:12px}
.avatar-surface{height:min(75vh,960px);min-height:520px;position:relative;background:#081b35;overflow:hidden}
#avatar-stage{position:absolute;left:50%;top:50%;width:1080px;height:1920px;overflow:hidden;isolation:isolate;transform-origin:center;background:#102e51 url('./assets/aquarium-portrait.png') center/cover no-repeat}
#avatar-canvas{position:absolute;inset:0;width:1080px;height:1920px;display:block;z-index:2;background:transparent}
#avatar-bubble{position:absolute;left:65px;top:230px;max-width:680px;max-height:400px;z-index:4;opacity:0;transform:scale(.85);transform-origin:bottom left;transition:opacity .25s,transform .25s;pointer-events:none;padding:28px 38px;border-radius:36px;border:4px solid #a3dbe8;background:rgba(255,255,255,.96);color:#263d53;font-weight:650;font-size:36px;line-height:1.5;box-shadow:0 8px 24px rgba(0,0,0,.2);word-break:break-word;white-space:pre-wrap}
#avatar-bubble.on{opacity:1;transform:scale(1)}#avatar-bubble:after{content:"";position:absolute;bottom:-23px;left:44px;width:36px;height:36px;background:#fff;transform:rotate(45deg);border-right:4px solid #a3dbe8;border-bottom:4px solid #a3dbe8}
.avatar-stage-caption{position:absolute;bottom:56px;left:56px;right:56px;display:flex;align-items:center;gap:18px;border-radius:24px;padding:22px 30px;background:rgba(7,27,48,.72);backdrop-filter:blur(12px);z-index:3;color:#effaff;font:600 28px system-ui}.avatar-stage-caption span:last-child{margin-left:auto;color:#acdae7;font-weight:400}.avatar-dot{width:15px;height:15px;border-radius:50%;background:#73e1c5;box-shadow:0 0 18px #73e1c5}
#avatar-stage.transparent{background:transparent}#avatar-stage.green{background:#00ff00}#avatar-stage.transparent .avatar-stage-caption,#avatar-stage.green .avatar-stage-caption{display:none}
.avatar-body.stage-only{padding:0;background:transparent;overflow:hidden}.stage-only .live-workspace{padding:0;max-width:none;margin:0}.stage-only .live-heading,.stage-only .live-connection,.stage-only .live-controls,.stage-only .live-metrics,.stage-only .live-preview-column>details,.stage-only .preview-toolbar,.stage-only .preview-footer{display:none}.stage-only .live-layout{display:block}.stage-only .live-preview-column{position:static}.stage-only .preview-card{border:0;box-shadow:none;background:transparent;border-radius:0}.stage-only .avatar-surface{position:fixed;inset:0;z-index:100;width:100vw;height:100vh;min-height:0;background:transparent}
@media(max-width:800px){.avatar-body .live-layout{display:flex;flex-direction:column-reverse}.avatar-body .live-preview-column{position:static;width:100%}.avatar-body .live-controls{width:100%}.avatar-surface{height:72vh;min-height:420px}.avatar-body .live-connection form{grid-template-columns:1fr}}

/* Integrated workspace: use the existing shell, card rhythm and violet accents. */
.avatar-studio .live-workspace{max-width:none;margin:0;padding:0}
.avatar-studio .live-layout{grid-template-columns:minmax(300px,.9fr) minmax(300px,1.1fr);gap:24px}
.avatar-studio .live-controls,.avatar-studio .live-preview-column{gap:18px;min-width:0}
.avatar-studio .live-controls>.card,.avatar-studio .live-preview-column>details{padding:22px}
.avatar-studio .live-controls h2{font-size:14px;color:var(--ink);margin:0 0 14px}
.avatar-studio .panel-heading{margin-bottom:16px}
.avatar-studio .panel-heading h2{margin:0}
.avatar-studio .panel-heading p{font-size:11px;line-height:1.8;color:var(--muted);margin:7px 0 0}
.avatar-studio .live-workspace label{font-size:11px;color:#8d799d;margin:14px 0 0;gap:8px}
.avatar-studio .live-workspace input,.avatar-studio .live-workspace select,.avatar-studio .live-workspace textarea{font-size:12px;border-color:#e5deef;background:#fdfcff;color:#81708f;padding:10px;border-radius:9px;accent-color:var(--primary)}
.avatar-studio .live-workspace input[type=range]{padding:0;height:24px}
.avatar-studio .live-workspace input[type=file]{font-size:10px}
.avatar-studio .live-workspace summary{font-size:11px;color:#8d799d;line-height:1.8}
.avatar-studio .live-controls details{margin-top:16px}
.avatar-studio .live-buttons{gap:8px;margin-top:18px}
.avatar-studio .live-buttons .primary-button{font-size:11px;min-width:112px;min-height:38px}
.avatar-studio .live-buttons .secondary-button{font-size:10px;padding:10px 12px}
.avatar-studio .avatar-hint{font-size:10px;line-height:1.8;color:var(--muted);margin:10px 0 0}
.avatar-studio .avatar-surface{height:min(68vh,800px);min-height:480px}
.avatar-studio .live-preview-column{top:18px}
.avatar-studio .live-metrics{grid-template-columns:repeat(2,minmax(0,1fr));padding:20px;gap:20px}
.avatar-studio .live-metrics span{font-size:10px;color:var(--muted);margin-bottom:8px}
.avatar-studio .live-metrics strong{font-size:18px;color:#7867b5;font-weight:500}
.avatar-studio .live-answer{font-size:13px;color:#81708f;line-height:1.9;overflow-wrap:anywhere}
.avatar-studio .live-workspace pre{font-size:11px;color:#8d799d}
.avatar-studio .preview-toolbar{gap:12px;flex-wrap:wrap;height:auto;min-height:45px;padding:12px 16px}
.avatar-studio .preview-toolbar>span:nth-child(2){font-size:10px;margin-left:auto}
.avatar-studio .preview-footer{gap:10px;flex-wrap:wrap;padding:12px 16px;font-size:10px}
.avatar-studio .preview-footer>span{margin-right:auto}
.stage-only>.sidebar,.stage-only .topbar,.stage-only .app-footer,.stage-only .avatar-studio>.page-heading,.stage-only .avatar-studio>.connection-banner{display:none}
.stage-only .main-shell{margin:0}.stage-only .avatar-studio{padding:0}
body.stage-only{background:transparent;overflow:hidden}.stage-only .avatar-studio .avatar-surface{height:100vh;width:100vw;min-height:0}
@media(max-width:1100px){.avatar-studio .live-layout{grid-template-columns:minmax(265px,.9fr) minmax(265px,1fr);gap:18px}.avatar-studio .live-controls>.card{padding:18px}}
@media(max-width:900px){.avatar-studio .live-layout{display:flex;flex-direction:column-reverse}.avatar-studio .live-preview-column{position:static;width:100%}.avatar-studio .live-controls{width:100%}.avatar-studio .avatar-surface{height:60vh;min-height:360px}}
