/* Room for Volau, 8 Nov 2026.
   Volau (the assistant bubble from the assistant API) places herself: her clear-spot finder keeps
   her off FijiLearn's buttons, and a child can drag her anywhere. FijiLearn never pins her in place.
   These rules only keep a clear spot free for her, in the bottom-right corner, and apply only while
   she is on the page (body:has(> #volau-host)); with her switched off, nothing changes. */

/* While one of FijiLearn's own panels, bars or overlays is open, she steps out of sight, and comes back
   where she was when it closes (volau-room-20261108.js then asks her finder to look again, as the text
   size or the page under her may have changed). None of these is a modal dialog, so they sit under her
   (she is above everything): she covered Reading help's Done, Biggest text and Easy-read spacing, the
   menu's Read aloud and Reading help, the command bar's results, Dimau Connect's Chat, Boards and Voice
   call, and the error bar's Dismiss and Reload, and a tap there opened her chat instead. The list:
   - Reading help (#fl-a11y), the header menu (dimau-header-standard sets data-dimau-menu-open on the
     header), Class talk (.ct-panel) and the sign-in panel (dimau-account's .dm-ov);
   - the command bar (dimau-next's .dn-ambient, opened from the menu's "Command bar" row on phones, or its
     own launcher on wider screens);
   - Dimau Connect's menu (Matua only: dimau-connect.js sets data-open on #dimau-connect-launcher while it
     is open; the closed round button sits above her corner, see below);
   - FijiLearn's own bars at the bottom of index.html: "Something went wrong on this screen" and "This
     browser is not saving progress" (#fl-safety-bar), until the child taps Reload or Dismiss;
   - the level-up, achievement and certificate overlays (.fl-celebration, index.html).
   Modal dialogs (Ask your tutor, voice settings, sharing) and the install prompts are drawn above her, so
   they need nothing here. Only whether she shows changes: not her place, so her finder, her drag and her
   saved spot work as before. Hidden three ways: visibility (no taps, no focus), opacity (her animated 2D
   picture, volau-2d.js, sets its own visibility:visible, and would still be drawn) and pointer-events (no
   taps on that picture either). */
body:has(#fl-a11y:not([hidden])) > #volau-host,
body:has([data-dimau-header][data-dimau-menu-open]) > #volau-host,
body:has(.ct-panel:not([hidden])) > #volau-host,
body:has(> .dm-ov) > #volau-host,
body:has(> .dn-ambient:not([hidden])) > #volau-host,
body:has(> #dimau-connect-launcher[data-open]) > #volau-host,
body:has(> #fl-safety-bar) > #volau-host,
body:has(> .fl-celebration) > #volau-host{visibility:hidden;opacity:0;pointer-events:none}

/* Dimau Connect (only on Matua now: main took it off the children's pages) moves up a little, so her
   corner spot (72px bubble, 100px from the bottom, bobbing 6px, name chip 10px out to the left) never
   touches its closed round button. Its menu opens upwards from that button, over her corner, so while
   the menu is open she is out of sight (above). */
body:has(> #volau-host) #dimau-connect-launcher{bottom:calc(108px + env(safe-area-inset-bottom))}

/* In a lesson step, the Check / Continue bar is 106px tall and keeps its right end free for her
   corner spot and for Class talk's button beside her, so neither of them ever floats over an answer,
   the read-aloud button or the Check button, however far the step scrolls. The lesson keeps the same
   space below its last line as before. Inside the fijilearn-mobile layer: that layer's !important
   bar padding beats any unlayered rule.
   Bigger text (FijiLearn's reading help, html[data-fl-size] 1 or 2) zooms #app, and the bar inside it,
   by 1.15 or 1.3 (index.html). She and Class talk's button are outside #app and keep their size, so the
   bar's room for them is divided by the same zoom: 174px free on the right and 24px above and below on
   screen at every text size, and the Check button keeps the rest (zoomed 174px squashed its label). */
body:has(> #volau-host){--volau-room-zoom:1}
html[data-fl-size="1"] body:has(> #volau-host){--volau-room-zoom:1.15}
html[data-fl-size="2"] body:has(> #volau-host){--volau-room-zoom:1.3}
/* Class talk (class-talk.js) keeps its launcher bottom-left on every screen. In a lesson step it would sit
   over the Check button (on main it hides 28-43% of it on a phone, and more once the bar keeps its right
   end free for her), so there it moves into the bar's free right end beside her, where Dimau Connect sat
   before main took Connect off the children's pages: a 56px button with a speech bubble. Its name
   for screen readers stays its own text, "Talanoa · Class talk" (the bubble is decoration). */
body[data-learning-screen=lesson]:has(> #volau-host):has(#app > .actions) .ct-fab{left:auto;right:110px;bottom:calc(25px + env(safe-area-inset-bottom));box-sizing:border-box;width:56px;min-width:56px;height:56px;min-height:56px;padding:0;font-size:0;line-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
body[data-learning-screen=lesson]:has(> #volau-host):has(#app > .actions) .ct-fab::before{content:"\1F4AC";content:"\1F4AC" / "";font-size:26px;line-height:1}
@layer fijilearn-mobile{
  body[data-learning-screen=lesson]:has(> #volau-host) .actions{padding:calc(24px / var(--volau-room-zoom,1)) max(calc(174px / var(--volau-room-zoom,1)),calc((100vw - 680px)/2)) calc(24px / var(--volau-room-zoom,1) + env(safe-area-inset-bottom)) max(24px,calc((100vw - 680px)/2))!important}
  html:not(.fijilearn-install-offer-open) body[data-learning-screen=lesson]:has(> #volau-host) #app{padding-bottom:calc(141px + env(safe-area-inset-bottom))!important}
}
