/* ============================================================
   GATE EXTENSIONS for the Assist session pages.
   The design source is the skin library: skin.css in this
   folder is a byte-identical vendored copy of
   skin-library/skin.css and is not edited here. This file
   holds only what a live page needs that a static artboard
   does not. Every extension is listed in the build log entry
   for the skin rebuild. All values come from the library
   tokens or the instance theme the gate serves at /theme.css;
   no new colors, sizes, or spacing steps are introduced.
   ============================================================ */

/* Page height chain: the library root fills its frame; on a
   live page the frame is the viewport. */
html, body { height: 100%; }
body { font-family: var(--font-ui); background: var(--page); }
[hidden] { display: none !important; }

/* Visually hidden but present in the document: the chat
   input keeps its label element (the label the accessibility
   checks measure) without a visible label the artboards do
   not carry. */
.gate-sronly {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The brand mark slot as an image: the gate serves the active
   instance's own artwork at the top left of every page, the
   one-line lockup on light grounds and the standalone glyph on
   the dark session bar, each rendered at the brand's own header
   height (30 px, the height the website header sets) from a
   slot-sized file the instance configuration names. The
   styled-text mark in the library sheet remains the fallback
   for an instance with no artwork file for a ground. The img
   also carries its size inline, so the operator page, which
   loads no library stylesheet, renders the same slot. */
.tsa-brandlogo { height: 30px; width: auto; display: block; }
.tsa-brandglyph { height: 30px; width: 30px; display: block; }
.tsa-brandmark--img { line-height: 0; }

/* The framed session target: the library screen surface
   holds the live target page here (the mock window classes
   never ship, per the library sheet). */
.tsa-screen iframe {
  width: 100%; height: 100%; border: 0; display: block;
  background: var(--panel);
}

/* Blocked-frame fallback: when the target refuses to open
   inside the page, the screen offers the same target in a
   new window. Composed on the connect box layout; the
   library carries no blocked-frame state. The panel carries
   the stage ground itself: its words are set in the stage
   text tokens, and without the ground they landed on the
   framed page's white and could not be read (fix pass for
   DSP-20261123-08, finding 3). */
.gate-screenfallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--sp-4);
  text-align: center; padding: var(--sp-6);
  background: var(--stage);
  color: var(--stage-text);
}
.gate-screenfallback .big { font-size: var(--text-xl); font-weight: 700; }
.gate-screenfallback .small {
  font-size: var(--text-md); color: var(--stage-muted);
  line-height: 1.5; max-width: 320px;
}

/* The details sheet carries session facts in kv rows; the
   sheet itself is the library component. */
.tsa-sheet .tsa-kv { margin: var(--sp-2) 0; }

/* Session title: the artboard phone frames omit it (the
   brandmark and the presence sentence carry the bar), the
   wider frames include it. */
@media (max-width: 640px) {
  .tsa-session-title { display: none; }
}

/* Guide tile: the small Android frame in the library omits
   it; below the phone width it leaves the screen. */
@media (max-width: 480px) {
  .tsa-pip { display: none; }
}

/* Phone tightening: the library scopes these rules to its
   gallery device frames; a live page has no gallery frame,
   so the same declarations are applied by viewport width
   instead. Same tokens, same values as the library rules. */
@media (max-width: 480px) {
  .tsa-topbar { gap: var(--sp-1); padding-left: var(--sp-1); padding-right: var(--sp-1); }
  .tsa-brandmark { letter-spacing: -0.03em; }
  .tsa-statuspill { gap: var(--sp-1); padding-left: var(--sp-1); padding-right: var(--sp-1); font-size: var(--text-xs); }
  .tsa-presence { font-size: var(--text-xs); letter-spacing: -0.03em; }
  /* The live bar is a working surface: at phone widths it runs
     edge to edge so the presence sentence keeps its whole width
     beside the long connecting pill (premium audit finding
     P-03). The light pages keep the library inset; their bars
     carry two short elements and never compete for the width. */
  .tsa-session:not(.tsa-session--light) .tsa-topbar { padding-left: 0; padding-right: 0; }
  /* The compact connecting pill carries its state in the word
     alone at phone widths (library small-frame rule; premium
     audit finding P-03). */
  .tsa-statuspill--connecting .dot { display: none; }
  .tsa-controlbar { gap: var(--sp-1); padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .tsa-ctl { min-width: 60px; padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .tsa-ctl--end, .tsa-ctl--complete { padding-left: var(--sp-4); padding-right: var(--sp-4); }
}

/* Tablet chat rail: the library scopes the narrower rail
   to its tablet gallery frame; applied here by width. The
   sheet-versus-rail switch itself is made by the page
   script, which sets the library placement class for the
   current width. Breakpoint re-scoped from 861 to 768 px
   (fix for DSP-20261122-01, REBUILD-CHECK criterion 2):
   the library tablet frame is 768 px and renders the rail,
   so the rail and its tablet width now run from 768 px up
   to where the library base rail width takes over at
   1101 px. Below 768 px the chat is the bottom sheet. */
@media (min-width: 768px) and (max-width: 1100px) {
  .tsa-chat--rail { flex-basis: var(--chat-rail-tablet); width: var(--chat-rail-tablet); }
}

/* A control that has done its work (the completion mark)
   dims in place; the library artboards render only the
   active state. */
.tsa-ctl[disabled] { opacity: .5; cursor: default; }

/* The real composer field: the library draws the field as
   a pill-shaped div for the artboards; the shipped composer
   uses a real input with the same class, so it takes the
   text color and the UI font instead of the placeholder
   tone the drawn field carries. */
.tsa-composer input.field {
  color: var(--ink); font-family: var(--font-ui);
  outline: none; min-width: 0;
}
/* The placeholder is the only visible label on the session's one
   input: it sets in the muted tone, which measures 6.47 to 1 on
   the panel, not the faint tone's 3.11 (premium audit finding
   P-04). The typed text itself is unchanged. */
.tsa-composer input.field::placeholder { color: var(--muted); }
.tsa-composer input.field:focus { border-color: var(--brand); }

/* The consent checklist (Phase 2): the lobby's before-we-start
   rows are real checkboxes the participant checks, one per
   consent element, before the session can start. The row is the
   library check row; the box takes the tick circle's place at
   the same size, tinted from the brand token. The whole row is
   the label, so the row's own tap height is the target. */
.gate-consentrow { cursor: pointer; }
.gate-consentrow input[type="checkbox"] {
  flex: 0 0 auto; width: 30px; height: 30px; margin: 1px 0 0;
  accent-color: var(--brand); cursor: pointer;
}
/* A button waiting on the checklist dims in place, as the
   completed control does. */
.tsa-btn[disabled] { opacity: .5; cursor: default; }

/* The stage bars (fix pass for DSP-20261123-08): one plain
   instruction at a time, in the skin, between the mode banner
   and the screen. The connect bar is a single line in the
   brand wash with the brand edge; the sign-in bar is a panel
   with a title, the turn's words, and the participant's one
   button. Both take only library tokens: panel ground, ink
   text, hairline edge, the library's own spacing steps and
   text sizes, so the words meet the same contrast floors as
   every other surface in the library. */
.gate-stagebar {
  background: var(--brand-wash);
  color: var(--ink);
  border-bottom: 2px solid var(--brand);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-md);
  line-height: 1.45;
}
.gate-stagebar--signin {
  background: var(--panel);
  border-bottom: 1px solid var(--hairline);
  padding: var(--sp-4);
}
.gate-stagebar-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--sp-1);
}
.gate-stagebar--signin p {
  margin: 0 0 var(--sp-3);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink);
  max-width: 560px;
}

/* Chat-first composition (DSP-20261123-08 supplement, Phase B).
   The library scopes the chat home's wide-frame side rules to its
   artboard device frames; on the live page the same treatment is
   keyed to the viewport. The peek strip is phone furniture: on
   wider frames the visit's chat rail stands open and the strip
   never renders. The chat home carries no close control and no
   sheet grab (there is nothing behind it to close back to), and
   the visit's rail carries no close control either: the rail is
   the conversation standing open beside the screen. */
@media (min-width: 768px) {
  .tsa-chat--home {
    border-left: 1px solid var(--hairline);
    border-right: 1px solid var(--hairline);
  }
  .tsa-chatpeek { display: none; }
}
.tsa-chat--home .tsa-chat-grab,
.tsa-chat--home .tsa-chatclose,
.tsa-chat--rail .tsa-chatclose { display: none; }
.tsa-jobcard .gate-consent-title {
  font-size: var(--text-lg);
  font-weight: 700;
}
.tsa-jobcard .fineprint {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}
