/* Page templates (DESIGN_SYSTEM.md §4.3): Home and Detail use 8 + 4 columns from 1024; List and Form are one column.
   Plus the vertical rhythm every template shares (dw-stack, dw-section). Components layer so it wins over legacy rules. */
@layer components {
  .dw-stack { display: flex; flex-direction: column; gap: var(--dw-space-6); min-width: 0; }
  .dw-stack--sm { gap: var(--dw-space-3); }
  .dw-stack > .section, .dw-stack > .dw-section { margin-top: 0; } /* the stack owns the spacing */
  .dw-section { display: flex; flex-direction: column; gap: var(--dw-space-3); min-width: 0; margin-top: var(--dw-space-8); }
  .dw-section:first-child { margin-top: 0; }
  .dw-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--dw-space-2) var(--dw-space-4); }
  .dw-section__title { margin: 0; font: var(--dw-text-heading-md); color: var(--dw-color-text-primary); }
  .dw-section__meta { margin: 0; font: var(--dw-text-label); color: var(--dw-color-text-secondary); }
  .dw-meta-text { margin: 0; font: var(--dw-text-caption); color: var(--dw-color-text-secondary); }
  .dw-body-text { margin: 0; font: var(--dw-text-body); color: var(--dw-color-text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
  .dw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--dw-space-2); }
  .dw-actions--bottom { align-items: flex-end; }
  .dw-grid-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--dw-space-4); }
  /* Detail and Home: content + side panel (people, key dates, who can see) */
  .dw-layout-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--dw-space-6); align-items: start; }
  .dw-layout-split__main, .dw-layout-split__side { display: flex; flex-direction: column; gap: var(--dw-space-6); min-width: 0; }
  @media (min-width: 768px) { .dw-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .dw-layout-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
    .dw-layout-split__main .dw-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* a stat row in the 8-column side: 2 × 2 */
  /* Public pages outside the app shell (a signing link, a proposal): one centered column with the brand on top (D15) */
  .dw-public { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: var(--dw-space-6); padding: var(--dw-space-6) var(--dw-space-4); background: var(--dw-color-surface-page); }
  .dw-public__brand { display: flex; align-items: center; gap: var(--dw-space-2); font: var(--dw-text-heading-sm); color: var(--dw-color-text-primary); text-decoration: none; }
  .dw-public__main { width: 100%; max-width: var(--dw-container-dialog-lg); display: flex; flex-direction: column; gap: var(--dw-space-6); }
}
