/* The learner shell: what differs from the shared chrome (../../shared/chrome.css: the frame, the top bar, the rail and sidebar rows). Compact: floating pill tab bar + the greeting. Medium: rail. Expanded: sidebar + aligned web header.
   Spec: 02-foundations/app-shell.md. Tokens only. The shared rules moved out on 2026-10-11 (one recipe, one file). */

/* ---------- top bar ---------- */
.pb-topbar .who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 48px; text-align: start; }
.pb-topbar .who .pb-avatar { width: 44px; height: 44px; } /* no ring: a ring means a story */
.pb-topbar .hello { min-width: 0; line-height: 1.25; }
.pb-topbar .hello small { display: block; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one line like the name: the bar is a fixed 64 dp, and a wrapped greeting at 1.43 text scale overflowed it */
.pb-topbar .hello b { display: block; font-size: calc(18px * var(--font-scale)); font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-topbar .me-btn { display: none; }
@media (max-width: 599px) { .pb-content { padding-bottom: 112px; } }   /* room for the floating tab bar (the frame is shared/chrome.css) */

/* ---------- floating pill tab bar (Compact) ---------- */
.pb-bottom { position: fixed; inset-inline-start: 12px; inset-inline-end: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); height: 68px; z-index: 30; display: flex; align-items: center; gap: 0; padding: 8px; box-sizing: border-box; background: var(--surface); border-radius: 999px; box-shadow: var(--elev-3), 0 3px 6px color-mix(in srgb, var(--shadow-ink) 10%, transparent), inset 0 0 0 1px var(--edge); transition: transform 300ms cubic-bezier(.4,0,.2,1); }
.pb-bottom .tab { flex: 1 1 0; min-width: 0; height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; color: var(--text-secondary); transition: flex-grow 300ms cubic-bezier(.4,0,.2,1), background-color 150ms ease, color 150ms ease; overflow: hidden; }
.pb-bottom .tab .ico { font-size: 26px; transition: transform 300ms cubic-bezier(.34,1.56,.64,1); }
.pb-bottom .tab .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 0; opacity: 0; font-size: calc(14px * var(--font-scale)); font-weight: 700; white-space: nowrap; transition: max-width 300ms cubic-bezier(.4,0,.2,1), opacity 150ms ease; }
.pb-bottom .tab[aria-current="page"] { flex: 0 0 auto; padding: 0 16px; gap: 6px; background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-text); }   /* 2026-10-27, the owner chose F of the bar sheet: the pill hugs the icon and label (was flex-grow 3, a pill that took three tabs' room); the other tabs keep their width, so nothing shifts on a switch */
.pb-bottom .tab[aria-current="page"] .lbl { max-width: 96px; opacity: 1; font-size: calc(13px * var(--font-scale)); }
.pb-bottom .tab[aria-current="page"] .ico { transform: scale(1.08); }
/* five tabs keep 48 dp targets: an inactive tab never shrinks below 48 dp (no gaps; the invisible tab box is the target) and below 360 dp the pill sits closer to the edges so the active label keeps its room (review 2026-10-03) */
.pb-bottom .tab:not([aria-current="page"]) { min-width: 48px; }
@media (max-width: 399px) { .pb-topbar { gap: 6px; } .pb-topbar .tbtn { width: 40px; height: 40px; } .pb-topbar .tbtn::after { inset: -4px; } }   /* a 40 dp circle in a 48 dp target: the title or the greeting still fits beside four round icons on a 360 dp phone */
@media (max-width: 359px) { .pb-topbar { gap: 4px; } .pb-topbar .tbtn { width: 36px; height: 36px; } }   /* four round icons (Search, Saved, Chat, Notifications): the title and the four fit a 320 dp phone (the Chat and Notifications page bars do the same) */
@media (max-width: 359px) { .pb-bottom { inset-inline-start: 8px; inset-inline-end: 8px; } .pb-bottom .tab[aria-current="page"] { padding: 0 12px; } .pb-bottom .tab:not([aria-current="page"]) { min-width: 46px; } }   /* 2026-10-27 (the owner, at 320: the pill touched the capsule edge): the bar keeps its 8 dp padding; the pill gives 4 dp a side and the inactive tabs 2 dp each so five fit a 288 dp row */

/* ---------- rail (Medium) / sidebar (Expanded) ---------- */
@media (max-width: 599px) { .pb-nav { display: none; } }   /* no sidebar on phones: the floating tab bar is the navigation (the rail and sidebar rules are shared/chrome.css) */

@media (min-width: 600px) {
  .pb-bottom { display: none; }
}
@media (min-width: 1024px) {
  /* Expanded top bar: aligned to the content column. greeting/title left | search icon (opens into a box), saved, chat, bell, avatar right */
  .pb-topbar .who { flex: 1 0 auto; } /* the title never truncates */
  .pb-topbar .who .pb-avatar { display: none; }
  .pb-topbar .hello b { font-size: calc(24px * var(--font-scale)); }
  .pb-topbar .me-btn { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 999px; margin-inline-start: 4px; }
  .pb-topbar .me-btn .pb-avatar { width: 44px; height: 44px; }
}

/* scroll-aware chrome (Compact only) */
@media (max-width: 599px) {
  .pb-topbar.hide { transform: translateY(-100%); }
  .pb-bottom.hide { transform: translateY(calc(100% + 32px)); }
  .theme-lab { transition: bottom 300ms cubic-bezier(.4,0,.2,1); }
  body.chrome-hidden .theme-lab { bottom: 12px; }
}
/* the rail / sidebar of a top-bar screen (PBShell.rail, from 600 dp like the shell's own rail; same widths: 88 dp, 272 dp from 1024): fixed, no item current, the page makes room for it and keeps its own bar
   with Back (2026-10-05; until then the three roots dropped Back beside the rail) */
.pb-nav.pb-nav--rail { display: none; position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 25; }
@media (min-width: 600px) {
  .pb-nav.pb-nav--rail { display: flex; }
  body.has-rail { padding-inline-start: 88px; }
}
@media (min-width: 1024px) { body.has-rail { padding-inline-start: 272px; } }
@media (prefers-reduced-motion: reduce) { .pb-topbar, .pb-bottom, .pb-bottom .tab, .pb-bottom .tab .ico, .pb-bottom .tab .lbl { transition: none; } }

/* toast: theme.css; here it only moves above the floating tab bar */
@media (max-width: 599px) { body:has(.pb-shell) .toast { bottom: 100px; } }

/* keyboard focus (2026-10-03 navigation review): one visible ring on every shell control, and a control reached with Tab is scrolled clear of the
   sticky top bar and the floating tab bar instead of resting under them */
.pb-topbar .who:focus-visible, .pb-bottom .tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 599px) { html:has(.pb-shell) { scroll-padding-bottom: 100px; } }

/* dev-only Theme Lab: keep it off the bars */
@media (max-width: 599px) { .theme-lab { bottom: 92px; } }   /* above the floating tab bar; the panel and the bottom-end placement are shared/chrome.css */

/* ---------- search: an icon at every width (2026-10-05). From 1024 dp a tap opens it into a box in the bar, the other buttons stay; below it the icon opens the Search screen ---------- */
.pb-sx { display: flex; align-items: center; gap: 8px; margin: 0; }
.pb-sxi { display: none; }
@media (min-width: 1024px) {
  .pb-sxi { display: block; width: 0; min-width: 0; height: 44px; padding: 0; opacity: 0; border: 0; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); color: var(--text-primary); font: inherit; font-size: calc(14px * var(--font-scale)); outline: none; transition: width 150ms cubic-bezier(.4,0,.2,1), padding 150ms ease, opacity 150ms ease; }
  .pb-sxi::placeholder { color: var(--text-secondary); }
  .pb-topbar.sx-open .pb-sxi { width: min(380px, 34vw); padding: 0 16px; opacity: 1; }
  .pb-sxi:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }
}

/* the box's list (web, with the box): the Search page's Recent and Popular under the box, narrowed by what is typed; search.css draws the rows */
.pb-sug { position: absolute; z-index: 5; width: min(380px, 34vw); max-width: calc(100vw - 32px); max-height: min(70vh, 560px); overflow-y: auto; padding: 4px 16px 12px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), 0 16px 40px color-mix(in srgb, var(--shadow-ink) 18%, transparent); }
.pb-sug[hidden] { display: none; }
.pb-sug .gs-h { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .pb-sxi { transition: none; } }

