/* ===================================================================
   The app shell, as the Limestone design system draws it.

   Source: @limestonetechnologygroup/design-system 0.13.1 -- AppShell,
   NavRow, RailTip, AccountFooter, AppearanceToggle and PageHeader's
   breadcrumb (src/shell.tsx, account.tsx, theme.tsx), the nav tokens and
   the "Sidebar motion" rules in tokens/tokens.css. The Next.js pages (web/)
   render those components directly; this file draws the same frame for the
   Flask pages, value for value, so a link from one half of the app to the
   other doesn't change the sidebar under your hand. When the design
   system's shell changes, change this with it.

     >= 768px  a sidebar column, 272px, or a 56px icon rail when collapsed;
               the labels fade and the column folds (380ms)
     <  768px  a 64px top bar with a labelled Menu button that opens the
               same sidebar as a drawer

   Loaded after style.css and redesign.css. The old shell's rules there
   (.app-shell, .sidebar, .topbar, .breadcrumb) no longer match anything;
   .main-content is kept on <main> for the page rules that key off it, and
   overridden here.
   =================================================================== */

/* ---- Tokens the rest of the app doesn't already define (tokens.css) ---- */
:root {
  --ltg-nav: #102b46;
  --ltg-nav-top: #133456;
  --ltg-nav-bottom: #0a1b2c;
  --ltg-nav-glow: rgb(143 185 216 / 0.16);
  --ltg-nav-edge: rgb(255 255 255 / 0.06);
  --ltg-nav-hover: #1b3f63;
  --ltg-nav-active: #254d6c;
  --ltg-nav-text: #ffffff;
  --ltg-nav-text-secondary: #c4d2de;
  --ltg-nav-icon: #8fb9d8;
  --ltg-nav-divider: #2a4a68;
  --ltg-nav-focus: #a8d1ef;
  --ltg-on-signal: #0a1b2c;
  --ltg-heading: #102b46;
  --ltg-scrim: rgb(11 23 37 / 0.55);
  --ltg-shadow-pop: 0 12px 32px -12px rgb(16 43 70 / 0.28), 0 2px 6px rgb(16 43 70 / 0.08);
  --ltg-sidebar: 272px;
  --ltg-rail: 56px;
  --ltg-nav-row: 28px;
  --ltg-nav-row-touch: 40px;
  --ltg-header: 64px;
  --ltg-target-sm: 36px;
  --ltg-ease: cubic-bezier(0.2, 0, 0, 1);
  --ltg-dur-fast: 120ms;
  --ltg-dur-overlay: 180ms;
  /* Sidebar collapse / expand: the labels fade, then the column folds (and
     the reverse), 380ms in all. The labels come back row by row. */
  --ltg-dur-sidebar: 380ms;
  --ltg-ease-sidebar: cubic-bezier(0.32, 0.72, 0, 1);
  --ltg-dur-nav-fade: 160ms;
  --ltg-nav-fold-delay: 90ms;
  --ltg-nav-fade-in-delay: 170ms;
  --ltg-nav-stagger: 28ms;
}
/* Midnight, in both of the app's dark contexts (see limestone-v2.css). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ltg-nav: #0f2236;
    --ltg-nav-top: #11263b;
    --ltg-nav-bottom: #08121d;
    --ltg-nav-glow: rgb(143 185 216 / 0.12);
    --ltg-nav-edge: rgb(143 185 216 / 0.14);
    --ltg-nav-hover: #183350;
    --ltg-heading: #f4f7fa;
    --ltg-scrim: rgb(0 0 0 / 0.6);
    --ltg-shadow-pop: 0 12px 32px -12px rgb(0 0 0 / 0.7);
  }
}
:root[data-theme="dark"] {
  --ltg-nav: #0f2236;
  --ltg-nav-top: #11263b;
  --ltg-nav-bottom: #08121d;
  --ltg-nav-glow: rgb(143 185 216 / 0.12);
  --ltg-nav-edge: rgb(143 185 216 / 0.14);
  --ltg-nav-hover: #183350;
  --ltg-heading: #f4f7fa;
  --ltg-scrim: rgb(0 0 0 / 0.6);
  --ltg-shadow-pop: 0 12px 32px -12px rgb(0 0 0 / 0.7);
}
/* The page title, as the design system sets it: 24/32 (was 28/36). */
:root:root { --text-title: 1.5rem; --text-title-lh: 1.333333; }

/* On the navy frame, the pale-blue ring -- never an invisible navy one. */
.ltg-nav-scope { --ltg-focus: var(--ltg-nav-focus); }
/* Brand navy with a soft-blue light behind the logo; .ltg-nav-bar is the
   same surface as the narrow top bar. */
.ltg-nav-surface {
  background:
    radial-gradient(140% 38% at 0% 0%, var(--ltg-nav-glow), transparent 70%),
    linear-gradient(180deg, var(--ltg-nav-top) 0%, var(--ltg-nav-bottom) 100%);
  box-shadow: inset -1px 0 0 var(--ltg-nav-edge);
}
.ltg-nav-bar {
  background:
    radial-gradient(60% 140% at 0% 0%, var(--ltg-nav-glow), transparent 70%),
    linear-gradient(90deg, var(--ltg-nav-top) 0%, var(--ltg-nav-bottom) 100%);
  box-shadow: inset 0 -1px 0 var(--ltg-nav-edge);
}

/* ---- Frame ---- */
.shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: var(--ltg-sidebar) minmax(0, 1fr);
}
:root[data-sidebar="collapsed"] .shell { grid-template-columns: var(--ltg-rail) minmax(0, 1fr); }
.shell-bar, .shell-scrim { display: none; }

/* ---- Sidebar ---- */
.shell-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-direction: column; align-self: start;
  box-sizing: border-box;
  height: 100vh; height: 100dvh;
  padding: 8px;
  padding-left: max(8px, env(safe-area-inset-left));
  color: var(--ltg-nav-text);
  outline: none;
  /* Words stay whole in the sidebar, as the design system has them: the
     app's own overflow-wrap would break "1.24.60" in the middle. A long
     email breaks at its "@" (a <wbr> in base.html). */
  overflow-wrap: normal; word-break: normal;
}
.shell-nav :is(ul, li) { margin: 0; padding: 0; list-style: none; }
/* style.css styles bare <button>s -- centred contents, a gap, padding, and
   submit buttons painted navy; every sidebar button draws itself from
   scratch. Centring especially: a group heading is a button, and inherited
   centring put "MY WORK" in the middle of the row. */
.shell-nav button {
  justify-content: flex-start; gap: 0; margin: 0; padding: 0;
  border: 0; background: none; box-shadow: none;
  font: inherit; letter-spacing: inherit; text-transform: none;
  color: inherit; cursor: pointer;
}

/* Identity. The mark and the collapse icon sit on the top line and never
   move; the lockup sits between them, the product and space under them. */
.shell-head { position: relative; min-height: 44px; padding: 4px 0 8px; }
.shell-mark-slot { position: absolute; left: 0; top: 4px; z-index: 10; }
.shell-markcell {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: var(--ltg-radius-control);
  transition: background-color var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-markcell:hover { background: var(--ltg-nav-hover); }
.shell-mark { flex-shrink: 0; display: block; }
.shell-expand { display: none; position: relative; }
.shell-expand-mark, .shell-expand-icon {
  display: grid; place-items: center;
  transition: transform var(--ltg-dur-fast) var(--ltg-ease), opacity var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-expand-icon { position: absolute; inset: 0; opacity: 0; transform: scale(0.9); color: var(--ltg-nav-text); }
.shell-expand:is(:hover, :focus-visible) .shell-expand-mark { opacity: 0; transform: scale(0.9); }
.shell-expand:is(:hover, :focus-visible) .shell-expand-icon { opacity: 1; transform: scale(1); }
.shell-collapse-slot { position: absolute; right: 0; top: 4px; display: flex; align-items: center; height: 40px; }
.shell-nav .shell-collapse {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border-radius: var(--ltg-radius-control); color: var(--ltg-nav-text-secondary);
  transition: color var(--ltg-dur-fast) var(--ltg-ease), background-color var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-nav .shell-collapse:hover { background: var(--ltg-nav-hover); color: var(--ltg-nav-text); }
.shell-lockup {
  display: flex; flex-direction: column; justify-content: center;
  height: 40px; margin: 0 32px 0 42px; overflow: hidden; white-space: nowrap;
}
.shell-lockup-name { display: block; font-size: 15px; line-height: 1; font-weight: 700; letter-spacing: -0.01em; color: var(--ltg-nav-text); }
.shell-lockup-desc { display: block; margin-top: 3px; font-size: 11px; line-height: 1; font-weight: 500; letter-spacing: 0.02em; color: var(--ltg-nav-icon); }
/* A block that folds shut with the sidebar: laid out at the full width and
   clipped, so its text doesn't rewrap as the column narrows. */
.shell-fold-clip { min-height: 0; overflow: hidden; }
.shell-fold-body { width: calc(var(--ltg-sidebar) - 1rem); }
.shell-product { padding: 11px 6px; border-block: 1px solid rgb(255 255 255 / 0.1); }
.shell-product-name {
  display: block; overflow-wrap: break-word;
  font-size: 17px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ltg-nav-text-secondary);
}
.shell-workspace { display: block; margin-top: 2px; overflow-wrap: break-word; font-size: 12px; line-height: 18px; color: var(--ltg-nav-icon); }

/* Destinations scroll on their own. The box is padded 8px on every side
   because a scroll box clips, and the focus ring reaches 7px outside a row. */
.shell-nav .shell-sections {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  margin: 0 -8px; padding: 8px;
}
.shell-heading-row { position: relative; height: 28px; margin-bottom: 2px; }
.shell-rule {
  position: absolute; left: 4px; right: 4px; top: 50%;
  border-top: 1px solid var(--ltg-nav-divider); pointer-events: none;
}
.shell-nav .shell-heading {
  display: flex; align-items: center; gap: 6px;
  width: 100%; height: 100%; padding: 0 6px; overflow: hidden;
  border-radius: var(--ltg-radius-control);
  font-size: 12px; line-height: 18px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; text-align: left;
  color: var(--ltg-nav-text);
  transition: background-color var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-nav .shell-heading:hover { background: var(--ltg-nav-hover); }
.shell-heading-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-fold-icon { flex-shrink: 0; transition: transform var(--ltg-dur-fast) var(--ltg-ease); }
.shell-heading[aria-expanded="false"] .shell-fold-icon { transform: rotate(-90deg); }
/* A folded group keeps its waiting count where it can be seen. */
.shell-fold-count {
  margin-left: auto; flex-shrink: 0; box-sizing: border-box; min-width: 18px;
  padding: 0 6px; border-radius: 999px; background: var(--ltg-orange);
  text-align: center; font-size: 11px; line-height: 18px; font-weight: 600; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums; text-transform: none; color: var(--ltg-on-signal);
}
.shell-fold-count[hidden] { display: none; }
.shell-list { display: flex; flex-direction: column; }
.shell-list[hidden] { display: none; }

/* A row: 28px with a mouse, 40px on touch; 13px text, a soft-blue icon in
   a 40px cell, white on the current destination, which also gets the orange
   leading marker. */
.shell-row {
  position: relative;
  display: flex; align-items: center;
  box-sizing: border-box; width: 100%; height: var(--ltg-nav-row);
  padding: 0 8px 0 0;
  border-radius: var(--ltg-radius-control);
  font-size: 13px; line-height: 18px; font-weight: 400;
  color: var(--ltg-nav-text-secondary); text-decoration: none;
  transition: color var(--ltg-dur-fast) var(--ltg-ease), background-color var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-row:hover { background: var(--ltg-nav-hover); color: var(--ltg-nav-text); text-decoration: none; }
/* Regular weight on the current row too: the design system asks for medium,
   but its own font-normal outranks it in the generated CSS, so the Next.js
   pages draw 400 -- and the two halves should match. */
.shell-row.is-active {
  background: var(--ltg-nav-active); color: var(--ltg-nav-text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}
.shell-marker {
  position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px;
  border-radius: 0 4px 4px 0; background: var(--ltg-orange);
}
.shell-icon { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 100%; color: var(--ltg-nav-icon); }
.shell-row.is-active .shell-icon { color: var(--ltg-nav-text); }
.shell-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A count that needs attention, in the signal colour; zero shows nothing. */
.shell-badge {
  margin-left: auto; flex-shrink: 0; box-sizing: border-box; min-width: 20px;
  padding: 0 6px; border-radius: 999px; background: var(--ltg-orange);
  text-align: center; font-size: 11px; line-height: 20px; font-weight: 600; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums; color: var(--ltg-on-signal);
}
/* On the rail a dot says "something here"; the count is still in the name. */
.shell-dot {
  position: absolute; top: 8px; right: 8px; width: 8px; height: 8px;
  border-radius: 999px; background: var(--ltg-orange); box-shadow: 0 0 0 2px var(--ltg-nav);
}
.shell-bucket.dragging { opacity: 0.5; }

/* ---- Account area: pinned below the destinations ---- */
.shell-foot { flex-shrink: 0; margin-top: auto; padding-top: 8px; }
.shell-account { border-top: 1px solid var(--ltg-nav-divider); padding-top: 8px; }
.shell-acct { position: relative; }
.shell-nav .shell-chip {
  position: relative;
  display: flex; align-items: center;
  width: 100%; min-height: 48px; padding: 4px 4px 4px 0;
  border-radius: var(--ltg-radius-control); text-align: left;
  transition: background-color var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-nav .shell-chip:hover, .shell-nav .shell-chip[aria-expanded="true"] { background: var(--ltg-nav-hover); }
.shell-chip-cell { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 100%; }
.shell-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 999px;
  background: rgb(143 185 216 / 0.15); box-shadow: 0 0 0 1px rgb(143 185 216 / 0.3);
  font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: 0.025em;
  color: var(--ltg-nav-text);
}
.shell-chip-who { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.shell-chip-text { flex: 1 1 auto; min-width: 0; padding-left: 2px; line-height: 1.25; }
.shell-chip-name { display: block; overflow-wrap: break-word; font-size: 14px; line-height: 20px; color: var(--ltg-nav-text); }
.shell-chip-role { display: block; overflow-wrap: break-word; font-size: 12px; line-height: 18px; color: var(--ltg-nav-icon); }
.shell-chip-chev { display: grid; place-items: center; flex-shrink: 0; width: 28px; color: var(--ltg-nav-text-secondary); }

/* The account menu: above the chip, the sidebar's width less its padding. */
.shell-acct-menu {
  position: absolute; bottom: 100%; left: 0; z-index: 40;
  box-sizing: border-box; width: 240px; margin-bottom: 8px; padding: 6px;
  border: 1px solid var(--ltg-nav-divider); border-radius: var(--ltg-radius-card);
  background: var(--ltg-nav); box-shadow: var(--ltg-shadow-pop);
  color: var(--ltg-nav-text);
}
.shell-acct-menu[hidden] { display: none; }
.shell-acct-email {
  margin: 0; padding: 6px 8px 8px; overflow-wrap: break-word;
  font-size: 12px; line-height: 18px; color: var(--ltg-nav-text-secondary);
}
.shell-switch {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-bottom: 4px; padding: 2px;
  border-radius: var(--ltg-radius-control);
  background: rgb(255 255 255 / 0.06); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
}
.shell-nav .shell-switch button {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: var(--ltg-target-sm); padding: 0; border-radius: 6px;
  font-size: 12px; line-height: 18px; color: var(--ltg-nav-text-secondary);
  transition: color var(--ltg-dur-fast) var(--ltg-ease), background-color var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-nav .shell-switch button svg { flex-shrink: 0; color: var(--ltg-nav-icon); }
.shell-nav .shell-switch button:hover { color: var(--ltg-nav-text); }
.shell-nav .shell-switch button[aria-pressed="true"] {
  background: rgb(255 255 255 / 0.14); color: var(--ltg-nav-text); font-weight: 500;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
.shell-nav .shell-switch button[aria-pressed="true"] svg { color: inherit; }
.shell-acct-rule { margin: 6px 4px; border: 0; border-top: 1px solid var(--ltg-nav-divider); }
.shell-signout { margin: 0; }
.shell-nav .shell-menu-row {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  box-sizing: border-box; width: 100%; min-height: var(--ltg-nav-row); padding: 4px 8px;
  border-radius: var(--ltg-radius-control); text-align: left;
  font-size: 14px; line-height: 20px; color: var(--ltg-nav-text-secondary);
  transition: color var(--ltg-dur-fast) var(--ltg-ease), background-color var(--ltg-dur-fast) var(--ltg-ease);
}
.shell-nav .shell-menu-row:hover { background: var(--ltg-nav-hover); color: var(--ltg-nav-text); text-decoration: none; }
.shell-menu-icon { display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; color: var(--ltg-nav-icon); }
.shell-acct-version {
  margin: 0; padding: 8px 8px 4px;
  font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; color: var(--ltg-nav-icon);
}

/* The rail tip (RailTip), shared by every rail control and placed by
   base.html's script from the control's box. */
.shell-railtip {
  position: fixed; z-index: 40; visibility: hidden; pointer-events: none;
  transform: translateY(-50%); white-space: nowrap;
  padding: 6px 12px; border-radius: var(--ltg-radius-control);
  background: var(--ltg-surface); box-shadow: var(--ltg-shadow-pop);
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ltg-text);
}
.shell-railtip.is-shown { visibility: visible; }

@media (pointer: coarse) {
  .shell-row { height: var(--ltg-nav-row-touch); }
  .shell-heading-row { height: var(--ltg-nav-row-touch); }
  .shell-markcell, .shell-nav .shell-collapse { width: var(--ltg-nav-row-touch); height: var(--ltg-nav-row-touch); }
  .shell-nav .shell-switch button { height: var(--ltg-target); }
  .shell-nav .shell-menu-row { min-height: var(--ltg-nav-row-touch); }
}

/* ---- The rail (768px and up), with motion ---- */
.ltg-nav-fold { display: grid; grid-template-rows: 1fr; margin: var(--ltg-fold-mt, 0) 0 var(--ltg-fold-mb, 0); }
.ltg-nav-rule, .ltg-nav-dot { opacity: 0; }
@media (min-width: 48rem) {
  /* Collapsing: the labels fade at once and the column folds after 90ms.
     Expanding: the column opens, then the labels fade in from the top, 28ms
     apart. */
  .shell { transition: grid-template-columns var(--ltg-dur-sidebar) var(--ltg-ease-sidebar); }
  :root[data-sidebar="collapsed"] .shell { transition-delay: var(--ltg-nav-fold-delay); }
  .ltg-nav-fade {
    transition: opacity var(--ltg-dur-nav-fade) ease;
    transition-delay: calc(var(--ltg-nav-fade-in-delay) + min(var(--ltg-i, 0), 8) * var(--ltg-nav-stagger));
  }
  .shell-nav[data-rail] .ltg-nav-fade { transition-delay: 0s; }
  .ltg-nav-fold {
    transition:
      grid-template-rows var(--ltg-dur-sidebar) var(--ltg-ease-sidebar),
      margin var(--ltg-dur-sidebar) var(--ltg-ease-sidebar),
      opacity var(--ltg-dur-nav-fade) ease;
    transition-delay: var(--ltg-nav-fade-in-delay);
  }
  .shell-nav[data-rail] .ltg-nav-fold { transition-delay: 0s; }
  .ltg-nav-resize {
    transition:
      height var(--ltg-dur-sidebar) var(--ltg-ease-sidebar),
      margin var(--ltg-dur-sidebar) var(--ltg-ease-sidebar);
  }
  .ltg-nav-rule, .ltg-nav-dot { transition: opacity var(--ltg-dur-nav-fade) ease; }
  .shell-nav[data-rail] :is(.ltg-nav-rule, .ltg-nav-dot) { transition-delay: var(--ltg-nav-fold-delay); }
  .ltg-nav-collapse { transition: opacity var(--ltg-dur-nav-fade) ease var(--ltg-nav-fade-in-delay), visibility 0s; }
  .shell-nav[data-rail] .ltg-nav-collapse {
    transition: opacity var(--ltg-dur-nav-fade) ease 0s, visibility 0s linear var(--ltg-dur-nav-fade);
  }

  .shell-nav[data-rail] .ltg-nav-fold { grid-template-rows: 0fr; margin-block: 0; opacity: 0; }
  .shell-nav[data-rail] .ltg-nav-fade { opacity: 0; pointer-events: none; }
  .shell-nav[data-rail] .ltg-nav-rule { opacity: 0.8; }
  .shell-nav[data-rail] .ltg-nav-dot { opacity: 1; }
  .shell-nav[data-rail] .ltg-nav-collapse { opacity: 0; visibility: hidden; pointer-events: none; }

  /* The mark: home when open, Expand on the rail. */
  .shell-nav[data-rail] .shell-home { display: none; }
  .shell-nav[data-rail] .shell-expand { display: grid; }
  /* Headings shrink to a rule (none above the first group); the rail
     ignores folding. */
  .shell-nav[data-rail] .shell-heading-row { height: 16px; margin-bottom: 0; }
  .shell-nav[data-rail] .shell-heading-row.is-first { height: 0; }
  .shell-nav[data-rail] .shell-list[hidden] { display: flex; }
  /* Rows: the icon centred, the label faded with no width, the count's pill
     out of the row's flow from the same spot so the label isn't squeezed. */
  .shell-nav[data-rail] .shell-row { justify-content: center; padding-right: 0; }
  .shell-nav[data-rail] .shell-badge { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); }
  .shell-nav[data-rail] .shell-chip { justify-content: center; padding-right: 0; }
  .shell-nav[data-rail] .shell-chip-text { white-space: nowrap; }
  /* On the rail the menu opens to the chip's right. */
  .shell-nav[data-rail] .shell-acct-menu { bottom: 0; left: 100%; margin: 0 0 0 12px; }
}

/* ---- Below 768px: top bar and drawer ---- */
@media (max-width: 47.999rem) {
  .shell, :root[data-sidebar="collapsed"] .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .shell-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    box-sizing: content-box; height: var(--ltg-header);
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    color: var(--ltg-nav-text);
  }
  .shell-bar-id {
    display: flex; align-items: center; gap: 12px; min-width: 0;
    border-radius: var(--ltg-radius-control); color: inherit; text-decoration: none;
  }
  .shell-bar-id:hover { color: inherit; text-decoration: none; }
  .shell-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 24px; font-weight: 600; }
  .shell-menu {
    display: inline-flex; align-items: center; gap: 8px;
    height: var(--ltg-target); padding: 0 12px;
    border: 0; border-radius: var(--ltg-radius-control); background: none;
    font: inherit; font-size: 14px; line-height: 20px; font-weight: 500;
    color: inherit; cursor: pointer;
  }
  .shell-menu:hover { background: var(--ltg-nav-hover); }
  .shell-menu-shut { display: none; }
  .shell-drawer-open .shell-menu-open { display: none; }
  .shell-drawer-open .shell-menu-shut { display: inline; }

  .shell-nav {
    /* An explicit height, as the design system's drawer: with the desktop
       rule's align-self:start, top and bottom alone would size a fixed box
       to its content and push the account area off the screen. */
    position: fixed; top: 0; left: 0; z-index: 50;
    width: var(--ltg-sidebar); height: 100vh; height: 100dvh;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: var(--ltg-shadow-pop);
    /* Visibility flips at once on open, so the panel can take focus on the
       frame it opens, and waits out the slide on close. */
    visibility: hidden; transform: translateX(-100%);
    transition: transform var(--ltg-dur-overlay) var(--ltg-ease), visibility 0s linear var(--ltg-dur-overlay);
  }
  .shell-drawer-open .shell-nav {
    visibility: visible; transform: translateX(0);
    transition: transform var(--ltg-dur-overlay) var(--ltg-ease), visibility 0s;
  }
  .shell-drawer-open .shell-scrim { display: block; position: fixed; inset: 0; z-index: 30; background: var(--ltg-scrim); }
  :root.shell-drawer-open { overflow: hidden; }
  /* The drawer has no rail, so no collapse icon. */
  .shell-collapse-slot { display: none; }
  /* The account menu spans the drawer instead of overhanging it. */
  .shell-acct-menu { left: -8px; width: calc(100% + 1rem); }
}

/* ---- The working region: canvas, house padding, 1200px maximum ---- */
.shell-main.main-content {
  container-type: normal;
  width: auto; max-width: none; min-width: 0; margin: 0;
  padding: 24px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: var(--ltg-canvas);
  outline: none;
}
@media (min-width: 64rem) {
  .shell-main.main-content { padding: 32px 40px max(32px, env(safe-area-inset-bottom)); }
}
/* The page container is what page-width container queries measure. */
.shell-page { width: 100%; max-width: var(--ltg-content-max); margin: 0 auto; container-type: inline-size; container-name: page; }
.shell-page:has(.bucket-board) { max-width: 1600px; }
.shell-page h1 { font-weight: 600; letter-spacing: -0.025em; color: var(--ltg-heading); }

/* ---- Breadcrumb: ancestry, above the page title (PageHeader) ---- */
.shell-crumbs { margin-bottom: 12px; }
.shell-crumbs ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0; padding: 0; list-style: none;
  font-size: 13px; line-height: 18px; font-weight: 400;
  color: var(--ltg-text-secondary);
}
.shell-crumbs li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.shell-crumbs a { color: var(--ltg-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

@media (prefers-reduced-motion: reduce) {
  .shell, .shell *, .shell *::before, .shell *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
@media (forced-colors: active) {
  .shell-marker { background: Highlight !important; forced-color-adjust: none; }
}
