/* ==========================================================================
   Layout primitives — Page owns width, gutters and vertical rhythm.
   Pages and components never set their own outer width or margins.
   ========================================================================== */

.ui-page {
  width: 100%;
  max-width: calc(var(--page-max) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding: var(--space-8) var(--page-gutter) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.ui-page--wide {
  max-width: none;
}

.ui-page--narrow {
  max-width: calc(var(--page-max-narrow) + 2 * var(--page-gutter));
}

/* Children of a page shrink with it; nothing pushes the page wider. */
.ui-page > * {
  min-width: 0;
}

/* ── Section: a titled region of a page; header, then content ───────── */
.ui-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

/* ── Page header: the page's title block, not a card ─────────────────── */
.ui-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}

.ui-page-header__text {
  flex: 1 1 36ch;
  min-width: 0;
  display: grid;
  gap: var(--space-2);
}

.ui-page-header__title {
  font-size: var(--text-24);
  overflow-wrap: anywhere;
}

.ui-page-header__description {
  max-width: var(--prose-max);
  color: var(--text-dim);
  font-size: var(--text-14);
  line-height: var(--leading-normal);
}

/* Live status under the description ("● Healthy"). */
.ui-page-header__meta {
  margin-top: var(--space-1);
}

.ui-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
