/* =====================================================================
   MAXPOINT NOVA — Page composition overrides (V7)
   Loaded LAST (after shared pages/*.css) so Nova can re-compose any page
   without touching the neutral structural layer. Keyed by the SSR
   body[data-mx-page] attribute.
   ===================================================================== */

/* ---------------- dashboard: engine blocks get Nova surface rhythm ---------------- */
body[data-mx-page="dashboard"] .nv-compose { gap: 16px; }
body[data-mx-page="dashboard"] .nv-block--dominant .card { border-color: var(--nv-line-strong); box-shadow: var(--nv-e2); }
body[data-mx-page="dashboard"] .tabs { margin-top: 4px; }

/* ---------------- home: journey mount replaces hero cleanly ---------------- */
body[data-mx-page="home"] #mx-journey { padding-top: clamp(16px, 3vw, 30px); }
body[data-mx-page="home"] .nv-navbar { border-bottom: 1px solid transparent; }
body[data-mx-page="home"] .hero { padding-top: clamp(34px, 6vw, 70px); }

/* ---------------- store: denser product grid on wide screens ---------------- */
body[data-mx-page="store"] .exams-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
@media (min-width: 1440px) {
  body[data-mx-page="store"] .exams-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------- exam take: full-height app surface, dock lifted ---------------- */
body[data-mx-page="exam-take"] .nv-public > main,
body[data-mx-page="exam-take"] .nv-canvas { padding-bottom: 0; }
body[data-mx-page="exam-take"] .exam-shell { max-width: 860px; margin-inline: auto; }

/* ---------------- results: narrative column measure ---------------- */
body[data-mx-page="my-exam-result"] .nv-canvas > main > *,
body[data-mx-page="my-exam-result"] main > .page-fade { max-width: 940px; margin-inline: auto; }

/* ---------------- checkout: narrower commerce measure ---------------- */
body[data-mx-page="checkout"] .co-grid { max-width: 1040px; margin-inline: auto; }
body[data-mx-page="payment"] main > * { max-width: 560px; margin-inline: auto; }

/* ---------------- chat: two-pane on desktop ---------------- */
body[data-mx-page="support-room"] .chat-wrap { max-width: 820px; margin-inline: auto; }

/* ---------------- notifications: readable inbox width ---------------- */
body[data-mx-page="notifications"] .mx-notif { max-width: 860px; }

/* ---------------- profile: account center columns ---------------- */
body[data-mx-page="profile"] main > .page-fade > * { max-width: 980px; }

/* ---------------- admin: operating-environment density ---------------- */
body[data-role="admin"] .nv-canvas { padding-block: 14px 30px; }
/* mobile: the fixed dock still overlays admin pages — keep content clear */
@media (max-width: 767.98px) {
  body[data-role="admin"] .nv-canvas { padding-block: 14px calc(var(--nv-dock-h) + 26px); }
}
body[data-role="admin"] .card { padding: calc(14px * var(--nv-density)); }
body[data-role="admin"] .panel { padding: calc(14px * var(--nv-density)); }
body[data-role="admin"] .nv-pagehead__eyebrow { display: none; }

/* admin tables: crisp rows, hover-ready */
body[data-role="admin"] .table td { padding-block: calc(7px * var(--nv-density)); font-size: .78rem; }
body[data-role="admin"] .table th { padding-block: calc(8px * var(--nv-density)); }
body[data-role="admin"] .table-wrap { box-shadow: none; }

/* ---------------- 320–430px: mobile architecture guards ---------------- */
@media (max-width: 430px) {
  .nv-block--dominant .btn { min-height: 46px; }
  .nv-strip__actions .btn { flex: 1; justify-content: center; }
  .nv-hero-block .nv-between { flex-direction: column; align-items: stretch; }
  .nv-hero-block .nv-between .btn { width: 100%; }
  body[data-mx-page="store"] .exams-grid { grid-template-columns: 1fr; }
}
