/* Page frame (docs/DESIGN.md section 3): floating top bar, side menu card, content up to 1400px; phone gutter 16px. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 14px/1.5 var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at -10% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 420px at 110% -5%, var(--glow-2), transparent 60%),
    var(--ground);
  background-attachment: fixed;
  font-variant-numeric: tabular-nums;
}
:focus-visible { outline: 2px solid var(--g); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell { max-width: 1400px; margin: 0 auto; padding: 16px; }

.topbar {
  position: sticky; top: 16px; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 12px;
  background: var(--bar);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-radius: var(--r-bar);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-tile {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: var(--r-strip);
  background: var(--hero); color: var(--on-hero); font-weight: 600; font-size: 18px;
}
.brand-text { min-width: 0; }
.brand-name, .brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-name { font-weight: 600; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--soft); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.main { padding: 32px 0; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
/* Focused by script after a navigation (the main region, a screen title): not controls, so no focus ring. */
.main:focus, .main [tabindex="-1"]:focus { outline: none; }

@media (max-width: 600px) {
  .shell { padding: 12px 16px; }
  .topbar { top: 12px; }
  .main { padding: 24px 0; }
}

/* Role menu (docs/DESIGN.md sections 3 and 4): a floating card beside the page on wide screens, the floating bottom
   bar on phones. */
.menu {
  display: flex; gap: 4px; padding: 6px; background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.menu-item {
  display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill);
  color: var(--soft); font-weight: 600; text-decoration: none;
}
.menu-item[aria-current="page"] { background: var(--g-soft); color: var(--ink); }
@media (min-width: 901px) {
  .shell.has-menu { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 24px; align-items: start; grid-template-rows: auto 1fr; }
  .shell.has-menu .topbar { grid-column: 1 / -1; }
  .shell.has-menu .menu { flex-direction: column; position: sticky; top: 96px; margin-top: 32px; padding: 10px; }
}
@media (max-width: 900px) {
  .menu {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10; justify-content: space-around;
    background: var(--bar); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  }
  .menu-item { flex: 1; justify-content: center; padding: 0 6px; font-size: 13px; text-align: center; }
  .shell.has-menu { padding-bottom: 96px; }
}
