/* The app frame (web/frame.js): the ink sidebar for managers and owners, the slim top bar for learners, the course bar
   while playing. Matches docs/brand/src/mock-dashboard.html (side) and mock-course.html (bar). */

/* manager and owner: sidebar + body */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.shell-body { min-width: 0; }
.side { background: var(--ink); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 0 6px; font: 800 18px/1.1 var(--display); letter-spacing: -.01em; color: #fff; text-decoration: none; }
.side-logo:hover { color: #fff; }
.side-logo .logo, .m-bar .logo, .lbar .logo, .pbar .logo { width: 30px; height: 30px; flex: none; }
.org { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); background: rgba(255, 255, 255, .07); }
.org .avatar { background: #fff; color: var(--ink); }
.org-t { min-width: 0; }
.org b { display: block; font: 600 14px/1.2 var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org small { font-size: 12px; color: #B5B2CC; }
.org > .i { margin-left: auto; color: #B5B2CC; }
.org select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.org:focus-within { outline: 3px solid var(--going); outline-offset: 2px; }
.org select:focus-visible { outline: none; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 10px; border-radius: 10px; color: #C9C6DC; text-decoration: none; font: 500 14.5px/1 var(--text); }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.nav a.on .i { color: var(--sun); }
.nav a .count { margin-left: auto; }
.side :focus-visible { outline-color: var(--sun); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); min-width: 0; }
.me .avatar { background: var(--sun); color: var(--ink); }
.me b { display: block; font: 600 14px/1.2 var(--text); overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 12px; color: #B5B2CC; }
.m-bar { display: none; }
.shell-body > .wrap { padding-top: 26px; }
/* the nav now carries Team and To review, so the old in-page tabs are not needed beside it */
.has-side .mtabs { display: none; }

/* the "More" key and its sheet exist for the phone bar only; on the sidebar every item is a plain link */
.nav-more { display: none; }
.nav-sheet { display: contents; }

/* phone: a top bar with the company and you, and the nav as a bar at the thumb */
@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 76px; }
  .m-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; min-width: 0; }
  .m-bar div { min-width: 0; }
  .m-bar b { display: block; font: 700 15px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-bar small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; top: auto; height: auto; overflow: visible; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); flex-direction: row; gap: 0; }
  .side-logo, .org, .me { display: none; }
  .nav { display: flex; flex: 1; justify-content: space-around; }
  .nav a { flex: 1; flex-direction: column; justify-content: center; gap: 5px; height: 54px; padding: 0 8px; font-size: 11.5px; position: relative; text-align: center; }
  .nav a.on, .nav .nav-more.on { background: none; }
  .nav-more { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 54px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: #C9C6DC; font: 500 11.5px/1 var(--text); cursor: pointer; touch-action: manipulation; }
  .nav-more.on, .nav.more-open .nav-more { color: #fff; font-weight: 600; }
  .nav-more.on .i, .nav.more-open .nav-more .i { color: var(--sun); }
  .nav-more:focus-visible { outline: 3px solid var(--sun); outline-offset: -3px; }
  .nav-sheet { display: none; }
  .nav.more-open .nav-sheet { display: grid; position: fixed; z-index: 6; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); min-width: 200px; padding: 6px; gap: 2px; background: var(--ink); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-l); box-shadow: 0 8px 24px rgba(20, 16, 50, .35); }
  .nav-sheet a { flex-direction: row; justify-content: flex-start; gap: 11px; height: 44px; padding: 0 12px; font-size: 14.5px; }
  .nav-sheet a.on { background: rgba(255, 255, 255, .1); }
  .nav a .count { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 4px; }
  .shell-body > .wrap { padding-top: 18px; }
}

/* learner: a slim top bar */
.lbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.lbar-in { max-width: 1120px; margin: 0 auto; padding: 0 var(--s5); height: 60px; display: flex; align-items: center; gap: var(--s5); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 18px/1 var(--display); letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.lbar-me { margin-left: auto; display: flex; align-items: center; gap: 10px; text-align: right; line-height: 1.25; }
.lbar-n { font: 600 14px/1.2 var(--text); }
.lbar-o { font-size: 12px; color: var(--muted); display: none; }
.lbar-me .avatar { background: var(--sun); color: var(--ink); }
@media (max-width: 700px) { .lbar-in { padding: 0 var(--s4); height: 56px; } .lbar-n { display: none; } }

/* playing: the course bar */
.pbar { display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.pbar-logo { display: flex; border-radius: 8px; }
.bar-t { min-width: 0; }
.bar-t b { display: block; font: 700 16px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { margin: 0 auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font: 600 13.5px/1 var(--text); min-width: 0; }
.steps .pips { flex-wrap: nowrap; }
.steps .pips i { width: 34px; height: 10px; border-radius: 5px; flex: 0 1 34px; min-width: 6px; }
.pbar-x { margin: 0 0 0 auto; width: 40px; padding: 0; flex: none; }
.pbar-logo { flex: none; }
.steps + .pbar-x { margin-left: 0; }
@media (max-width: 700px) {
  .pbar { height: 56px; padding: 0 12px; gap: 10px; }
  .bar-t { flex: 1 1 0; } .steps { margin: 0; flex: 0 1 auto; } .pbar-x { margin: 0; width: 36px; } .steps span, .bar-t small { display: none; }
  .steps .pips i { width: 18px; height: 8px; flex-basis: 18px; }
  .bar-t b { font-size: 15px; }
}
