:root {
  --present-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --present-surface: #ffffff;
  --present-text: #18283f;
  --present-muted: #536579;
  --present-accent: #6b55ce;
  --present-accent-hover: #5743b5;
  --present-tint: #f1edfb;
  --present-line: #e7e3ef;
  --present-bg: #f7f6fa;
  --present-focus: #705bd0;
}

body { font-family: var(--present-font); }

.present-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--present-line);
}

.present-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: var(--present-text);
  font-size: 19px;
  font-weight: 750;
  font-family: var(--present-font);
  letter-spacing: -.04em;
  text-decoration: none;
}

.present-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--present-accent);
  color: #fff;
}

.present-mark svg {
  width: 19px;
  height: 19px;
}

.present-nav {
  display: flex;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  border-radius: 10px;
  background: #edf2f8;
}

.present-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  padding: 5px 13px;
  border-radius: 7px;
  color: var(--present-muted);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.present-nav a:hover { color: var(--present-accent-hover); background: #f8fbff; }
.present-nav a[aria-current=page] { background: #fff; color: var(--present-accent-hover); box-shadow: 0 1px 3px #203e631c; }
.present-nav a[hidden] { display: none; }
.present-nav a:focus-visible, .present-wordmark:focus-visible { outline: 2px solid var(--present-focus); outline-offset: 2px; }

@media (max-width: 600px) {
  .present-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .present-nav a { min-height: 42px; padding-inline: 4px; font-size: 12px; }
}

.present-workspace-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e7ebef;
  border-radius: 13px;
}
.present-workspace-bar .present-wordmark { justify-self: start; }
.present-workspace-bar .present-mark { background: #293e51; }
.present-workspace-bar > button { justify-self: end; }
.present-action-menu {
  position: fixed;
  z-index: 50000;
  display: grid;
  gap: 2px;
  min-width: 174px;
  max-width: calc(100vw - 16px);
  padding: 5px;
  background: #fff;
  border: 1px solid #e3dfeb;
  border-radius: 11px;
  box-shadow: 0 8px 28px #26304422;
}
.present-action-menu button {
  border: 0;
  border-radius: 7px;
  min-height: 34px;
  padding: 6px 10px;
  color: #384658;
  background: #fff;
  font: 500 13px/1.4 system-ui, sans-serif;
  text-align: left;
}
.present-action-menu button:is(:hover,:focus-visible) { background: #edf2f8; color: #223850; }
@media (max-width: 650px) {
  .present-workspace-bar { grid-template-columns: 1fr auto; padding: 7px 9px; gap: 6px; }
  .present-workspace-bar .present-nav { grid-row: 2; grid-column: 1 / -1; }
  .present-workspace-bar > button { grid-column: 2; grid-row: 1; }
}

/* 13.33 — Shared top navigation across library, boards and lessons.
   One design token set, no per-page positioning/colour overrides. */
:root {
  --present-nav-surface: #f3f1f7;
  --present-nav-border: #e7e3ef;
  --present-nav-active: #ffffff;
  --present-nav-fg: #625e6e;
  --present-nav-active-fg: #332b4d;
}
.present-bar.present-workspace-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: flex-start;
  min-height: 62px;
  padding: 9px 16px;
  border: 1px solid #e5e9f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(22,42,70,.025);
}
.present-workspace-bar .present-wordmark { margin-right: auto; }
.present-workspace-bar .present-nav, .workspace .main-topbar .present-nav,
.wb-header .present-nav {
  display: flex;
  width: auto;
  grid-template-columns: none;
  align-items: center;
  justify-self: end;
  margin-left: auto;
}
.present-nav {
  min-height: 40px;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--present-nav-border);
  border-radius: 12px;
  background: var(--present-nav-surface);
  box-shadow: none;
}
.present-nav a {
  min-height: 33px;
  padding: 6px 13px;
  border-radius: 9px;
  color: var(--present-nav-fg);
  font: 600 13px/1.3 var(--present-font);
  white-space: nowrap;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.present-nav a:hover { color: var(--present-nav-active-fg); background: #f9fafc; }
.present-nav a[aria-current="page"] {
  color: var(--present-nav-active-fg);
  background: var(--present-nav-active);
  box-shadow: 0 1px 4px rgba(32,48,70,.09);
}
.present-section-nav a { order: 0; }
@media (max-width: 650px) {
  .present-section-nav a { min-height: 42px; }
  .present-bar.present-workspace-bar { gap: 8px; }
  .present-workspace-bar .present-nav {
    flex: 1 1 100%;
    grid-column: 1 / -1;
    grid-row: auto;
    order: 2;
    width: 100%;
    margin: 0;
  }
  .present-workspace-bar .present-nav a { flex: 1 1 0; min-height: 42px; padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) { .present-nav a { transition: none; } }

/* Unified staff navigation: a readable desktop rail, an existing library
   sidebar, and a compact safe-area tab bar on phones. */
:root {
  --present-mobile-nav-height: 68px;
  --present-shell-rail-width: 176px;
  --present-shell-border: #e4e9ed;
}
.present-section-nav {
  box-sizing: border-box;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 29;
  width: var(--present-shell-rail-width);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 6px;
  padding: 16px 8px;
  border: 0;
  border-right: 1px solid var(--present-shell-border);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 1px 8px rgba(26, 42, 58, .025);
}
.present-mobile-section-nav { display: none; }
.present-workspace-bar .present-section-nav,
.wb-header .present-section-nav { width: var(--present-shell-rail-width); }
.present-section-nav a {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 11px;
  color: #596979;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 620;
  white-space: normal;
  transition: background-color .12s ease, color .12s ease;
}
.present-nav-icon { display: grid; place-items: center; min-height: 22px; color: currentColor; font-size: 20px; line-height: 1; }
.present-nav-icon svg { width: 21px; height: 21px; }
.present-section-nav a:hover { color: var(--present-shell-accent, #287d78); background: #f3f7f7; }
.present-section-nav a[aria-current="page"] { color: var(--present-shell-accent, #287d78); background: color-mix(in srgb, var(--present-shell-accent, #287d78) 10%, white); box-shadow: none; }
.present-section-nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 0 3px 3px 0; background: currentColor; }
.present-section-nav a:focus-visible { outline: 3px solid var(--present-focus); outline-offset: 1px; }
.present-shell-lessons { --present-shell-accent: #9a5c7d; }
.present-shell-boards { --present-shell-accent: #4d78a3; }
body.present-shell-fullscreen .present-section-nav,
#app:has(.fullscreen) .present-section-nav,
#app:has(.immersive) .present-section-nav { display: none !important; }
/* The library's mobile nav is mounted as a body-level sibling, so the
   descendant selectors above cannot reach it while a player is immersive. */
body.present-shell-fullscreen .present-mobile-section-nav,
body:has(#app .fullscreen) .present-mobile-section-nav,
body:has(#app .immersive) .present-mobile-section-nav { display: none !important; }
body.present-shell-lessons, body.present-shell-boards { padding-left: var(--present-shell-rail-width); }
body.ld-client.present-shell-lessons, body.ld-guest.present-shell-lessons { padding-left: 0; }
.present-shell-boards .wb-home { padding-left: clamp(16px, 4vw, 38px); }
.present-shell-lessons .ld-shell { width: min(calc(100% - 32px), 1240px); }

/* The library keeps its original collapsible sidebar. Shared destinations
   stay as a compact horizontal row in its top bar on desktop. */
.workspace .main-topbar .present-section-nav {
  position: static;
  inset: auto;
  width: auto;
  min-height: 40px;
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--present-nav-border);
  border-radius: 12px;
  background: var(--present-nav-surface);
  box-shadow: none;
}
.workspace .main-topbar .present-section-nav a {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 33px;
  padding: 6px 11px;
  font-size: 13px;
  white-space: nowrap;
}

@media (min-width: 761px) and (max-width: 1000px) {
  :root { --present-shell-rail-width: 80px; }
  .present-section-nav { width: 80px; }
  .present-section-nav a { flex-direction: column; gap: 5px; justify-content: center; padding: 5px 3px; min-height: 58px; font-size: 10px; line-height: 1.15; }
  .workspace .main-topbar .present-section-nav { width: auto; min-height: 40px; flex-direction: row; }
  .workspace .main-topbar .present-section-nav a { flex-direction: row; min-height: 33px; padding: 6px 8px; font-size: 12px; }
}

@media (max-width: 760px) {
  :root { --present-shell-rail-width: 0px; }
  body.present-shell-lessons, body.present-shell-boards { padding-left: 0; }
  .present-shell-lessons .ld-shell { width: 100%; }
  .present-section-nav {
    inset: auto 0 0;
    z-index: 90;
    width: 100%;
    min-height: 0;
    height: calc(var(--present-mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    gap: 2px;
    padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    border: 0;
    border-top: 1px solid var(--present-shell-border);
    background: rgba(255,255,255,.97);
    box-shadow: 0 -3px 14px rgba(28,42,58,.06);
    backdrop-filter: blur(14px);
  }
  .present-mobile-section-nav { display: flex; }
  .workspace .present-section-nav { display: flex; }
  .present-workspace-bar .present-section-nav,
  .wb-header .present-section-nav { width: 100%; }
  .present-section-nav a,
  .present-section-nav a[aria-current="page"],
  .present-workspace-bar .present-section-nav a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding: 3px 1px;
    border-radius: 9px;
    gap: 2px;
    font-size: 10px;
    line-height: 1.05;
    white-space: nowrap;
  }
  .present-section-nav a[aria-current="page"]::before { display: none; }
  .present-nav-icon { min-height: 20px; font-size: 18px; }
  .workspace .main-topbar .present-section-nav { display: none; }
  /* workspace-ui.css has a later mobile layout rule for the topbar nav.
     Keep only the body-level safe-area tabs visible in the library. */
  .workspace .main-panel .main-topbar .present-section-nav { display: none; }
  body.present-shell-keyboard .present-section-nav { display: none; }
  body.sidebar-drawer-open .present-section-nav { display: none !important; }
  .workspace .content { padding-bottom: calc(var(--present-mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 24px); }
  .ld-shell { padding-bottom: calc(var(--present-mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 18px) !important; }
  .wb-home { padding-bottom: calc(var(--present-mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 24px); }
  .ld-guest .present-section-nav, .ld-client .present-section-nav,
  .wb-in-lesson .present-section-nav, .wb-guest-mode .present-section-nav { display: none !important; }
}
@media (prefers-color-scheme: dark) {
  .present-section-nav { color-scheme: light; background: #fff; }
  .present-section-nav a { color: #4d5b69; }
}
@media (prefers-reduced-motion: reduce) {
  .present-section-nav a { transition: none; }
}
