/* Shared chrome for every audience (04-prototype/shared/chrome.css): the shell frame, the top bar's frame and its plain icons, the modules list
   (sidebar rows; the rail between 600 and 1023 dp), the content column and the keyboard ring. Each audience's shell.css adds only what differs:
   the learner's floating pill tab bar, greeting and search box (learner/shared/shell.css, 02-foundations/app-shell.md); the portal's drawer,
   breadcrumb, ⌘K entry and counts (admin/shared/shell.css, 02-foundations/portal-shell.md). Moved out of learner/shared/shell.css on 2026-10-11
   (one recipe, one file); the row sizes are variables so the portal's dense list (tokens §3.3) is the same rule. Tokens only. */
body { margin: 0; font-family: var(--font-family); background: var(--bg-glow) no-repeat, var(--bg); color: var(--text-primary); }   /* the canvas is lit from the top (tokens §4.1) */
a { font: inherit; color: inherit; text-decoration: none; } /* the button reset lives in theme.css only */
.pb-shell { display: flex; min-height: 100vh; }
.pb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- top bar: the frame; each audience fills it ---------- */
.pb-topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 8px; padding-block: 0; padding-inline: 16px 12px; background: transparent; transition: transform 300ms cubic-bezier(.4,0,.2,1), box-shadow 150ms ease, background-color 150ms ease; }   /* clear at the top so the lit canvas shows through; solid once scrolled */
.pb-topbar.scrolled { background: var(--bg); box-shadow: 0 1px 0 var(--border); }
.pb-topbar .sp { display: none; }
/* plain header icons (2026-10-05): no circle around the bar's icon buttons; a soft circle only on hover and while their panel is open */
.pb-topbar .tbtn { background: transparent; box-shadow: none; }
.pb-topbar .tbtn:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.pb-topbar .tbtn .ico { font-size: 24px; }
@media (max-width: 399px) { .pb-topbar .tbtn .ico { font-size: 22px; } }
@media (max-width: 359px) { .pb-topbar .tbtn .ico { font-size: 20px; } }
.pb-content { flex: 1; padding: 8px 16px 32px; width: 100%; box-sizing: border-box; container: pbc / inline-size; }   /* the content column is a size container (2026-10-20): a pattern that chooses its columns asks the column's width (pbc), not the viewport's, so a page beside the PB panel or a hidden menu lays out by the room it has */

/* ---------- the modules list: rows (the sidebar from 1024 dp, and a drawer on phones where an audience has one); the rail between ---------- */
.pb-nav { flex-direction: column; gap: 4px; width: 272px; padding: 20px 16px; box-sizing: border-box; background: var(--bg); border-inline-end: 1px solid var(--border); }
.pb-nav .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pb-nav .logo { width: var(--nav-logo, 44px); height: var(--nav-logo, 44px); }
.pb-nav .word { font-size: calc(20px * var(--font-scale)); font-weight: 800; letter-spacing: -0.02em; }
.pb-nav a { position: relative; display: flex; align-items: center; gap: var(--nav-row-gap, 16px); padding: 0 var(--nav-row-pad, 16px); min-height: var(--nav-row, 52px); border-radius: 16px; font-size: calc(var(--nav-font, 16px) * var(--font-scale)); font-weight: 600; color: var(--text-secondary); transition: background-color 150ms ease, color 150ms ease; }
.pb-nav a .rp { display: flex; align-items: center; justify-content: center; }
.pb-nav a .ico { font-size: var(--nav-ico, 24px); }
.pb-nav a .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-nav a:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pb-nav a[aria-current="page"] { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary-text); font-weight: 700; }
@media (min-width: 600px) {
  .pb-nav { display: flex; position: sticky; top: 0; height: 100vh; }
  .pb-topbar { padding-inline: 20px 16px; }
  .pb-content { padding: 8px 24px 32px; }
}
@media (min-width: 600px) and (max-width: 1023px) {   /* the rail: an icon over a small label, the active pill */
  .pb-nav { width: 88px; padding: 16px 8px; gap: 6px; align-items: center; }
  .pb-nav .word { display: none; }
  .pb-nav a { flex-direction: column; gap: 4px; width: 100%; padding: 6px 0; min-height: 0; border-radius: 16px; font-size: 11px; }
  .pb-nav a .rp { width: 56px; height: 32px; border-radius: 999px; transition: background-color 150ms ease; }
  .pb-nav a .ico { font-size: 24px; }
  .pb-nav a .lbl { flex: none; white-space: normal; text-align: center; }
  .pb-nav a:hover { background: none; } .pb-nav a:hover .rp { background: color-mix(in srgb, var(--primary) 10%, transparent); }
  .pb-nav a[aria-current="page"] { background: none; font-weight: 600; }
  .pb-nav a[aria-current="page"] .rp { background: color-mix(in srgb, var(--primary) 18%, transparent); }
}
@media (min-width: 1024px) {   /* the menu hidden on the web (2026-10-20, the owner: "hide and unhide menu for web"): the sidebar takes the rail recipe above until Show the menu; the same declarations, repeated because a media query cannot be OR-ed with a class */
  .pb-shell.nav-collapsed .pb-nav { width: 88px; padding: 16px 8px; gap: 6px; align-items: center; }
  .pb-shell.nav-collapsed .pb-nav .word { display: none; }
  .pb-shell.nav-collapsed .pb-nav a { flex-direction: column; gap: 4px; width: 100%; padding: 6px 0; min-height: 56px; box-sizing: border-box; border-radius: 16px; font-size: 11px; }
  .pb-shell.nav-collapsed .pb-nav a .rp { width: 56px; height: 32px; border-radius: 999px; transition: background-color 150ms ease; }
  .pb-shell.nav-collapsed .pb-nav a .ico { font-size: 24px; }
  .pb-shell.nav-collapsed .pb-nav a .lbl { flex: none; white-space: normal; text-align: center; }
  .pb-shell.nav-collapsed .pb-nav a:hover { background: none; } .pb-shell.nav-collapsed .pb-nav a:hover .rp { background: color-mix(in srgb, var(--primary) 10%, transparent); }
  .pb-shell.nav-collapsed .pb-nav a[aria-current="page"] { background: none; font-weight: 600; }
  .pb-shell.nav-collapsed .pb-nav a[aria-current="page"] .rp { background: color-mix(in srgb, var(--primary) 18%, transparent); }
}
@media (min-width: 1024px) {
  /* Expanded top bar: aligned to the content column (max 1200 dp) */
  .pb-topbar { padding-inline: calc(32px + max(0px, (100% - 64px - 1200px) / 2)); height: 72px; gap: 12px; }
  .pb-topbar .sp { display: block; flex: 1 1 0; }
  .pb-content { padding: 8px 32px 32px; }
  .pb-content > .inner { max-width: 1200px; margin: 0 auto; }
}

/* keyboard focus: one visible ring on every shell control, and a control reached with Tab is scrolled clear of the sticky top bar */
.pb-nav a:focus-visible, .pb-topbar .tbtn:focus-visible, .pb-topbar .me-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
html:has(.pb-shell) { scroll-padding-top: 80px; }

/* dev-only Theme Lab: bottom end, off the bars */
.theme-lab { top: auto !important; bottom: 16px; inset-inline-end: 12px; }
.theme-lab-panel { top: auto !important; bottom: 44px; inset-inline-end: 0; max-height: 70vh; overflow: auto; }
