/* ==========================================================================
   PlacementFlow — Student page frame v1
   --------------------------------------------------------------------------
   ONE top-level structure for every student page, so the page title, the
   content gutters and the toolbar sit in the same place on every view.

   WHY THIS SHEET EXISTS
   The student area currently declares its outer frame in six competing places:

     styles/today-redesign.css:27    .app-inner        24px 30px 56px !important / 1280px
     styles/today-redesign.css:501   Today active      8px 28px 38px  !important / 1320px
     styles/timetable.css:2338       .app-content      24px 32px 48px !important / no .app-inner at all
     style.css:37464                 .app-inner        max-width 1160px
     style.css:39683                 Sign-offs         1.35rem clamp(1.2rem,2vw,2rem) 2.4rem / no max
     style.css:17011                 .app-content      2.1rem 2.75rem 3rem

   Measured at 1440px before this sheet: the first visible heading sat at
   x=268 (Timetable), x=333 (Sign-offs), x=376 (Today's hero H2) and did not
   exist at all on Notices — a 108px horizontal and 345px vertical jump when
   moving between pages, and two of four views with no <h1>.

   HOW IT WORKS
   Opt-in per page with `pf-frame-v1` on <body>, next to the existing
   `student-shell-unified`. It MUST be in the static class attribute in the HTML,
   not added by script: every rule here and every superseded rule elsewhere keys
   off it, so a class applied after parse makes the page paint once with the old
   frame and then jump. The frame is declared ONCE, from tokens, on
   `.app-inner.pf-page`. The `!important` on the reset block is deliberate and
   is the whole point: it retires the six declarations above rather than adding
   a seventh. On integration those superseded rules should be DELETED and the
   !important here dropped with them — see the handoff note.

   Everything below is additive and scoped to `body.pf-frame-v1`. It touches no
   brand token, no typography token, no sidebar, no topbar and no feature
   content: those all stay exactly as approved.
   ========================================================================== */

body.pf-frame-v1{
  /* Outer frame. 32/24/16 desktop/tablet/mobile gutters, matching top offset. */
  --pf-page-max: 1280px;
  --pf-page-gutter: 32px;
  --pf-page-top: 32px;
  --pf-page-bottom: 56px;

  /* Vertical rhythm inside the frame. One scale, four steps. */
  --pf-page-title-gap: 6px;    /* title  → subtitle */
  --pf-page-head-gap: 20px;    /* header → context/toolbar/content */
  --pf-page-band-gap: 16px;    /* context → toolbar → content */

  /* Shared control sizing for everything that lands in a toolbar. */
  --pf-ctl-h: 36px;
  --pf-ctl-r: 9px;
  --pf-ctl-gap: 10px;
}

@media (max-width: 1023.98px){
  body.pf-frame-v1{ --pf-page-gutter:24px; --pf-page-top:24px; --pf-page-bottom:48px; }
}
@media (max-width: 767.98px){
  body.pf-frame-v1{
    --pf-page-gutter:16px; --pf-page-top:16px;
    /* clears the fixed mobile nav */
    --pf-page-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    --pf-page-head-gap:16px; --pf-page-band-gap:12px;
  }
}
/* The access runtime's degraded-access notice (shared/access-runtime.js) is
   top-anchored, where on a phone it sits over the Instrument Pill's search,
   messages and account. On student pages it takes the consolidated offline
   banner's slot instead (above the tab bar on phones), and steps aside while
   that banner already says "offline". Presentation only; the runtime's
   timing, wording and role="status" are unchanged. */
body.pf-frame-v1 .pf-access-notice{
  top:auto !important;
  bottom:calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
}
body.pf-frame-v1:has(.pp-offline-banner.is-visible.is-offline) .pf-access-notice{ display:none !important; }
@media (max-width: 768px){
  body.pf-frame-v1 .pf-access-notice{ bottom:calc(env(safe-area-inset-bottom, 0px) + 86px) !important; }
}
/* The fixed tab bar appears at max-width:768px (style.css), one pixel wider
   than the phone gutter step above. Clear it at exactly 768px too, so the last
   line of a page is never under the bar; gutters are unchanged. */
@media (min-width: 767.99px) and (max-width: 768px){
  body.pf-frame-v1{ --pf-page-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- A. PAGE FRAME ------------------------------------------------
   The sidebar offset stays on .app-content (it is the shell's job); every
   horizontal inset moves to the one frame element so there is a single
   number to reason about. */
/* Only where a frame element actually exists. Two views adopt the page HEADER
   without the centred column (Messages' two-pane workspace, see the exceptions
   at the end of this sheet), and they must keep their own content padding. */
body.pf-frame-v1:has(.pf-page) .app-content{
  padding-left:0 !important;
  padding-right:0 !important;
  padding-top:0 !important;
  padding-bottom:0 !important;
}

/* `.student-shell-unified` is on every student page's static <body class>, so
   pairing it with the frame marker states the real condition — "a student page
   that has adopted the frame" — and gives this declaration the weight it needs
   to supersede the per-route frames it replaces (several of which are
   .app-inner rules at the same class count). It is a real condition, not a
   specificity trick: the rule is meaningless without it. */
body.pf-frame-v1.student-shell-unified .pf-page{
  width:100% !important;
  max-width:var(--pf-page-max) !important;
  margin:0 auto !important;
  padding:var(--pf-page-top) var(--pf-page-gutter) var(--pf-page-bottom) !important;
  min-width:0;
}

/* A page whose main content genuinely needs the full width (the calendar) can
   opt its BODY wider without moving the heading: the frame keeps its gutters
   and only the marked region widens. */
body.pf-frame-v1 .pf-page-wide{
  --pf-page-max: 1600px;
}

/* ---------- B. PAGE HEADER ----------------------------------------------- */
body.pf-frame-v1 .pf-pagehead{
  display:flex !important;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin:0 0 var(--pf-page-head-gap) !important;
  /* no fixed height: a wrapped long title must grow the header, not clip */
  min-height:0;
}
body.pf-frame-v1 .pf-pagehead-main{ min-width:0; flex:1 1 320px; }

body.pf-frame-v1 .pf-pagehead-title,
body.pf-frame-v1 .pf-pagehead .page-title-row h1,
body.pf-frame-v1 .pf-pagehead > h1{
  margin:0 !important;
  font-family:var(--pf-font, var(--font-application-ui));
  font-size:30px !important;
  line-height:1.16 !important;
  font-weight:600 !important;
  letter-spacing:-0.028em;
  color:var(--pf-brand-ink, #16233f) !important;
  overflow-wrap:anywhere;
  text-wrap:pretty;
}

body.pf-frame-v1 .pf-pagehead-sub,
body.pf-frame-v1 .pf-pagehead .page-placement,
body.pf-frame-v1 .pf-pagehead .forms-subtitle{
  margin:var(--pf-page-title-gap) 0 0 !important;
  font-size:14.5px !important;
  line-height:1.45;
  font-weight:500 !important;
  color:var(--pf-ink-2, #5d6b84) !important;
  overflow-wrap:anywhere;
  max-width:74ch;
}
/* An empty subtitle must not reserve space — no filler, no phantom gap. */
body.pf-frame-v1 .pf-pagehead-sub:empty{ display:none !important; }

/* Genuine page-level actions + optional metadata. Empty = invisible. */
body.pf-frame-v1 .pf-pagehead-actions{
  display:flex;
  align-items:center;
  gap:var(--pf-ctl-gap);
  flex-wrap:wrap;
  flex:0 0 auto;
  padding-top:4px;
}
body.pf-frame-v1 .pf-pagehead-actions:empty{ display:none; }

@media (max-width: 767.98px){
  body.pf-frame-v1 .pf-pagehead-sub,
  body.pf-frame-v1 .pf-pagehead .page-placement,
  body.pf-frame-v1 .pf-pagehead .forms-subtitle{ font-size:13.5px !important; }
}

/* ---------- C. CONTEXT / STATUS BAND -------------------------------------
   Placement context, availability notices and warnings. Below the header,
   never instead of it. */
body.pf-frame-v1 .pf-pagecontext{
  margin:0 0 var(--pf-page-band-gap) !important;
}
body.pf-frame-v1 .pf-pagecontext:empty{ display:none !important; }
body.pf-frame-v1 .pf-pagecontext > .pf-platform-banners{ margin-bottom:0 !important; }

/* Announcements normally establish this band before the shell is staged.
   A genuinely late result remains fully readable and dismissible without
   moving the page or reserving empty space when there is no announcement. */
body.pf-frame-v1 [data-platform-banner-stable] > .pf-platform-banners--late{
  position:fixed;
  right:max(16px, env(safe-area-inset-right));
  bottom:calc(16px + env(safe-area-inset-bottom));
  width:min(460px, calc(100vw - 32px));
  max-height:min(50vh, 420px);
  overflow-y:auto;
  z-index:120;
  box-shadow:0 8px 28px rgba(22,35,63,.16);
  border-radius:12px;
}
body.pf-frame-v1 [data-platform-banner-stable]:has(> .pf-platform-banners--late):not(:has(> :not(.pf-platform-banners--late))){
  margin:0 !important;
}
@media (max-width:760px){
  body.pf-frame-v1 [data-platform-banner-stable] > .pf-platform-banners--late{
    bottom:calc(88px + env(safe-area-inset-bottom));
  }
}

body.pf-frame-v1 .pf-context-line{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:9px 13px;
  border:1px solid var(--pf-line, #e9edf4);
  border-radius:var(--pf-r-sm, 10px);
  background:var(--pf-bg, #f6f8fc);
  font-size:13px;
  font-weight:500;
  color:var(--pf-ink-2, #5d6b84);
  min-width:0;
}
body.pf-frame-v1 .pf-context-line b{
  font-weight:600;
  color:var(--pf-ink, #1b2740);
  overflow-wrap:anywhere;
}
body.pf-frame-v1 .pf-context-line .pf-context-dot{
  width:7px;height:7px;border-radius:50%;flex:none;
  background:var(--pf-brand, #1f6fd6);
}
body.pf-frame-v1 .pf-context-line--warn{
  border-color:#f3ddb4; background:var(--pf-amber-tint, #fdf1df); color:#7a5511;
}
body.pf-frame-v1 .pf-context-line--warn .pf-context-dot{ background:var(--pf-amber, #e08a1e); }

/* ---------- D. TOOLBAR ---------------------------------------------------
   Search, filters, view switches and date controls. One region, one spacing
   rule, one control height. Pages that do not need one must NOT declare one:
   an empty toolbar collapses to nothing so a stray wrapper cannot leave a gap. */
body.pf-frame-v1 .pf-toolbar{
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:var(--pf-ctl-gap);
  flex-wrap:wrap;
  margin:0 0 var(--pf-page-band-gap) !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  min-width:0;
}
body.pf-frame-v1 .pf-toolbar:empty{ display:none !important; }

/* Some routes' control rows are pinned by their own source contracts
   (foundation .fd-tabs, electives .el-seg), so they take the toolbar's spacing
   by selector rather than by having a class added to them. */
body.pf-frame-v1.foundation-page .fd-tabs,
body.pf-frame-v1.electives-page .el-seg{
  margin:0 0 var(--pf-page-band-gap) !important;
}
body.pf-frame-v1 .pf-toolbar-group{
  display:flex;
  align-items:center;
  gap:var(--pf-ctl-gap);
  flex-wrap:wrap;
  min-width:0;
}
/* flex-basis is direction-dependent: a px basis becomes a HEIGHT inside a
   toolbar that stacks (.sor-tools is column-first), which stretched the
   sign-offs search box to 240px tall on a phone. Grow with an auto basis and a
   min-width instead, so the intent ("at least this wide, then share the row")
   holds in both directions. */
body.pf-frame-v1 .pf-toolbar-group--grow{
  flex:1 1 auto;
  min-width:min(240px, 100%);
}

/* A single control that sits directly in the toolbar. Unlike .pf-toolbar-group
   it imposes no display/wrap of its own, so a control with its own internal
   layout (the sign-offs search label, the status segments) keeps it. */
body.pf-frame-v1 .pf-toolbar-item{ min-width:0; }
body.pf-frame-v1 .pf-toolbar-item--grow{
  flex:1 1 auto;
  min-width:min(240px, 100%);
}

/* Shared control sizing across every toolbar occupant. */
body.pf-frame-v1 .pf-toolbar .pf-ctl,
body.pf-frame-v1 .pf-toolbar input[type="search"],
body.pf-frame-v1 .pf-toolbar .sor-search,
body.pf-frame-v1 .pf-toolbar .roster-toggle,
body.pf-frame-v1 .pf-toolbar .schedule-week-nav,
body.pf-frame-v1 .pf-toolbar .sor-seg{
  min-height:var(--pf-ctl-h);
  box-sizing:border-box;
}
body.pf-frame-v1 .pf-toolbar .notice-filter-chip,
body.pf-frame-v1 .pf-toolbar .roster-toggle-btn,
body.pf-frame-v1 .pf-toolbar .sor-seg > button{
  min-height:calc(var(--pf-ctl-h) - 8px);
}
body.pf-frame-v1 .pf-toolbar :focus-visible{
  outline:2px solid var(--pf-brand, #1f6fd6);
  outline-offset:2px;
  border-radius:var(--pf-ctl-r);
}

/* The toolbar's own label ("This week", the date range) is a subheading of the
   page, not a second page title. */
body.pf-frame-v1 .pf-toolbar-label{
  margin:0 !important;
  font-size:16px !important;
  font-weight:600 !important;
  letter-spacing:-0.015em;
  color:var(--pf-brand-ink, #16233f) !important;
}
body.pf-frame-v1 .pf-toolbar-note{
  margin:2px 0 0 !important;
  font-size:12.5px !important;
  font-weight:500;
  color:var(--pf-ink-3, #8a97ad) !important;
}

@media (max-width: 767.98px){
  body.pf-frame-v1 .pf-toolbar{ align-items:stretch; }
  body.pf-frame-v1 .pf-toolbar-group--grow{ flex:1 1 100%; }
}

/* ---------- E. MAIN CONTENT ---------------------------------------------- */
body.pf-frame-v1 .pf-pagebody{
  min-width:0;
  /* Wide feature content (the calendar) scrolls inside its OWN region so the
     document never gains a horizontal scrollbar. */
}
body.pf-frame-v1 .pf-scrollregion{
  overflow-x:auto;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
  min-width:0;
}

/* Nothing in the frame may push the document sideways. */
body.pf-frame-v1.student-shell-unified .pf-page,
body.pf-frame-v1 .pf-pagehead,
body.pf-frame-v1 .pf-toolbar,
body.pf-frame-v1 .pf-pagecontext{
  max-width:100%;
}

/* ---------- shared empty / loading / error presentation ------------------
   Distinct states must LOOK distinct. These are structural containers only —
   every string comes from the page's own authoritative copy. */
body.pf-frame-v1 .pf-state{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  padding:26px 22px;
  border:1px solid var(--pf-line, #e9edf4);
  border-radius:var(--pf-r, 14px);
  background:var(--pf-bg, #f6f8fc);
}
body.pf-frame-v1 .pf-state h2,
body.pf-frame-v1 .pf-state h3{
  margin:0 !important;
  font-size:16.5px !important;
  font-weight:600 !important;
  color:var(--pf-ink, #1b2740) !important;
}
body.pf-frame-v1 .pf-state p{
  margin:0 !important;
  font-size:14px !important;
  color:var(--pf-ink-2, #5d6b84) !important;
  max-width:62ch;
}
body.pf-frame-v1 .pf-state--error{
  border-color:#f0c9c4; background:var(--pf-red-tint, #fdecea);
}

/* Skeletons must occupy the CONTENT's box, never the header's, so the heading
   cannot move when fixtures finish loading. */
body.pf-frame-v1 .pf-skeleton{
  border-radius:var(--pf-r-sm, 10px);
  background:linear-gradient(90deg,#eef1f7 25%,#e4e9f2 37%,#eef1f7 63%);
  background-size:400% 100%;
  animation:pf-skeleton-shimmer 1.4s ease infinite;
}
@keyframes pf-skeleton-shimmer{ 0%{background-position:100% 50%} 100%{background-position:0 50%} }
@media (prefers-reduced-motion: reduce){
  body.pf-frame-v1 .pf-skeleton{ animation:none; }
}

/* ==========================================================================
   PAGE ADOPTION — the four views proved in this pass.
   Each block below says what the page contributes to the shared structure and
   what it keeps. No page gets a bespoke gutter, a bespoke title size or a
   bespoke top offset: those come from the tokens above, once.
   ========================================================================== */

/* ---------- TODAY (app.html #section-dashboard) --------------------------
   Contributes: header + subtitle (the live placement label). No toolbar —
   Today has nothing to search, filter or page through, and a blank one would
   be exactly the "uniformity as filler" this system is meant to avoid. */

/* The shared header was hidden outright by today-redesign.css:481, which is
   why Today (and every other section in app.html) had no page title at all
   and the greeting became the de-facto heading. */
body.pf-frame-v1 .today-header.pf-pagehead{ display:flex !important; }

/* The greeting stays — it is a nice moment — but as supporting information
   under the page title, not a competing header system. It keeps its own row
   with the search/avatar controls it owns on mobile. */
body.pf-frame-v1 .tm-shell .tm-whisper{ margin-top:0; }
body.pf-frame-v1 .tm-shell p#tm-greeting{
  font-size:15px !important;
  font-weight:500 !important;
  letter-spacing:-0.01em !important;
  color:var(--pf-ink-2, #5d6b84) !important;
}
body.pf-frame-v1 .tm-shell p#tm-greeting b{
  font-weight:600 !important;
  color:var(--pf-ink, #1b2740) !important;
}
/* The date is already the page's subtitle context; the eyebrow above the
   greeting repeated it in caps. */
body.pf-frame-v1 .tm-shell .tm-whisper .tm-eyebrow{ display:none !important; }

/* A more proportionate no-placement presentation. The populated hero keeps its
   full 280px photographic treatment; the empty state does not need it, and a
   half-page banner should not be the answer to "you have no placement yet".
   Copy is unchanged (shared/today-meridian.js owns it). */
body.pf-frame-v1 .tm-hero.tm-hero--vacant{
  min-height:0 !important;
  padding:20px 22px 22px !important;
  border:1px solid var(--pf-line, #e9edf4);
  background:var(--pf-bg, #f6f8fc);
}
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-photo,
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-scrim,
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-hatch,
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-grain,
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-ghost{ display:none !important; }
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-title{
  font-size:19px !important; color:var(--pf-ink, #1b2740) !important;
}
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-kicker,
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-sub{
  color:var(--pf-ink-2, #5d6b84) !important;
}
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-kicker i{
  background:var(--pf-ink-3, #8a97ad) !important;
}
/* Keeps the independent-account destinations reachable: the pill is the route
   to Site info and is left in place, restyled to sit on the light surface. */
body.pf-frame-v1 .tm-hero.tm-hero--vacant .tm-hero-pill{
  background:var(--pf-surface, #fff) !important;
  border:1px solid var(--pf-line, #e9edf4) !important;
  color:var(--pf-brand-2, #1559b0) !important;
  backdrop-filter:none !important;
}

/* ---------- TIMETABLE (schedule.html) ------------------------------------
   Contributes: header + subtitle (placement) + a toolbar carrying the week
   label, Day/Week and Previous/Today/Next. Keeps: the calendar, the session
   semantics and the legend, untouched. */

/* The calendar is the one piece of student content that genuinely needs more
   width than a reading column — but widening the FRAME for this page would move
   the Timetable heading off the shared left edge on wide screens. So the frame
   stays at the shared --pf-page-max and the calendar keeps its own scroll
   region: the week grid never shrinks below a readable column width, and any
   overflow scrolls inside the grid rather than on the document. */
body.pf-frame-v1 .timetable-week-grid:not(.is-hidden){
  overflow-x:auto;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
}
body.pf-frame-v1 .timetable-week-grid .timetable-week-header,
body.pf-frame-v1 .timetable-week-grid .timetable-week-body{
  min-width:840px; /* 7 readable day columns + the time axis */
}
/* The legend belongs to the calendar, below the toolbar, at the shared rhythm. */
body.pf-frame-v1 .tt-weekbar{ margin:0 0 var(--pf-page-band-gap) !important; }

/* ---------- SIGN-OFFS (forms.html) ---------------------------------------
   Contributes: header + subtitle + funnel action, a context band for the
   placement scope line, and a toolbar carrying search and the status filter.
   Keeps: the register, evidence-file link and every status term as they are. */
/* .sor-tools is column-first and only becomes a row at its own breakpoint, so
   the frame must NOT force cross-axis centring on it: column + centre made the
   search box and the status segments shrink to their content and the segments
   ran off the right edge on a phone. Let the shared toolbar's own rules apply,
   and keep both groups full-width while the layout is stacked. */
body.pf-frame-v1 .sor-search.pf-toolbar-item{ max-width:420px; }
@media (max-width: 767.98px){
  body.pf-frame-v1 .sor-tools.pf-toolbar{ align-items:stretch !important; }
  body.pf-frame-v1 .sor-search.pf-toolbar-item{ max-width:none; }
}
body.pf-frame-v1 .pf-pagehead-actions .sor-funnel{
  min-height:var(--pf-ctl-h);
  min-width:var(--pf-ctl-h);
}

/* ---------- NOTICES (app.html #section-notices) --------------------------
   Contributes: the missing page title (from data-page-title), a context band
   for the Day Sheet masthead, and a toolbar for All/Unread/Pinned + Mark all
   read. Keeps: the Day Sheet design, notice content and bin access. */

/* The section was a full-width white card containing another card, which is
   the nested framing that made "Your placement" read as the page title. The
   masthead is the card now; the section is just a region on the canvas. */
body.pf-frame-v1 #section-notices.student-notices{
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0 !important;
}
/* The masthead no longer needs to announce the page, so it can carry a long
   placement name across lines instead of truncating it. */
body.pf-frame-v1 #section-notices .ntb-mast-title{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere;
}
/* The chip row was built to span the full width of a card; inside the shared
   toolbar it sizes to its content instead, and the label + count stay on one
   line at any width. */
body.pf-frame-v1 #section-notices .notice-filter-row{
  margin:0 !important;
  flex:0 0 auto;
}
body.pf-frame-v1 #section-notices .notice-filter-chip{
  flex:0 0 auto;
  white-space:nowrap;
  padding:0 14px;
  min-height:calc(var(--pf-ctl-h) - 6px) !important;
}
body.pf-frame-v1 #section-notices .ntb-chip-count{
  display:inline;
  white-space:nowrap;
}
body.pf-frame-v1 #section-notices .ntb-markall:not(.is-hidden){
  display:inline-flex;
  align-items:center;
  min-height:calc(var(--pf-ctl-h) - 8px);
}

/* ---------- MOBILE: one heading, not two --------------------------------
   The student shell already promotes the page title into the sticky mobile
   masthead (.pp-mobhead, shared/student-sidebar.js) and hides each page's
   in-body <h1> to match — see styles/student-shell.css. The shared header
   follows the SAME existing rule rather than introducing a second pattern. */
@media (max-width: 768px){
  /* Hidden ONLY where a mobile masthead is already carrying the page title:
     .pp-mobhead on the standalone pages (Timetable, Sign-offs), and
     #pp-section-head on app.html's section views (Notices). */
  body.pf-frame-v1.pp-has-mobhead .pf-pagehead,
  body.pf-frame-v1:has(#pp-section-head.is-on) .pf-pagehead{ display:none !important; }
  /* With the header suppressed, the frame's top offset is the masthead's job. */
  body.pf-frame-v1.student-shell-unified.pp-has-mobhead .pf-page,
  body.pf-frame-v1.student-shell-unified:has(#pp-section-head.is-on) .pf-page{ padding-top:8px !important; }

  /* Today is the one view with NO mobile masthead, so it keeps the shared
     header — otherwise it would be the only student page on a phone with no
     page title at all, and the greeting would go on doing the heading's job. */
  body.pf-frame-v1.today-mobile-mock:not(.pp-has-mobhead):not(:has(#pp-section-head.is-on)) .pf-pagehead{
    display:flex !important;
  }
  /* Today's heading takes the SAME mobile title spec the student shell already
     gives .pp-mobhead-title and #pp-section-head .psh-title (24px/600/-.025em,
     injected by shared/student-sidebar.js under html.pf-th-on), so the four
     views' titles are typographically identical on a phone. */
  html.pf-th-on body.pf-frame-v1 .pf-pagehead .pf-pagehead-title,
  body.pf-frame-v1 .pf-pagehead .pf-pagehead-title,
  /* two routes carry their page title in an element they own rather than the
     shared one: Teaching's clinical-folio header, and Foundation's contracted
     bare <h1>. They take the same mobile title spec. */
  body.pf-frame-v1.teaching-v12-active #teaching-experience .p-h1,
  body.pf-frame-v1.foundation-page .pf-pagehead h1{
    font-size:24px !important;
    font-weight:600 !important;
    letter-spacing:-.025em !important;
    line-height:1.1 !important;
  }

  /* That same injected rule also gives the Today GREETING title type, because
     until now the greeting was Today's mobile page title. It is not any more,
     so it drops back to a supporting line.
     Done here rather than by editing shared/student-sidebar.js on purpose:
     that file is a hosted dependency of ECG Studio, whose loader embeds its
     content hash and whose ecg-studio.html carries an exact release seal
     (scripts/application-typography-contract.test.js). Editing it would break a
     seal that belongs to the release workflow, not to this design pass. The
     extra `body.pf-frame-v1` raises specificity above the injected rule, which
     is appended to <head> after this sheet. */
  html.pf-th-on body.pf-frame-v1 .tm-whisper p#tm-greeting,
  body.pf-frame-v1 .tm-whisper p#tm-greeting{
    font-size:15px !important;
    font-weight:500 !important;
    letter-spacing:-0.01em !important;
    color:var(--pf-ink-2, #5d6b84) !important;
  }

  /* The sticky mastheads carry the page title on a phone, so they answer to the
     frame's gutter like everything else. Measured before this rule, the four
     views' titles started at x = 16 / 14 / 16 / 16 (and 24 / 14 / 16 / 16 at
     768px, where the frame's gutter steps up but the mastheads did not).
     Only the horizontal inset is touched: the mastheads keep their own
     background, height, safe-area handling, z-index and controls. */
  body.pf-frame-v1 .pp-mobhead,
  body.pf-frame-v1 #pp-section-head.is-on{
    padding-left:var(--pf-page-gutter) !important;
    padding-right:var(--pf-page-gutter) !important;
  }
}

/* ==========================================================================
   ADOPTION — the rest of the student area (2026-09-06)
   The four proved views are above. Everything below adopts the SAME frame and
   header; each block records what the page contributes and what it keeps.
   ========================================================================== */

/* ---------- shared: retiring a page's bespoke header type ----------------
   Several pages styled their own <h1> (23px–39px across the area). Those rules
   are left in place for any non-adopting consumer and simply out-ranked here,
   so the title spec lives in exactly one place. */
/* Scoped to desktop on purpose: this block sits after the phone block above,
   and a media query adds no specificity, so an unscoped desktop size here would
   override the 24px phone title spec at every width. */
@media (min-width: 769px){
  body.pf-frame-v1 .pf-pagehead .pf-pagehead-title,
  body.pf-frame-v1 .pf-pagehead h1.el-h1.pf-pagehead-title{
    font-family:var(--pf-font, var(--font-application-ui)) !important;
    font-size:30px !important;
    line-height:1.16 !important;
    font-weight:600 !important;
    letter-spacing:-0.028em !important;
    color:var(--pf-brand-ink, #16233f) !important;
    margin:0 !important;
  }
}

/* A lede/scope paragraph that becomes the shared subtitle answers to the
   subtitle spec, not to its old per-page one. */
body.pf-frame-v1 .pf-pagehead .pf-pagehead-sub{
  font-size:14.5px !important;
  line-height:1.45 !important;
  font-weight:500 !important;
  color:var(--pf-ink-2, #5d6b84) !important;
  margin:var(--pf-page-title-gap) 0 0 !important;
  max-width:74ch;
}

/* ---------- app.html sections -------------------------------------------- */

/* Clinical exposure, Roadmaps, My progress and Tips each printed their own
   <h2> repeating the page title plus their own subtitle paragraph. Those
   blocks are gone from the markup; these rules retire the leftover spacing so
   the first real content sits on the shared rhythm. */
body.pf-frame-v1 #section-conditions .cs-shell,
body.pf-frame-v1 #section-my-progress .mp-overview,
body.pf-frame-v1 #section-roadmaps .rp-review-note{
  margin-top:0 !important;
}
/* The mirrored subtitle source is read by the module, never shown twice. */
body.pf-frame-v1 .pf-sub-source{ display:none !important; }

/* Sections that were full-width decorative cards holding their own cards. */
body.pf-frame-v1 #section-conditions,
body.pf-frame-v1 #section-my-progress,
body.pf-frame-v1 #section-roadmaps,
body.pf-frame-v1 #section-tips{
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0 !important;
}

/* Roadmaps' Year/Specialty switch and Tips' filter row are view controls. */
body.pf-frame-v1 #section-roadmaps .rp-seg,
body.pf-frame-v1 #section-tips .tp-filters{
  margin:0 0 var(--pf-page-band-gap) !important;
}
body.pf-frame-v1 #section-tips .tp-filters.pf-toolbar{
  justify-content:flex-start;
  row-gap:10px;
}
/* A section's page-level actions are hidden while they are still sitting in the
   section markup, and become visible once the module lends them to the shared
   header's action slot. Done in CSS rather than with a `hidden` attribute,
   which would travel with the node and keep it invisible in the header. */
body.pf-frame-v1 .app-page-section [data-pf-page-actions]{ display:none !important; }
body.pf-frame-v1 .pf-pagehead-actions [data-pf-page-actions]{
  display:flex !important;
  align-items:center;
  gap:var(--pf-ctl-gap);
}

/* Tips' "About this feed" is lent to the header; size it like every other
   header action. */
body.pf-frame-v1 .pf-pagehead-actions .tp-info-btn{
  min-height:var(--pf-ctl-h);
  min-width:var(--pf-ctl-h);
}

/* Site info and Placement details asked for an unbounded frame of their own;
   they now share the page frame like everything else. Placement details keeps
   its breadcrumb + placement-name heading BELOW the shared header — that is a
   drill-down subject line, not a second page title. */
body.pf-frame-v1 #section-placement-details .placement-details-header{
  margin:0 0 var(--pf-page-band-gap) !important;
}
body.pf-frame-v1 #section-placement-details #placement-details-title{
  font-size:20px !important;
  font-weight:600 !important;
  margin:4px 0 0 !important;
  color:var(--pf-ink, #1b2740) !important;
}

/* ---------- standalone pages --------------------------------------------- */

/* Your future / Electives / Foundation are reading routes: the frame keeps the
   shared gutters and the heading keeps the shared left edge, while the prose
   below sits in its own narrower measure. This is the "narrow column inside the
   shared frame" case, not a narrower frame. */
body.pf-frame-v1.your-future-page .app-inner.pf-page > *:not(.pf-pagehead):not(.pf-pagecontext):not(.pf-toolbar),
body.pf-frame-v1.electives-page #electives-root > *:not(.pf-pagehead):not(.pf-pagecontext):not(.pf-toolbar),
body.pf-frame-v1.foundation-page .app-inner.pf-page > *:not(.pf-pagehead):not(.pf-pagecontext):not(.pf-toolbar){
  max-width:var(--pf-read-max, 900px);
}
body.pf-frame-v1.electives-page{ --pf-read-max:1000px; }
body.pf-frame-v1.foundation-page{ --pf-read-max:none; }

/* Foundation's <h1> deliberately carries no frame classes (its route contract
   pins the bare tag), so the shared title spec is applied by position instead. */
body.pf-frame-v1.foundation-page .pf-pagehead h1{
  font-family:var(--pf-font, var(--font-application-ui)) !important;
  font-weight:600 !important;
  letter-spacing:-0.028em !important;
  color:var(--pf-brand-ink, #16233f) !important;
  margin:0 !important;
  overflow-wrap:anywhere;
}
@media (min-width: 769px){
  body.pf-frame-v1.foundation-page .pf-pagehead h1{
    font-size:30px !important;
    line-height:1.16 !important;
  }
}
/* The contracted eyebrow sits above that title, so Foundation's heading starts
   one eyebrow-height below the shared top offset. Kept tight so the gap is the
   smallest it can honestly be. */
body.pf-frame-v1.foundation-page .pf-pagehead .fd-eyebrow{
  margin:0 0 4px !important;
}

/* Foundation's back link is a drill-down affordance, below the header. */
body.pf-frame-v1 .pf-pagecontext > .fd-back{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
body.pf-frame-v1 .pf-pagehead-actions .fd-cycle{
  display:inline-flex;
  align-items:center;
}

/* Settings keeps its two-column workspace; only the frame and header change. */
body.pf-frame-v1.student-settings-page .st-layout{ margin-top:0; }

/* Opportunities keeps its pipeline board and view tabs. */
body.pf-frame-v1.research-page .op-views.pf-toolbar{ justify-content:flex-start; }

/* ---------- TEACHING — justified exception ------------------------------- */
/* teaching-home.html renders the approved clinical-folio experience inside
   #teaching-experience, and styles/teaching-experience.css hides every other
   child of .app-inner. Its header changes shape per view (crumbs, mast, stats,
   search), so it keeps its own internal header rather than gaining a second
   one — the "dedicated teaching experience keeps its task-specific layout"
   case. What it DOES adopt is the outer frame: the experience stops centring
   itself in a 1060px box and stops adding its own horizontal inset, so its
   heading starts on the shared gutter and its top offset matches. */
body.pf-frame-v1.teaching-v12-active #teaching-experience{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding-left:0 !important;
  padding-right:0 !important;
  padding-top:0 !important;
}
/* Its own reading measure is preserved, inside the shared frame. */
body.pf-frame-v1.teaching-v12-active #teaching-experience > *{
  max-width:1060px;
}
/* The experience's own page title takes the shared title spec — the exception
   covers its per-view header STRUCTURE, not the size of the page name. */
body.pf-frame-v1.teaching-v12-active #teaching-experience .p-headzone{
  margin-top:0 !important;
  padding-top:0 !important;
}
body.pf-frame-v1.teaching-v12-active #teaching-experience .p-h1{
  font-weight:600 !important;
  letter-spacing:-0.028em !important;
  margin-top:0 !important;
}
@media (min-width: 769px){
  body.pf-frame-v1.teaching-v12-active #teaching-experience .p-h1{
    font-size:30px !important;
    line-height:1.16 !important;
  }
}

/* ---------- MESSAGES — justified exception ------------------------------- */
/* A two-pane workspace with its own full-height body, so it keeps .bleep-page
   instead of the centred column. It still answers to the frame's gutter and
   top offset, so its heading lands on the shared left edge. */
body.pf-frame-v1.messages-workspace .bleep-head.pf-pagehead{
  align-items:flex-start;
}

/* ---------- PROFILE — justified exception -------------------------------- */
/* Keeps the lanyard hero as its first content block; only the page head is
   shared. The head is still hidden on phones, where the masthead carries the
   title (styles/student-shell.css). */
body.pf-frame-v1.student-profile-page .student-profile-page-head.pf-pagehead{
  margin-bottom:var(--pf-page-head-gap) !important;
}
