/* Single-document Ask layout. No iframe, scrolling stage, or tree portal. */
#ask-app{color:#30382c;font:16px/1.4 system-ui,-apple-system,sans-serif;min-width:0;width:100%}
#ask-app[data-theme=dark]{color:#f0e9dc}
#ask-app .ask-main{width:100%;margin:0 auto;padding:20px 24px 28px}
#ask-app .ask-history-panel{overscroll-behavior:contain}
/* Desktop artwork takes real layout space; phone positioning stays independent. */
@media(min-width:601px){
 body.page-ask>main.wrap{min-width:0}
 #ask-app .ask-main{max-width:1200px;min-height:calc(100dvh - 155px);display:flex;flex-direction:column;justify-content:center;gap:20px;padding:24px 24px 32px}
 #ask-app .bot-person{container-type:normal;height:auto;margin:0}
 #ask-app .character-scene:not(.has-tree){display:flex;align-items:center;justify-content:center;min-height:0;padding:0;gap:0}
 #ask-app .character-scene:not(.has-tree)>.bot-person{position:relative;inset:auto;translate:none;flex:none;width:clamp(200px,calc((100dvh - 270px)*.666667),352px);max-width:100%}
 #ask-app .character-scene:not(.has-tree)>.decision-tree,#ask-app .character-scene:not(.has-tree)>.tree-companion{display:none}
 #ask-app .character-scene.has-tree{min-height:0;padding-bottom:0}
 #ask-app #ask-form{position:relative;inset:auto;flex:none;width:min(100%,640px);margin:0 auto;padding:0}
}
@media(max-width:600px){
 html:has(body.page-ask),html.phone-header-fixed:has(body.page-ask){height:100%;overflow:hidden;overscroll-behavior:none;scrollbar-gutter:auto}
 body.page-ask{height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
 html.phone-header-fixed body.page-ask>main.wrap,body.page-ask>main.wrap{
   position:fixed;inset:var(--phone-header-height,76px) 0 auto;width:100%;margin:0;padding:0;
   height:calc(100dvh - var(--phone-header-height,76px));min-height:0;overflow:hidden;overscroll-behavior:none
 }
 body.page-ask .footer-end-space{display:none}
 #ask-app{height:var(--ask-stage-height);overflow:clip;position:relative}
 #ask-app .ask-main{position:relative;width:100%;height:100%;min-height:0;margin:0;padding:12px 16px;overflow:clip}
 #ask-app .character-scene:not(.phone-researching):not(.phone-result-active){position:absolute;inset:48px 16px 0;height:auto;min-height:0;padding:0;display:flex;align-items:center;justify-content:center}
 #ask-app .character-scene:not(.phone-researching):not(.phone-result-active)>.bot-person{position:absolute;width:min(83vw,352px);max-width:100%;flex:none}
 #ask-app .character-scene:not(.phone-researching):not(.phone-result-active)>.ask-duo{position:absolute;width:100%}
 #ask-app #ask-form{position:fixed;z-index:200;left:16px;right:16px;top:var(--ask-composer-top,60%);width:auto;margin:0;padding:0}
 #ask-app #question{font-size:16px}
 #ask-app .character-scene.phone-researching,#ask-app .character-scene.phone-result-active{
   position:absolute;inset:44px 16px 12px;display:flex;align-items:center;justify-content:center;
   width:auto;height:auto;min-height:0;max-height:none;margin:0;padding:0;overflow:clip;gap:0
 }
 #ask-app:has(.phone-researching),#ask-app:has(.phone-result-active){height:var(--ask-visible-height)}
 #ask-app .character-scene.phone-researching>.decision-tree{
   display:flex;flex-direction:column;align-self:stretch;width:100%;min-height:0;height:100%;max-height:100%;padding:0;overflow:hidden;flex:1;background:none
 }
 #ask-app .decision-tree-heading{flex:none;min-height:0}
 #ask-app #tree-question{flex:none;font-size:clamp(20px,6vw,28px);margin:0 0 8px}
 #ask-app #tree-map{display:block;width:100%;height:100%;min-height:0;flex:1 1 0;overflow:hidden}
 #ask-app .network-caption{flex:none;font-size:10px;min-height:16px;margin:4px 0 0}
 #ask-app .character-scene.phone-result-active{padding-top:min(23vh,150px)}
 #ask-app .character-scene.phone-result-active>.phone-result{
   flex:none;align-self:center;width:min(100%,420px);max-height:100%;margin:0 auto;padding:18px 20px;gap:8px;translate:none;overflow:visible
 }
 #ask-app .phone-result-presenter{width:min(110%,360px);left:50%;translate:-50% 0;max-height:230px;object-fit:contain;bottom:calc(100% - 54px)}
 #ask-app .phone-result-verdict{font-size:clamp(56px,12vh,90px)}
 #ask-app .phone-result-question{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
 #ask-app .phone-result-data{padding:8px 12px;margin:0}
 #ask-app .phone-result-data strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
 #ask-app .phone-result-done{min-height:44px}
 #ask-app #result-error{position:absolute;bottom:16px;left:16px;right:16px}
}
@media(max-width:600px) and (max-height:600px){
 #ask-app .character-scene.phone-result-active{inset:40px 16px 8px;padding-top:45px}
 #ask-app .character-scene.phone-result-active>.phone-result{gap:4px;padding:10px 16px}
 #ask-app .phone-result-presenter{max-height:110px;bottom:calc(100% - 25px)}
 #ask-app .phone-result-verdict{font-size:48px}
 #ask-app .phone-result-kicker{font-size:9px}
}
@media(max-width:600px){
 #ask-app .character-scene.phone-researching>:is(.bot-person,.tree-companion,.ask-duo),
 #ask-app .character-scene.phone-result-active>:is(.bot-person,.tree-companion,.ask-duo,.decision-tree){display:none!important}
 #ask-app:has(.phone-researching) .ask-duo-toolbar,#ask-app:has(.phone-result-active) .ask-duo-toolbar{display:none}
 #ask-app .phone-result-page #ask-form,#ask-app.phone-result-page #ask-form{display:none!important}
}
/* Keep shared site textarea defaults from adding a second box inside the composer. */
#ask-app #ask-form #question{border:0;border-radius:0;background:transparent;box-shadow:none;resize:none}
#ask-app #ask-form #question:focus{outline:none;box-shadow:none}
@media(max-width:600px){
 /* Invitations are anchored to the page, independently of the artwork. */
 #ask-app>.round-usage[data-bubble-mode=dialogue],#ask-app>.ask-duo-bubble{
   position:absolute;top:var(--ask-bubble-top,25px);bottom:auto;left:16px;right:auto;translate:none;margin:0;
   width:180px;max-width:calc(100% - 120px);padding:11px 12px;font-size:12px;z-index:20
 }
 #ask-app>.round-usage[data-bubble-mode=dialogue]::after{
   content:'';position:absolute;right:20px;bottom:-7px;width:12px;height:12px;
   background:inherit;border-right:1px solid #cbd3bf;border-top:1px solid #cbd3bf;transform:rotate(135deg)
 }
 #ask-app:not(.ask-duo-enabled)>.ask-duo-bubble,
 #ask-app.ask-duo-enabled>.round-usage[data-bubble-mode=dialogue],
 #ask-app:has(.phone-researching)>.round-usage,#ask-app:has(.phone-result-active)>.round-usage,
 #ask-app:has(.phone-researching)>.ask-duo-bubble,#ask-app:has(.phone-result-active)>.ask-duo-bubble{display:none!important}
 #ask-app .character-scene:not(.phone-researching):not(.phone-result-active)>.bot-person,
 #ask-app .character-scene:not(.phone-researching):not(.phone-result-active)>.ask-duo{top:var(--ask-person-offset,0px);translate:none}
}

@media(max-width:600px){
 #ask-app .character-scene:not(.phone-researching):not(.phone-result-active){top:calc(var(--ask-invite-bottom,54px) + 10px);align-items:flex-start}
}

/* Site-wide vote portraits have a fixed height; the Ask artwork owns its height. */
#ask-app .bot-person{height:auto}
/* An electric-blue current follows the composer outline while editing. */
@property --ask-current-angle{syntax:'<angle>';initial-value:0deg;inherits:false}
#ask-app #ask-form .question-row{position:relative;isolation:isolate}
#ask-app #ask-form .question-row:focus-within{border-color:transparent;box-shadow:0 0 12px #149bff24}
#ask-app #ask-form .question-row:focus-within::before{
 content:'';position:absolute;inset:-1px;z-index:2;pointer-events:none;border-radius:inherit;padding:2px;
 background:conic-gradient(from var(--ask-current-angle),#168bff44 0deg,#168bff55 230deg,#2baaff 285deg,#bcefff 315deg,#168bff44 360deg);
 -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
 -webkit-mask-composite:xor;mask-composite:exclude;
 animation:ask-border-current 2s linear infinite
}
#ask-app #ask-form #question:focus-visible{outline:none!important;box-shadow:none!important}
@keyframes ask-border-current{to{--ask-current-angle:360deg}}
@media(prefers-reduced-motion:reduce){#ask-app #ask-form .question-row:focus-within::before{animation:none;background:#249fff}}
#ask-app .answer-details-toggle{display:block;width:fit-content;min-height:36px;margin:10px auto;padding:6px 14px;border:1px solid #cbd3bf;border-radius:18px;background:transparent;color:inherit;font:500 12px/1.4 system-ui;cursor:pointer}
#ask-app .answer-details-toggle[hidden]{display:none!important}
#ask-app .phone-result .answer-details-toggle{margin:0;min-height:32px;padding:4px 12px}
#ask-app.answer-details-available #round-usage[data-bubble-mode=usage]{display:none!important}
#ask-app .answer-details-panel{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 48px);padding:0;border:1px solid #d5d7cc;border-radius:20px;background:#faf8f3;color:#30382c;box-shadow:0 16px 60px #0003;overflow:hidden}
#ask-app .answer-details-panel::backdrop{background:#161d2966;backdrop-filter:blur(4px)}
#ask-app .answer-details-panel>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid #d5d7cc}
#ask-app .answer-details-panel h2{margin:0;font:600 18px/1.3 system-ui}
#ask-app .answer-details-close{min-height:40px;padding:6px 12px;border:1px solid #cbd3bf;border-radius:12px;background:transparent;color:inherit;font:500 13px system-ui}
#ask-app .answer-details-content{padding:16px 18px;max-height:calc(100dvh - 130px);overflow:auto;overscroll-behavior:contain;font:13px/1.6 system-ui}
#ask-app .answer-details-panel #result{margin:0;width:100%}
#ask-app .answer-details-panel #result:not([hidden]),#ask-app .answer-details-panel #similar-feedback:not([hidden]),#ask-app .answer-details-panel #search-attribution:not([hidden]){display:block!important}
#ask-app .answer-details-panel #attachment-reading-usage:not([hidden]){display:block!important}
#ask-app[data-theme=dark] .answer-details-panel{background:#2e3135;color:#f0e9dc;border-color:#484d54}
#ask-app[data-theme=dark] .answer-details-panel>header{border-color:#484d54}

@media(max-width:600px){
 #ask-app .character-scene.phone-researching{top:10px}
 #ask-app .phone-researching .decision-tree-heading{display:none}
 #ask-app .phone-researching #tree-question{margin-top:0;padding-top:0}
}

/* One blue question card with a shuffle control keeps the scene compact. */
#ask-app .character-scene{position:relative}
#ask-app .ask-question-bubbles{position:absolute;z-index:12;left:calc(50% + 155px);top:28px;width:204px;padding-bottom:35px;isolation:isolate}
#ask-app .ask-question-bubbles[hidden],#ask-app .ask-question-card[hidden]{display:none!important}
#ask-app .ask-question-bubbles::before,#ask-app .ask-question-bubbles::after{content:"";position:absolute;inset:0 0 35px;border:1px solid #4285d4;border-radius:16px;background:var(--bg,#faf8f3);z-index:-1;pointer-events:none}
#ask-app .ask-question-bubbles::before{transform:rotate(-5deg) translate(-4px,3px)}
#ask-app .ask-question-bubbles::after{transform:rotate(5deg) translate(4px,3px)}
#ask-app .ask-question-card{display:block;width:100%;min-height:90px;padding:17px;border:1.5px solid #4285d4;border-radius:16px;background:var(--bg,#faf8f3);color:var(--ink,#30382c);font:500 13px/1.45 system-ui;box-shadow:0 3px 12px #4285d418;cursor:pointer}
#ask-app .ask-question-shuffle{display:block;margin:9px auto 0;padding:3px 10px;border:0;background:transparent;color:#3477c7;font:500 12px/1.4 system-ui;cursor:pointer}
#ask-app .ask-question-bubbles button:focus-visible{outline:2px solid #4285d4;outline-offset:4px}
#ask-app .ask-question-card:hover{background:var(--card,#fff);border-color:#1666c7}
#ask-app.ask-duo-enabled .ask-question-bubbles{left:calc(50% - 102px);top:0}
@media(max-width:760px){
 #ask-app .ask-question-bubbles,#ask-app.ask-duo-enabled .ask-question-bubbles{left:auto;right:5px;top:0;width:150px}
 #ask-app .ask-question-card{min-height:75px;padding:12px;font-size:11px}
}

/* Match the post page's mounted paper folder cards. */
#ask-app .ask-question-bubbles{width:224px;box-sizing:border-box;padding:30px 14px 10px;background:var(--mount-lavender,#e1ddeb);border:1px solid #4285d4;border-radius:8px;box-shadow:none}
#ask-app .ask-question-bubbles::before{content:'TRY A QUESTION';inset:auto;left:14px;top:13px;bottom:auto;width:auto;height:auto;padding:4px 10px;background:var(--paper,var(--bg,#faf8f3));color:var(--ink,#30382c);border:1px solid #4285d4;border-bottom:0;border-radius:5px 5px 0 0;box-shadow:-3px -2px 0 -1px var(--mount-lavender,#e1ddeb),-5px -3px 0 -2px #4285d4;transform:none;z-index:1;font:500 9px/1 system-ui;letter-spacing:.06em}
#ask-app .ask-question-bubbles::after{display:none}
#ask-app .ask-question-card{min-height:116px;padding:25px 14px 20px;background:var(--paper,var(--bg,#faf8f3));border:1px solid #4285d4;border-radius:0 2px 2px 2px;box-shadow:2px 3px 0 #302e2914;text-align:left;font:500 18px/1.25 var(--font,system-ui);letter-spacing:-.02em}
#ask-app .ask-question-shuffle{margin:9px 0 0 auto;padding:6px 8px;min-height:32px;color:var(--ink,#30382c);border-radius:5px;font-size:11px}
#ask-app .ask-question-shuffle:hover{background:var(--paper,var(--bg,#faf8f3))}
#ask-app.ask-duo-enabled .ask-question-bubbles{left:calc(50% - 112px)}
@media(max-width:760px){
 #ask-app .ask-question-bubbles,#ask-app.ask-duo-enabled .ask-question-bubbles{left:auto;width:160px;padding:27px 10px 7px}
 #ask-app .ask-question-bubbles::before{left:10px;top:11px;padding:4px 7px;font-size:8px}
 #ask-app .ask-question-card{min-height:90px;padding:19px 10px 14px;font-size:14px}
 #ask-app .ask-question-shuffle{margin-top:5px;min-height:30px;font-size:10px}
}

/* On phones the character says the suggested question instead of showing a card. */
@media(max-width:600px){
 #ask-app .ask-question-bubbles{display:none!important}
 #ask-app #round-usage[data-bubble-mode=dialogue][role=button]{border-color:#4285d4;cursor:pointer;pointer-events:auto}
 #ask-app #round-usage[data-bubble-mode=dialogue][role=button]::after{border-color:#4285d4}
 #ask-app #round-usage[role=button]:focus-visible{outline:2px solid #4285d4;outline-offset:4px}
}
