/*
 * App shell: the sidebar beside a column holding the header bar and the page.
 *   <div class="lv-app">
 *     <aside class="lv-sidebar" id="sidebar">…</aside>
 *     <div class="lv-app__scrim" data-action="close-sidebar"></div>   ← phone drawer backdrop, after the sidebar
 *     <div class="lv-app__main">
 *       <header class="lv-header">…</header>
 *       <main class="lv-app__content" id="main-content" tabindex="-1">…</main>
 *     </div>
 *   </div>
 * The sidebar sets its own width (expanded or collapsed), so the grid's first column is `auto`.
 * Loading: aria-busy="true" on lv-app__content dims the page only after 150 ms, so quick switches never flicker.
 */
@layer components {
  .lv-app { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100dvh; background: var(--surface-page); }
  .lv-app__main { display: flex; flex-direction: column; min-width: 0; }
  .lv-app__content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: var(--space-6) var(--space-8) var(--space-12); }
  .lv-app__content:focus { outline: none; }
  .lv-app__content[aria-busy="true"] { opacity: .68; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-out) 150ms; }
  .lv-app__scrim { display: none; }
  @media (max-width: 900px) { .lv-app__content { padding: var(--space-5) var(--space-5) var(--space-10); } }
  /* Phones: the sidebar becomes a drawer over the page, so the page gets the full width. */
  @media (max-width: 760px) {
    .lv-app { grid-template-columns: minmax(0, 1fr); }
    .lv-app__content { padding: var(--space-4) var(--space-4) var(--space-10); }
    .lv-sidebar[data-open] ~ .lv-app__scrim { display: block; position: fixed; inset: 0; z-index: 49; background: var(--scrim); }
  }
}
