    /* ───────────────────────────────────────────────────────────────────
       PORTAL CHROME — redesigned 2026-05-09.
       Replaces the legacy Canvas-style sidebar. Two pieces of fixed UI:
         · Top-left avatar  → opens profile
         · Bottom FAB row   → Saved (left), Drill (center, primary), Practice (right)
       Both hidden by default; visibility wired in router.js via body
       classes (.has-portal-avatar / .has-portal-fabs).
       ─────────────────────────────────────────────────────────────────── */

    /* Top-left avatar — circular, sits over content. Visible on every
       portal page except the profile page itself (where it'd be redundant). */
    .portal-avatar {
      display: none;
      position: fixed;
      top: 1.1rem; right: 1.2rem;
      width: 52px; height: 52px;
      border-radius: 50%;
      border: 1px solid var(--line);
      background: var(--card, #fff);
      cursor: pointer;
      z-index: 110;
      box-shadow: 0 8px 20px -10px rgba(0,0,0,.2);
      transition: transform .15s, box-shadow .2s, border-color .15s;
      padding: 0;
    }
    body.has-portal-avatar .portal-avatar { display: inline-flex; align-items: center; justify-content: center; }
    .portal-avatar:hover {
      transform: scale(1.04);
      border-color: var(--accent-warm, #B6442C);
      box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent-warm, #B6442C) 50%, rgba(0,0,0,.25));
    }
    .portal-avatar-mark {
      font-family: var(--font-display);
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--accent-warm, #B6442C);
      letter-spacing: -.01em;
      text-transform: uppercase;
    }
    .portal-avatar-img {
      width: 100%; height: 100%;
      border-radius: 50%;
      object-fit: cover;
      display: block;
    }

    /* Bottom FAB row — three floating buttons. Drill is the center FAB
       (primary, larger). Saved + Practice are smaller pills flanking it. */
    .portal-fabs {
      display: none;
      position: fixed;
      bottom: 1.4rem; left: 0; right: 0;
      pointer-events: none;          /* row itself ignores clicks */
      z-index: 110;
      align-items: center;
      justify-content: center;
      gap: 1.2rem;
    }
    body.has-portal-fabs .portal-fabs { display: flex; }
    .portal-fab {
      pointer-events: auto;
      display: inline-flex; align-items: center;
      gap: .5rem;
      text-decoration: none;
      border: 1px solid var(--line);
      background: var(--card, #fff);
      color: var(--ink-soft);
      transition: all .18s;
      box-shadow: 0 12px 28px -14px rgba(0,0,0,.22);
    }
    .portal-fab:hover {
      transform: translateY(-2px);
      color: var(--ink);
      border-color: var(--ink-mute);
      box-shadow: 0 18px 36px -14px rgba(0,0,0,.28);
    }
    .portal-fab-saved, .portal-fab-practice {
      padding: .65rem 1.1rem .65rem .9rem;
      border-radius: 99px;
    }
    .portal-fab-label {
      font-size: .88rem;
      font-weight: 600;
    }
    .portal-fab-drill {
      width: 64px; height: 64px;
      border-radius: 50%;
      justify-content: center;
      color: #fff;
      background: linear-gradient(135deg, var(--accent-warm, #B6442C) 0%, color-mix(in srgb, var(--accent-warm, #B6442C) 75%, #000) 100%);
      border-color: transparent;
      box-shadow: 0 14px 32px -10px color-mix(in srgb, var(--accent-warm, #B6442C) 70%, transparent);
    }
    .portal-fab-drill:hover {
      color: #fff;
      transform: translateY(-3px) scale(1.04);
      box-shadow: 0 20px 40px -10px color-mix(in srgb, var(--accent-warm, #B6442C) 80%, transparent);
      border-color: transparent;
    }

    @media (max-width: 540px) {
      .portal-avatar { top: .85rem; right: .85rem; width: 46px; height: 46px; }
      .portal-fabs { gap: .7rem; bottom: 1rem; }
      .portal-fab-saved, .portal-fab-practice {
        padding: .6rem .9rem .6rem .8rem;
      }
      .portal-fab-label { font-size: .8rem; }
      .portal-fab-drill { width: 58px; height: 58px; }
    }

    /* ───────────────────────────────────────────────────────────────────
       STUB SHELL (Coming-soon pages — Profile, Drill, Practice, Class, Inbox)
       Reuses the course-shell visuals but with stub content.
       ─────────────────────────────────────────────────────────────────── */
    .stub-shell {
      display: none;
      position: fixed; inset: 0;
      background: var(--bg);
      color: var(--ink);
      font-family: var(--font-body);
      flex-direction: column;
      z-index: 75;
      overflow: hidden;
    }
    .stub-shell.is-active { display: flex; }

    /* Cosmetic top header — hidden across portal pages (lessons /
       drill / practice / profile / class). Page identity is
       sufficiently established by the left-rail nav + the page's own
       h1. The reader-header stays — it's functional (back / bookmark
       / edit / prev-next). */
    /* Stub header — minimal top bar with the contextual back link on
       the left and an X close button on the right. The center title is
       de-emphasised; the page's own h1 carries identity. */
    .stub-header {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: .85rem 1.25rem;
      background: transparent;
      flex-shrink: 0;
    }
    /* X close lives on the LEFT now. The verbose course-back link is
       redundant (X has the same destination), so we hide it. */
    .stub-header .stub-close { order: 0; }
    .stub-header-title { order: 1; }
    .stub-header .course-back { display: none; }
    .stub-header .course-back {
      display: inline-flex;
      align-items: center;
      gap: .4rem;
      padding: .5rem .9rem .5rem .65rem;
      background: var(--card, #fff);
      border: 1px solid var(--line);
      border-radius: 99px;
      color: var(--ink-soft);
      font-size: .82rem;
      font-weight: 600;
      text-decoration: none;
      transition: all .15s;
    }
    .stub-header .course-back:hover {
      color: var(--ink);
      border-color: var(--ink);
      background: var(--bg-tint, #f7f3e8);
    }
    .stub-header-title {
      flex: 1; min-width: 0;
      font-family: var(--font-display);
      font-size: 1rem;
      font-weight: 500;
      color: var(--ink-mute);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      text-align: center;
    }
    .stub-close {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 38px; height: 38px;
      border-radius: 50%;
      background: var(--card, #fff);
      border: 1px solid var(--line);
      color: var(--ink-mute);
      text-decoration: none;
      cursor: pointer;
      transition: all .15s;
    }
    .stub-close:hover {
      color: var(--ink);
      border-color: var(--ink);
      background: var(--bg-tint, #f7f3e8);
      transform: scale(1.05);
    }
    .stub-body {
      flex: 1; min-height: 0;
      overflow-y: auto;
      padding: 3rem 2rem;
      display: flex;
      align-items: center; justify-content: center;
    }
    .stub-card {
      max-width: 480px;
      width: 100%;
      text-align: center;
      padding: 2.4rem 2rem;
      background: var(--bg-tint);
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
    }
    .stub-icon {
      width: 64px; height: 64px;
      margin: 0 auto 1rem;
      border-radius: 50%;
      background: rgba(184,146,58,.12);
      color: var(--gold);
      display: flex; align-items: center; justify-content: center;
    }
    .stub-icon svg { width: 28px; height: 28px; }
    .stub-eyebrow {
      font-size: .7rem;
      letter-spacing: .14em;
      text-transform: uppercase;
      color: var(--gold);
      font-weight: 700;
      margin-bottom: .5rem;
    }
    .stub-title {
      font-family: var(--font-display);
      font-size: 1.7rem;
      color: var(--ink);
      margin: 0 0 .8rem;
      font-weight: 500;
      line-height: 1.2;
    }
    .stub-desc {
      font-size: .94rem;
      color: var(--ink-soft);
      line-height: 1.55;
      margin: 0 0 1.4rem;
    }

