/* O mascote não altera a geometria do conteúdo nem bloqueia modais. */
.conde-mascot{position:fixed;z-index:75;right:18px;bottom:max(16px,env(safe-area-inset-bottom));width:124px;height:141px;user-select:none;isolation:isolate;pointer-events:none;}
.conde-mascot[hidden],.conde-mascot [hidden]{display:none!important}
body:has(.sidebar.open) .conde-mascot:not(.mascot-modal-active){visibility:hidden}
.mascot-stage{position:absolute;inset:18px 0 0;border:0;background:transparent;display:flex;align-items:flex-end;justify-content:center;padding:0;cursor:grab;touch-action:none;pointer-events:auto;transform-origin:50% 95%;}
.mascot-stage:focus-visible,.mascot-tools button:focus-visible{outline:2px solid var(--accent,#526344);outline-offset:2px;border-radius:10px;}
.mascot-stage img{display:block;object-fit:contain;max-width:100%;max-height:100%;height:auto;width:auto;filter:drop-shadow(0 3px 3px #0003);pointer-events:none;transform-origin:50% 95%;}
.mascot-pose{animation:mascot-breathe 4.5s ease-in-out infinite;}
.mascot-tools{position:absolute;top:0;right:0;display:flex;gap:3px;pointer-events:auto;z-index:2;}
.mascot-tools button,.mascot-caption button{width:26px;height:26px;border:1px solid var(--line);border-radius:50%;background:var(--white,#fff);color:var(--ink);padding:0;display:grid;place-items:center;font-size:14px;box-shadow:0 1px 6px #0001;}
.mascot-bubble{position:absolute;bottom:calc(100% + 7px);right:0;width:min(232px,calc(100vw - 30px));padding:10px 12px;border:1px solid var(--line);border-radius:13px;background:var(--white,#fff);box-shadow:0 6px 24px #0002;color:var(--ink);pointer-events:auto;}
.mascot-bubble:after{content:'';position:absolute;right:25px;bottom:-6px;width:10px;height:10px;background:var(--white,#fff);border-right:1px solid var(--line);border-bottom:1px solid var(--line);transform:rotate(45deg);}
.conde-mascot:not(.bubble-left) .mascot-bubble{right:auto;left:0;}.conde-mascot:not(.bubble-left) .mascot-bubble:after{right:auto;left:25px;}
.conde-mascot.bubble-below .mascot-bubble{bottom:auto;top:calc(100% + 7px);}.conde-mascot.bubble-below .mascot-bubble:after{bottom:auto;top:-6px;transform:rotate(225deg);}
.mascot-caption{display:flex;justify-content:space-between;align-items:center;color:var(--accent,#526344);font-weight:750;font-size:11px;letter-spacing:.3px;}.mascot-caption button{width:21px;height:21px;font-size:13px;box-shadow:none;}
.mascot-bubble p{font-size:calc(12px * var(--font-scale,1));line-height:1.45;margin:4px 0 0;overflow-wrap:anywhere;}.mascot-action{border:0;background:none;color:var(--accent-strong,#526344);font-weight:700;text-decoration:underline;padding:6px 0 0;font-size:12px;}
.mascot-confetti{position:absolute;inset:0;pointer-events:none;display:none;}.victory .mascot-confetti{display:block;}.mascot-confetti i{position:absolute;left:calc(8% + var(--i)*9%);top:35%;width:5px;height:9px;border-radius:2px;background:#d4772b;animation:mascot-confetti 1.4s calc(var(--i)*.08s) ease-out 3 both;}.mascot-confetti i:nth-child(2n){background:var(--accent);}.mascot-confetti i:nth-child(3n){background:#efbd5b;}
.stroll .mascot-stage{animation:mascot-stroll 1.8s ease-in-out;}.dragging .mascot-stage{cursor:grabbing;}.dragging *, .reduced *, .reduced .mascot-stage{animation:none!important;transition:none!important;}.reduced .mascot-confetti{display:none!important;}
@keyframes mascot-breathe{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-3px) scale(1.018)}}
@keyframes mascot-wave{0%,100%{transform:rotate(0)}30%{transform:rotate(-5deg) translateY(-3px)}65%{transform:rotate(5deg)}}
@keyframes mascot-dance{0%{transform:rotate(-9deg) translateY(0)}100%{transform:rotate(10deg) translateY(-13px)}}
@keyframes mascot-stroll{0%,100%{transform:translateX(0)}25%{transform:translateX(calc(-18px * var(--mascot-walk-dir,1))) rotate(-4deg)}50%{transform:translateX(calc(-32px * var(--mascot-walk-dir,1))) rotate(3deg)}75%{transform:translateX(calc(-16px * var(--mascot-walk-dir,1))) rotate(-3deg)}}
@keyframes mascot-confetti{0%{opacity:0;transform:translateY(10px) rotate(0)}25%{opacity:1;transform:translateY(-65px) rotate(140deg)}100%{opacity:0;transform:translateY(38px) rotate(330deg)}}
.mascot-account-link{margin-top:8px!important;min-height:28px!important;padding:4px 8px!important;border:0!important;text-decoration:underline;color:var(--muted)!important;background:transparent!important;}
.mascot-settings-head{display:flex;gap:12px;align-items:center;margin:0 0 10px;}.mascot-settings-head img{width:85px;height:85px;object-fit:contain;}.mascot-settings-head p{margin:3px 0;}.mascot-settings form>label:has(input[type=checkbox]){display:flex;align-items:center;gap:9px;margin:9px 0;}.mascot-settings input[type=checkbox]{width:auto;margin:0;accent-color:var(--accent,#526344);}.mascot-settings-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;margin-top:12px;}
.mascot-library-rows{max-height:42vh;overflow:auto;margin-top:8px;padding-right:4px;}.mascot-phrase-row{display:grid;grid-template-columns:27px minmax(0,1fr) 30px;align-items:center;gap:5px;padding:4px 0;border-bottom:1px solid var(--line);}.mascot-phrase-row input[type=text],#mascotPaste{min-width:0;width:100%;border:1px solid var(--line);background:var(--field,#fff);color:var(--ink);border-radius:6px;padding:7px;}.mascot-phrase-row input[type=checkbox]{width:auto;margin:0;accent-color:var(--accent,#526344);}.mascot-phrase-row span{font-size:11px;color:var(--muted);}.mascot-library-rows+div{margin-top:10px;}
@media(max-width:760px){.conde-mascot{width:94px;height:112px;right:10px;bottom:max(12px,env(safe-area-inset-bottom));}.mascot-tools button{width:28px;height:28px;}.mascot-stage{top:24px;}.mascot-bubble{width:min(205px,calc(100vw - 24px));}.mascot-library-rows{max-height:35vh;}}
@media(prefers-reduced-motion:reduce){.conde-mascot *{animation:none!important;transition:none!important;}.mascot-confetti{display:none!important}}

/* V62: desktop ao lado do modal; telas estreitas e diálogos nativos, no cabeçalho. */
.conde-mascot.mascot-modal-active{z-index:160;left:auto!important;top:auto!important;right:12px!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:96px;height:115px;visibility:visible;pointer-events:none;}
.conde-mascot.mascot-modal-active :is(.mascot-stage,.mascot-tools,.mascot-bubble){pointer-events:none!important;}
.conde-mascot.mascot-modal-active :is(.mascot-tools,.mascot-bubble){display:none!important;}
.conde-mascot.mascot-modal-active .mascot-stage{inset:0;}
.conde-mascot.mascot-modal-inline{position:relative;inset:auto!important;width:48px;height:54px;flex:0 0 48px;align-self:center;margin:0;}
.modal-head:has(>.mascot-modal-inline){gap:7px;align-items:center;}
.modal-head:has(>.mascot-modal-inline)>div:first-child{flex:1;min-width:0;overflow-wrap:anywhere;}
.modal-head:has(>.mascot-modal-inline)>.close{flex:0 0 32px;}
.conde-mascot.mascot-modal-native{float:right;}
@media(max-width:420px){.conde-mascot.mascot-modal-inline{width:38px;height:46px;flex-basis:38px;}.modal-head:has(>.mascot-modal-inline) .eyebrow{letter-spacing:1px;}}
/* Pequenos acessórios animados, sem novas imagens ou chamadas externas. */
.mascot-prop{display:none;position:absolute;right:7%;bottom:10%;width:26px;height:20px;border:2px solid var(--accent);border-radius:4px;background:#fff;color:var(--accent-strong);pointer-events:none;z-index:1;box-shadow:0 2px 5px #0002;}
.conde-mascot[data-prop="document"] .mascot-prop{display:block;width:21px;height:29px;background:repeating-linear-gradient(to bottom,var(--white) 0 5px,var(--accent-soft) 5px 7px);transform:rotate(9deg);}
.conde-mascot[data-prop="letter"] .mascot-prop{display:block;animation:mascot-letter 1.2s ease-in-out 3;}
.conde-mascot[data-prop="letter"] .mascot-prop:before{content:"";position:absolute;left:5px;top:-3px;width:11px;height:11px;border-right:2px solid var(--accent);border-bottom:2px solid var(--accent);transform:rotate(45deg);}
.conde-mascot[data-prop="rest"] .mascot-prop{display:block;border:0;background:none;box-shadow:none;font-weight:700;right:12%;bottom:54%;animation:mascot-rest 3s ease-in-out infinite;}
.conde-mascot[data-prop="rest"] .mascot-prop:before{content:"Zz";color:var(--accent-strong,#526344);font-size:14px;}
.conde-mascot.mascot-modal-active .mascot-prop{display:none;}
@keyframes mascot-letter{50%{transform:translateY(-5px) rotate(-7deg)}}
@keyframes mascot-rest{0%,100%{opacity:.6;transform:translateY(1px)}50%{opacity:1;transform:translateY(-5px)}}

/* r6.5: small fixed mascot, independent of scrolling, above the content but below menus/dialogs. */
@media(max-width:760px){
 .conde-mascot:not(.mascot-modal-active){position:fixed!important;left:auto!important;top:auto!important;right:12px!important;bottom:max(14px,calc(env(safe-area-inset-bottom) + 10px))!important;margin:0;width:76px;height:96px;z-index:75!important;}
 .conde-mascot:not(.mascot-modal-active) .mascot-stage{top:24px;touch-action:auto;cursor:pointer;}
 .conde-mascot:not(.mascot-modal-active) .mascot-tools{top:0;right:0;}
 .conde-mascot:not(.mascot-modal-active) .mascot-bubble{position:absolute!important;width:min(245px,calc(100vw - 28px));max-height:40dvh;overflow:auto;right:0!important;left:auto!important;top:auto!important;bottom:calc(100% + 8px)!important;}
 .conde-mascot .mascot-bubble:after{display:none;}
 .conde-mascot.mascot-modal-active,body:has(dialog[open]) .conde-mascot,body:has(.modal-overlay:not(.ws-inline .modal-overlay)) .conde-mascot{display:none!important;}
}

/* HORUS Sentinel r6.24: one actor, animated WebP plus static fallback. */
.conde-mascot .mascot-stage .mascot-pose{width:100%;height:100%;margin:0;max-width:100%;max-height:100%;object-fit:contain;animation:none;}
.conde-mascot[data-scene="idle"] .mascot-stage .mascot-pose{animation:horus-breathe 5s ease-in-out infinite;}
.conde-mascot[data-scene="sleep"] .mascot-pose,.conde-mascot[data-scene="lunch"] .mascot-pose{animation:horus-breathe 6s ease-in-out infinite;}
.conde-mascot.victory .mascot-stage .mascot-pose{animation:horus-victory .85s ease-in-out 5;}
.conde-mascot[data-scene="friday"] .mascot-stage .mascot-pose{animation:horus-victory .85s ease-in-out 4;}
.conde-mascot .mascot-prop{display:none!important;}
.conde-mascot[data-scene="sleep"] .mascot-prop,.conde-mascot[data-scene="lunch"] .mascot-prop{display:block!important;}
.conde-mascot .horus-symbol{position:absolute;right:0;top:33%;width:31%;aspect-ratio:1;display:grid;place-items:center;color:#91efff;background:rgba(10,45,65,.87);border:1px solid currentColor;border-radius:24%;box-shadow:0 0 8px currentColor;pointer-events:none;animation:horus-symbol-in .35s ease-out both;}
.horus-symbol svg{width:77%;height:77%;}
.conde-mascot:is([data-scene="deadline"],[data-scene="birthday"],[data-scene="goal"]) .horus-symbol{color:#ffd16c;background:rgba(52,35,8,.9);}
.conde-mascot[data-scene="fatal"] .horus-symbol{color:#ff7777;background:rgba(71,13,13,.92);animation:horus-alert 1.4s ease-in-out 3;}
.conde-mascot.mascot-modal-active .horus-symbol{display:none;}
.conde-mascot .mascot-confetti i:nth-child(2n){background:#f9cf6c;}
@keyframes horus-breathe{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-2px) scale(1.012)}}
@keyframes horus-victory{0%,100%{transform:translateY(0) rotate(0)}30%{transform:translateY(-7px) rotate(-4deg)}65%{transform:translateY(-3px) rotate(4deg)}}
@keyframes horus-symbol-in{from{opacity:0;transform:translateY(5px) scale(.92)}to{opacity:1;transform:none}}
@keyframes horus-alert{0%,100%{box-shadow:0 0 5px #ff7777}50%{box-shadow:0 0 12px #ff7777}}
.conde-mascot.reduced .mascot-stage .mascot-pose,.conde-mascot.reduced .horus-symbol{animation:none!important;}
@media(prefers-reduced-motion:reduce){.conde-mascot .mascot-stage .mascot-pose,.conde-mascot .horus-symbol{animation:none!important;}}

/* r6.26: escolha textual compacta em Minha conta. */
.mascot-account-section{border-top:1px solid var(--line);padding-top:10px;margin:10px 0;}
.mascot-account-section h3{margin:0 0 4px;}
.mascot-character-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.mascot-character-choice{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0;min-height:44px;justify-content:center;padding:7px 10px;border:1px solid var(--line);border-radius:10px;background:var(--white);color:var(--ink);cursor:pointer;font:inherit;}
.mascot-character-choice[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent);}
.mascot-character-choice span{font-weight:650;}.mascot-character-choice small{color:var(--muted);}.mascot-character-choice:disabled{cursor:default;opacity:.7;}.mascot-account-status{min-height:1.4em;margin:5px 0;}
