/* Phase 1: measured outer shell only. Source: design.md, sections 1–5.
   OPPO Sans is loaded from the user-supplied variable font via theme.css.
   Exported icons are used; the ZIP contains no original logo or avatar asset. */
.sidebar {
  position: fixed; inset: 0 auto auto 0;
  width: var(--sidebar-width); height: min(var(--sidebar-height), 100dvh);
  padding: 15px 12px 32px; background: transparent;
  border: 0; border-right: 1px solid var(--border-sidebar);
  border-radius: var(--radius-shell); box-shadow: none;
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { padding: 0; gap: 12px; font-size: 14px; font-weight: 600; line-height: 20px; letter-spacing: 0; }
.brand-icon { width: 28px; height: 28px; border-radius: 9px; }
.sidebar nav { display: flex; flex-direction: column; gap: 12px; margin-top: 114px; }
.sidebar nav a {
  height: 40px; min-height: 40px; padding: 0 12px 0 16px;
  gap: 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-primary);
  font-size: 14px; font-weight: 500; line-height: 20px;
  letter-spacing: 0; box-shadow: none;
}
.sidebar nav a:hover { background: transparent; color: var(--text-primary); }
.sidebar nav a.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-nav-selected); }
.sidebar nav a.active::after {
  content: ''; position: absolute; left: 0; top: 10px;
  width: 4px; height: 20px; margin: 0; border-radius: 0; background: var(--nav-marker);
}
.sidebar nav a svg { width: 20px; height: 20px; stroke-width: 1.5; }
.sidebar nav a:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.sidebar-bottom { padding-top: 32px; margin-top: auto; }
.account-name { font-size: 14px; font-weight: 500; line-height: 20px; }
.device-status { margin: 4px 0 0; gap: 6px; font-size: 12px; line-height: 18px; color: var(--text-email); }
.status-dot { background: var(--success); }
.shell { margin-left: var(--sidebar-width); background: var(--canvas); border-radius: var(--radius-shell); min-width: 0; }
.topbar {
  position: static; height: var(--topbar-height); padding: 0 24px;
  background: var(--canvas); color: var(--text-primary);
  border: 0; border-bottom: 1px solid var(--border-top);
  border-radius: var(--radius-shell); box-shadow: none;
  font-size: var(--text-title-size); font-weight: 500; line-height: var(--text-title-leading); letter-spacing: 0;
}
.profile { display: flex; align-items: center; justify-content: center; gap: 8px; width: 64px; height: 32px; padding: 4px; border-radius: 8px; background: var(--border-card); }
.profile svg { width: 20px; height: 20px; stroke-width: 1.5; }
.profile b { width: 24px; height: 24px; border-radius: 20px; border: 0; box-shadow: none; background: var(--canvas); color: var(--text-primary); font-size: 11px; font-weight: 500; }
/* No uniform root padding exists in Figma. These route insets map the first
   dashboard row (235,91) and assessment material (249,70), after the 220/48 shell.
   Per-widget offsets remain for a later phase; the inner pages are untouched. */
main { max-width: none; margin: 0; padding: 43px 24px 0 15px; background: var(--canvas); min-height: calc(100dvh - var(--topbar-height)); border-radius: 0; }
body[data-view="practice"] main { padding: 22px 29px 0; }
.shell > footer { padding: 24px; background: var(--canvas); border-color: var(--border-top); color: var(--text-secondary); font-size: 12px; line-height: 18px; }
/* Figma supplies desktop frames only. Retain the app's existing mobile
   bottom-navigation behavior, using measured tokens; this is an adaptation. */
@media (max-width: 640px) {
  .sidebar { position: relative; inset: auto; width: 100%; height: auto; min-height: 48px; overflow: visible; padding: 12px 24px; border-right: 0; border-bottom: 1px solid var(--border-sidebar); }
  .sidebar-bottom { display: none; }
  .sidebar nav { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 0; gap: 4px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--canvas); border-top: 1px solid var(--border-sidebar); backdrop-filter: none; }
  .sidebar nav a { flex-direction: column; justify-content: center; height: auto; min-height: 48px; padding: 4px; gap: 4px; font-size: 11px; line-height: 18px; text-align: center; }
  .sidebar nav a.active::after { display: none; }
  .shell { margin-left: 0; }
  .topbar { position: static; padding: 0 24px; height: var(--topbar-height); }
  #breadcrumb { display: block; }
  main, body[data-view="practice"] main { padding: 24px 24px 0; }
  .shell > footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

.sidebar nav a .figma-icon, .profile .figma-icon { width: 20px; height: 20px; }
.sidebar nav a.active .figma-icon { filter: brightness(0) invert(1); }
