/* Live class (12 Nov 2026): the room's look. Every rule is scoped to #liveRoom (the room), .live-save (the
   recording card) or body.in-live. Tokens only: night, --card, linen and its --text, --rule and --fill
   steps, lavender for what you can press, the alert reds as fills (#C73A42 behind white, #E5484D for the
   small dots), and in the chat the friend chat's --rv-* tokens and system font (its documented exception;
   design 11). Newsreader everywhere else. Every animation stops under reduced motion. */

/* While the room is open the page behind it doesn't scroll. The friend chat stepping aside and the toast
   above the control bar are index.html's rules (body.in-live), kept there only. */
body.in-live{overflow:hidden}
/* and the page itself (20 Nov 2026, by request: "screen fit not scrollable"): index.html keeps the page's scrollbar on
   screen always (html{overflow-y:scroll}), which body's rule can't take away, so it stayed beside the room, 15px wide,
   and the page behind still scrolled under the wheel. While a live class is open the page neither scrolls nor shows it. */
html.in-live{overflow:hidden; scrollbar-gutter:auto}

#liveRoom{position:fixed; inset:0; z-index:8500; display:none; flex-direction:column; box-sizing:border-box; overflow:hidden;
  background:var(--night); color:var(--linen); font-family:var(--serif); font-size:17px; line-height:1.45; color-scheme:dark}
#liveRoom *,#liveRoom *::before,#liveRoom *::after{box-sizing:border-box}
#liveRoom [hidden]{display:none !important}
#liveRoom h2,#liveRoom h3,#liveRoom h4{margin:0; font-weight:400; color:var(--linen)}
#liveRoom h2:focus,#liveRoom h3:focus{outline:none}
#liveRoom h2:focus-visible,#liveRoom h3:focus-visible{outline:2px solid var(--daybreak); outline-offset:3px}
#liveRoom svg{flex:none}
.live-ico{width:24px; height:24px}
.live-dot{display:inline-block; flex:none; width:8px; height:8px; border-radius:50%; background:#E5484D}   /* still, never pulsing (design 7) */

/* ---------- pre-join, waiting and notices ---------- */
.live-pre{flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:32px 16px 40px}
.live-pre-col{max-width:640px; margin:0 auto; display:flex; flex-direction:column; gap:16px}
.live-pre-title{font-size:28px; line-height:1.2; overflow-wrap:anywhere; text-align:center}
.live-pre-state,.live-pre-rec{display:flex; align-items:center; justify-content:center; gap:8px; margin:0; font-size:17px; color:var(--text-1); text-align:center}
.live-pre-body{display:flex; flex-direction:column; gap:16px}
.live-preview{position:relative; margin:0; width:100%; aspect-ratio:16/9; border-radius:var(--r-lg); overflow:hidden; background:var(--card); border:1px solid var(--rule-2)}
.live-preview video{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transform:scaleX(-1)}
.live-preview-face{position:absolute; inset:0; display:flex; align-items:center; justify-content:center}
.live-meter{height:4px; border-radius:var(--r-pill); background:var(--rule-2); overflow:hidden}
.live-meter b{display:block; height:100%; width:0; background:var(--text-2)}   /* --text-2, not lavender: it isn't pressed (design 6) */
.live-pre-ctl{display:flex; justify-content:center; gap:20px; flex-wrap:wrap}
.live-round{display:flex; flex-direction:column; align-items:center; gap:6px; min-width:72px; padding:0; border:0; background:none; color:var(--linen); font:inherit; font-size:15px; cursor:pointer}
.live-round-ic,.live-round > svg{display:flex; align-items:center; justify-content:center; width:56px; height:56px; border-radius:50%; background:var(--fill-2); border:1px solid var(--rule-3)}
.live-round > svg{padding:15px; width:56px; height:56px}
.live-round:hover .live-round-ic,.live-round:hover > svg{background:var(--rule-2)}
.live-round[aria-pressed="false"] .live-round-ic{background:#C73A42; border-color:#C73A42; color:#fff}
.live-round:focus-visible{outline:none}
.live-round:focus-visible .live-round-ic,.live-round:focus-visible > svg{outline:2px solid var(--daybreak); outline-offset:3px}
.live-round-w{color:var(--text-1)}
.live-devs{display:grid; grid-template-columns:1fr 1fr; gap:16px}
.live-fl{display:flex; flex-direction:column; gap:6px; min-width:0}
.live-fl > span{font-size:15px; color:var(--text-3)}
.live-fl .hub-field{padding:9px 12px; font-size:16px; min-height:44px; resize:none}
#liveRoom select.hub-field{color-scheme:dark; background-color:#14163A; text-overflow:ellipsis}
.live-pre-note,.live-hint{margin:0; font-size:15px; color:var(--text-2)}
/* Settings, Connection (21 Nov 2026): this device's delay to the relay and what is lost on the way, in words and figures */
.live-net{margin-top:4px; padding-top:12px; border-top:1px solid var(--rule-1)}
.live-net-h{font-size:17px}
.live-net-line{margin:6px 0 6px; font-size:17px; color:var(--linen)}
.live-net-recon{margin:0 0 6px; font-size:15px; color:var(--text-1)}
/* People: who a host allowed to share (26 Nov 2026), and a line under Who can share their screen */
.live-tag.is-can{border-color:var(--daybreak); color:var(--daybreak)}
.live-shareset .live-share-hint{margin-top:6px}
.live-pre-note{text-align:center}
.live-check{display:flex; align-items:center; gap:10px; min-height:44px; font-size:16px; color:var(--text-1); cursor:pointer}
.live-check input{flex:none; width:18px; height:18px; margin:0; accent-color:var(--daybreak)}
.live-pre-err{margin:0; font-size:16px; color:var(--text-1)}
.live-pre-err:empty{display:none}
.live-pre-wait{margin:0; font-size:19px; color:var(--text-1); text-align:center}
.live-pre-btns{display:flex; justify-content:center; gap:12px; flex-wrap:wrap; margin-top:8px}
.live-pre-btns .btn{min-width:160px}
.live-notice{padding-top:12vh; text-align:center}
.live-notice-msg{margin:0; font-size:19px; color:var(--text-1)}
@media(max-width:640px){ .live-devs{grid-template-columns:1fr} .live-pre-title{font-size:24px} .live-pre-btns .btn{flex:1 1 100%} }

/* ---------- the room ---------- */
.live-in{flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto minmax(0,1fr) auto;
  grid-template-areas:"top top" "banner banner" "stage side" "bar side"}
.live-top{grid-area:top; display:flex; align-items:center; flex-wrap:wrap; gap:6px 16px; padding:12px 16px; border-bottom:1px solid var(--rule-1)}
.live-title{font-size:20px; line-height:1.3; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.live-chip{display:inline-flex; align-items:center; gap:6px; font-size:15px; color:var(--text-1)}
.live-started,.live-count{font-size:15px; color:var(--text-2)}
.live-elapsed{font-size:15px; color:var(--text-3); font-variant-numeric:tabular-nums}
.live-sound{display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 14px; margin-left:auto; border:1px solid var(--daybreak); border-radius:var(--r-pill);
  background:none; color:var(--daybreak); font:inherit; font-size:15px; cursor:pointer}
.live-sound svg{width:20px; height:20px}
.live-sound:hover{background:var(--fill-2)}
.live-banner{grid-area:banner; display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin:0; padding:10px 16px; font-size:15px; color:var(--text-1); background:var(--fill-2); border-bottom:1px solid var(--rule-1)}
.live-banner-t{flex:1 1 auto; min-width:0; margin:0}
.live-banner .btn{min-height:44px}
.live-stage{grid-area:stage; position:relative; min-height:0; min-width:0; display:flex; flex-direction:column; gap:12px; padding:12px 16px}
.live-pager{display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; font-size:15px; color:var(--text-2)}
.live-pg{min-height:44px; padding:0 16px; border:1px solid var(--rule-3); border-radius:var(--r-pill); background:none; color:var(--linen); font:inherit; font-size:15px; cursor:pointer}
.live-pg:hover{background:var(--fill-2)}
.live-pg:disabled{opacity:.45; cursor:default}
.live-main{flex:1; min-height:0; display:flex}
.live-main > *{flex:1; min-width:0; min-height:0}
.live-grid{flex:1; min-height:0; display:grid; gap:12px; grid-template-columns:1fr; grid-auto-rows:minmax(0,1fr)}
.live-grid[data-n="2"]{grid-template-columns:1fr 1fr}
.live-grid[data-n="3"],.live-grid[data-n="4"]{grid-template-columns:1fr 1fr}
.live-grid[data-n="5"],.live-grid[data-n="6"],.live-grid[data-n="7"],.live-grid[data-n="8"],.live-grid[data-n="9"]{grid-template-columns:1fr 1fr 1fr}
/* with the screen, the board or a pinned tile in the main place: the people in a strip at the right */
#liveRoom.has-main .live-stage{display:grid; grid-template-columns:minmax(0,1fr) 240px; grid-template-rows:auto minmax(0,1fr); grid-template-areas:"pager pager" "main strip"}
#liveRoom.has-main .live-pager{grid-area:pager}
#liveRoom.has-main .live-main{grid-area:main}
#liveRoom.has-main .live-grid.is-strip{grid-area:strip; grid-template-columns:1fr; grid-auto-rows:minmax(0,150px); align-content:start; overflow:hidden}
/* The main place on a computer (20 Nov 2026, by request: "on computer it becomes small", then "screen fit ... no dead
   spaces"): the pages of people sit above the strip, not across the top, so a shared screen, a video, a PDF, the board or
   a pinned person has the stage's whole height; the strip's tiles share its whole height (live.js shows as many as fit),
   so no room is left empty under them; and a row with no pages in it takes no room. For a shared screen live.js
   measures the stage and sets the columns (the picture's width, the rest to the strip) or, in a tall narrow window,
   puts the people in a row under it (strip-under: the picture's height, the rest to the row). While a side panel is
   open in a window under 1600px wide the strip steps aside (no-strip), so the screen is as large as with it closed. */
@media (pointer:fine) and (min-width:641px){
  #liveRoom.has-main .live-stage{grid-template-areas:"main pager" "main strip"; row-gap:0}
  #liveRoom.has-main .live-pager{gap:6px 8px; margin-bottom:12px}
  #liveRoom.has-main .live-pageof{order:-1; flex:1 1 100%; text-align:center}
  #liveRoom.has-main .live-pg{padding:0 10px}
  #liveRoom.has-main .live-grid.is-strip{grid-auto-rows:minmax(0,1fr)}
  #liveRoom.strip-under .live-stage{grid-template-columns:minmax(0,1fr); grid-template-areas:"pager" "main" "strip"}
  #liveRoom.strip-under .live-main{margin-bottom:12px}
  #liveRoom.strip-under .live-pageof{order:0; flex:0 1 auto}
  #liveRoom.strip-under .live-grid.is-strip{grid-template-columns:none; grid-template-rows:minmax(0,1fr); grid-auto-flow:column; grid-auto-columns:minmax(0,1fr)}
}
/* the figure at exactly its picture's size, in the middle of what the stage gives it */
.live-screenfig.is-fit{flex:none; margin:auto}
#liveRoom.no-strip .live-stage{grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); grid-template-areas:"main"}
#liveRoom.no-strip .live-grid.is-strip,#liveRoom.no-strip .live-pager{display:none}

.live-tile{position:relative; margin:0; min-width:0; min-height:0; border-radius:var(--r-md); overflow:hidden; background:var(--card); border:1px solid var(--rule-1)}
.live-tile::after{content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none}
.live-tile.is-speaking::after{box-shadow:inset 0 0 0 3px var(--linen)}   /* linen, shown and hidden with no transition; lavender stays for focus (design 7) */
.live-tile-v{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:var(--card)}
.live-tile.is-mirror .live-tile-v{transform:scaleX(-1)}
.live-tile-face{position:absolute; inset:0; display:flex; align-items:center; justify-content:center}
.live-tile-face img,.live-preview-face img{width:min(30%,120px); aspect-ratio:1; height:auto; border-radius:50%; object-fit:cover}
.live-init{display:flex; align-items:center; justify-content:center; width:48px; height:48px; border-radius:50%; background:var(--fill-2); border:1px solid var(--rule-2); font-size:20px; color:var(--linen)}
.live-init.is-big{width:min(30%,96px); height:auto; aspect-ratio:1; font-size:32px}
/* in a tile the photo or initial follows the tile's height, so a short tile never cuts its circle (21 Nov 2026) */
.live-tile-face img{width:auto; height:min(62%,120px); max-width:60%}
.live-tile-face .live-init.is-big{width:auto; height:min(62%,96px); max-width:60%}
/* tiles at a camera's shape (live.js sets the columns and rows from the grid's measured box): together in the middle */
.live-grid.is-fit{justify-content:center; align-content:center; grid-auto-flow:row}
#liveRoom .live-grid.is-fit{grid-auto-flow:row}
/* a camera held upright in a wide tile (or the other way round) is shown whole, not cut to its middle */
.live-tile.is-contain .live-tile-v{object-fit:contain}
.live-tile-cap{position:absolute; left:8px; bottom:8px; max-width:calc(100% - 16px); display:flex; align-items:center; gap:6px; padding:3px 10px; border-radius:var(--r-sm);
  background:rgba(17,19,48,.78); font-size:15px; line-height:1.4; color:var(--linen)}
.live-tile-name{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.live-tile-tag,.live-tag{flex:none; padding:0 8px; border:1px solid var(--rule-3); border-radius:var(--r-pill); font-size:13px; line-height:1.5; color:var(--text-1)}
.live-tile-ics{display:inline-flex; align-items:center; gap:4px}
.live-tile-ic{width:18px; height:18px}
.live-tile-state{position:absolute; left:8px; top:8px; padding:3px 10px; border-radius:var(--r-sm); background:rgba(17,19,48,.78); font-size:15px; color:var(--linen)}
.live-tile-menu{position:absolute; right:6px; top:6px; width:44px; height:44px; display:flex; align-items:center; justify-content:center; border:0; border-radius:50%;
  background:rgba(17,19,48,.78); color:var(--linen); cursor:pointer; opacity:0}
.live-tile-menu svg{width:22px; height:22px}
.live-tile:hover .live-tile-menu,.live-tile-menu:focus-visible,.live-tile-menu[aria-expanded="true"]{opacity:1}
@media(hover:none){ .live-tile-menu{opacity:1} }
.live-tile.is-big{border-radius:var(--r-lg)}
.live-screenfig{position:relative; margin:0; border-radius:var(--r-lg); overflow:hidden; background:var(--card); border:1px solid var(--rule-1)}
.live-screenfig video{position:absolute; inset:0; width:100%; height:100%; object-fit:contain}
/* Stop sharing on the shared screen (19 Nov 2026): the sharer's, and a teacher's on anyone's, over the top right corner on the
   caption's dark glass so it reads over any picture; Full screen beside it for everyone who sees the screen (20 Nov 2026) */
.live-screen-tools{position:absolute; top:8px; right:8px; z-index:2; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; max-width:calc(100% - 16px)}
.live-screenfig .live-screen-stop,.live-screenfig .live-screen-full{min-height:44px; background:rgba(17,19,48,.78); border-color:var(--rule-3); color:var(--linen)}
.live-screenfig .live-screen-stop:hover,.live-screenfig .live-screen-full:hover{background:var(--night)}
.live-screenfig .live-screen-full{display:inline-flex; align-items:center; gap:8px}
.live-screenfig .live-screen-full svg{width:20px; height:20px; flex:none}
/* my own share's state beside its name (Starting, then The class can see it), and a line in the middle of someone
   else's screen while no picture has come yet */
.live-screen-state{margin-left:8px; padding:0 8px; border:1px solid var(--rule-3); border-radius:var(--r-pill); color:var(--linen)}
.live-screen-note{position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); z-index:1; margin:0; padding:8px 16px; max-width:calc(100% - 32px);
  border-radius:var(--r-pill); background:rgba(17,19,48,.78); color:var(--linen); font-size:15px; text-align:center}
/* in full screen the picture is on black, edge to edge; where the browser has no full screen for an element, the figure
   fills the room instead (the two full-screen selectors stay apart: one a browser doesn't know would void both) */
.live-screenfig:fullscreen{width:100% !important; height:100% !important; margin:0; border:0; border-radius:0; background:#000}
.live-screenfig:-webkit-full-screen{width:100% !important; height:100% !important; margin:0; border:0; border-radius:0; background:#000}
#liveRoom.screen-fill .live-screenfig{position:fixed; inset:0; z-index:60; width:auto !important; height:auto !important; margin:0; border:0; border-radius:0; background:#000}
/* A YouTube video a teacher shows (19 Nov 2026): the player fills the main place like a shared screen, on black so a
   video's own letterbox reads as part of it; a line in the middle says when it can't play */
.live-videofig{position:relative; margin:0; border-radius:var(--r-lg); overflow:hidden; background:#000; border:1px solid var(--rule-1)}
.live-video-box,.live-video-box iframe{position:absolute; inset:0; width:100%; height:100%; border:0}
.live-video-note{position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); max-width:min(440px, calc(100% - 32px)); margin:0; padding:12px 16px;
  border-radius:var(--r-md); background:rgba(17,19,48,.9); color:var(--linen); font-size:15px; text-align:center}
.live-videoform{display:flex; flex-direction:column; gap:10px}
.live-videoform .btn{align-self:flex-start; min-height:44px}
.live-video-err{margin:0; font-size:15px; color:var(--garnet)}
.live-video-err:empty{display:none}
/* A PDF a teacher presents (19 Nov 2026): the page as large as the main place holds, on the room's card color, then a
   row under it with the page number (and, for teachers, Previous page, Next page and Stop presenting, 44px targets) */
.live-pdffig{position:relative; margin:0; display:flex; flex-direction:column; min-height:0; border-radius:var(--r-lg); overflow:hidden; background:var(--card); border:1px solid var(--rule-1)}
.live-pdf-page{position:relative; flex:1; min-height:0; display:flex; align-items:center; justify-content:center; overflow:hidden; padding:8px}
.live-pdf-cv{display:block; max-width:100%; max-height:100%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.35)}
.live-pdf-bar{display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px 12px; padding:8px 12px; border-top:1px solid var(--rule-1); font-size:15px; color:var(--text-1)}
.live-pdf-bar .btn{min-height:44px}
.live-pdf-of{font-variant-numeric:tabular-nums; min-width:96px; text-align:center}
.live-presentset .live-psec{margin:0 0 8px}
.live-presentset .live-psec .btn{margin:2px 0 8px}

/* the whiteboard (plain since 13 Nov 2026, by request): the board is the canvas itself, 16:9 at the largest size its
   place holds, with a --rule-2 edge. Its background and grid are the teacher's choice for the room, set on .live-board
   from live.js's BOARD_BG (--bb, --grid) and drawn as the canvas's own CSS background, behind the strokes. The tools sit
   on the room's night above it. Nothing on the board selects as text or opens a callout or magnifier. */
.live-board{display:flex; flex-direction:column; gap:8px; min-height:0; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none}
.live-board-tools{display:flex; flex-direction:column; gap:4px; min-width:0}
.live-tool-row{position:relative; display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; min-width:0}   /* positioned, so words hidden for screen readers stay inside it when it scrolls */
.live-pens,.live-sizes{display:flex; align-items:center; gap:4px; flex-wrap:wrap}
.live-pen{position:relative; flex:none; width:44px; height:44px; border-radius:50%; border:0; background:none; cursor:pointer; display:flex; align-items:center; justify-content:center; touch-action:manipulation}
.live-pen::before{content:""; position:absolute; inset:9px; border-radius:50%; background:var(--pen)}
.live-pen[aria-checked="true"]::before{box-shadow:0 0 0 2px var(--night), 0 0 0 4px var(--linen)}   /* the ring and the check, not the color alone (design 6) */
.live-pen-ok{position:relative; width:18px; height:18px; color:var(--night); opacity:0}
.live-pen[aria-checked="true"] .live-pen-ok{opacity:1}
/* on White and Cream each deeper ink sits on a ring of the board's own color, so Ink still shows on the night tools */
.live-board.is-light .live-pen::before{inset:11px; box-shadow:0 0 0 3px var(--bb)}
.live-board.is-light .live-pen[aria-checked="true"]::before{box-shadow:0 0 0 3px var(--bb), 0 0 0 5px var(--night), 0 0 0 7px var(--linen)}
.live-board.is-light .live-pen-ok{width:16px; height:16px; color:var(--linen)}
/* the eraser: a pill beside the pens, in their radio group, with the same ring and check when chosen */
.live-eraser{position:relative; flex:none; display:inline-flex; align-items:center; gap:6px; min-height:44px; margin-left:8px; padding:0 10px 0 12px; border:1px solid var(--rule-3); border-radius:var(--r-pill);
  background:none; color:var(--linen); font:inherit; font-size:15px; cursor:pointer; touch-action:manipulation}
.live-eraser:hover,.live-size:hover{background:var(--fill-2)}
.live-eraser-ic{width:20px; height:20px}
.live-eraser-ok{width:16px; height:16px; opacity:0}
.live-eraser[aria-checked="true"]{border-color:var(--linen); background:var(--fill-2); box-shadow:0 0 0 2px var(--night), 0 0 0 4px var(--linen)}
.live-eraser[aria-checked="true"] .live-eraser-ok{opacity:1}
.live-size{position:relative; flex:none; display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 12px; border:1px solid var(--rule-3); border-radius:var(--r-pill); background:none; color:var(--linen); font:inherit; font-size:15px; cursor:pointer; touch-action:manipulation}
.live-size[aria-checked="true"]{border-color:var(--linen); background:var(--fill-2)}
.live-size-dot{display:inline-block; flex:none; width:var(--w); height:var(--w); border-radius:50%; background:var(--linen)}
.live-board.is-erasing .live-size-dot{background:none; border:1.5px solid var(--linen)}   /* the eraser's sizes are rings */
.live-tool-row .btn{flex:none; min-height:44px; touch-action:manipulation}
/* once a pen has drawn and rested: "Drawing with a pen: touch is ignored on the board." and Use touch too, under the
   board (never above it, so the board doesn't move down under the pen when it shows) */
.live-penline{display:flex; align-items:center; flex-wrap:wrap; gap:0 8px; margin:0; font-size:15px; color:var(--text-2)}
.live-linkbtn{min-height:44px; padding:0 4px; border:0; background:none; color:var(--daybreak); font:inherit; font-size:15px; text-decoration:underline; text-underline-offset:3px; cursor:pointer; touch-action:manipulation}
.live-board-wrap{flex:1; min-height:0; display:flex; align-items:flex-start; justify-content:center}   /* the board right under its tools */
.live-canvas{display:block; max-width:100%; max-height:100%; border-radius:var(--r-sm); background-color:var(--bb, var(--card)); box-shadow:0 0 0 1px var(--rule-2); -webkit-tap-highlight-color:transparent}
.live-board.is-grid .live-canvas{background-image:linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size:var(--cell, 32px) var(--cell, 32px)}
.live-canvas.can-draw{cursor:crosshair; touch-action:none}   /* no scroll or zoom from the board while you may draw on it */
.live-board-note{margin:0; font-size:15px; color:var(--text-2)}
/* the Whiteboard panel's Background: a swatch of each before its name, then Show grid */
.live-swatch{flex:none; width:22px; height:22px; border-radius:50%; background:var(--sw); box-shadow:0 0 0 1px var(--rule-4)}
.live-gridck{margin-top:4px}
/* Windows High Contrast (forced colors): the board, its pens' swatches and the Background swatches keep their real
   colors, since the lines are drawn in the pen family of the board's background (a forced black or white canvas
   could hide every line, and the pens would all look the same); the size dots and rings take the system's text color */
.live-canvas,.live-pen::before,.live-swatch{forced-color-adjust:none}
@media (forced-colors:active){
  .live-size-dot{forced-color-adjust:none; background:CanvasText}
  .live-board.is-erasing .live-size-dot{background:none; border-color:CanvasText}
}

/* ---------- the control bar ---------- */
.live-bar{grid-area:bar; display:flex; align-items:flex-start; justify-content:center; flex-wrap:wrap; gap:8px 6px; padding:10px 16px 12px; padding-bottom:max(12px, env(safe-area-inset-bottom)); border-top:1px solid var(--rule-1)}
.live-ctl{position:relative; display:flex; flex-direction:column; align-items:center; gap:4px; min-width:72px; padding:0; border:0; background:none; color:var(--linen); font:inherit; cursor:pointer}
.live-ctl-ic{display:flex; align-items:center; justify-content:center; width:56px; height:56px; border-radius:50%; background:var(--fill-2); border:1px solid var(--rule-3); color:var(--linen)}
.live-ctl:hover .live-ctl-ic{background:var(--rule-2)}
.live-ctl:focus-visible{outline:none}
.live-ctl:focus-visible .live-ctl-ic{outline:2px solid var(--daybreak); outline-offset:3px}
.live-ctl-w{font-size:15px; line-height:1.3; color:var(--text-1); white-space:nowrap}
.live-w-short{display:none}
.live-ctl[aria-pressed="true"]:not([data-act="mic"]):not([data-act="cam"]) .live-ctl-ic{background:var(--daybreak); border-color:var(--daybreak); color:var(--night)}
.live-ctl[data-act="mic"][aria-pressed="false"] .live-ctl-ic,.live-ctl[data-act="cam"][aria-pressed="false"] .live-ctl-ic{background:#C73A42; border-color:#C73A42; color:#fff}
.live-ctl[aria-expanded="true"] .live-ctl-ic{background:var(--rule-2); border-color:var(--daybreak)}
.live-ctl:disabled{cursor:default; opacity:.45}
.live-ctl-n{position:absolute; top:-2px; left:calc(50% + 12px); min-width:22px; height:22px; padding:0 6px; border-radius:var(--r-pill); background:#C73A42; color:#fff;
  font-size:13px; line-height:22px; text-align:center; font-variant-numeric:tabular-nums}
/* Leave: the alert red fill with white words */
.live-ctl.is-leave{flex-direction:row; gap:8px; height:56px; min-width:0; padding:0 20px; border-radius:var(--r-pill); background:#C73A42; color:#fff}
.live-ctl.is-leave .live-ctl-ic{width:24px; height:24px; background:none; border:0; color:#fff}
.live-ctl.is-leave .live-ctl-w{color:#fff; font-size:17px}
.live-ctl.is-leave:hover .live-ctl-ic{background:none}
.live-ctl.is-leave:focus-visible{outline:2px solid var(--daybreak); outline-offset:3px}
.live-ctl.is-leave:focus-visible .live-ctl-ic{outline:none}

/* ---------- the side panel ---------- */
.live-side{grid-area:side; width:360px; min-height:0; display:flex; flex-direction:column; background:var(--card); border-left:1px solid var(--rule-2)}
.live-side-hd{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 8px 10px 16px; border-bottom:1px solid var(--rule-1)}
.live-side-hd h3{font-size:20px}
.live-x{width:44px; height:44px; display:flex; align-items:center; justify-content:center; border:0; border-radius:50%; background:none; color:var(--text-1); cursor:pointer}
.live-x:hover{background:var(--fill-2)}
.live-side-bd{flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:12px 16px 16px}
.live-side.is-chat .live-side-bd{padding:0; overflow:hidden; display:flex; flex-direction:column}
.live-psec{margin:0 0 20px}
.live-psec-hd{display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin:8px 0 8px}
.live-psec-hd h4{font-size:17px; font-weight:500}
.live-psec-hd span{font-size:15px; color:var(--text-3); font-variant-numeric:tabular-nums}
.live-allin{margin:0 0 8px}
.live-plist{list-style:none; margin:0; padding:0}
.live-prow{display:flex; align-items:center; gap:10px; min-height:56px; padding:6px 0; border-top:1px solid var(--rule-1)}
.live-av{flex:none; width:36px; height:36px; border-radius:50%; overflow:hidden; display:flex; align-items:center; justify-content:center; background:var(--fill-2)}
.live-av img{width:100%; height:100%; object-fit:cover}
.live-av .live-init{width:36px; height:36px; font-size:15px; border:0}
.live-pwho{flex:1; min-width:0; display:flex; align-items:center; gap:8px}
.live-pname{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:16px}
.live-pics{display:inline-flex; align-items:center; gap:6px; color:var(--text-2)}
.live-pic{width:18px; height:18px}
.live-pacts{display:flex; gap:6px}
.live-pacts .btn{min-height:44px; padding:0 14px}
.live-pmore{flex:none; width:44px; height:44px; display:flex; align-items:center; justify-content:center; border:0; border-radius:50%; background:none; color:var(--text-1); cursor:pointer}
.live-pmore:hover{background:var(--fill-2)}
.live-settings,.live-boardset{display:flex; flex-direction:column; gap:14px}
.live-settings .btn,.live-boardset .btn{align-self:flex-start; min-height:44px}
.live-settings .btn svg{width:20px; height:20px}
.live-radios{margin:0; padding:0; border:0; display:flex; flex-direction:column}
.live-radios legend{padding:0; margin:0 0 4px; font-size:15px; color:var(--text-3)}
.live-radios:disabled{opacity:.45}

/* the room's chat: the friend chat's look (its --rv-* tokens, the system font and bubbles; design 11) */
.live-chat{--rv-bg:#1B1D45; --rv-line:#3A3A5C; --rv-mine:#3B3968; --rv-text:#F5EFE6; --rv-sub:#B8B4B9; --rv-dim:#A29FA9; --rv-off:#6E6D82;
  flex:1; min-height:0; display:flex; flex-direction:column; background:var(--rv-bg); color:var(--rv-text);
  font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; font-size:14px; line-height:20px}
.live-chatempty{margin:16px; font-size:14px; color:var(--rv-sub); text-align:center}
.live-chatlog{flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:8px 16px 12px; display:flex; flex-direction:column; gap:2px}
.live-chatlog:focus-visible{outline:2px solid var(--daybreak); outline-offset:-2px}
/* a live stream's chat (20 Nov 2026; live.js paintChat): every message from the left, a face, the name with its badge
   and the time on a person's first message of a run, the later ones under the same name; yours on a faint lavender */
.live-msg{position:relative; align-self:stretch; display:grid; grid-template-columns:28px minmax(0,1fr); column-gap:10px; padding:2px 8px; border-radius:10px}
.live-msg:hover{background:rgba(245,239,230,.04)}
.live-msg.is-me{background:rgba(185,169,242,.08)}
.live-msg.is-me + .live-msg.is-me:not(.is-first){margin-top:-2px; padding-top:4px; border-top-left-radius:0; border-top-right-radius:0}
.live-msg.is-me:has(+ .live-msg.is-me:not(.is-first)){border-bottom-left-radius:0; border-bottom-right-radius:0}
.live-msg.is-first{margin-top:10px; padding-top:6px}
.live-msg-av{grid-column:1; grid-row:1 / span 2; display:grid; place-items:center; width:28px; height:28px; overflow:hidden; border-radius:50%; background:rgba(245,239,230,.1); color:var(--rv-text); font-size:13px; font-weight:600; line-height:1}
.live-msg-av.is-teacher{background:var(--daybreak); color:var(--night)}
.live-msg-av img{display:block; width:100%; height:100%; object-fit:cover}
.live-msg:not(.is-first) .live-msg-av{visibility:hidden; height:0}
.live-msg:not(.is-first) .live-msg-hd{display:none}
.live-msg-hd{grid-column:2; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; margin:0 0 2px; font-size:12px; line-height:18px}
.live-msg-who{font-weight:600; color:var(--rv-text); overflow-wrap:anywhere}
.live-msg.is-teacher .live-msg-who{color:var(--daybreak)}
.live-msg-badge{display:inline-flex; align-items:center; padding:0 7px; border-radius:999px; background:var(--daybreak); color:var(--night); font-size:11px; font-weight:600; line-height:18px; letter-spacing:.01em}
.live-msg-badge[hidden]{display:none}
.live-msg-tm{color:var(--rv-dim); white-space:nowrap}
.live-msg.is-me .live-msg-tm{color:var(--rv-sub)}
.live-msg-tx{grid-column:2; margin:0; font-size:14px; line-height:20px; white-space:pre-wrap; overflow-wrap:anywhere}
.live-msg-tx a{color:var(--daybreak); text-decoration:underline; text-underline-offset:3px}
.live-chatform{flex:none; margin:0 16px 16px; margin-bottom:max(16px, env(safe-area-inset-bottom)); border:1px solid var(--rv-line); border-radius:12px; display:flex; flex-direction:column}
.live-chatform:focus-within{border-color:var(--daybreak); box-shadow:0 0 0 1px var(--daybreak); outline:2px solid transparent}
.live-chatbox.hub-field{width:100%; min-height:64px; max-height:140px; margin:0; padding:12px 14px 4px; border:0; border-radius:11px 11px 0 0; background:none; color:var(--rv-text);
  font:inherit; font-size:14px; line-height:20px; resize:none}
.live-chatbox.hub-field::placeholder{color:var(--rv-dim); opacity:1}
.live-chatbox.hub-field:focus{outline:0}
.live-chattools{display:flex; align-items:center; gap:8px; padding:4px 8px 8px 14px}
.live-chatgap{flex:1}
.live-chatn{font-size:12px; color:var(--rv-sub)}
.live-chatsend{flex:none; width:44px; height:44px; display:flex; align-items:center; justify-content:center; border:0; border-radius:8px; background:var(--daybreak); color:var(--night); cursor:pointer}
.live-chatsend:hover{background:#CEC2F7}
.live-chatsend[aria-disabled="true"]{background:var(--rv-line); color:var(--rv-off); cursor:default}
.live-chatsend:focus-visible{outline:2px solid var(--daybreak); outline-offset:2px}

/* ---------- menus and the question ---------- */
#liveRoom .live-menu{position:absolute; top:auto; right:auto; z-index:20; max-height:min(420px, calc(100% - 24px)); overflow-y:auto}
#liveRoom .live-menu .acct-item svg{width:20px; height:20px}
.live-ask{position:absolute; inset:0; z-index:30; display:flex; align-items:center; justify-content:center; padding:16px; background:rgba(8,9,24,.72)}
.live-ask-box{width:100%; max-width:440px; padding:24px; border-radius:var(--r-lg); background:var(--card); border:1px solid var(--rule-2); box-shadow:0 30px 60px -24px rgba(0,0,0,.9)}
.live-ask-box h3{font-size:24px; line-height:1.25; overflow-wrap:anywhere}
.live-ask-box p{margin:10px 0 0; font-size:17px; color:var(--text-2)}
.live-ask-btns{display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:22px}

/* ---------- the compact control bar: phones, and windows 900px wide or less or 520px tall or less ----------
   (a laptop at 200% zoom is 683 by 384). One row of five: Microphone, Camera, Raise hand, More, Leave; the
   rest is in More. The same query as compactBar() in live.js, so the bar's buttons and its look agree
   (design 6, WCAG 1.4.10 and 1.4.4). One row is under 100px, so the toast at bottom:120px clears it. */
@media (max-width:900px), (max-height:520px){
  .live-bar{flex-wrap:nowrap; gap:4px; padding:8px 12px; padding-bottom:max(8px, env(safe-area-inset-bottom))}
  .live-ctl{flex:1 1 0; min-width:0}
  .live-ctl-ic{width:48px; height:48px}
  .live-ctl-w{font-size:13px}
  .live-w-long{display:none}
  .live-w-short{display:inline}
  .live-ctl.is-leave{flex:0 0 auto; height:48px; padding:0 14px; align-self:flex-start}
  .live-ctl.is-leave .live-ctl-w{font-size:15px}
  .live-ctl-n{left:calc(50% + 8px)}
}
/* up to 1180px wide, or short: the side panel lies over the stage at the right instead of taking a column
   from the stage and the bar */
@media (max-width:1180px), (max-height:520px){
  #liveRoom .live-in{grid-template-columns:minmax(0,1fr); grid-template-areas:"top" "banner" "stage" "bar"}
  #liveRoom .live-side{position:absolute; top:0; right:0; bottom:0; width:min(360px,100%); z-index:10; box-shadow:0 30px 60px -24px rgba(0,0,0,.9)}
}
/* short windows: the whiteboard's size words and the eraser's go to screen readers only (each keeps its name), so the
   canvas keeps room to draw */
@media (max-height:520px){
  .live-size>span:not(.live-size-dot){position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
  .live-eraser>span{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
  .live-tool-row{gap:4px 8px}
  .live-board-wrap{min-height:140px}
}
/* touch screens and narrow windows: the board's tools are one row of 44px targets that scrolls sideways when it must
   (the padding keeps the rings and the focus outline in view); on a touch screen the note for keyboard users goes to
   screen readers only (the canvas still names it) */
@media (pointer:coarse), (max-width:640px){
  .live-tool-row{flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; touch-action:pan-x; padding:6px; margin:-6px; scrollbar-width:thin}
  .live-pens,.live-sizes{flex:none; flex-wrap:nowrap}
}
@media (pointer:coarse){
  .live-board-note{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
}
/* touch screens (phones and every tablet, an iPad Pro on its side too) and windows 640px and under: the sizes show as
   their dots and rings only (each keeps its name for screen readers), so the whole row, Clear the board too, fits
   an iPad on its side and Undo my last stroke is in view on an upright one without scrolling the row */
@media (pointer:coarse), (max-width:640px){
  .live-size{justify-content:center; min-width:44px; padding:0}
  .live-size-w{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
  .live-tool-row{column-gap:12px}
}

/* ---------- phones: 640px and under (design 6) ---------- */
@media(max-width:640px){
  .live-in{grid-template-columns:minmax(0,1fr); grid-template-areas:"top" "banner" "stage" "bar"}
  .live-top{padding:8px 12px; gap:4px 12px}
  .live-title{font-size:17px; flex:1 1 100%}
  .live-elapsed{display:none}
  .live-stage{padding:8px 12px; gap:8px}
  .live-grid{gap:8px}
  .live-grid[data-n="2"]{grid-template-columns:1fr}
  .live-grid[data-n="3"],.live-grid[data-n="4"]{grid-template-columns:1fr 1fr}
  #liveRoom.has-main .live-stage{grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) 120px; grid-template-areas:"pager" "main" "strip"}
  #liveRoom.has-main .live-grid.is-strip{grid-template-columns:1fr 1fr; grid-auto-rows:minmax(0,1fr)}
  #liveRoom .live-side{position:absolute; inset:0; z-index:10; width:auto; border-left:0; box-shadow:none}
  .live-tile-cap{font-size:15px; padding:2px 8px}
}

/* ---------- tablets with a pen or touch (13 Nov 2026) ----------
   A touch screen 600px wide and 500px tall or more (an iPad: 768 to 1024 wide upright, 1024 to 1366 on its side): the
   open whiteboard has the stage's main place at the largest 16:9 that fits (live.js sizes the canvas to its place),
   with the people in a narrow strip beside it on its side or a row under it upright, and their pages (Previous page,
   Next page) with them rather than across the top of the board. A side panel never lies over the
   board there: it takes a column beside the stage (on its side) or a band under it (upright), and the strip steps
   aside meanwhile. After the phone rules, so a 600 to 640px tablet gets these. */
@media (pointer:coarse) and (min-width:600px) and (min-height:500px){
  #liveRoom.has-board .live-stage{padding:8px 12px; gap:8px}
  #liveRoom.has-board.has-side .live-side{position:static; inset:auto; z-index:auto; box-shadow:none}
  #liveRoom.has-board.has-side .live-stage{grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); grid-template-areas:"pager" "main"}
  #liveRoom.has-board.has-side .live-grid.is-strip,#liveRoom.has-board.has-side .live-pager{display:none}
}
@media (pointer:coarse) and (min-width:600px) and (min-height:500px) and (orientation:landscape){
  #liveRoom.has-board .live-stage{grid-template-columns:minmax(0,1fr) 176px; grid-template-rows:auto minmax(0,1fr); grid-template-areas:"main pager" "main strip"}
  #liveRoom.has-board .live-grid.is-strip{grid-template-columns:1fr; grid-auto-rows:minmax(0,112px); gap:8px}
  #liveRoom.has-board.has-side .live-in{grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto minmax(0,1fr) auto; grid-template-areas:"top top" "banner banner" "stage side" "bar side"}
  #liveRoom.has-board.has-side .live-side{width:min(360px, 40vw); border-left:1px solid var(--rule-2)}
}
/* a YouTube video on an upright tablet (19 Nov 2026): the people in a row under it, as on a phone, so the video is as
   wide as the stage rather than squeezed beside a 240px strip; a shared screen the same (20 Nov 2026) */
@media (pointer:coarse) and (min-width:600px) and (orientation:portrait){
  #liveRoom.has-video .live-stage,#liveRoom.has-screen .live-stage{grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) 120px; grid-template-areas:"pager" "main" "strip"}
  #liveRoom.has-video .live-grid.is-strip,#liveRoom.has-screen .live-grid.is-strip{grid-template-columns:1fr 1fr; grid-auto-rows:minmax(0,1fr)}
}
@media (pointer:coarse) and (min-width:600px) and (min-height:500px) and (orientation:portrait){
  #liveRoom.has-board .live-stage{grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto 120px; grid-template-areas:"main" "pager" "strip"}
  #liveRoom.has-board .live-grid.is-strip{grid-template-columns:1fr 1fr; grid-auto-rows:minmax(0,1fr); gap:8px}
  #liveRoom.has-board.has-side .live-in{grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr) min(44vh, 460px) auto; grid-template-areas:"top" "banner" "stage" "side" "bar"}
  #liveRoom.has-board.has-side .live-side{width:auto; border-left:0; border-top:1px solid var(--rule-2)}
}
/* upright, on a tablet and on a phone 700px tall or more: the board is as wide as the stage, so its height follows from
   its width (at most the window's height less 500px, what the top line, the tools, the pages, 120px of people and
   the bar can take), and the room left goes to the people under it rather than to empty space around the board. The
   stage clips, so nothing can ever lie over the control bar. */
@media (pointer:coarse) and (min-width:600px) and (min-height:500px) and (orientation:portrait), (max-width:640px) and (min-height:700px) and (orientation:portrait){
  #liveRoom.has-board:not(.has-side) .live-stage{grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto minmax(120px,1fr); grid-template-areas:"main" "pager" "strip"; overflow:hidden}
  #liveRoom.has-board:not(.has-side) .live-board-wrap{flex:none; aspect-ratio:16/9; max-height:calc(100vh - 500px); max-height:calc(100dvh - 500px)}
}
/* a tablet 700px tall or more with no side panel open has the height for a second row of tools where the row doesn't
   fit (an iPad upright, or a 1024 or 1080 wide one on its side: the board's size follows from its width there), so
   the row wraps and every tool, Clear the board too, shows without scrolling sideways and without the board getting
   smaller; with a panel open, or on a shorter screen, the board is short of height, so the row keeps to one line and
   scrolls */
@media (pointer:coarse) and (min-width:600px) and (min-height:700px){
  #liveRoom.has-board:not(.has-side) .live-tool-row{flex-wrap:wrap; overflow:visible; touch-action:manipulation}
}

/* ---------- the recording card (outside the room) ---------- */
.live-save{position:fixed; left:24px; bottom:24px; z-index:8400; width:min(360px, calc(100vw - 32px)); padding:16px; border-radius:var(--r-lg);
  background:var(--card); border:1px solid var(--rule-2); box-shadow:0 30px 60px -24px rgba(0,0,0,.9); color:var(--linen); font-family:var(--serif)}
.live-save[hidden]{display:none}
.live-save-t{margin:0; font-size:17px; line-height:1.45; color:var(--text-1)}
.live-save-bar{height:4px; margin-top:12px; border-radius:var(--r-pill); background:var(--rule-2); overflow:hidden}
.live-save-bar b{display:block; height:100%; width:0; background:var(--daybreak)}
.live-save-btns{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px}
.live-save-btns .btn{min-height:44px}
@media(max-width:640px){ .live-save{left:16px; bottom:16px} }

/* ---------- reduced motion and transparency ---------- */
@media (prefers-reduced-motion:reduce){
  #liveRoom .live-menu{animation:none}
  #liveRoom *,.live-save *{transition:none !important; animation:none !important}
  .live-tile-menu{transition:none}
}
@media (prefers-reduced-transparency:reduce){
  .live-tile-cap,.live-tile-state,.live-tile-menu,.live-screenfig .live-screen-stop,.live-screenfig .live-screen-full,.live-screen-note,.live-video-note{background:var(--night)}
  .live-ask{background:var(--night)}
}
