/* The page shell: a sidebar, a top bar with breadcrumbs and the account menu, then <main>. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--gray-bg); color: var(--dark); min-height: 100vh; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.shell-app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.shell-app-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }

.shell-sidebar { flex: 0 0 var(--sidebar-width); background: var(--chrome); color: rgba(255, 255, 255, 0.72); padding: 18px 0 24px; }
.nav-brand { font-family: var(--mono); font-weight: 500; font-size: 14px; color: var(--blue); text-decoration: none; white-space: nowrap; }
.shell-sidebar .nav-brand { display: block; color: #fff; padding: 0 20px 18px; }
.nav-brand:hover { opacity: 0.85; }
.shell-sidebar-group { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); padding: 14px 20px 6px; }
.shell-sidebar-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 20px; color: rgba(255, 255, 255, 0.78); text-decoration: none; font-size: var(--fs-body); }
.shell-sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.shell-sidebar-link.active { color: #7eb3ff; background: rgba(11, 69, 255, 0.22); }

.shell-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-height: 56px; padding: 8px 32px; background: var(--white); border-bottom: 1px solid var(--border-solid); }
.shell-topbar-crumbs { font-size: 13px; color: var(--text-muted); min-width: 0; overflow-wrap: anywhere; }
.shell-topbar-crumbs a { color: var(--text-muted); text-decoration: none; }
.shell-topbar-crumbs a:hover { color: var(--blue); }
.shell-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.shell-account { position: relative; }
.shell-account > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: var(--fs-body); color: var(--dark); }
.shell-account > summary::-webkit-details-marker { display: none; }
.shell-account-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-light); color: var(--blue-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.shell-account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--z-chrome); min-width: 220px; background: var(--white); border: 1px solid var(--border-solid); border-radius: var(--r-sm); box-shadow: 0 8px 24px rgba(11, 69, 255, 0.12); padding: 6px; }
.shell-account-menu .shell-who { padding: 8px 10px; font-size: var(--fs-meta); color: var(--text-muted); border-bottom: 1px solid var(--border-solid); margin-bottom: 4px; overflow-wrap: anywhere; }
.shell-account-menu a, .shell-account-menu button { display: flex; width: 100%; align-items: center; min-height: 40px; padding: 0 10px; border-radius: var(--r-xs); font: inherit; font-size: var(--fs-body); color: var(--dark); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.shell-account-menu a:hover, .shell-account-menu button:hover { background: var(--blue-pale); color: var(--blue-dark); }

/* The bottom padding clears the corpus-chat button, which is fixed over the bottom-right corner. */
main { width: 100%; max-width: 1180px; padding: 28px 32px 96px; }
footer { width: 100%; max-width: 1180px; padding: 0 32px 24px; font-family: var(--mono); font-size: var(--fs-label); color: var(--text-muted); }

/* Signed out: no sidebar, the content centered. */
.shell-anonymous main, .shell-anonymous footer { margin: 0 auto; }
.shell-anonymous footer { text-align: center; }

@media (max-width: 860px) {
  .shell-sidebar { flex-basis: 100%; padding: 10px 0; display: flex; flex-wrap: wrap; align-items: center; }
  .shell-sidebar .nav-brand { padding: 6px 16px; }
  .shell-sidebar-group { display: none; }
  .shell-sidebar-link { padding: 0 12px; }
  .shell-topbar, main, footer { padding-left: 16px; padding-right: 16px; }
}
