/* App shell: header, side navigation, main column. Phones: nav becomes a tab row (M1/M3). */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--surface);
}

.app-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); line-height: 1.1; }
.brand-school { font-size: var(--fs-xs); color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-pill {
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 9px; color: var(--muted);
}

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100% - var(--header-h)); }
.side-nav {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  height: calc(100vh - var(--header-h));
  align-self: start;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-sm);
  border: 0; background: none; text-align: left; cursor: pointer;
  color: var(--muted); font-weight: 700; font-size: var(--fs-sm);
}
.nav-item .dot { width: 14px; height: 14px; border-radius: 3px; background: var(--line-soft); flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.nav-item[aria-current="page"] .dot { background: var(--on-primary); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.side-foot .nav-item { font-weight: 400; padding: 7px 14px; }

.main {
  min-width: 0;
  padding-block: 28px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.main-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head > div { min-width: 0; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.page-title { font-size: var(--fs-3xl); margin-top: 4px; }
.page-lede { color: var(--muted); margin-top: 6px; max-width: 65ch; }

/* Sign-in: full-page two-column (screen 01) */
.signin {
  min-height: 100%;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px;
  align-items: center;
  max-width: 1160px; margin: 0 auto;
  padding-block: 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.signin > * { min-width: 0; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side-nav {
    position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 15;
    height: auto; flex-direction: row; overflow-x: auto; gap: 4px;
    padding: 8px max(12px, env(safe-area-inset-left, 0px));
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .nav-item { white-space: nowrap; padding: 8px 12px; }
  .nav-item .dot { display: none; }
  .side-foot { display: none; }
  .brand-school, .who-name { display: none; }
  .page-title { font-size: var(--fs-2xl); }
  .main { padding-block: 20px 96px; }
  .signin { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 28px; }
}

.shell > *, .main-inner, .main-inner > * { min-width: 0; }
.view { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.view > * { min-width: 0; }
