/* R16 · guests (3 November 2026; design-research/r16-guest/BRIEF.md; js/ux/guest.js). Loaded after the r13 sheets.
   1 Switch guest (the drawer's top row) and its panel · 2 guest mode (Add guest details, Continue as guest) · 3 the consent strip · 4 the "different person?" and presenter lines
   5 the Undo bar · 6 the inactivity prompt · 7 the switch between guests (the attract screen as a cover) · 8 TV and reduced motion.
   Type through --ty-* (css/r13/tokens.css), the white drawer's inks through --lg-fg*, the dark sheet's through the .lg-dark card, as the neighbours do. */
.gs-panel[hidden], .gs-diff[hidden], .gs-consent[hidden], .gs-nopres[hidden], .gs-add[hidden] { display: none !important; }

/* ---------- 1 · Switch guest ---------- */
#drawer .dr-who .gs-sw { flex: none; margin-left: auto; align-self: flex-start; min-height: 44px; }
#drawer .dr-who > div { min-width: 0; }
.gs-panel { margin: 0 1.5rem .5rem; border-radius: var(--mf-r-lg, 20px); background: var(--mf-wash, rgba(22, 22, 27, .06)); }
.gs-panel-in { display: grid; gap: .35rem; padding: 1rem 1.1rem 1.1rem; }
.gs-panel .k { margin: 0; }
.gs-sum { margin: 0 0 .5rem; font: var(--ty-head); letter-spacing: var(--tr-head); color: var(--lg-fg); overflow-wrap: anywhere; }
.gs-acts { display: grid; gap: .5rem; justify-items: stretch; }
.gs-acts .pill { justify-content: center; }
.gs-mis { display: grid; gap: 0; justify-items: center; text-align: center; margin-bottom: .6rem; }   /* the caption hugs Entered by mistake; a clear gap separates Cancel (R16 fix 19) */
.gs-mis small { margin-top: -.1rem; font: 500 calc(14px * var(--ui-scale, 1))/1.4 var(--sans); letter-spacing: 0; color: var(--lg-fg2); padding: 0 .5rem; }
.gs-cancel { background: transparent; box-shadow: none; color: var(--lg-fg2); }
:root body #drawer:not(.ux-setup) .gs-sw, :root body #drawer:not(.ux-setup) .gs-add { background: var(--mf-wash, rgba(22, 22, 27, .06)); box-shadow: none; color: #16161b; font-weight: 500; }
:root body #drawer:not(.ux-setup) .gs-sw:active, :root body #drawer:not(.ux-setup) .gs-add:active { background: var(--mf-wash-hi, rgba(22, 22, 27, .11)); }
:root body #drawer:not(.ux-setup) .gs-sw[aria-expanded="true"] { background: #fff; box-shadow: inset 0 0 0 1.5px #16161b; }

/* ---------- 2 · guest mode ---------- */
#drawer .dr-who .gs-add { margin-top: .5rem; min-height: 44px; }
.jr-guestb { margin: 0 0 0 -20px; font: var(--ty-callout); letter-spacing: var(--tr-callout); }   /* the sheet's left slot on step 1: where Skip stands on steps 2 and 3 */
.jr-guestb.jr-wait { opacity: .5; pointer-events: none; }

/* the form after R16 addendum A/B: two pages (no dots, no kicker on the first), a field that glows when it is what is missing, the line on the terms page, the Resume row's note */
.jr-sheet .jr-k:empty { display: none; }
.jr-agreewrap.off .jr-agree { pointer-events: none; }
.jr-bad { box-shadow: 0 0 0 2px #ffd7a1; border-radius: 18px; }   /* the number's field (or the switch) is outlined in the warning colour for a moment */
.jr-switch.jr-bad { border-radius: 16px; box-shadow: 0 0 0 2px #ffd7a1; }
.jr-foot { position: relative; }
.jr-help2 { position: absolute; left: 2px; right: 2px; top: 2px; margin: 0; min-height: 0; visibility: hidden; }   /* the line lives in the footer's top padding: it needs no space of its own, so the card neither jumps nor carries a dead band (R16 fix 24, round 2) */
.jr-sheet.jr-terms-on .jr-foot { padding-top: 34px; }
html.jr-short .jr-sheet.jr-terms-on .jr-foot { padding-top: 30px; }
.jr-help2.show { visibility: visible; }
.jr-closed { margin: 0 0 8px; font: var(--ty-body); letter-spacing: var(--tr-body); color: var(--lg-fg2); }

/* R16 fix round 1 */
.jr-nextb.jr-sec2 { background: transparent; background-image: none; color: var(--lg-fg); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .78); color: #fff; }   /* D3: with the returning card open, Resume visit is the one primary; Begin steps back (a clear outline and white words: available, not a disabled Next) */
.jr-pb.jr-sec { min-height: 48px; width: 100%; max-width: 320px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55); color: var(--lg-fg); }   /* D5: the x prompt's three levels: primary pill, an outlined second choice, Leave as quiet text */
.jr-pb.jr-quiet { min-height: 44px; margin-top: 4px; font-size: calc(14px * var(--ui-scale, 1)); color: var(--lg-fg3); }
.jr-pt, .jr-pl { text-wrap: balance; }   /* no orphaned last word */
.jr-pcard .jr-pl { font-size: calc(17px * var(--ui-scale, 1)); line-height: 1.4; }
.jr-pcard { max-height: calc(var(--jr-vh, 100dvh) - 32px); overflow: auto; }
.jr-prompt .jr-pcard.lg-dark { background-color: rgba(18, 18, 22, .94); }
.pr-match { align-items: center !important; }
#guest .g-txt b { max-width: 12ch; }
#guest.g-cut .g-txt b { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; }
/* (round 3) a narrow screen (900x700; portrait keeps the toast low, under the bars, which sit higher there): the Century page's toast sits above the stats bar and the Into Bengaluru pill instead of on them, even over two lines */
@media (max-width: 960px) and (orientation: landscape) { body[data-level="century"]:not(:has(#drawer.on:not(.ux-setup))) #toast { bottom: calc(var(--pad, 24px) + 8.2rem); } }
@media (max-width: 960px) and (orientation: portrait) { body[data-level="century"]:not(:has(#drawer.on:not(.ux-setup))) #toast { bottom: calc(var(--pad, 24px) + .6rem); } }   /* portrait: the bars sit higher, so the toast goes under them, clear of the orb on the right */
/* the toast clears the open presenter drawer (R16 fix 13): centred in what is left of the screen, above the drawer's dim, solid white */
body:has(#drawer.on:not(.ux-setup)) #toast { z-index: 140; left: calc((100vw - min(34rem, 94vw)) / 2); max-width: calc(100vw - min(34rem, 94vw) - 2rem) !important; background: #fff; }
@media (max-width: 699px) { body:has(#drawer.on:not(.ux-setup)) #toast { left: 50%; top: auto; bottom: 7.5rem; max-width: calc(100vw - 2rem) !important; } }   /* a phone-narrow screen: no room beside the drawer, so the toast sits low over the drawer, under its avatars and above Play (round 2). From 700px wide (portrait 768) the free strip left of the drawer is used, as on a landscape tablet (round 3): the toast wraps there and never covers the drawer's chips */
/* between guests the attract screen is a plain dark cover: its violet and orange picture never shows (R16 fix 17), reduced motion included */
body.gs-switching #attract .at-bg { opacity: 0 !important; }
body.gs-prep #attract { opacity: 0 !important; }   /* (round 3) reduced motion, Entered by mistake / Save & start next guest: no frame of the bare cover before the form is up (js/ux/guest.js startNext sets and clears gs-prep) */
body.gs-prep::before { content: ""; position: fixed; inset: 0; z-index: 24; pointer-events: none; background: linear-gradient(180deg, rgba(10, 8, 20, .62) 0%, rgba(10, 8, 20, .42) 36%, rgba(10, 8, 20, .58) 66%, rgba(10, 8, 20, .84) 100%); }   /* (round 4) the form's own dim is already there on the frame the guest is reset, so no frame shows the bare map (reduced motion, Save & start next guest and Entered by mistake) */

/* the x's prompt: a card in the sheet's own style over the form (R16 B1) */
.jr-prompt { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px; background: rgba(10, 10, 14, .42); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.jr-pcard { box-sizing: border-box; width: min(480px, 100%); display: grid; gap: 8px; justify-items: center; text-align: center; padding: 32px 30px 24px; border-radius: var(--rad-xl, 34px); color: var(--lg-fg); font-family: var(--sans);
  background-color: var(--lg-tint-thick); background-image: var(--lg-sheen); -webkit-backdrop-filter: blur(var(--lg-blur-card)) saturate(var(--lg-sat)); backdrop-filter: blur(var(--lg-blur-card)) saturate(var(--lg-sat)); box-shadow: var(--lg-hi), var(--lg-shade), var(--lg-shadow); }
.jr-pt { margin: 0; font: var(--ty-title); letter-spacing: var(--tr-title); color: var(--lg-fg); overflow-wrap: anywhere; }
.jr-pl { margin: 0; font: var(--ty-body); letter-spacing: var(--tr-body); color: var(--lg-fg2); overflow-wrap: anywhere; }
.jr-pl2 { color: var(--lg-fg3); }
.jr-pa { display: grid; gap: 4px; justify-items: center; width: 100%; margin-top: 14px; }
.jr-pa .jr-pill { width: 100%; max-width: 320px; }
.jr-pa .jr-ghost { min-height: 48px; }
.jr-prompt :is(button):focus-visible { outline: 2px solid var(--mf-focus-d, rgba(255, 255, 255, .85)); outline-offset: 3px; }
html.tv .jr-pcard { zoom: 1; width: min(720px, 94%); }   /* its words and buttons use the TV tokens (x1.7) like the rest: no extra zoom (round 2) */
html.tv .jr-cue-go { font: var(--ty-head); letter-spacing: var(--tr-head); }   /* the card's primary is never smaller than the footer's Begin, and Start fresh follows the TV callout */
html.tv .jr-cue-no { font: var(--ty-callout); letter-spacing: var(--tr-callout); }
/* the landing greeting (round 3, D10): one fixed design at every size, no searching for a spot. Centred on the screen, the time and weather line on the same axis, over a soft dark scrim that lies on the map, its pins and the
   Mirai badge (z-index 5: above the world and the clouds, below the Century headline, the altimeter, the chip, the orb and the bars, which keep their full brightness) and fades in and out with the greeting. A long first name
   is scaled down (js/ux/journey.js fitGreet sets the line's own size) to a fixed maximum width, so it never reaches the headline block or the screen edge. */
.jr-greet, body.cine .jr-greet { left: 50%; top: 50%; translate: -50% -50%; text-align: center; width: max-content; max-width: none; }
.jr-greet .jr-g1 { white-space: nowrap; }
.jr-greet .jr-g1 b { font-weight: 500; }
.jr-greet .jr-g2 { justify-content: center; }
.jr-scrim { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 75% 60% at 50% 50%, rgba(9, 7, 20, .66) 0%, rgba(9, 7, 20, .52) 55%, rgba(9, 7, 20, .4) 100%); }
body.jr-greeting .hero.hg { opacity: var(--jr-hero, 1) !important; transition: none !important; }   /* (round 4, D13) the Mirai badge is out while the greeting shows, in step with the scrim; the pins stay dimmed under it */
@media (max-height: 900px) { html.tv .jr-greet .jr-g1, html.tv .jr-greet .jr-g2 { zoom: 1; } }   /* ?tv=1 at 1280x800: the greeting at the TV tokens alone */   /* the type tokens already scale 1.7 on the TV: the zoom alone reads, as the sheet's own lines do (journey.css) */

/* ---------- 3 · the consent strip (the presenter drawer's Guest tab, under the number) ---------- */
.gs-consent { border-radius: var(--mf-r-lg, 20px); background: var(--mf-wash, rgba(22, 22, 27, .06)); }
.gs-c-in { display: grid; gap: .7rem; padding: 1rem 1.1rem .5rem; }
.gs-c-h { margin: 0; font: var(--ty-head); letter-spacing: var(--tr-head); color: var(--lg-fg); }
.gs-terms { max-height: 7.5rem; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: .8rem 1rem; border-radius: var(--mf-r-md, 14px); background: #fff; box-shadow: inset 0 0 0 1px rgba(22, 22, 27, .08); font: var(--ty-foot); letter-spacing: var(--tr-foot); color: var(--lg-fg2); }
.gs-terms p { margin: 0 0 .5rem; } .gs-terms p:last-child { margin-bottom: 0; }
.gs-terms b { font-weight: 600; color: var(--lg-fg); }
.gs-switch { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 52px; padding: 0 .2rem; border: 0; background: transparent; color: var(--lg-fg); cursor: pointer; text-align: left; font: var(--ty-callout); letter-spacing: var(--tr-callout); }
.gs-trk { position: relative; flex: none; width: 51px; height: 31px; border-radius: 99px; background: rgba(22, 22, 27, .16); transition: background-color var(--mc-t-fade, 200ms) var(--mc-ease-fade, ease); }
.gs-trk::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .28); transition: translate var(--mc-s1-t, 300ms) var(--mc-spring, ease); }
.gs-switch.on .gs-trk { background: #34a15f; }
.gs-switch.on .gs-trk::after { translate: 20px 0; }
.gs-c-ok { display: flex; align-items: center; gap: .6rem; margin: 0; min-height: 52px; font: var(--ty-head); letter-spacing: var(--tr-head); color: #1f7a45; }
.gs-c-ok[hidden] { display: none; }
.gs-c-ok svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gs-consent.gs-done :is(.gs-c-h, .gs-terms, .gs-switch) { display: none; }
.gs-switch:focus-visible, .gs-terms:focus-visible { outline: 2px solid var(--focus, #16161b); outline-offset: 2px; }

/* ---------- 4 · the "different person?" line, who is presenting ---------- */
.gs-diff { margin: 0; padding: .1rem 0; font: var(--ty-foot); letter-spacing: var(--tr-foot); color: var(--lg-fg2); }
.gs-nopres { margin: .5rem 0 0; font: var(--ty-foot); letter-spacing: var(--tr-foot); color: var(--lg-fg2); }

/* ---------- 5 · the Undo bar (over the form, 10 s) ---------- */
.gs-undo { position: fixed; z-index: 130;   /* over the form (the drawer is 80 while the sheet is up) */
  left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; display: flex; align-items: center; gap: 6px; max-width: calc(100vw - 32px); min-height: 56px; padding: 0 8px 0 24px; border-radius: 999px; overflow: hidden;
  background: #fff; color: #16161b; box-shadow: var(--mf-sh-float, 0 8px 24px -12px rgba(22, 22, 27, .3)); font: var(--ty-callout); letter-spacing: var(--tr-callout); }
.gs-undo.gs-plain { padding-right: 24px; }
.gs-undo-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-undo-b { flex: none; min-width: 64px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(22, 22, 27, .06); color: #16161b; cursor: pointer; font: var(--ty-head); letter-spacing: var(--tr-head); }
.gs-undo-b:active { background: rgba(22, 22, 27, .11); }
.gs-undo-b:focus-visible { outline: 2px solid #16161b; outline-offset: 2px; }
.gs-undo-bar { position: absolute; left: 24px; right: 24px; bottom: 0; height: 2px; border-radius: 2px; background: rgba(22, 22, 27, .22); transform-origin: left center; pointer-events: none; }

/* ---------- 6 · the inactivity prompt ---------- */
.gs-idle { position: fixed; inset: 0; z-index: 100010;   /* over everything, the media viewer (100000) too */
  display: grid; place-items: center; padding: 24px; background: rgba(10, 10, 14, .46); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1); }
.gs-idle-card { box-sizing: border-box; width: min(460px, 100%); display: grid; gap: 10px; justify-items: center; text-align: center; padding: 34px 32px 28px; border-radius: var(--rad-xl, 34px); color: var(--lg-fg); font-family: var(--sans);
  background-color: var(--lg-tint-thick); background-image: var(--lg-sheen); -webkit-backdrop-filter: blur(var(--lg-blur-card)) saturate(var(--lg-sat)); backdrop-filter: blur(var(--lg-blur-card)) saturate(var(--lg-sat)); box-shadow: var(--lg-hi), var(--lg-shade), var(--lg-shadow); }
.gs-idle-h { margin: 0; font: var(--ty-title); letter-spacing: var(--tr-title); color: var(--lg-fg); overflow-wrap: anywhere; }
.gs-idle-p.gs-idle-x { margin: -4px 0 14px; color: var(--lg-fg); }   /* (round 3, D12) the line about the number sits just under the countdown line */
.gs-idle-p { margin: 0 0 14px; font: var(--ty-body); letter-spacing: var(--tr-body); color: var(--lg-fg2); }
.gs-idle-n { font-weight: 600; color: var(--lg-fg); font-variant-numeric: lining-nums tabular-nums; }
.gs-idle-a { display: grid; gap: 4px; justify-items: center; width: 100%; }
.gs-idle-yes { width: 100%; max-width: 320px; }
.gs-idle-end { min-height: 48px; }
.gs-idle :is(button):focus-visible { outline: 2px solid var(--mf-focus-d, rgba(255, 255, 255, .85)); outline-offset: 3px; }

/* ---------- 7 · between guests with no attract tap: the attract screen is only the cover over the last guest's page (its copy and ring stay out of the way) ---------- */
body.gs-switching #attract .at-copy, body.gs-switching #attract .at-touch { opacity: 0 !important; }

/* ---------- 8 · TV and contrast ---------- */
html.tv .gs-undo { zoom: 1.45; bottom: 20px; --ui-scale: 1; }
html.tv .gs-idle-card { zoom: 1.5; --ui-scale: 1; }
@media (prefers-contrast: more) { .gs-panel, .gs-consent { box-shadow: inset 0 0 0 1.5px #16161b; } .gs-idle-card { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7); } .gs-diff, .gs-nopres, .gs-mis small { color: var(--lg-fg); } }

/* ---------- R16 fix round 1: the TV ---------- */
html.tv .jr-help, html.tv .jr-help2, html.tv .jr-closed { --ui-scale: 1.45; }   /* the line that carries the feedback scales with the rest of the TV form (fix 16) */
@media (max-height: 900px) {   /* ?tv=1 at 1280x800: the form scales a step lower so nothing is cut, and the bars clear the sheet (fixes 14, 15) */
  html.tv .jr-sheet .jr-top, html.tv .jr-sheet .jr-body, html.tv .jr-sheet .jr-foot, html.tv .jr-sheet .jr-x, html.tv .jr-sheet .jr-back { zoom: 1; }
  html.tv .gs-undo { zoom: 1; bottom: 16px; }
  html.tv .gs-idle-card { zoom: 1.1; }
  html.tv .jr-terms { max-height: 232px; }   /* (round 3) the terms box shows more than two lines at the short TV's size (the label's faded band is the rule below, for both TV sizes) */
  html.tv .jr-cue { --ui-scale: 1.45; }   /* (round 3) the returning card's own rows follow the TV scale: at this size the sheet is not zoomed, so they were 16px beside 29px buttons; 1.45 is what the 1920 sheet's zoom gives them */
  html.tv .jr-cue-av { width: 56px; height: 56px; }
  html.tv .jr-cue-l > div { grid-template-columns: 128px minmax(0, 1fr); }
}
html.tv .jr-terms-wrap[data-more] .jr-terms { -webkit-mask-image: linear-gradient(#000 calc(100% - 96px), transparent calc(100% - 50px)); mask-image: linear-gradient(#000 calc(100% - 96px), transparent calc(100% - 50px)); }   /* (round 3) the label gets its own faded band under the text at both TV sizes (the hint is 37 css px tall at the TV scale, 10px up) */
html.tv #toast { width: max-content; max-width: min(72rem, calc(100vw - 4rem)) !important; }
html.tv body[data-level="century"] #toast { bottom: calc(var(--pad) + 9rem) !important; }   /* the details-later line stays on one line, clear of Into Bengaluru (fix 22) */
html.tv #drawer .gs-panel .pill, html.tv #drawer .gs-sw, html.tv #drawer .gs-add { height: auto; min-height: 44px; padding-block: .6em; }   /* TV drawer buttons grow with their text (fix 26) */
html.tv.jr-short .jr-sheet :is(.jr-top, .jr-body, .jr-foot, .jr-x, .jr-back) { zoom: .85; }   /* ?tv=1 with the keyboard up: the compact form at a size that fits (fix 23) */
html.tv.jr-short .jr-pcard { zoom: .8; }
html:root body:not(#r13a):not(#z):not(#z) #drawer .dr-who h2.gs-long { font-size: calc(24px * var(--ui-scale, 1) * .8); overflow-wrap: break-word; }   /* a long name's heading (fix 26) */
