/* Shared first-use, demo and recovery surfaces. All colours follow the product,
   and corners, gaps and type sizes come from the scales in tokens.css. */
.t-app { display: flex; flex-direction: column; }
.t-app > :is(.t-head,.t-foot,.teacher-demo-bar,.teacher-notice,#t-status-note) { flex: none; }
.t-app > .t-split { flex: 1; min-height: 0; }
/* Trust centre: a reading page. The sections stay in view on the left, the
   text keeps one comfortable measure on the right, and headings, paragraphs
   and lists each get room of their own. */
.trust-content { max-width: 72rem; margin: auto; padding: 0 var(--sp-24) 5rem; }
.trust-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: clamp(var(--sp-48), 5vw, 4rem); align-items: start; }
.trust-body { min-width: 0; max-width: 44rem; }
.trust-body h1 { margin: var(--sp-24) 0 var(--sp-16); font: 650 clamp(2.2rem,5vw,3rem)/1.1 var(--font-head); letter-spacing: -.022em; }
.trust-body h1:focus:not(:focus-visible) { outline: none; }
.trust-body > .ln-lede { max-width: 40rem; margin: 0; color: var(--fg-muted); }
.trust-body section { margin-top: var(--sp-48); padding-top: var(--sp-48); border-top: 1px solid var(--border); scroll-margin-top: calc(var(--public-nav-height, 85px) + var(--trust-context-height, 64px) + 1.25rem); }
.trust-body h2 { margin: 0 0 var(--sp-16); font: 600 1.35rem/1.3 var(--font-head); letter-spacing: -.01em; color: var(--fg); }
.trust-body p, .trust-body li { color: var(--fg-muted); font-size: var(--fs-16); line-height: 1.75; }
.trust-body p { margin: 0 0 var(--sp-16); }
.trust-body p:has(+ ul) { margin-bottom: var(--sp-8); }
.trust-body ul { margin: 0 0 var(--sp-16); padding-left: var(--sp-24); }
.trust-body li + li { margin-top: var(--sp-8); }
.trust-body li::marker { color: var(--border-strong); }
.trust-body section > :last-child { margin-bottom: 0; }
.trust-body strong { color: var(--fg); font-weight: 600; }
.trust-body a { color: var(--c-accent-ink); }

/* The rail. Plain words, the one being read turning bold and dark as it
   becomes current (Inter is variable, so the weight itself eases), and a line
   down the side that marks the same place. */
.trust-toc { position: sticky; top: calc(var(--public-nav-height, 85px) + var(--trust-context-height, 64px) + 1.25rem); max-height: calc(100dvh - var(--public-nav-height, 85px) - var(--trust-context-height, 64px) - 2.5rem); overflow-y: auto; padding: var(--sp-32) 0 var(--sp-16); scrollbar-width: thin; }
.trust-toc-toggle { display: none; }
/* A short uppercase label with tracking: the one kind of text allowed --fs-12. */
.trust-toc-title { margin: 0 0 var(--sp-16); color: var(--fg-muted); font-size: var(--fs-12); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.trust-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--border); }
.trust-toc li { margin: 0; }
.trust-toc a { display: block; margin-left: -1px; padding: var(--sp-8) 0 var(--sp-8) var(--sp-16); border-left: 2px solid transparent; color: var(--fg-muted); font-size: var(--fs-14); font-weight: 400; line-height: 1.4; text-decoration: none; transition: font-weight .25s ease, color .25s ease, border-color .25s ease; }
.trust-toc a:hover { color: var(--fg); }
.trust-toc a:focus-visible { outline: 2px solid var(--c-accent-ink); outline-offset: 2px; border-radius: var(--r-xs); }
.trust-toc a[aria-current] { color: var(--fg); font-weight: 650; border-left-color: var(--c-accent-ink); }
.trust-jump { display: flex; gap: var(--sp-8); margin-top: var(--sp-24); padding-top: var(--sp-16); border-top: 1px solid var(--border); }
/* One quiet button for the page: Back, Top and Bottom. 44px, like every button. */
.trust-button { display: inline-flex; align-items: center; gap: var(--sp-4); min-height: 44px; padding: var(--sp-4) 0.75rem; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--card); color: var(--fg-muted); font-family: inherit; font-size: var(--fs-13); font-weight: 500; line-height: 1; text-decoration: none; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.trust-button:hover { color: var(--fg); border-color: var(--border-strong); }
.trust-button:focus-visible { outline: 2px solid var(--c-accent-ink); outline-offset: 2px; }
.trust-button svg { flex: none; width: 16px; height: 16px; }
@media (prefers-reduced-motion: no-preference) { html:has(body.trust-page) { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .trust-toc a, .trust-button, .trust-toc-toggle svg, .ln-nav::after, .trust-context::after, .trust-toc::after { transition: none; } }

/* The header shade (landing.css) hangs under the lowest sticky bar: here the
   back bar, and on a phone the contents row. It spans the window, not the
   text column, so the page clips sideways overflow. */
body.trust-page { overflow-x: clip; }
.trust-context::after { content: ""; position: absolute; top: 100%; left: 50%; width: 100vw; height: 12px; transform: translateX(-50%); background: linear-gradient(var(--header-shade), transparent); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
html.is-scrolled .trust-context::after { opacity: 1; }
/* The bar's own rule spans only the text column; once the shade spans the
   window beneath it, the rule would stop short on top of it, so it fades out
   as the shade fades in. */
@media (prefers-reduced-motion: no-preference) { .trust-context { transition: border-color .25s ease; } }
html.is-scrolled .trust-context { border-bottom-color: transparent; }

/* Narrower than the rail and the text side by side: the rail folds into one
   sticky row under the back bar that names the section being read, and opens
   into the same list. */
@media (max-width: 999px) {
  .trust-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .trust-toc { top: calc(var(--public-nav-height, 73px) + var(--trust-context-height, 60px)); z-index: 9; max-height: none; overflow: visible; margin-top: calc(-1 * var(--sp-16)); padding: 0; background: var(--bg); border-bottom: 1px solid var(--border); }
  .trust-toc-toggle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; align-content: center; column-gap: var(--sp-8); width: 100%; min-height: 48px; padding: var(--sp-8) 0; border: 0; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
  .trust-toc-label { color: var(--fg-muted); font-size: var(--fs-12); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
  .trust-toc-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-14); font-weight: 600; }
  .trust-toc-toggle svg { align-self: center; width: 18px; height: 18px; }
  .trust-toc-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .trust-toc-toggle:focus-visible { outline: 2px solid var(--c-accent-ink); outline-offset: -2px; }
  .trust-toc-panel { position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100dvh - var(--public-nav-height, 73px) - var(--trust-context-height, 60px) - 4rem); overflow-y: auto; padding: var(--sp-8) 0 var(--sp-16); background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px -16px var(--scrim); }
  .trust-toc:not(.is-open) .trust-toc-panel { display: none; }
  /* The list drops into place as it fades in and lifts away as it fades out,
     the same motion as the header menu; the chevron turns with it. */
  @media (prefers-reduced-motion: no-preference) {
    .trust-toc-panel { transition: opacity .18s ease, transform .24s var(--ease-out), display .24s allow-discrete; }
    .trust-toc:not(.is-open) .trust-toc-panel { opacity: 0; transform: translateY(-6px); }
    @starting-style { .trust-toc.is-open .trust-toc-panel { opacity: 0; transform: translateY(-6px); } }
    .trust-toc-toggle svg { transition: transform .24s var(--ease-out); }
  }
  .trust-toc-title { display: none; }
  .trust-body h1 { margin-top: var(--sp-32); }
  .trust-body section { scroll-margin-top: calc(var(--public-nav-height, 73px) + var(--trust-context-height, 60px) + 48px + 1rem); }
  .trust-toc::after { content: ""; position: absolute; top: 100%; left: 50%; width: 100vw; height: 12px; transform: translateX(-50%); background: linear-gradient(var(--header-shade), transparent); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  html.is-scrolled .trust-context::after { opacity: 0; }
  html.is-scrolled .trust-context { border-bottom-color: var(--border); }
  @media (prefers-reduced-motion: no-preference) { .trust-toc { transition: border-color .25s ease; } }
  html.is-scrolled .trust-toc:not(.is-open) { border-bottom-color: transparent; }
  html.is-scrolled .trust-toc:not(.is-open)::after { opacity: 1; }
}
/* The bar's margin and the contents row's pull-up under it (max-width: 999px)
   are the same step, so the row still tucks under the bar. */
.trust-context { position: sticky; top: var(--public-nav-height, 85px); z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-16); padding: var(--sp-8) 0; margin-bottom: var(--sp-16); background: var(--bg); border-bottom: 1px solid var(--border); }
.trust-context .ln-intro { margin: 0 !important; text-align: right; font-size: var(--fs-13); }
@media(max-width:660px) {
  .trust-content { padding-inline: 0; }
  .trust-context { top: var(--public-nav-height, 73px); gap: var(--sp-8); }
  .trust-context .ln-intro { max-width: 10rem; font-size: var(--fs-13); }
}
.submission-recovery { margin: var(--sp-16) 0; padding: var(--sp-16); border: 1px solid var(--border); border-radius: var(--r-sm); }
.submission-recovery p { margin: 0 0 var(--sp-8); }
.mic-check { margin: var(--sp-24) 0; text-align: left; padding: var(--sp-16); border: 1px solid var(--border); border-radius: var(--r-sm); }
.mic-check p { font-size: var(--fs-14); color: var(--fg-muted); }
.mic-check audio { display: block; width: 100%; margin-top: var(--sp-8); }
.cls-copy-label { display: block; font: 600 var(--fs-13)/1.5 var(--font-body); letter-spacing: 0; color: var(--fg-muted); }
.submission-recovery audio { width: 100%; margin-bottom: var(--sp-8); }
/* A toast, not a banner. Out of the flow, so "Copied MS5249" never shifts the
   page under the cursor. Bottom-centre keeps it clear of the header and of the
   table a teacher is working in. */
.teacher-notice { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 70; margin: 0; padding: var(--sp-8) var(--sp-16); max-width: min(28rem, calc(100vw - 2rem)); background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-card); cursor: pointer; }
.teacher-notice.is-error { border-color: color-mix(in oklch, var(--c-berry) 40%, var(--border-strong)); }
.teacher-demo-bar { display: flex; align-items: center; gap: var(--sp-16); flex-wrap: wrap; padding: var(--sp-8) var(--sp-24); border-bottom: 1px solid var(--border); background: var(--card); font-size: var(--fs-13); }
.teacher-demo-bar span { color: var(--fg-muted); flex: 1; }
.teacher-demo-bar a { text-decoration: none; }
body[data-teacher-demo] .t-foot, body[data-teacher-demo] #t-status-note { display: none; }
.demo-review-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-16); margin-bottom: var(--sp-24); }
.demo-review-header > p { flex-basis: 100%; margin: 0; }
.demo-review-header h2 { flex: 1; margin: 0; }
.demo-students { display: flex; gap: var(--sp-8); flex-wrap: wrap; margin-bottom: var(--sp-24); }
.demo-students [aria-pressed="true"] { background: var(--accent-soft); border-color: var(--c-accent-ink); color: var(--c-accent-ink); }
.demo-review-content { max-width: 52rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--sp-24); }
.demo-question { font: 650 1.35rem/1.35 var(--font-head); margin: var(--sp-8) 0 var(--sp-16); }
.demo-criteria { margin-bottom: var(--sp-24); font-size: var(--fs-14); }
.demo-criteria summary { cursor: pointer; min-height: 32px; color: var(--c-accent-ink); }
.demo-criteria ul { padding-left: var(--sp-24); color: var(--fg-muted); line-height: 1.7; }
.demo-answer-list { margin: 0; padding: 0; list-style: none; }
.demo-answer-list > .cls-attempt-item { border: 0; padding: 0; }
.demo-student-receipt { max-width: 52rem; margin-top: var(--sp-24); border-left: 2px solid var(--c-teal); padding: var(--sp-4) var(--sp-16); }
.demo-student-receipt h3 { font: 600 var(--fs-14) var(--font-body); margin: 0 0 var(--sp-8); }
.demo-student-receipt p { font-size: var(--fs-14); color: var(--fg-muted); margin: var(--sp-8) 0; }
/* The homepage preview grows to its content; it has no independent scroller.
   A document gutter and app background otherwise leave a strip around it. */
html:has(body[data-demo-embed]) { scrollbar-gutter: auto; overflow: clip; background: var(--card); }
body[data-demo-embed] { overflow: clip; height: auto; display: block; background: var(--card); }
body[data-demo-embed] .topbar { display: none; }
body[data-demo-embed] #t-class-scroll { padding: 0; }
body[data-demo-embed] .t-app { height: auto; }
body[data-demo-embed] :is(.teacher-demo-bar,.t-head,.t-side,.demo-review-header,.demo-students,.demo-student-receipt,.teacher-notice) { display: none; }
body[data-demo-embed] #t-classes-split { display: block; }
body[data-demo-embed] :is(.t-scroll,.t-main) { overflow: visible; height: auto; padding: 0; scrollbar-gutter: auto; }
body[data-demo-embed] .demo-review-content { border: 0; border-radius: 0; padding: var(--sp-24); }
body[data-demo-embed] .rv-when, body[data-demo-embed] .demo-criteria { display: none; }
body[data-demo-embed] .rv-form { grid-template-columns: 1fr; }
body[data-demo-embed] .rv-fb { display: none; }
body[data-demo-embed] .rv-acts { display: none; }
body[data-demo-embed] .rv-label { font-size: var(--fs-13); }
body[data-demo-embed] .rv-said { font-size: var(--fs-16); }
@media(max-width:640px) {
  .teacher-demo-bar { padding: var(--sp-8) var(--sp-16); gap: var(--sp-8); }
  .teacher-demo-bar span { flex-basis: 65%; font-size: var(--fs-13); }
  .demo-review-content { padding: var(--sp-16); }
  .demo-review-header h2 { font-size: 1.3rem; }
  .demo-students button, .demo-review-header button { min-height: 44px; }
}
.teacher-load { padding: var(--sp-48) var(--sp-24); text-align: center; color: var(--fg-muted); }
.teacher-load p { margin: 0 0 var(--sp-16); }
#view-teacher[data-library-pending="true"] .t-split { display: none; }

/* Last, so it outranks the Trust centre's shade fades declared above it. */
@media (prefers-reduced-motion: reduce) { .trust-context::after, .trust-toc::after { transition: none; } }
