/* web-surface.css - THE WEB-ONLY PRESENTATION MARKER'S STYLE HALF.
   Loaded by BOTH member.html and widget.html. Every rule in this file, and in every web-*.css that
   follows it, MUST be scoped under :root[data-ui-surface="web-app"]. An unscoped rule here leaks into
   the packaged Android app, the packaged iOS app, the marketing shell, the floating launcher and the
   in-course embeds - all five of which load these same bytes and none of which ever carry the marker.

   THE ONE DELIBERATELY UNSCOPED RULE is the sentinel below, and it is unscoped on purpose. */

/* ---- THE SENTINEL -------------------------------------------------------------------------------
   web-surface.js refuses to set the marker unless this resolves to 1.

   WHY: a marker with no stylesheet is not "the old layout", it is a BROKEN layout. The classifier is
   inline-cheap JS that works offline the instant member.html is cached; this stylesheet is a separate
   network object that can be missing on a first cold open, missing after a rename, missing when a new
   sw.js SHELL list ships without a SHELL_CACHE bump, or missing behind a shield that blocks it. In
   every one of those states the JS would happily stamp data-ui-surface="web-app" onto a document with
   no rules to answer it - and the student gets a half-built rail on a page that no longer knows how to
   lay itself out. Gating on the CSS makes the failure fall back to the CURRENT, shipped, working UI.

   It works because a <script src> cannot execute while a preceding <link rel=stylesheet> is still
   pending, so by the time web-surface.js runs this value is either 1 or absent - never "not yet".
   That ordering is load-bearing: the <link> must come BEFORE the <script> in both documents. */
:root{ --web-surface-css:1 }

/* ---- SHARED PRESENTATION TOKENS ------------------------------------------------------------------
   Values are WEB-DESIGN-CONTRACT.md's table verbatim. Native and base tokens are untouched: nothing
   in this file redefines a token that exists outside the marker's scope.

   NOT DEFINED HERE, ON PURPOSE: --glass-bg, --glass-blur and the other seven --glass-* properties.
   member.html's syncGlassChrome() (member.html:2114) writes those onto the widget's documentElement as
   INLINE styles, and an inline custom property beats any stylesheet. Redefining them here would lose
   silently and look like a cascade bug. Override the RULES that consume them, never the values.

   NOT REDEFINED HERE, ALSO ON PURPOSE: --lh-body. It carries several spacing roles in the widget as
   well as text leading (contract line 29). New reading/paragraph/turn roles get their own tokens. */
:root[data-ui-surface="web-app"]{
  --web-font:'Lato',-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;

  --web-sidebar-expanded:var(--sb-width-web);
  --web-sidebar-rail:var(--sb-rail-web);
  --web-drawer:280px;
  --web-drawer-cap:calc(100vw - 32px);
  --web-content-max:760px;

  --web-fs-nav:var(--fs-nav-control);   --web-lh-nav:var(--lh-nav-control);
  --web-fs-chat:var(--fs-answer);       --web-lh-chat:var(--lh-answer);
  --web-fs-input:var(--fs-body-input);  --web-lh-input:var(--lh-body-input);

  --web-space-1:4px;  --web-space-2:8px;  --web-space-3:12px;
  --web-space-4:16px; --web-space-5:24px; --web-space-6:32px;
}

/* The shared web surface uses the same self-hosted Lato faces and fallback tail as both base documents. */
:root[data-ui-surface="web-app"] body{ font-family:var(--web-font) }

/* ---- THE TEARDOWN BACKSTOP ----------------------------------------------------------------------
   Plan 001's marker-loss teardown requirement, expressed as a rule that CANNOT be undone by the
   marker going away. Every other rule in this file dies the instant data-ui-surface is removed, which
   is exactly the moment the web-only rail must be guaranteed invisible - so the rule that hides it
   must not be scoped to the marker. #webRail is a new ID owned entirely by the web layer, so an
   unconditional rule on it can never reach native, embedded or marketing presentation: in those
   surfaces the element is never constructed at all.

   web-surface.js sets hidden BEFORE it removes the attribute (see the ordering note in that file). */
#webRail[hidden]{ display:none !important }
#webScrim[hidden]{ display:none !important }
