/* Avatar stage and settings drawer. Workspace forms live in workspace.css. */
html, body { height: 100%; overflow: hidden; background: #080f19; }
main.avatar-shell { padding: 0; margin: 0; max-width: none; }
.avatar-shell > header { display: none; }
#workspace { position: fixed; inset: 0; height: 100dvh; isolation: isolate; background: radial-gradient(ellipse at 50% 35%, #293e50, #142231 40%, #080f19 80%); }
#noraCanvas { position: absolute; top: 76px; left: 0; width: 100%; height: calc(100% - 240px); display: block; z-index: 0; }
.stage-brand { position: absolute; left: 32px; top: max(26px, env(safe-area-inset-top)); color: #eef3f8; font-size: 18px; letter-spacing: 5px; line-height: 1.5; z-index: 10; }
.stage-brand small { display: block; margin-top: 4px; color: #9aafbf; font-size: 8px; letter-spacing: 3px; }
.stage-controls { position: absolute; box-sizing: border-box; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); width: min(480px, calc(100% - 40px)); padding: 20px; text-align: center; border: 1px solid #ffffff1c; border-radius: 24px; background: #111e2eea; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 16px 60px #0005; z-index: 10; }
#voiceStatus { margin: 0 0 16px; color: #a7b9c8; font-size: 12px; letter-spacing: .3px; }
#voiceStatus::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: #b9d6d4; }
.stage-controls .buttons { justify-content: center; gap: 10px; }
.stage-controls button { min-height: 48px; border: 1px solid #ffffff18; border-radius: 14px; background: #1e3043; color: #dae5ee; font-size: 12px; }
.stage-controls button.primary { flex: 1; min-width: 0; padding: 16px 24px; border: 0; background: #e0eceb; color: #162f36; font-size: 15px; font-weight: 600; }
.stage-controls button:disabled { display: none; }
.settings-trigger { position: absolute; right: 28px; top: max(26px, env(safe-area-inset-top)); width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff20; border-radius: 14px; background: #ffffff08; font-size: 19px; z-index: 11; }
#avatarNotice { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); max-width: 90%; color: #b3c3cf; text-align: center; font-size: 12px; z-index: 2; }
#avatarNotice.avatar-error { padding: 12px; border-radius: 12px; background: #462b34; color: #ffe5e5; }
#backstage { box-sizing: border-box; width: min(1100px, 96vw); max-height: 90dvh; padding: 24px; overflow: auto; border: 1px solid #3c5267; border-radius: 20px; background: #0b1424; color: #e6edf6; }
dialog::backdrop { background: #0009; backdrop-filter: blur(8px); }
.drawer-head { display: flex; align-items: center; gap: 10px; position: sticky; top: -24px; padding: 15px 0; background: #0b1424; z-index: 5; }
.drawer-head h2 { margin-right: auto; }
#backstage .grid { padding-top: 20px; }
#backstage .briefing { display: none; }
#message:not(:empty) { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); box-sizing: border-box; width: min(92vw, 700px); z-index: 20; box-shadow: 0 10px 35px #0008; }
#login { position: fixed; box-sizing: border-box; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 460px); margin: 0; z-index: 15; }
#login::before { content: 'NORA'; display: block; margin-bottom: 24px; color: #b9d6d4; font-size: 13px; letter-spacing: 6px; }
@media (max-width: 700px) {
 .stage-brand { left: 24px; top: max(24px, env(safe-area-inset-top)); font-size: 16px; letter-spacing: 4px; }
 .settings-trigger { right: 24px; top: max(24px, env(safe-area-inset-top)); }
 .stage-controls { width: calc(100% - 32px); bottom: calc(18px + env(safe-area-inset-bottom)); padding: 18px; border-radius: 22px; }
 .stage-controls .talk { width: 100%; flex-basis: 100%; min-height: 54px; }
 .stage-controls button { flex: 1; }
 #backstage { padding: 16px; }
 .drawer-head { top: -16px; flex-wrap: wrap; }
 #backstage .grid { grid-template-columns: 1fr; }
 #connections .row { flex-wrap: wrap; }
}
@media (max-height: 500px) and (orientation: landscape) {
 .stage-controls { padding: 10px 14px; bottom: 8px; }
 .stage-controls .talk { width: auto; flex-basis: auto; min-height: 44px; }
 #voiceStatus { margin-bottom: 7px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

@media(max-width:700px){#noraCanvas{top:76px;height:calc(100% - 255px)}}
@media(max-height:500px) and (orientation:landscape){#noraCanvas{top:24px;height:calc(100% - 145px)}}
