/* H83 (owner INBOX #813): home slide 2's live BRIEFING DEMO (inc/avi-briefing-demo.php, assets/js/avi-briefing-demo.js).
   The real briefing in a flat phone frame beside H81's first-run card. Design guide: flat navy, mono eyebrow, DM Sans,
   no glow, no gradient, no gold outline (gold stays the card's one action). Every size is fixed before anything loads,
   so nothing on the page moves when the frames arrive. Order (the product-page pattern): eyebrow, the device, the role
   switcher with its progress line, the example line. */

.avi-bd { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; min-width: 0; color: #e8eef5; font-family: 'DM Sans', system-ui, sans-serif; }
.avi-fc-grid > .avi-bd { align-self: center; }

/* eyebrow */
.avi-bd__top { display: flex; justify-content: center; margin: 0 0 10px; }
.avi-bd__eye { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: 500 11px/1.3 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .2em; text-transform: uppercase; color: #94a7be; }
.avi-bd__live { width: 7px; height: 7px; border-radius: 50%; background: #3ccb8f; }
.avi-bd.is-play .avi-bd__live { animation: avi-bd-live 3.2s ease-in-out infinite; }
@keyframes avi-bd-live { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* the device: a solid quiet bezel, the screen, the frames scaled into it (the scale and height come from the script) */
.avi-bd__stage { display: flex; justify-content: center; width: 100%; }
.avi-bd__dev { box-sizing: border-box; position: relative; flex: 0 0 auto; height: min(720px, calc(100vh - var(--avs-header-h, 64px) - 178px)); height: min(720px, calc(100dvh - var(--avs-header-h, 64px) - 178px));
	min-height: 480px; aspect-ratio: 390 / 760; max-width: 100%; padding: 8px; border: 1px solid #22385a; border-radius: 46px; background: #101d33;
	box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .6); transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .9s ease; }
/* a flat frame (no 3D tilt: a 3D-turned frame of a page renders it soft and narrower in Chrome, measured 2026-11-19); a gentle rise the first time it comes into view */
.avi-bd.is-js:not(.is-seen) .avi-bd__dev { opacity: 0; transform: translateY(18px) scale(.985); }
.avi-bd__scr { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 38px; background: #0c1a30; isolation: isolate; contain: strict; }
/* the top safe band: a solid strip the page scrolls under (no sliver of the card above a pause; clear of the corners) */
.avi-bd__scr::before { content: ""; position: absolute; top: 0; left: 0; right: 0; z-index: 4; height: calc(18px * var(--bd-s, 1)); background: #0c1a30; pointer-events: none; }
.avi-bd__chrome { display: none; }
.avi-bd__scr::after { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55); pointer-events: none; } /* where the glass meets the bezel */
html body .avi-bd__if { position: absolute; top: 0; left: 0; z-index: 1; display: block; width: calc(var(--bd-w, 390) * 1px); max-width: none; min-width: calc(var(--bd-w, 390) * 1px); height: calc(var(--bd-h, 800) * 1px); max-height: none; margin: 0; padding: 0; border: 0; /* (the theme caps iframes at 100 % wide) */
	background: #0c1a30; transform: scale(var(--bd-s, 1)); transform-origin: 0 0; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s; }
html body .avi-bd__if.is-on { z-index: 2; opacity: 1; visibility: visible; transition: opacity .7s ease, visibility 0s; }

/* before the first frame (and without JavaScript): the briefing's outline, quiet */
.avi-bd__sk { position: absolute; inset: 0; z-index: 0; box-sizing: border-box; padding: 26px 16px 0; transition: opacity .5s ease; }
.avi-bd.is-live .avi-bd__sk { opacity: 0; }
.avi-bd__sk > span { display: block; border-radius: 12px; background: #13243f; }
.avi-bd__sk-h { height: 64px; margin-bottom: 14px; }
.avi-bd__sk-c { height: 132px; margin-bottom: 12px; }
.avi-bd__sk-c--s { height: 84px; }

/* Pilot / Student / AME under the device, one progress line under the group (how far the current briefing has played) */
.avi-bd__ctl { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 14px 0 0; }
.avi-bd__tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #1f3354; border-radius: 999px; background: #0c1a30; }
html body .avi-bd__tab { display: inline-flex; align-items: center; justify-content: center; min-width: 80px; min-height: 36px; margin: 0; padding: 0 16px;
	border: 0; border-radius: 999px; background: transparent; box-shadow: none; color: #94a7be; font: 600 13px/1 'DM Sans', system-ui, sans-serif; letter-spacing: 0; text-transform: none; cursor: pointer;
	transition: background-color .2s ease, color .2s ease; -webkit-tap-highlight-color: transparent; }
html body .avi-bd__tab:hover { background: #12203a; color: #e8eef5; }
html body .avi-bd__tab.is-on { background: #1a2b47; color: #fff; }
html body .avi-bd__tab:focus-visible { outline: 2px solid #7d93ad; outline-offset: 2px; }
.avi-bd__bar { display: block; width: 120px; height: 2px; border-radius: 1px; background: rgba(125, 147, 173, .38); overflow: hidden; }
.avi-bd__bar > span { display: block; width: 100%; height: 100%; background: #cfd9e5; transform: scaleX(0); transform-origin: 0 50%; }

/* the example line, on the device's axis */
.avi-bd__ex { max-width: 34ch; min-height: 1.4em; margin: 10px auto 0; font-size: 14px; font-weight: 600; line-height: 1.4; text-align: center; text-wrap: balance; color: #cfd9e5; }
.avi-bd__note { max-width: 36ch; margin: 4px auto 0; font-size: 12px; line-height: 1.5; text-align: center; text-wrap: balance; color: #7d93ad; }

/* desktop (Chris 2026-11-19): the briefing WIDE, as its desktop view (the page 1100 px wide, scaled down: --bd-w / --bd-s
   from the script), in a flat browser window the SAME SIZE as the first-run card: equal columns, the window's top and
   bottom on the card's. Everything of the player sits in the window: the top bar holds the three dots, the switcher and
   the live label (its bottom edge is the progress line); the example line is the window's footer. No 3D. */
@media (min-width: 1024px) {
	.avi-fc-grid:has(> .avi-bd) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
	.avi-fc-grid > .avi-bd { position: relative; align-self: stretch; display: flex; flex-direction: column; min-height: 0; }
	.avi-bd__stage { flex: 1 1 auto; min-height: 0; }
	.avi-bd__dev { display: flex; flex-direction: column; width: 100%; height: auto; min-height: 0; aspect-ratio: auto; padding: 0 0 34px; overflow: hidden; border-radius: 16px; border-color: #1f3354; box-shadow: none; }
	.avi-bd__chrome { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 46px; padding: 0 16px; background: #101d33; border-bottom: 1px solid #1b2e4c; }
	.avi-bd__chrome > i { display: block; width: 9px; height: 9px; border-radius: 50%; background: #2a4266; }
	.avi-bd__scr { flex: 1 1 auto; height: auto; border-radius: 0; }
	.avi-bd__scr::before, .avi-bd__scr::after { display: none; }
	.avi-bd__sk { padding: 18px 22px 0; }
	.avi-bd__top { position: absolute; top: 0; right: 16px; z-index: 6; height: 46px; margin: 0; align-items: center; }
	.avi-bd__eye { font-size: 10px; letter-spacing: .18em; }
	.avi-bd__ctl { position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 46px; margin: 0; justify-content: center; pointer-events: none; }
	.avi-bd__tabs { pointer-events: auto; padding: 2px; background: #0a1628; }
	html body .avi-bd__tab { min-width: 70px; min-height: 30px; padding: 0 14px; font-size: 12px; }
	.avi-bd__bar { position: absolute; left: 1px; right: 1px; top: 45px; width: auto; height: 2px; border-radius: 0; background: transparent; }
	.avi-bd__bar > span { background: #5f7894; }
	.avi-bd__ex { position: absolute; left: 1px; right: 1px; bottom: 1px; z-index: 6; box-sizing: border-box; max-width: none; height: 33px; margin: 0; padding: 0 16px; border-top: 1px solid #1b2e4c; border-radius: 0 0 15px 15px;
		background: #101d33; font-size: 12px; font-weight: 500; line-height: 32px; color: #94a7be; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.avi-bd__note { display: none; }
}

/* tablets: the frame under the card, centred */
@media (min-width: 768px) and (max-width: 1023.98px) {
	.avi-bd { padding: 28px 0 8px; }
	.avi-bd__dev { height: 640px; min-height: 0; }
}

/* phones (#813 item 5): no side panel; under the card, the device with a short peek of the briefing (no card around it) */
@media (max-width: 767.98px) {
	.avi-bd { padding: 22px 0 6px; }
	.avi-bd__top { margin-bottom: 12px; }
	.avi-bd__dev { width: 88%; height: 440px; min-height: 0; aspect-ratio: auto; padding: 7px; border-radius: 34px; }
	.avi-bd__scr { border-radius: 27px; }
	.avi-bd__sk { padding-top: 22px; }
	.avi-bd__ctl { margin-top: 16px; }
	html body .avi-bd__tab { min-width: 0; min-height: 40px; padding: 0 14px; font-size: 13px; }
	html body .avi-bd__tab.is-on { background: #16263f; }
	.avi-bd__ex { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
	.avi-bd__dev, html body .avi-bd__if, html body .avi-bd__if.is-on, .avi-bd__sk { transition: none; }
	.avi-bd__dev, .avi-bd.is-js:not(.is-seen) .avi-bd__dev { transform: none !important; opacity: 1 !important; }
	.avi-bd.is-play .avi-bd__live { animation: none; }
	.avi-bd__bar { visibility: hidden; }
}

/* a walkthrough tap's result, echoed at full size in the example line (the page's toast words) */
.avi-bd__ex { transition: color .25s ease; }
.avi-bd__ex.is-echo { color: #e8eef5; }
/* the left picker's row for the role now playing: a quiet tint, never ticked (the visitor's answer stays theirs) */
.avi-fc--home[data-bd-role="student"] .avi-pf-row input[value="student"]:not(:checked) + .avi-pf-row__in,
.avi-fc--home[data-bd-role="ame"] .avi-pf-row input[value="maintenance"]:not(:checked) + .avi-pf-row__in { background: rgba(125, 147, 173, .08); transition: background-color .4s ease; } /* (background only: "now showing", not "selected") */
