/* Matrix Rewards product site — House of Matrix.
   Tokens are the parent site's (mhg-tokens.css in the matrix-health-group theme); the components are the
   fluid versions of direction B's mockup (docs/mockups/matrix-rewards-site/DirectionB.dc.html).
   Reference these variables from every page; never hard-code a colour twice. */

/* Self-hosted (website/tools/fetch-fonts.py; SIL OFL 1.1, see src/fonts/LICENCE.md). No request leaves the
   site for a font: no fonts.googleapis.com, no fonts.gstatic.com. font-display: swap so text paints at once. */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/playfair-display-500.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/playfair-display-600.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/playfair-display-700.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 500; font-display: swap; src: url("/fonts/playfair-display-500-italic.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-600.woff2") format("woff2"); }

:root {
  --mr-teal: #1a5c5c;
  --mr-teal-dark: #144848;
  --mr-charcoal: #2d2d2d;
  --mr-grey: #444444;
  --mr-white: #ffffff;
  --mr-off-white: #f8f7f4;
  --mr-gold: #c9a84c;
  --mr-gold-ink: #7a5e24;          /* gold as text on light ground, 5.8:1 */
  --mr-footer: #1a1a1a;
  --mr-border: #e8e6e0;
  --mr-rule: rgba(56, 48, 34, .18);
  --mr-rule-soft: rgba(56, 48, 34, .09);
  --mr-on-dark: #ffffff;
  --mr-on-dark-muted: #d9d6cf;
  --mr-app-black: #14171a;         /* the App Store icon's ground */
  --mr-app-gold: #e8b44a;          /* the App Store icon's gold */
  /* The developer docs' code and notes: monochrome, so contrast holds by construction. docs_build.py reads these
     four and fails the build under 4.5:1 (WCAG 1.4.3), measured, not assumed. */
  --mr-code-ink: #2d2d2d;
  --mr-code-bg: #ffffff;
  --mr-note-ink: #3a3a3a;
  --mr-note-bg: #f1efe9;
  --mr-font-heading: "Playfair Display", Georgia, serif;
  --mr-font-body: Inter, Helvetica, Arial, sans-serif;
  --mr-radius-sm: 4px;
  --mr-radius-md: 8px;
  --mr-radius-lg: 10px;
  --mr-container: 1200px;
  --mr-header-h: 86px;
  --mr-section: clamp(56px, 8vw, 112px);
  --mr-ease: .18s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--mr-off-white); color: var(--mr-grey);
  font-family: var(--mr-font-body); font-size: 17px; line-height: 1.75; -webkit-font-smoothing: antialiased;
}
@media (max-width: 700px) { body { font-size: 16px; line-height: 1.7; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mr-teal); text-underline-offset: .2em; }
a:hover { color: var(--mr-teal-dark); }
:focus-visible { outline: 2px solid var(--mr-teal); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--mr-font-heading); color: var(--mr-charcoal); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
strong { font-weight: 600; color: var(--mr-charcoal); }
.mr-skip { position: absolute; left: -999px; top: 8px; background: var(--mr-white); padding: 8px 12px; border-radius: 4px; z-index: 100; }
.mr-skip:focus { left: 16px; }

/* layout */
.mr-wrap { width: 100%; max-width: var(--mr-container); margin-inline: auto; padding-inline: 20px; }
.mr-section { padding-block: var(--mr-section); }
.mr-section-tight { padding-block: clamp(36px, 5vw, 64px); }
.mr-band-white { background: var(--mr-white); border-top: 1px solid var(--mr-border); border-bottom: 1px solid var(--mr-border); }
.mr-band-dark { background: var(--mr-footer); color: var(--mr-on-dark-muted); }
.mr-band-dark h1, .mr-band-dark h2, .mr-band-dark h3 { color: var(--mr-on-dark); }
.mr-band-dark strong { color: var(--mr-on-dark); }
.mr-band-dark a { color: var(--mr-on-dark); }
.mr-stack { display: flex; flex-direction: column; gap: 24px; }
.mr-stack-sm { display: flex; flex-direction: column; gap: 12px; }
.mr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.mr-grid { display: grid; gap: 24px; }
.mr-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mr-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mr-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mr-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.mr-split-reverse > :first-child { order: 2; }
@media (max-width: 1000px) { .mr-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mr-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .mr-split { grid-template-columns: minmax(0, 1fr); } .mr-split-reverse > :first-child { order: 0; } .mr-cols-3, .mr-cols-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .mr-cols-4 { grid-template-columns: minmax(0, 1fr); } }

/* type */
.mr-eyebrow { display: inline-flex; align-items: center; gap: 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; color: var(--mr-teal); font-weight: 600; }
.mr-eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--mr-gold); flex: 0 0 auto; }
.mr-band-dark .mr-eyebrow { color: var(--mr-gold); }
.mr-h1 { font-size: clamp(2.35rem, 1.4rem + 4vw, 3.2rem); }
.mr-h2 { font-size: clamp(1.75rem, 1.25rem + 2.1vw, 2.4rem); }
.mr-h3 { font-size: 1.35rem; line-height: 1.3; }
.mr-h4 { font-family: var(--mr-font-body); font-size: 1.05rem; font-weight: 600; color: var(--mr-charcoal); }
.mr-lede { font-size: 1.15rem; line-height: 1.65; max-width: 46ch; text-wrap: pretty; }
.mr-measure { max-width: 58ch; text-wrap: pretty; }
.mr-muted { color: #6b665c; }
.mr-band-dark .mr-muted { color: var(--mr-on-dark-muted); }
.mr-small { font-size: .95rem; }
.mr-num { font-variant-numeric: tabular-nums; }
.mr-serif-line { font-family: var(--mr-font-heading); font-size: 1.35rem; color: var(--mr-charcoal); }
.mr-band-dark .mr-serif-line { color: var(--mr-on-dark); }
.mr-hairline { border: 0; border-top: 1px solid var(--mr-rule); margin: 0; }
.mr-band-dark .mr-hairline { border-top-color: rgba(255,255,255,.12); }

/* buttons */
.mr-btn, .mr-btn-ghost, .mr-btn-light {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 26px;
  border-radius: var(--mr-radius-sm); font-family: var(--mr-font-body); font-size: 1rem; font-weight: 600; text-decoration: none;
  white-space: nowrap; cursor: pointer; transition: background var(--mr-ease), color var(--mr-ease), border-color var(--mr-ease);
}
.mr-btn { background: var(--mr-teal); color: var(--mr-white); border: 1px solid var(--mr-teal); }
.mr-btn:hover { background: var(--mr-teal-dark); border-color: var(--mr-teal-dark); color: var(--mr-white); }
.mr-btn-ghost { background: transparent; color: var(--mr-teal); border: 1px solid var(--mr-rule); }
.mr-btn-ghost:hover { border-color: var(--mr-teal); color: var(--mr-teal-dark); }
.mr-btn-light { background: var(--mr-white); color: var(--mr-charcoal); border: 1px solid var(--mr-white); }
.mr-btn-light:hover { background: var(--mr-off-white); color: var(--mr-charcoal); }
.mr-band-dark .mr-btn-ghost { color: var(--mr-on-dark); border-color: rgba(255,255,255,.35); }
.mr-band-dark .mr-btn-ghost:hover { border-color: var(--mr-on-dark); color: var(--mr-on-dark); }
@media (max-width: 480px) { .mr-btn, .mr-btn-ghost, .mr-btn-light { width: 100%; } }

/* header */
.mr-header { position: sticky; top: 0; z-index: 50; background: var(--mr-white); border-bottom: 1px solid var(--mr-border); }
.mr-header .mr-wrap { min-height: var(--mr-header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.mr-lockup { display: flex; align-items: center; gap: 14px; text-decoration: none; min-height: 44px; }
.mr-lockup img { width: 46px; height: 46px; }
.mr-lockup-words { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.mr-lockup-name { font-family: var(--mr-font-heading); font-size: 25px; font-weight: 500; letter-spacing: .10em; color: var(--mr-charcoal); text-transform: uppercase; }
.mr-lockup-sub { font-size: 11px; font-weight: 500; letter-spacing: .30em; color: var(--mr-teal); text-transform: uppercase; }
.mr-lockup-dark .mr-lockup-name { color: var(--mr-on-dark); }
.mr-lockup-dark .mr-lockup-sub { color: var(--mr-gold); }
.mr-nav { display: flex; align-items: center; gap: 4px; }
.mr-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--mr-charcoal); text-decoration: none; font-size: 1rem; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.mr-nav a:hover { color: var(--mr-teal); }
.mr-nav a[aria-current="page"] { color: var(--mr-teal); border-bottom-color: var(--mr-gold); }
.mr-header-actions { display: flex; align-items: center; gap: 10px; }
.mr-nav .mr-nav-signin { display: none; }
[id] { scroll-margin-top: calc(var(--mr-header-h) + 16px); }
@media (max-width: 640px) { :root { --mr-header-h: 72px; } }
.mr-menu-btn { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--mr-border); border-radius: var(--mr-radius-sm); background: var(--mr-white); color: var(--mr-charcoal); cursor: pointer; }
/* The full row (lockup + 7 links + two buttons) needs about 1200px at 1rem; below that, the menu button. */
@media (max-width: 1240px) {
  .mr-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--mr-white); border-bottom: 1px solid var(--mr-border); flex-direction: column; align-items: stretch; padding: 8px 20px 16px; gap: 0; }
  .mr-nav.is-open { display: flex; }
  .mr-nav a { min-height: 48px; border-bottom: 1px solid var(--mr-rule-soft); }
  .mr-nav a[aria-current="page"] { border-bottom-color: var(--mr-gold); }
  .mr-menu-btn { display: inline-flex; }
  .mr-header-actions .mr-btn-ghost { display: none; }
  .mr-nav .mr-nav-signin { display: inline-flex; }
}
@media (max-width: 640px) {
  .mr-lockup img { width: 38px; height: 38px; }
  .mr-lockup-name { font-size: 20px; }
  .mr-lockup-sub { font-size: 9.5px; }
  .mr-header .mr-wrap { min-height: 72px; }
  .mr-header-actions .mr-btn { min-height: 44px; padding: 0 16px; font-size: .95rem; width: auto; }
}
/* A REAL PHONE WIDTH. Measured at 390 CSS pixels for the first time on 25 Sep 2026 (render.py used to measure at
   500, the narrowest window headless Chrome allows): the call to action ran over the lockup and cut "MATRIX" to
   "MATRI". Below 440px the button's words may take two lines, so the lockup keeps its room. */
@media (max-width: 440px) {
  .mr-header .mr-wrap { gap: 12px; }
  .mr-header-actions { gap: 8px; }
  .mr-header-actions .mr-btn { white-space: normal; text-align: center; line-height: 1.15; max-width: 136px; padding: 4px 12px; font-size: .88rem; }
}

/* cards, tags, notes, tables, figures */
.mr-card { background: var(--mr-white); border: 1px solid var(--mr-border); border-radius: var(--mr-radius-lg); }
.mr-card-pad { padding: clamp(20px, 3vw, 32px); }
.mr-card-dark { background: var(--mr-charcoal); color: var(--mr-on-dark-muted); border-color: var(--mr-charcoal); }
.mr-card-dark h3, .mr-card-dark strong { color: var(--mr-on-dark); }
.mr-icon { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: 0 0 auto; }
.mr-icon-teal { color: var(--mr-teal); display: inline-flex; }
.mr-icon-gold { color: var(--mr-gold); display: inline-flex; }
.mr-check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.mr-check-list li { display: flex; gap: 12px; align-items: flex-start; }
.mr-check-list li .mr-icon { margin-top: 4px; width: 20px; height: 20px; }
.mr-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 4px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mr-tag-planned { color: var(--mr-gold-ink); border: 1px solid var(--mr-gold); }
.mr-tag-held { color: var(--mr-gold-ink); border: 1px dashed var(--mr-gold); }
.mr-tag-running { color: #2e7d46; background: #e4f3ea; }
.mr-band-dark .mr-tag-planned, .mr-band-dark .mr-tag-held { color: var(--mr-gold); }
.mr-note-held { border: 1px dashed var(--mr-gold); border-radius: var(--mr-radius-md); padding: 14px 18px; font-size: .95rem; color: var(--mr-gold-ink); background: rgba(201,168,76,.06); display: flex; gap: 12px; align-items: flex-start; }
.mr-band-dark .mr-note-held { color: var(--mr-gold); background: rgba(201,168,76,.08); }
.mr-numeral { width: 40px; height: 40px; border-radius: var(--mr-radius-sm); background: var(--mr-charcoal); color: var(--mr-gold); font-family: var(--mr-font-heading); font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mr-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mr-table th, .mr-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--mr-rule-soft); vertical-align: top; }
.mr-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #6b665c; font-weight: 600; }
.mr-table td.mr-right, .mr-table th.mr-right { text-align: right; }
.mr-table-wrap { overflow-x: auto; }
.mr-shot { border: 1px solid var(--mr-border); border-radius: var(--mr-radius-md); box-shadow: 0 18px 40px -24px rgba(31,29,25,.35); background: var(--mr-white); }
.mr-shot-card { background: var(--mr-white); border: 1px solid var(--mr-border); border-radius: var(--mr-radius-lg); padding: 12px; box-shadow: 0 24px 48px -28px rgba(31,29,25,.35); }
.mr-shot-card img { border-radius: 6px; }
.mr-caption { font-size: .95rem; color: #6b665c; text-align: center; margin-top: 12px; }
.mr-photo { border-radius: var(--mr-radius-lg); object-fit: cover; width: 100%; aspect-ratio: 3 / 2; }
.mr-prose { max-width: 46rem; }
.mr-prose h1 { font-size: clamp(2rem, 1.3rem + 2.5vw, 2.6rem); margin-bottom: 1.25rem; }
.mr-prose h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; }
.mr-prose h3 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; font-family: var(--mr-font-body); font-weight: 600; }
.mr-prose p, .mr-prose li { margin: 0 0 .85rem; }
.mr-prose ul, .mr-prose ol { padding-left: 1.25rem; }
.mr-prose hr { border: 0; border-top: 1px solid var(--mr-rule); margin: 2.5rem 0; }
.mr-prose code { font-size: .9em; background: rgba(56,48,34,.08); padding: .1em .35em; border-radius: 3px; }
.mr-prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.25rem; font-size: .95em; }
.mr-prose th, .mr-prose td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--mr-rule-soft); vertical-align: top; }
.mr-prose th { font-weight: 600; }
/* A policy table's longest word set the page 2px wider than a 390px phone (the first true-390 render, 25 Sep 2026). */
.mr-prose th, .mr-prose td { overflow-wrap: anywhere; }
.mr-prose-meta { font-size: .95rem; color: #6b665c; margin-bottom: 2rem; }

/* forms */
.mr-field { display: flex; flex-direction: column; gap: 6px; }
.mr-field label { font-size: .95rem; font-weight: 600; color: var(--mr-charcoal); }
.mr-field input, .mr-field textarea, .mr-field select { font: inherit; font-size: 1rem; color: var(--mr-charcoal); background: var(--mr-white); border: 1px solid var(--mr-border); border-radius: var(--mr-radius-sm); padding: 12px 14px; min-height: 48px; width: 100%; }
.mr-field textarea { min-height: 160px; resize: vertical; }
.mr-field input:focus, .mr-field textarea:focus, .mr-field select:focus { border-color: var(--mr-teal); outline: 2px solid rgba(26,92,92,.25); outline-offset: 0; }

/* previews of planned screens (the hub mockups, scaled to fit) */
.mr-preview { position: relative; overflow: hidden; background: var(--mr-white); border: 1px solid var(--mr-border); border-radius: var(--mr-radius-md); box-shadow: 0 18px 40px -24px rgba(31,29,25,.35); }
.mr-preview iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; pointer-events: none; } /* a picture of a screen: the page promises nothing in it is clickable */

/* footer */
.mr-footer { background: var(--mr-footer); color: var(--mr-on-dark-muted); padding: 72px 0 40px; }
.mr-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 48px; align-items: start; }
@media (max-width: 1000px) { .mr-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; } }
@media (max-width: 600px) { .mr-footer-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } .mr-footer { padding: 48px 0 32px; } }
.mr-footer-heading { font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; color: var(--mr-gold); font-weight: 600; }
.mr-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--mr-on-dark-muted); text-decoration: none; font-size: 1rem; }
.mr-footer a:hover { color: var(--mr-on-dark); }
.mr-footer-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.mr-footer-logo { display: inline-flex; align-items: center; }   /* no white plate: the mark carries its own transparency */
/* The parent-company mark in the footer: the monogram, transparent, so nothing paints a white slab behind it
   on the dark footer. Sized by height and linked to the parent site, the way totally-numb.com does it. */
.mr-footer-logo img { height: 30px; width: auto; }
.mr-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px; margin-top: 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: .95rem; }
.mr-footer address { font-style: normal; line-height: 1.7; }

/* A <picture> is only a wrapper for the WebP the build adds: it must not become a layout box of its own.
   BUT `display: contents` dissolves the wrapper and promotes EVERY child into the parent's layout — the
   <source> elements as well as the <img>. In a grid that expects two items the extra one shifts everything:
   on 18 Sep 2026 the home page's "Linking does not move the money" block rendered as a 96px column of text
   because of it. The UA stylesheet's display:none on <source> does not survive the promotion, so it is said
   here explicitly. Measured before and after, not reasoned about. */
picture { display: contents; }
picture > source { display: none; }
/* The dated line the build writes under every page (SEO plan §5.3). */
.mr-updated { margin: 0; padding: 0 0 40px; background: var(--mr-off-white); color: var(--mr-grey); font-size: .85rem; }
.mr-updated .mr-wrap { display: block; opacity: .75; }

/* The liftable answer paragraph under an H1 or a question H2 (SEO plan §5.2): plain body text, a little
   larger, with a gold rule so it reads as the answer without becoming a pull quote. */
.mr-answer { max-width: 58ch; text-wrap: pretty; border-left: 2px solid var(--mr-gold); padding-left: 18px; }
.mr-band-dark .mr-answer { border-left-color: var(--mr-gold); }
/* The Help hub's list of guides. */
.mr-guide-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; }
.mr-guide-list li { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--mr-rule); }
.mr-guide-list a { font-family: var(--mr-font-heading); font-size: 1.2rem; color: var(--mr-charcoal); text-decoration: none; }
.mr-guide-list a:hover { color: var(--mr-teal); text-decoration: underline; }
@media (max-width: 800px) { .mr-guide-list { grid-template-columns: minmax(0, 1fr); } }

/* The "not installable yet" bar. Shown only while the App Store listing is in review — build.py owns it, so
   it cannot be left up by accident after approval. Above the sticky header, so it scrolls away. */
.mr-status { background: var(--mr-charcoal); color: var(--mr-on-dark); font-size: .95rem; padding: 10px 0; }
.mr-status .mr-wrap { display: block; }
.mr-status strong { color: var(--mr-on-dark); }
.mr-status a { color: var(--mr-on-dark); text-decoration: underline; }

/* CARDS IN A ROW LINE UP. Two cards side by side rarely carry the same length of text, so everything after
   the body — the small print and the buttons — drifted to a different height in each one (seen on /sign-in,
   16 Sep 2026). The body is the part that varies, so the tail of the card is pushed to its foot as one
   group: the buttons sit on the same line across the row, and the note sits directly above them.
   Applies to any card that is a direct child of a grid; a card standing alone has no free space to push
   into, so the rule costs it nothing. */
.mr-grid > .mr-card { display: flex; flex-direction: column; height: 100%; }
.mr-grid > .mr-card > .mr-row:last-child,
.mr-grid > .mr-card > .mr-card-actions:last-child { margin-top: auto; }
/* When a note sits between the body and the buttons, the pair moves together rather than the note staying
   put and the buttons dropping away from it. */
.mr-grid > .mr-card > :nth-last-child(2) + .mr-row:last-child,
.mr-grid > .mr-card > :nth-last-child(2) + .mr-card-actions:last-child { margin-top: 0; }
.mr-grid > .mr-card > p:nth-last-child(2),
.mr-grid > .mr-card > .mr-small:nth-last-child(2),
.mr-grid > .mr-card > ul:nth-last-child(2) { margin-top: auto; }

/* THE DEVELOPER DOCS (/docs, built by docs_build.py). A sidebar beside the article on a wide screen; at 900px and
   below the sidebar goes and the same list is a <details> menu above the article — no JavaScript either way. Both
   lists are in the page and only one is ever displayed, so a screen reader meets one. */
.mr-docs { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-areas: "nav main"; gap: clamp(32px, 4vw, 64px); align-items: start; }
.mr-docs-nav { grid-area: nav; position: sticky; top: calc(var(--mr-header-h) + 24px); max-height: calc(100vh - var(--mr-header-h) - 48px); overflow-y: auto; font-size: .95rem; padding-bottom: 24px; }
.mr-docs-article { grid-area: main; min-width: 0; max-width: 50rem; }
.mr-docs-menu { display: none; grid-area: menu; border: 1px solid var(--mr-border); border-radius: var(--mr-radius-md); background: var(--mr-white); }
.mr-docs-menu summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 0 16px; font-weight: 600; color: var(--mr-charcoal); }
.mr-docs-menu nav { padding: 0 16px 12px; }
.mr-docs-nav-heading { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--mr-teal); font-weight: 600; margin: 18px 0 6px; }
.mr-docs-nav-heading:first-child { margin-top: 0; }
.mr-docs-nav ul, .mr-docs-menu ul { list-style: none; margin: 0; padding: 0; }
.mr-docs-nav a, .mr-docs-menu a { display: flex; align-items: center; min-height: 36px; padding: 2px 10px; border-left: 2px solid transparent; color: var(--mr-charcoal); text-decoration: none; line-height: 1.35; }
.mr-docs-nav a:hover, .mr-docs-menu a:hover { color: var(--mr-teal); }
.mr-docs-nav a[aria-current="page"], .mr-docs-menu a[aria-current="page"] { border-left-color: var(--mr-gold); color: var(--mr-teal); font-weight: 600; }
@media (max-width: 900px) {
  .mr-docs { grid-template-columns: minmax(0, 1fr); grid-template-areas: "menu" "main"; gap: 24px; }
  .mr-docs-nav { display: none; }
  .mr-docs-menu { display: block; }
  .mr-docs-menu a { min-height: 44px; }
}
.mr-docs-article h1 code, .mr-docs-article h2 code { font-size: .85em; }
/* A heading can hold a path from the contract (webhook.test's "sent only by POST /webhooks/{endpoint_id}/test"),
   which has no place to break at 1.5rem: at 320px, WCAG 1.4.10's reflow width, the page scrolled sideways. */
.mr-docs-article h1, .mr-docs-article h2, .mr-docs-article h3 { overflow-wrap: anywhere; }
.mr-docs-article code { overflow-wrap: anywhere; color: var(--mr-code-ink); }
.mr-docs-article pre { margin: 0 0 1.25rem; padding: 14px 16px; overflow-x: auto; background: var(--mr-code-bg); color: var(--mr-code-ink); border: 1px solid var(--mr-border); border-radius: var(--mr-radius-md); font-size: .85rem; line-height: 1.55; }
.mr-docs-article pre code { background: none; padding: 0; overflow-wrap: normal; white-space: pre; font-size: inherit; }
.mr-docs-article pre:focus-visible { outline: 2px solid var(--mr-teal); outline-offset: 2px; }
.mr-docs-article .mr-table-wrap { margin: 0 0 1.25rem; border: 1px solid var(--mr-border); border-radius: var(--mr-radius-md); background: var(--mr-white); }
.mr-docs-article table.mr-table { margin: 0; font-size: .9rem; }
.mr-docs-article .mr-table th, .mr-docs-article .mr-table td { padding: 10px 12px; }
/* Not the policy tables' "anywhere" (above): that lets a column shrink to one character, and a status of 401
   came out as "40" over "1". A reference table's cells break at spaces; only a long name is broken. */
.mr-docs-article .mr-table th, .mr-docs-article .mr-table td { overflow-wrap: break-word; }
.mr-docs-article .mr-table th { white-space: nowrap; }
.mr-docs-article .mr-table td code { overflow-wrap: normal; }
/* ...except a long one in a description, such as a whole URL, which would push the table past its box. */
.mr-docs-article .mr-table td:last-child code { overflow-wrap: anywhere; }
.mr-docs-article .mr-table td:first-child code { white-space: nowrap; }
.mr-docs-article li li { margin-bottom: .3rem; }
.mr-docs-article li > ul { margin-top: .35rem; }
/* ON A PHONE, A ROW IS A CARD. Four or five columns cannot share 350 pixels, so below 640px each row stacks: the
   first cell as its heading, then each other cell with its column's name before it (data-label, written by
   docs_build.py). The header row is kept for screen readers, which also keep the table's roles (set explicitly). */
@media (max-width: 640px) {
  .mr-docs-article .mr-table, .mr-docs-article .mr-table tbody, .mr-docs-article .mr-table tr, .mr-docs-article .mr-table td { display: block; width: 100%; }
  .mr-docs-article .mr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mr-docs-article .mr-table tr { padding: 10px 0; border-bottom: 1px solid var(--mr-rule-soft); }
  .mr-docs-article .mr-table tr:last-child { border-bottom: 0; }
  .mr-docs-article .mr-table td { border: 0; padding: 2px 14px; }
  .mr-docs-article .mr-table td:first-child { padding-bottom: 4px; font-weight: 600; }
  .mr-docs-article .mr-table td:first-child code { white-space: normal; overflow-wrap: anywhere; }
  .mr-docs-article .mr-table td:not(:first-child)::before { content: attr(data-label) ": "; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #6b665c; font-weight: 600; }
  .mr-docs-article .mr-table td code { overflow-wrap: anywhere; }
  .mr-docs-article .mr-table td.mr-empty { display: none; }
}
.mr-note { margin: 0 0 1.25rem; padding: 14px 18px; border-left: 3px solid var(--mr-gold); background: var(--mr-note-bg); color: var(--mr-note-ink); border-radius: 0 var(--mr-radius-md) var(--mr-radius-md) 0; }
.mr-note p:last-child { margin-bottom: 0; }
.mr-docs-foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--mr-rule); font-size: .9rem; color: #5f5a51; }
.mr-docs-foot p { margin: 0 0 .4rem; }
.mr-docs-foot a, .mr-docs-article p a, .mr-docs-article li a { overflow-wrap: anywhere; }
