/* The mobile visual language, scoped away from the shared whiteboard renderer. */
body.panda-app {
  --bg: #f7f7f9; --surface: #fff; --surface-2: #eeeef2; --border: #e3e3ea;
  --text: #17171f; --muted: #6f6f80; --primary: #5c5be2; --primary-soft: #e4e9ff;
  --bot-bubble: var(--surface); --user-bubble: #5c5be2;
  --voice-start: #28266e; --voice-end: #16102f; --voice-glow: #37d2f2;
  background: var(--bg); overflow: hidden;
}
[data-theme="dark"] body.panda-app {
  --bg: #17171c; --surface: #23232b; --surface-2: #1f1f26; --border: #3d3d49;
  --text: #f2f2f6; --muted: #aaaabb; --primary: #8890ff; --primary-soft: #252855;
}
body[data-phase="listening"] { --voice-start: #004225; --voice-end: #00171a; --voice-glow: #46ce83; }
body[data-phase="thinking"] { --voice-start: #5d3100; --voice-end: #260f00; --voice-glow: #f7c243; }
body[data-phase="speaking"] { --voice-start: #491a70; --voice-end: #1e0424; --voice-glow: #af6af2; }
body.panda-app::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(160deg, var(--voice-start), var(--voice-end)); transition: opacity .45s; }
body.panda-app[data-view="voice"]::before { opacity: 1; }
.panda-app button, .panda-app a { -webkit-touch-callout: none; }
.panda-app button { font: inherit; cursor: pointer; }
.panda-app button:focus-visible, .panda-app a:focus-visible, .panda-app input:focus-visible { outline: 3px solid #a5aaff; outline-offset: 4px; }
.panda-app .app { position: relative; width: 100%; max-width: 1080px; min-height: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
.panda-app .topbar { flex-shrink: 0; position: relative; padding: 18px 24px; min-height: 90px; gap: 12px; background: none; border: 0; backdrop-filter: none; }
.panda-app .topbar .iconbtn { width: 40px; height: 40px; border-radius: 14px; flex-shrink: 0; }
.panda-app .topbar .iconbtn, .round-control { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.voice-heading, .workspace-heading { flex: 1; min-width: 0; }
.topbar h1 { font-family: var(--display); font-weight: 800; font-size: 23px; line-height: 1.2; }
.topbar p { font-size: 12px; margin-top: 4px; color: var(--muted); }
.panda-app[data-view="voice"] .topbar { color: white; }
.panda-app[data-view="voice"] .topbar p { color: #ffffffa8; }
.panda-app[data-view="voice"] .topbar .iconbtn { background: #ffffff18; border-color: #ffffff22; color: #fff; }
.panda-app .topActions { gap: 10px; }
.panda-app .count { position: absolute; display: grid; place-items: center; color: white; border-radius: 99px; font-weight: 800; line-height: 1; }
.panda-app .round-control .count { right: -3px; top: -4px; width: 18px; height: 18px; background: #dc8900; border: 2px solid #fff; }
.panda-app[data-view="voice"] .dot:not(.on) { background: #ffffff55; }
.panda-app .lang { background: var(--surface-2); color: var(--muted); border: 0; font-size: 10px; }
.panda-app[data-view="voice"] .lang { background: #ffffff18; color: #fff; }
.phase-pill { display: flex; gap: 7px; align-items: center; background: #ffffff18; padding: 7px 11px; border: 1px solid #ffffff12; border-radius: 99px; font-size: 11px; font-weight: 800; }
.phase-pill i, .drawer-talk i { width: 6px; height: 6px; border-radius: 50%; background: var(--voice-glow); }
.panda-dock { width: 56px; height: 56px; flex-shrink: 0; }
.voice-home { display: flex; flex: 1; min-height: 0; flex-direction: column; color: #fff; }
.voice-center { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px 20px 24px; overflow-y: auto; }
.voice-scene { position: relative; flex-shrink: 0; width: min(100%, 460px); height: 330px; display: grid; place-items: center; }
.panda-anchor { width: 240px; height: 320px; }
.scene-glow { width: 270px; height: 270px; border-radius: 50%; position: absolute; top: 30px; left: calc(50% - 135px); background: radial-gradient(ellipse, color-mix(in srgb, var(--voice-glow) 19%, transparent), transparent 68%); filter: blur(12px); }
.voice-copy { max-width: 530px; text-align: center; padding-top: 10px; }
#voiceCaption { font-size: 18px; line-height: 1.55; font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
#voiceHint { font-size: 11.5px; color: #ffffff88; margin-top: 12px; }
.voice-footer { flex-shrink: 0; padding: 0 20px 0; }
.panda-app .voice-footer .chips { margin: 0 auto 23px; justify-content: center; flex-wrap: nowrap; max-width: 620px; overflow-x: auto; scrollbar-width: none; padding: 4px; }
.panda-app .chip-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 8px 13px; border-radius: 99px; box-shadow: none; }
.panda-app .voice-footer .chip-btn { color: #fff; border: 1px solid #ffffff38; background: #ffffff12; }
.panda-app .chip-btn .ic { width: 15px; height: 15px; }
.voice-controls { display: flex; align-items: center; justify-content: center; gap: 22px; }
.round-control { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #ffffff1c; border: 1px solid #ffffff28; color: white; }
.round-control .ic { width: 23px; height: 23px; }
.panda-app .mic { width: 72px; height: 72px; min-width: 72px; border: 0; border-radius: 50%; background: #fff; color: #17171f; box-shadow: 0 6px 30px #0003; }
.panda-app .mic .ic { width: 29px; height: 29px; }
.panda-app .mic.listening { background: #fff; color: #00a166; }
.panda-app .mic.thinking { background: #fff; color: #9b6200; }
.panda-app .mic.speaking { background: #fff; color: #7e31a8; }
.panda-app .mic.listening > .ic { display: none; }
.voice-wave { display: none; align-items: center; gap: 4px; height: 32px; }
.listening .voice-wave { display: flex; }
.voice-wave i { width: 4px; height: 17px; border-radius: 4px; background: #00a166; animation: waveBar .7s ease-in-out infinite alternate; }
.voice-wave i:nth-child(2), .voice-wave i:nth-child(4) { height: 25px; animation-delay: -.3s; }
.voice-wave i:nth-child(3) { height: 32px; animation-delay: -.5s; }
.control-labels { display: flex; justify-content: center; gap: 15px; font-size: 10px; font-weight: 700; color: #ffffff99; margin-top: 9px; }
.control-labels span { width: 65px; text-align: center; }
.control-labels span:nth-child(2) { width: 72px; }
.panda-app .status-line { flex-shrink: 0; min-height: 30px; padding: 10px 20px 13px; font-size: 11px; text-align: center; color: var(--muted); }
.panda-app[data-view="voice"] .status-line { color: #ffffffa8; }
.orbit { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; color: white; animation: orbitFloat 4s ease-in-out infinite; }
.orbit > span:last-child { font-size: 11px; font-weight: 800; background: #0002; padding: 2px 8px; border-radius: 10px; }
.orbit-icon { width: 58px; height: 58px; position: relative; display: grid; place-items: center; background: #fff; border: 3px solid #a5d8f2; color: #006aaa; border-radius: 22px; box-shadow: 0 12px 25px #0002; }
.orbit-icon .ic { width: 25px; height: 25px; }
.orbit-homework { left: calc(50% - 180px); top: 35px; }
.orbit-progress { right: calc(50% - 181px); top: 180px; animation-delay: -1.6s; }
.orbit-progress .orbit-icon { border-color: #a8eac8; color: #008853; }
.orbit-board { right: calc(50% - 180px); top: 27px; animation-delay: -.8s; }
.orbit-board .orbit-icon { border-color: #f6d580; color: #be7700; }
.orbit-video { left: calc(50% - 176px); top: 200px; animation-delay: -2.5s; }
.orbit-video .orbit-icon { border-color: #f1bbc0; color: #ce354a; }
.orbit-new { position: absolute; right: -12px; top: -9px; font-size: 8px; color: #fff; background: #b57000; border: 2px solid #fff; border-radius: 9px; padding: 2px 4px; }
.orbit .count { background: #006aaa; top: -8px; right: -8px; border: 2px solid white; min-width: 23px; height: 23px; font-size: 10px; }

/* One persistent mascot travels between the voice scene and panel header. */
.panda-companion { position: fixed; top: 0; left: 0; width: 240px; height: 320px; z-index: 25; padding: 0; border: 0; background: none; opacity: 0; pointer-events: none; transform-origin: center; transition: transform 480ms cubic-bezier(.22,1,.36,1), opacity .2s; will-change: transform; }
.panda-companion.ready { opacity: 1; }
.panda-hit { position: absolute; left: 22%; top: 5%; width: 60%; height: 88%; pointer-events: auto; }
.panda-companion.compact .panda-hit { left: 0; top: 12.5%; width: 100%; height: 75%; }
.panda-full { display: block; position: absolute; inset: 0; transition: opacity .3s; }
.panda-face { position: absolute; left: 0; top: 40px; width: 240px; height: 240px; opacity: 0; transition: opacity .4s; }
.compact .panda-full { opacity: 0; }
.compact .panda-face { opacity: 1; }
.panda-shadow { position: absolute; width: 52%; height: 14px; bottom: -1px; left: 24%; background: #0005; filter: blur(7px); border-radius: 50%; animation: pandaShadow 3.6s ease-in-out infinite; }
.panda-thought { position: absolute; top: 8px; right: 0; display: none; gap: 5px; align-items: flex-end; }
.panda-thought i { width: 8px; height: 8px; border: 2px solid var(--voice-glow); background: white; border-radius: 50%; animation: thoughtDot 1.2s ease-in-out infinite; }
.panda-thought i:nth-child(2) { width: 12px; height: 12px; animation-delay: .2s; }
.panda-thought i:nth-child(3) { width: 16px; height: 16px; animation-delay: .4s; }
.panda-ripple, .panda-sound { position: absolute; right: -8px; top: 50px; width: 45px; height: 55px; border-right: 3px solid var(--voice-glow); border-radius: 50%; display: none; animation: earRipple 1.4s ease-out infinite; }
/* Expressions are real transparent assets; motion is applied around each pose. */
.panda-pose { display: block; position: absolute; inset: -20px 0; transform-origin: 50% 85%; animation: pandaSway 3.8s ease-in-out infinite; }
.panda-art { opacity: 0; transition: opacity .26s ease; }
.panda-art.active { opacity: 1; }
.panda-pose > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
[data-emotion="excited"] .panda-pose { animation: pandaBounce 1.1s ease-in-out infinite; }
[data-emotion="thinking"] .panda-pose { animation: pandaPonder 3.8s ease-in-out infinite; }
[data-emotion="curious"] .panda-pose { animation: pandaAttentive 3.8s ease-in-out infinite; }
[data-emotion="confused"] .panda-pose { animation: pandaPuzzled 3.8s ease-in-out infinite; }
[data-emotion="proud"] .panda-pose { animation: pandaCelebrate 1.7s ease-in-out infinite; }
[data-emotion="surprised"] .panda-pose { animation: pandaDiscover 1.8s ease-in-out infinite; }
[data-emotion="oops"] .panda-pose { animation: pandaReassure 3.8s ease-in-out infinite; }
[data-emotion="thinking"] .panda-thought { display: flex; }
[data-emotion="curious"] .panda-ripple, [data-phase="speaking"] .panda-sound { display: block; }
.panda-sparkles { position: absolute; inset: 40px -8px 150px; display: none; }
[data-emotion="proud"] .panda-sparkles { display: block; }
.panda-sparkles i { position: absolute; width: 9px; height: 9px; background: #ffdb77; border-radius: 2px; transform: rotate(45deg); animation: sparklePulse 1.7s ease-in-out infinite; }
.panda-sparkles i:nth-child(2) { top: 65px; left: 10px; animation-delay: -.4s; }
.panda-sparkles i:nth-child(3) { right: 5px; top: 16px; animation-delay: -.8s; }
.panda-sparkles i:nth-child(4) { right: -5px; top: 90px; animation-delay: -1.2s; }
.panda-gallery { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(150px, .65fr); gap: 14px 20px; }
.panda-gallery > h3 { grid-column: 1 / -1; margin-bottom: 0; }
.panda-gallery-stage { grid-row: 2 / 4; position: relative; min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 16px; border-radius: 18px; color: white; background: radial-gradient(ellipse at 50% 40%, #4c4487, #20183c 75%); overflow: hidden; }
.panda-gallery-stage > .panda-pose { width: 160px; height: 240px; top: 28px; left: calc(50% - 80px); }
.panda-gallery-stage strong { font-family: var(--display); font-size: 22px; }
.panda-gallery-stage p { font-size: 12px; color: #ffffffb3; margin-top: 3px; text-align: center; }
.emotion-choices { display: flex; flex-wrap: wrap; align-content: center; gap: 8px; }
.emotion-choices button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: 9px 14px; font-size: 12px; font-weight: 800; }
.emotion-choices button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: white; }
.panda-preview-controls { align-self: center; }
.panda-animation-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.panda-animation-choices button { border: 0; background: var(--primary); color: white; padding: 10px 13px; border-radius: 12px; font-size: 12px; font-weight: 800; }
.panda-puppet { opacity: 0; pointer-events: none; transition: opacity .2s; }
.panda-pose > .panda-puppet { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.panda-gallery-stage > .panda-pose { z-index: 3; }
[data-puppet="true"] .panda-puppet { opacity: 1; }
[data-puppet="true"] .panda-art, [data-puppet="true"] #pandaGalleryArt { opacity: 0; }
.puppet-left { transform-origin: 166px 653px; animation: pawWave 3.6s ease-in-out infinite; }
.puppet-right { transform-origin: 858px 1030px; animation: pawGesture 3.6s ease-in-out infinite; }
.puppet-mouth { opacity: 0; transform-origin: 515px 551px; }
[data-talking="true"] .puppet-mouth { opacity: 1; animation: pandaTalk 1.3s linear infinite; }
[data-talking="true"] .puppet-left { animation-duration: 1.6s; }
[data-talking="true"] .puppet-right { animation-duration: 1.6s; }
.compact .panda-full *, [data-puppet="false"] .panda-puppet *, body[data-motion-paused="true"] .panda-puppet * { animation-play-state: paused; }
.celebrating .panda-pose { animation: achievementJump 1.6s ease-in-out both; }
.welcoming:not(.compact) .panda-full { animation: welcomeJump 1.5s ease-in-out both; }
.celebrating.compact .panda-face { animation: achievementFaceJump 1.6s ease-in-out both; }
.panda-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: visible; }
.panda-confetti i { position: absolute; top: 42%; left: 50%; opacity: 0; border-radius: 1px; animation: paperSplash 1.8s var(--delay) ease-out both; }
.panda-achievement { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.achievement-buddy { position: absolute; right: 4%; bottom: 68px; width: 145px; height: 218px; }
.achievement-buddy > img { width: 100%; height: 100%; object-fit: contain; }
.achievement-message { position: absolute; bottom: 38px; left: 50%; transform: translateX(-50%); color: white; background: #252038; border-radius: 99px; padding: 12px 22px; font-size: 14px; font-weight: 800; box-shadow: 0 8px 30px #0002; }
@keyframes pawWave { 0%,50%,100% { transform: rotate(0deg); } 15%,65% { transform: rotate(9deg); } 30%,80% { transform: rotate(-8deg); } }
@keyframes pawGesture { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } }
@keyframes pandaTalk { 0%,23%,48%,75%,100% { transform: scaleY(.08); } 8% { transform: scaleY(.9); } 16%,38%,66%,90% { transform: scaleY(.4); } 32%,56%,82% { transform: scaleY(1); } }
@keyframes achievementJump { 0%,48%,100% { transform: translateY(0) scale(1); } 10%,57% { transform: translateY(4px) scale(1.04,.94); } 28% { transform: translateY(-46px) rotate(-3deg) scale(.97,1.04); } 74% { transform: translateY(-29px) rotate(3deg) scale(.98,1.03); } }
@keyframes achievementFaceJump { 0%,48%,100% { transform: translateY(0); } 28% { transform: translateY(-38px) rotate(-6deg); } 74% { transform: translateY(-22px) rotate(5deg); } }
@keyframes welcomeJump { 0%,48%,100% { transform: translateY(0) scale(1); } 10%,57% { transform: translateY(3px) scale(1.035,.95); } 28% { transform: translateY(-34px) scale(.98,1.035); } 74% { transform: translateY(-19px) scale(.99,1.02); } }
@keyframes paperSplash { 0% { opacity: 0; transform: translate(0,0) rotate(0deg); } 8% { opacity: 1; } 45% { opacity: 1; transform: translate(calc(var(--x) * .65),var(--lift)) rotate(calc(var(--spin) * .45)); } 100% { opacity: 0; transform: translate(var(--x),var(--fall)) rotate(var(--spin)) scaleX(.4); } }
@keyframes pandaSway { 50% { transform: rotate(1deg) translateY(-2px); } }
@keyframes pandaBounce { 50% { transform: translateY(-7px) rotate(1deg); } }
@keyframes pandaPonder { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(0deg) translateY(-2px); } }
@keyframes pandaAttentive { 0%,100% { transform: rotate(2deg); } 50% { transform: rotate(5deg) translateY(-2px); } }
@keyframes pandaPuzzled { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes pandaCelebrate { 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes pandaDiscover { 50% { transform: translateY(-5px) scale(1.025); } }
@keyframes pandaReassure { 0%,100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg) translateY(-2px); } }
@keyframes sparklePulse { 50% { opacity: .15; transform: rotate(90deg) scale(.65); } }

/* Content screens keep the original conversation, cards, drawing and player. */
.panda-app .chat { width: 100%; max-width: 780px; margin: auto; padding: 22px 24px; flex: 1; min-height: 0; }
.panda-app .welcome { margin: auto; padding: 30px 20px; background: none; border: 0; box-shadow: none; max-width: 450px; }
.panda-app .welcome::before { display: none; }
.panda-app .welcome h2 { font-size: 26px; margin: 12px 0; }
.panda-app .welcome p { font-size: 14px; line-height: 1.7; }
.panda-app .bot-av { background: var(--primary-soft); overflow: hidden; border-radius: 12px; }
.bot-av img { width: 100%; height: 100%; object-fit: contain; }
.panda-app .msg { border-radius: 18px; box-shadow: none; font-size: 15px; }
.panda-app .composer { width: 100%; max-width: 780px; margin: 0 auto; background: none; border: 0; padding: 8px 24px 0; }
.panda-app .composer .inputRow { padding: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 22px; gap: 5px; }
.panda-app .composer .textbox { background: none; border: 0; box-shadow: none; padding-left: 5px; }
.panda-app .composer .sendbtn { background: var(--text); color: var(--surface); border-radius: 16px; width: 43px; height: 43px; box-shadow: none; }
.panda-app .composer .sendbtn .ic { fill: none; stroke: currentColor; }
.panda-app .composer > .tiny { text-align: center; margin-top: 9px; font-size: 10px; }
.chat-shortcuts { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.workspace-panel { flex: 1; min-height: 0; overflow-y: auto; width: calc(100% - 48px); max-width: 820px; margin: 0 auto; padding: 24px; border: 1px solid var(--border); border-radius: 26px; background: var(--surface); animation: workspaceIn .35s cubic-bezier(.2,.9,.3,1); }
.workspace-panel .sheet-grab { display: none; }
.workspace-panel .sheet-head { padding: 0 0 18px; gap: 10px; flex-wrap: wrap; }
.workspace-panel .sheet-head h2 { font-size: 20px; }
.panda-app #boardSheet { display: flex; flex-direction: column; }
.panda-app .board-stage { overflow: auto; flex: 1; min-height: 160px; border-radius: 16px; background: var(--bg); padding: 20px; }
.panda-app .board-tools .tool { min-width: 34px; height: 34px; border-radius: 10px; }
.panda-app .hw-list { overflow: visible; gap: 14px; }
.panda-app .hw-list .ic-card { width: 100%; max-width: none; border-radius: 18px; padding: 18px; box-shadow: none; }
.panda-app .hw-list .ic-title { font-size: 17px; }
.panda-app .hw-tip { line-height: 1.7; padding-top: 12px; }
.homework-complete { margin-top: 16px; border: 0; border-radius: 12px; padding: 11px 18px; color: white; background: var(--primary); font-size: 13px; font-weight: 800; }
.homework-complete:disabled { color: #087c51; background: #e5f5ed; cursor: default; }
.panel-intro { margin: 4px 0 25px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.panel-intro h2 { font-family: var(--display); font-size: 27px; margin: 8px 0; }
.panel-intro p, .empty-note { font-size: 14px; color: var(--muted); line-height: 1.7; }
.empty-note { padding: 30px 16px; text-align: center; background: var(--bg); border-radius: 18px; }
.settings-card { padding: 19px; background: var(--bg); border-radius: 18px; margin-bottom: 15px; }
.settings-card h3 { font-size: 14px; margin-bottom: 13px; }
.settings-card .settings { justify-content: flex-start; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; }
.settings-card .seg button { min-height: 40px; padding: 7px 13px; }
.settings-card .tiny { line-height: 1.6; margin-top: 12px; }
.panel-action, .text-action, .setting-row { display: flex; align-items: center; gap: 10px; border: 0; background: var(--primary-soft); color: var(--primary); padding: 14px 18px; border-radius: 14px; font-weight: 800; font-size: 13px; text-decoration: none; }
.text-action { margin: 22px auto 0; width: fit-content; }
.setting-row { width: 100%; background: none; padding: 4px 0; }
.setting-row span:last-child { margin-left: auto; }
.topic-list { display: grid; gap: 14px; margin-bottom: 22px; }
.topic-card { padding: 17px; border: 1px solid var(--border); border-radius: 16px; }
.topic-card header { display: flex; justify-content: space-between; gap: 20px; font-size: 14px; font-weight: 800; margin-bottom: 12px; }
.topic-card progress { width: 100%; height: 9px; border: 0; border-radius: 10px; overflow: hidden; accent-color: #00a166; }
.topic-card progress::-webkit-progress-bar { background: var(--surface-2); }
.topic-card progress::-webkit-progress-value { background: #00a166; border-radius: 10px; }

/* The mobile glass menu, with a real keyboard/focus boundary. */
.drawer-scrim { position: fixed; inset: 0; z-index: 39; background: #07041366; backdrop-filter: blur(3px); }
.nav-drawer { position: fixed; z-index: 40; left: 12px; top: max(12px, env(safe-area-inset-top)); bottom: max(12px, env(safe-area-inset-bottom)); width: min(310px, calc(100vw - 24px)); padding: 20px; display: flex; flex-direction: column; overflow-y: auto; border-radius: 26px; border: 1px solid #ffffff29; background: #201739ed; color: white; backdrop-filter: blur(26px); animation: drawerIn .3s cubic-bezier(.2,.9,.3,1); box-shadow: 0 24px 100px #0005; }
.drawer-brand { display: flex; align-items: center; gap: 8px; margin: 0 0 24px; }
.drawer-brand h2 { font-family: var(--display); font-size: 22px; flex: 1; }
.brand-wordmark { display: block; position: relative; width: 270px; max-width: 100%; aspect-ratio: 3; }
.brand-wordmark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.brand-wordmark .brand-gold { display: none; clip-path: inset(70% 0 0 75%); }
.brand-inverse .brand-ink, html[data-theme="dark"] .brand-auto .brand-ink { filter: brightness(0) invert(1); }
.brand-inverse .brand-gold, html[data-theme="dark"] .brand-auto .brand-gold { display: block; }
.drawer-brand .brand-wordmark { margin: 0; min-width: 0; }
.drawer-brand .iconbtn { flex-shrink: 0; }
.nav-drawer .iconbtn { color: #fff; background: #ffffff12; border: 0; width: 32px; height: 32px; }
.drawer-talk { display: flex; align-items: center; gap: 10px; border: 1px solid #ffffff13; padding: 15px; border-radius: 15px; background: #ffffff1a; color: white; font-size: 14px; font-weight: 800; }
.drawer-talk i { background: #46ce83; }
.nav-drawer .eyebrow { color: #ffffff66; margin: 28px 0 13px; }
.drawer-prompt { display: flex; align-items: flex-start; gap: 12px; text-align: left; border: 0; background: none; color: white; padding: 14px 4px; font-size: 13px; font-weight: 700; }
.drawer-prompt .ic { color: #c1bdff; flex-shrink: 0; }
.drawer-prompt small { display: block; color: #ffffff77; font-size: 10.5px; font-weight: 600; margin-top: 5px; }
.drawer-links { margin-top: auto; padding: 25px 0 12px; }
.drawer-links button { display: flex; align-items: center; gap: 12px; width: 100%; color: white; background: none; border: 0; padding: 12px 4px; font-size: 14px; font-weight: 700; text-align: left; }
.drawer-links button:hover, .drawer-prompt:hover { color: #c1bdff; }
#drawerHwCount { margin-left: auto; background: #ffffff1a; padding: 1px 8px; border-radius: 9px; }
.drawer-profile { display: flex; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid #ffffff22; }
.drawer-profile .who { flex: 1; }
.drawer-profile .avatar { width: 34px; height: 34px; border-radius: 12px; background: #a5aaff33; font-size: 15px; }
.drawer-profile h3 { font-size: 13px; }
.drawer-profile .sub { color: #ffffff80; font-size: 10px; line-height: 1.5; margin-top: 3px; }
.panda-app .login-overlay { overflow-y: auto; background: var(--bg); padding: 30px 20px; }
.panda-app .login-card { width: min(100%, 410px); padding: 24px 10px; border: 0; box-shadow: none; background: none; gap: 16px; }
.panda-app .login-brand img { object-fit: contain; }
.panda-app .login-brand { display: flex; justify-content: center; }
.panda-app .login-card h2 { font-size: 28px; }
.panda-app .login-card > .tiny { font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.panda-app .login-input { min-height: 50px; border-radius: 16px; font-size: 14px; }
.panda-app .login-submit { background: var(--text); color: var(--surface); box-shadow: none; min-height: 52px; border-radius: 16px; }
.panda-app .demo-btn { border-radius: 16px; padding: 15px 5px; }
.panda-app .escalation { margin: 0 24px 8px; }
.panda-app .stats { z-index: 45; bottom: 35px; }
@keyframes orbitFloat { 50% { transform: translateY(-7px); } }
@keyframes waveBar { to { transform: scaleY(.5); } }
@keyframes pandaShadow { 50% { transform: scaleX(.94); opacity: .7; } }
@keyframes thoughtDot { 50% { opacity: .45; transform: translateY(-4px); } }
@keyframes earRipple { from { opacity: .8; transform: scale(.8); } to { opacity: 0; transform: scale(1.6); } }
@keyframes workspaceIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes drawerIn { from { opacity: 0; transform: translateX(-30px); } }
@media (max-width: 600px) {
  .panda-gallery { display: block; }
  .panda-gallery > h3 { margin-bottom: 14px; }
  .emotion-choices { margin-top: 14px; }
  .panda-app .topbar { padding: 12px 16px; min-height: 78px; gap: 9px; }
  .topbar h1 { font-size: 18px; }
  .topbar p { font-size: 10.5px; }
  .panda-app .topActions { gap: 7px; }
  .panda-app[data-view="voice"] .topbar .lang { display: none; }
  .phase-pill { font-size: 10px; padding: 7px 9px; }
  .voice-center { padding: 0 10px 20px; }
  .voice-scene { height: 325px; }
  .voice-copy { padding: 8px 20px 0; }
  #voiceCaption { font-size: 17px; line-height: 1.5; }
  .orbit-homework { left: 1%; }
  .orbit-progress { right: 1%; }
  .orbit-board { right: 1%; }
  .orbit-video { left: 1%; }
  .orbit-icon { width: 53px; height: 53px; border-radius: 19px; }
  .orbit > span:last-child { font-size: 10px; }
  .panda-app .voice-footer .chips { justify-content: flex-start; margin-bottom: 17px; }
  .workspace-panel { width: calc(100% - 24px); padding: 18px 14px; border-radius: 22px; }
  .panda-app .chat { padding: 16px; }
  .panda-app .composer { padding: 8px 14px 0; }
  .panda-app .board-stage { padding: 12px; }
  .workspace-panel .sheet-head { gap: 8px; }
  .workspace-panel .sheet-head h2 { width: 100%; }
  .board-tools { margin-left: 0; }
  .panel-intro h2 { font-size: 24px; }
  .panda-app .status-line { padding-bottom: 8px; }
}
@media (max-height: 740px) {
  .voice-center { justify-content: flex-start; padding-bottom: 8px; }
  .voice-scene { height: 270px; }
  .panda-anchor { width: 200px; height: 267px; }
  .orbit-progress { top: 155px; }
  .orbit-video { top: 175px; }
  #voiceCaption { font-size: 15px; -webkit-line-clamp: 3; }
  #voiceHint { margin-top: 6px; }
  .voice-footer .chips { margin-bottom: 10px !important; }
}
@media (max-height: 650px) {
  .voice-scene { height: clamp(125px, calc(100dvh - 375px), 230px); }
  .panda-anchor { width: auto; height: 100%; aspect-ratio: 3 / 4; }
  .voice-center { padding-top: 0; }
  .voice-copy { flex-shrink: 0; }
  .orbit-homework, .orbit-board { top: 5px; }
  .orbit-progress, .orbit-video { top: auto; bottom: 12px; }
  #voiceCaption { font-size: 14px; -webkit-line-clamp: 2; }
  #voiceHint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .panda-confetti { display: none; }
  .puppet-mouth { transform: scaleY(.4); }
  .panda-app *, .panda-app *::before, .panda-app *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- panda-life.js: procedural motion replaces the infinite CSS loops ----
   Finite moments (celebrating / welcoming) keep their CSS animation. */
.alive:not(.celebrating) .panda-pose { animation: none; will-change: transform; }
.alive .puppet-left, .alive .puppet-right { animation: none; }
.alive[data-talking="true"] .puppet-mouth { animation: none; }
.alive .panda-shadow { animation: none; }
.alive .panda-art { transition: opacity .32s cubic-bezier(.4, 0, .2, 1); }
.panda-pose > .panda-lids { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.panda-face { transform-origin: 50% 90%; }
@media (prefers-reduced-motion: reduce) {
  .panda-pose, .puppet-left, .puppet-right, .panda-shadow, [data-talking="true"] .puppet-mouth,
  .orbit, .panda-sparkles i { animation: none !important; }
}
