/* ==========================================================================
   Student portal on phones (21 Nov 2026)
   Everything a learner needs is visible on a phone without hunting:
   - the 7 menu items move to a fixed bottom tab bar (nothing hidden off-screen)
   - floating buttons sit above that bar
   - lesson tabs wrap instead of running off the screen
   - cramped rows (release plan, profile, steps) stack cleanly
   - Practice Books top strip is compact
   Loaded last, phone widths only.
   ========================================================================== */
@media (max-width:760px){
  /* ---------- Bottom tab bar ---------- */
  body.tp-app{--tp-mnav:64px;padding-bottom:calc(var(--tp-mnav) + env(safe-area-inset-bottom,0px))!important}
  body.tp-app .tp-appbar{padding:8px 12px!important;flex-wrap:nowrap!important;height:auto!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;transform:none!important;filter:none!important}
  body.tp-app .tp-appbar-right{margin-left:auto}
  body.tp-app .tp-appbar-nav{
    position:fixed!important;left:0;right:0;bottom:0;z-index:120;
    display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr));align-items:stretch!important;
    gap:0!important;order:0!important;flex:none!important;width:100%;margin:0!important;
    height:calc(var(--tp-mnav) + env(safe-area-inset-bottom,0px));
    padding:0 2px env(safe-area-inset-bottom,0px)!important;overflow:visible!important;
    background:#fff;border-top:1px solid #E2E8E5;box-shadow:0 -8px 24px -18px rgba(23,32,51,.45)
  }
  body.tp-app .tp-appbar-nav > button{
    position:relative;display:flex!important;flex-direction:column;align-items:center;justify-content:center;
    gap:4px!important;min-width:0;height:100%;padding:6px 1px!important;margin:0!important;
    border-radius:0!important;background:none!important;box-shadow:none!important;
    color:#5B6B66!important;font:700 10px/1.1 var(--body,system-ui)!important;letter-spacing:-.01em;white-space:nowrap
  }
  body.tp-app .tp-appbar-nav > button > svg{display:block!important;width:22px!important;height:22px!important;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  body.tp-app .tp-appbar-nav > button > span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  body.tp-app .tp-appbar-nav > button.on{color:#0A7D5B!important;background:none!important}
  body.tp-app .tp-appbar-nav > button.on::after{content:"";position:absolute;top:0!important;bottom:auto!important;left:22%!important;right:22%!important;height:3px;border-radius:0 0 3px 3px;background:#12B886!important}
  body.tp-app .tp-appbar-nav > button.on > svg{stroke-width:2.2}
  /* Short labels so all seven fit on a 320px phone */
  body.tp-app .tp-appbar-nav [data-app-view="instructor"] > span,
  body.tp-app .tp-appbar-nav [data-sim-open] > span,
  body.tp-app .tp-appbar-nav [data-app-view="jobs"] > span,
  body.tp-app .tp-appbar-nav [data-app-view="exam"] > span{font-size:0!important}
  body.tp-app .tp-appbar-nav [data-app-view="instructor"] > span::after{content:"Videos";font-size:10px}
  body.tp-app .tp-appbar-nav [data-sim-open] > span::after{content:"Practice";font-size:10px}
  body.tp-app .tp-appbar-nav [data-app-view="jobs"] > span::after{content:"Jobs";font-size:10px}
  body.tp-app .tp-appbar-nav [data-app-view="exam"] > span::after{content:"Exam";font-size:10px}
  /* Badges become small corner tags on the icon */
  body.tp-app .tp-appbar-nav .tp-nav-soon{position:absolute;top:5px;left:50%;margin-left:5px;padding:2px 4px!important;font-size:7.5px!important;line-height:1!important;letter-spacing:.02em;display:inline-block!important}
  body.tp-app .tp-appbar-nav .tp-nav-lock{position:absolute;top:5px;left:50%;margin-left:6px!important;padding:2px!important;width:16px;height:16px;display:inline-grid!important;place-items:center;border-radius:50%}
  body.tp-app .tp-appbar-nav .tp-nav-lock[hidden]{display:none!important}
  body.tp-app .tp-appbar-nav .tp-nav-lock b{display:none}
  body.tp-app .tp-appbar-nav .tp-nav-lock svg{width:10px!important;height:10px!important}
  body.tp-app .tp-appbar-nav .tp-nav-td{display:none!important}
  body.tx-in-exam{padding-bottom:0!important}

  /* ---------- Floating things sit above the tab bar ---------- */
  body.tp-app .zn-fab{bottom:calc(var(--tp-mnav) + 12px + env(safe-area-inset-bottom,0px))!important}
  body.tp-app .wa-float{bottom:calc(var(--tp-mnav) + 12px + env(safe-area-inset-bottom,0px))!important}
  body.tp-app .tp-idle-warn,body.tp-app .sb-toast{bottom:calc(var(--tp-mnav) + 14px)!important}
  /* A pop-up is open: Zena waits behind it instead of covering its buttons */
  body.tp-app:has(.tp-modal-back) .zn-fab{z-index:79!important}
  body.tp-app .tp-langbar{bottom:calc(var(--tp-mnav) + 10px + env(safe-area-inset-bottom,0px))!important;right:76px!important;left:10px!important;width:auto!important;max-width:none!important}
  /* "All languages unlocked" / "Your lessons play in…" are notes only: they covered content on
     every page. On phones only the one with an action (choose your language) stays. */
  body.tp-app .tp-langbar:not(:has([data-langpick])){display:none!important}

  /* ---------- Lesson page ---------- */
  body.tp-app.tp-classroom .p-foot{bottom:calc(var(--tp-mnav) + env(safe-area-inset-bottom,0px))!important;padding-right:84px!important}
  body.tp-app .ptabs{display:flex!important;flex-wrap:wrap!important;max-width:100%!important;width:100%;overflow:visible!important;align-self:stretch!important;gap:4px!important}
  body.tp-app .ptabs button{padding:8px 11px!important;font-size:13.5px!important;flex:0 1 auto}

  /* ---------- Home: "How to learn each lesson" steps, one per row ---------- */
  body.tp-app .tp-n-steps{grid-template-columns:1fr!important}
  body.tp-app .tp-n-steps .tp-d-step{flex-direction:row!important;align-items:center!important}
  body.tp-app .tp-n-steps .tp-d-step b{white-space:normal}

  /* ---------- Instructor videos: release plan rows ---------- */
  body.tp-app .tp-iv-plan li{flex-wrap:wrap;align-items:flex-start}
  body.tp-app .tp-iv-plan .tp-iv-pt{flex:1 1 0;min-width:0}
  body.tp-app .tp-iv-plan .tp-iv-chip{margin-left:44px;flex:none}

  /* ---------- Profile: progress header on two lines ---------- */
  body.tp-app .tp-ac-top h3{flex:1 0 100%!important}
  body.tp-app .tp-ac-top{row-gap:8px}

  /* ---------- Help: email button readable on the dark card ---------- */
  body.tp-app .tp-h-help .tp-h-line{color:#fff!important;border-color:rgba(255,255,255,.45)!important}

  /* ---------- Practice Books: compact top strip ---------- */
  html body .sb .pb-rail{padding:6px 8px!important;gap:6px!important;flex-direction:row!important;align-items:center!important;overflow-x:auto!important;overflow-y:hidden!important;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
  html body .sb .pb-rail .pb-logo{display:none!important}
  html body .sb .pb-rail .pb-newwrap{flex:none;margin:0!important}
  html body .sb .pb-rail .pb-new{width:auto!important;height:36px;margin:0!important;padding:0 14px!important;font-size:14px!important;white-space:nowrap}
  html body .sb .pb-rail .pb-tdr2{flex:none;display:flex!important;align-items:center;gap:10px;height:42px;margin:0!important;padding:0 14px!important;border-radius:12px;white-space:nowrap;background:#0B1F17!important;border:1.5px solid #2CA01C!important;box-shadow:0 6px 16px -10px rgba(44,160,28,.9)}
  html body .sb .pb-rail .pb-tdr2 img{width:22px!important;height:22px!important;object-fit:cover;object-position:left center;border-radius:50%}
  html body .sb .pb-rail .pb-tdr2 span::before{content:"QuickBooks ";color:#fff}
  html body .sb .pb-rail .pb-tdr2:has(> b) span::before{content:none}
  html body .sb .pb-rail .pb-tdr2 > b{font-size:15px!important}
  html body .sb .pb-rail .pb-tdr2 span{display:block;font-size:14px!important;line-height:1!important;color:#7CEB6F!important;font-weight:800!important}
  html body .sb .pb-rail .pb-tdr2 small{display:none!important}
  html body .sb .pb-rail .pb-rg{flex:none}
  html body .sb .pb-rail .pb-ri{width:auto!important;height:36px;padding:0 10px!important;font-size:13px!important;white-space:nowrap}
  html body .sb .zn-fab,body.sb-lock .zn-fab{bottom:14px!important}
}
/* Practice Books opens full-screen over the portal: the tab bar steps aside there. */
@media (max-width:760px){
  body.sb-lock .tp-appbar-nav{display:none!important}
  body.sb-lock{padding-bottom:0!important}
}
@media (max-width:380px){
  body.tp-app .tp-appbar-nav [data-app-view="player"] > span{font-size:0!important}
  body.tp-app .tp-appbar-nav [data-app-view="player"] > span::after{content:"Class";font-size:10px}
}
@media (max-width:360px){
  body.tp-app .tp-appbar-nav > button{font-size:9.5px!important}
  body.tp-app .tp-appbar-nav [data-app-view] > span::after,body.tp-app .tp-appbar-nav [data-sim-open] > span::after{font-size:9.5px}
  body.tp-app .tp-appbar-nav > button > svg{width:20px!important;height:20px!important}
}

/* Video full screen (button, iPhone, or turning the phone sideways): the lesson column's
   entrance animation leaves a transform on it, which trapped the "full screen" video inside
   the column. Drop it while a video is full screen so it really covers the screen, upright or sideways. */
html.tp-video-fs *:has(.tp-vwrap.is-pseudo-fs),html.tp-video-fs .tp-reveal,html.tp-video-fs body.tp-app .p-main,html.tp-video-fs body.tp-app .tp-home>*,html.tp-video-fs body.tp-app .mv{animation:none!important;transform:none!important;filter:none!important;will-change:auto!important;contain:none!important;backdrop-filter:none!important}
html.tp-video-fs .tp-appbar,html.tp-video-fs .tp-appbar-nav,html.tp-video-fs .zn-fab,html.tp-video-fs .tp-langbar{visibility:hidden!important}
