/* Page-layout rules ported from the design handoff's views/views.css (the "pg-" layer).
   Values are the handoff's own; port further rules here as pages are rebuilt. */
.pg-shell-main { padding: var(--space-6) var(--space-6) var(--space-8); max-width: 60rem; }
.pg-shell-main > .sa-page-header { margin-bottom: var(--space-5); }
.pg-empty-big { margin: var(--space-8) auto; align-items: center; text-align: center; }
.pg-empty-big .sa-empty__title { font-size: 26px; line-height: 34px; }

@media (max-width: 900px) {
  .pg-shell-main { padding: var(--space-5) var(--space-4) var(--space-7); }
}

/* Sign-in pages and notes (handoff views.css). */
.pg-note { color: var(--text-secondary); margin: var(--space-4) 0 var(--space-6); max-width: var(--content-measure); }
.pg-kicker { color: var(--text-secondary); font-size: 16px; line-height: 24px; }
.pg-on-tint { color: var(--success); font-weight: 700; }
.pg-fit { align-self: flex-start; margin-top: var(--space-2); }
.pg-sign { min-height: 100vh; display: flex; justify-content: center; padding: var(--space-8) var(--space-4); }
.pg-sign-col { width: 100%; max-width: 28rem; display: flex; flex-direction: column; align-items: center; gap: var(--space-7); }
.pg-form { width: 100%; display: flex; flex-direction: column; gap: var(--space-5); }
.pg-form .sa-field { max-width: none; }
.pg-form .sa-btn-row .sa-btn--primary { flex: 1; }
.pg-form-title { margin: 0; font-size: 26px; line-height: 34px; }
.pg-form-lede { color: var(--text-secondary); }
.pg-form-foot { font-size: 16px; }

@media (max-width: 900px) {
  .pg-sign { padding: var(--space-7) var(--space-4); }
}

/* Space a page-level notice from what follows (Home, Trainings). */
.sa-page > .sa-notice { margin-bottom: var(--space-6); }

/* Components set their own display (sa-notice, sa-svc__tag), which beats the browser's [hidden]. */
[hidden] { display: none !important; }

/* Live (CTF-185): training controls and the recovery-only group, ported from the handoff's views.css. */
.pg-ctl { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); max-width: var(--content-measure); }
.pg-apart { margin-top: var(--space-3); padding-top: var(--space-4); border-top: 1px dashed var(--border-control); display: flex; flex-direction: column; gap: var(--space-3); }
.pg-apart-label { color: var(--warning); font-size: 16px; line-height: 24px; font-weight: 700; }

/* Instructor event pages (CTF-187), ported from the handoff's views.css. */
.pg-event-head { margin: var(--space-3) 0 var(--space-4); }
.pg-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.pg-top { margin-top: var(--space-5); }
.pg-confirm { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); border: 1px solid var(--danger); border-radius: var(--radius-lg); background: var(--danger-surface); }
.pg-confirm-title { font-size: 20px; line-height: 30px; font-weight: 700; }
.pg-fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.pg-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--space-4); }

/* CTF-200: the top bar stays visible while scrolling. topnav-height.js keeps --pg-topnav-h
   equal to the bar's real height; these values are the fallbacks. */
:root { --pg-topnav-h: 69px; }
@media (max-width: 640px) { :root { --pg-topnav-h: 113px; } }
html { scroll-padding-top: var(--pg-topnav-h); }
.sa-topnav { position: sticky; top: 0; z-index: 20; }
.sa-sidebar { top: var(--pg-topnav-h); min-height: calc(100vh - var(--pg-topnav-h)); }
@media (max-width: 900px) { .sa-sidebar { top: var(--pg-topnav-h); min-height: 0; } }
@media (max-width: 900px) { html:has(.sa-sidebar) { scroll-padding-top: calc(var(--pg-topnav-h) + var(--pg-sidebar-h, 0px)); } }
