/* ════════════════════════════════════════════════════════════════════
   Layout fixes — optional per theme ("Layout fixes" under Admin → General
   → Themes → Edit). Never loaded for Standard, so Standard stays exactly
   as it is. Only spacing / alignment; no colours, no markup changes.
   Found by scanning every view for blocks that sit directly after one
   another without spacing, and for side-by-side cards that do not start
   at the same height.
   ════════════════════════════════════════════════════════════════════ */

/* 1. Side-by-side cards start at the same height.
      panel.css gives `.pn-card + .pn-card` a 16px top margin for stacked
      cards; inside a grid the gap already spaces them, so the second
      column started 16px lower (e.g. Admin → Status components). */
:is(.pn-grid, .pn-cols, .sz-grid, .sd-grid, .kb-two, .mw-grid, .ao-grid, .po-grid, .rv-grid, .bo-grid,
    .st-grid, .ex-skel-cols, .apd-intro, .bl-docs, .pp-top, .fq-layout, .cl-below, .sv-cards) > .pn-card + .pn-card { margin-top: 0; }

/* 2. Blocks that follow each other directly in a page get the same 16px
      rhythm as stacked cards (e.g. the Mode card and the incident grid on
      Admin → Status page touched). Zero specificity: any spacing a page
      sets itself still wins. */
:where(.pn-card, .pn-grid, .pn-cols, .kb-two, .sv-cards, .fq-layout, .pn-stack, .sz-grid, .sd-grid, .mw-grid)
  + :where(.pn-card, .pn-grid, .pn-cols, .kb-two, .sv-cards, .fq-layout, .pn-stack, .sz-grid, .sd-grid, .mw-grid, .pn-notice, .bl-paybar) { margin-top: 16px; }

/* 3. A help line right under a card. */
:where(.pn-card) + :where(.pn-desc, p.pn-muted) { margin-top: 10px; }

/* 4. A notice right before a card keeps the card rhythm instead of 10px
      (vertical margins collapse, so this is 16px, not 26px). */
:where(.pn-notice) + :where(.pn-card, .pn-grid) { margin-top: 16px; }
