/* Pages (brief 6, 7.16, 7.17, 7.20): how each page sets its parts. Only the arrangement lives here; every part keeps
   its own look from its stylesheet. Every value is named in tokens.css. */

.mg-page { display: grid; }
.mg-page > * { min-inline-size: 0; }
/* a narrow page (the approval screen) keeps a reading measure, in the middle of the main column on a wide screen so
   that no side of the page stands empty (7.22) */
.mg-page--narrow, .mg-page-wait--narrow { max-inline-size: var(--text-max); margin-inline: auto; }
/* loading, the way back sits where the narrow page's head puts it: its gap is the head's own padding */
.mg-page-wait.mg-page-wait--narrow { gap: var(--s2); }
.mg-sec__label { color: var(--ink-2); font: var(--type-eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; }

/* a sub-page's head: the way back, what it is, its name and one line of facts */
.mg-page-head { display: grid; justify-items: start; gap: var(--s1); max-inline-size: var(--text-max); padding-block-end: var(--s4); }
.mg-back { margin-block-end: var(--s1); color: var(--ink-2); font: var(--type-label-quiet); text-decoration: none; }
.mg-back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: var(--s-half); }
.mg-back:active { text-decoration: underline var(--focus-w); text-underline-offset: var(--s-half); }
.mg-page-head__title { font: var(--type-heading); letter-spacing: var(--track-heading); text-wrap: balance; }
.mg-page-head__meta { color: var(--ink-2); font: var(--type-body-s); }

/* facts as name and value, two columns of rows */
.mg-about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); margin: 0; }
.mg-about__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2);
  padding-block: var(--s-tight); border-block-end: var(--hairline) solid var(--line); }
.mg-about__row dt { color: var(--ink-2); font: var(--type-body-s); }
.mg-about__row dd { margin: 0; font: var(--type-label); font-variant-numeric: tabular-nums; text-align: end; }
/* names with their sentences (Data and method's labels and terms): the name in its column, the sentence read as text */
.mg-meanings { display: grid; margin: 0; }
.mg-meanings__row { display: grid; grid-template-columns: var(--meaning-name-w) minmax(0, 1fr); gap: var(--s3);
  padding-block: var(--s-tight); border-block-end: var(--hairline) solid var(--line); }
.mg-meanings__row:last-child { border-block-end: 0; }
.mg-meanings__row dt { font: var(--type-label); }
.mg-meanings__row dd { margin: 0; color: var(--ink-2); font: var(--type-body-s); text-wrap: pretty; }

/* the approval screen: the box, tighter than elsewhere so that its buttons show on the first screen; then the steps
   Megovia takes in Klaviyo, folded */
.mg-page--narrow > .mg-page-head { padding-block-end: var(--s2); }
/* the change table as on Today's card, a little apart from the box's title; its facts end their lines evenly */
.mg-page--narrow .mg-approve__body > .mg-changes-table { margin-block-start: var(--s1); }
.mg-approve .mg-ask__fact dd { text-wrap: pretty; }
.mg-detail { display: grid; justify-items: start; gap: var(--s1); padding-block-start: var(--s4); }
.mg-fold { display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s-half) 0; border: 0; background: none;
  color: var(--ink-2); font: var(--type-label-quiet); cursor: pointer; }
/* the chevron's stroke, not its box, on the column's edge (closed or open, within 2 px) */
.mg-fold .mg-icon { margin-inline-start: calc(-1 * var(--s-three-quarter)); transform: rotate(var(--turn-closed));
  transition: transform var(--dur) var(--ease); }
.mg-fold[aria-expanded="true"] .mg-icon { transform: none; }
.mg-fold:hover { color: var(--ink); text-decoration: underline; text-underline-offset: var(--s-half); }
.mg-fold:active { text-decoration: underline var(--focus-w); text-underline-offset: var(--s-half); }
.mg-steps-list { display: grid; gap: var(--s1); margin: 0; padding-inline-start: var(--s3); color: var(--ink-2); font: var(--type-body-s);
  list-style: decimal; }


/* loading: the head's lines, and each section's block at the size of what comes (7.19); the way back, outside the
   busy region, keeps the place it has in the head */
.mg-page-head--loading { gap: var(--s1); }
.mg-page-wait { display: grid; justify-items: start; gap: var(--s1); }
.mg-page-wait > .mg-page { justify-self: stretch; }
.mg-skel--ask { block-size: var(--skel-ask); }
.mg-skel--waiting { block-size: var(--skel-waiting); }
/* the summary card's block keeps its graphite-line edge, as the card does: graphite-2 alone is lost on the dark page */
.mg-skel--face { block-size: var(--skel-face); border: var(--hairline) solid var(--graphite-line); background: var(--graphite-2); }
.mg-skel--face::after { background: var(--shimmer-band-hero); }
.mg-skel--runs { block-size: var(--skel-runs); }
.mg-skel--alerts { block-size: var(--skel-alerts); }
.mg-skel--approve { block-size: var(--skel-approve); }
/* the folded steps' line, in the fold's own section and at its size */
.mg-skel--fold { display: block; inline-size: var(--skel-word); block-size: var(--skel-fold); border-radius: var(--r-s); }

/* Every card of a page keeps the card's own inner padding at its sides (s3, 7.4), and a table among them starts and
   ends its outer columns there too, so that their contents stand on one line from card to card (7.17). */
.mg-page .mg-table thead th:last-child, .mg-page .mg-table tbody > tr > :last-child { padding-inline-end: var(--s3); }
/* a figure or a range keeps one line; on a phone the table scrolls in its own box rather than break one (7.17) */
.mg-page .mg-table tbody > tr > :not(:first-child) { white-space: nowrap; }

/* --- Today: what waits for a decision (7.20 item 2: what changes, what follows, the warning, the buttons) --- */
/* one column across the card's width, in that order: no side of the card is left half empty */
.mg-ask { padding: var(--s3); }
.mg-ask > .mg-card__body { gap: var(--s2); margin: 0; }
.mg-ask .mg-changes-table { margin-block-start: var(--s1); }
.mg-ask__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s2); }
.mg-ask__by { display: flex; align-items: center; gap: var(--s1); color: var(--ink-2); font: var(--type-caption); }
.mg-ask .mg-card__heading { margin-block-start: calc(-1 * var(--s2)); }
/* what follows and what is learned side by side, on the change table's columns: the first under its name column */
.mg-ask__facts { display: grid; gap: var(--s2) var(--s3); margin: 0;
  grid-template-columns: [name] minmax(0, 4fr) [before] minmax(0, 5fr) [after] minmax(0, 5fr) [end]; }
.mg-ask__fact { display: grid; align-content: start; gap: var(--s-quarter); }
.mg-ask__fact:first-child { grid-column: name / after; }
.mg-ask__fact dt { color: var(--ink-2); font: var(--type-eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; }
.mg-ask__fact dd { margin: 0; font: var(--type-body-s); }
/* the foot: a hairline, the main button first and "Reject" beside it, as on the approval screen; "Details" at the
   far end, where it does not read as a third choice */
.mg-ask > .mg-card__foot { justify-content: flex-start; margin-block-start: var(--s1); padding-block-start: var(--s2);
  border-block-start: var(--hairline) solid var(--line); }
.mg-ask > .mg-card__foot > span:empty { display: none; }
/* a change approved on its card: the answers' place takes no room while it is empty (out of the column's flow, yet
   still in the page, so that what comes into it is read out), as in the approval box */
.mg-ask > .mg-card__body > .mg-approve__status:empty { position: absolute; }
.mg-ask > .mg-card__foot > .mg-card__actions { flex: 1 1 auto; margin-inline-start: 0; }
.mg-ask > .mg-card__foot .mg-button--quiet { margin-inline-start: auto; }
.mg-asks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--s2); }
.mg-asks .mg-ask__facts { grid-template-columns: minmax(0, 1fr); }
.mg-asks .mg-ask__fact:first-child { grid-column: auto; }

/* the others waiting: one line each; their words start on the section's edge, the hover's fill reaches past it */
/* the page's own ground under the rows, so that arriving they cover the block that stood in for them (content.js swap) */
.mg-waiting { display: grid; gap: var(--s1); background: var(--bg); }
.mg-waiting__title { color: var(--ink-2); font: var(--type-eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; }
/* the rows share the list's columns, so every name starts on one line whatever the kind's length (7.17) */
.mg-waiting__list { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--s2); margin: 0; padding: 0;
  border-block-start: var(--hairline) solid var(--line); list-style: none; }
.mg-waiting__item { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: inherit;
  border-block-end: var(--hairline) solid var(--line); }
.mg-waiting__link { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: inherit; align-items: baseline;
  margin-inline: calc(-1 * var(--s1)); padding: var(--s-tight) var(--s1); border-radius: var(--r-s); color: var(--ink);
  text-decoration: none; }
.mg-waiting__link:hover { background: var(--soft); }
.mg-waiting__link:hover .mg-waiting__go { text-decoration: underline; text-underline-offset: var(--s-half); }
.mg-waiting__link:active { background: var(--line); }
.mg-waiting__kind { color: var(--ink-2); font: var(--type-caption); white-space: nowrap; }
.mg-waiting__name { overflow: hidden; font: var(--type-label); letter-spacing: var(--track-label); text-overflow: ellipsis;
  white-space: nowrap; }
.mg-waiting__go { color: var(--ink-2); font: var(--type-label-quiet); }

/* --- Today: the page's one graphite card, its sentence beside its bars (7.20 item 1) --- */
/* its content starts on the same line as the cards above and below it (7.17): the same side padding, more above */
.mg-face { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--s1) var(--s6);
  grid-template-areas: "eyebrow bars" "lead bars" "text bars" "foot bars"; padding: var(--s5) var(--s3); }
.mg-face > .mg-card__eyebrow { grid-area: eyebrow; }
.mg-face > .mg-card__lead { grid-area: lead; }
.mg-face > .mg-card__text { grid-area: text; }
.mg-face > .mg-card__foot { grid-area: foot; }
.mg-face > .mg-card__body { grid-area: bars; margin: 0; }
.mg-face > .mg-card__foot { justify-content: flex-start; padding-block-start: var(--s2); }
.mg-face > .mg-card__foot > span:empty { display: none; }
.mg-face > .mg-card__foot > .mg-card__actions { margin-inline-start: 0; }

/* --- a titled card of rows (Today's tests and warnings): the card's own title (title-20, 7.3), then rows split by
   hairlines, at the same side padding as the cards above them --- */
.mg-rows-card { padding: var(--s3) var(--s3) var(--s1); }
.mg-rows-card > .mg-card__body { margin: 0; }

/* --- Today: tests running, one row each: the test and when its next result comes; its day counter and bar, on the
   graphite card's two columns (the same gap) --- */
.mg-runs { display: grid; margin: 0; padding: 0; list-style: none; }
.mg-runs__item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--s6);
  padding-block: var(--s2); border-block-start: var(--hairline) solid var(--line); }
.mg-runs__what { display: grid; justify-items: start; gap: var(--s-quarter); min-inline-size: 0; }
.mg-runs__due { color: var(--ink-2); font: var(--type-caption); }
.mg-runs__name { justify-self: start; color: var(--ink); font: var(--type-label); letter-spacing: var(--track-label);
  text-decoration: none; }
.mg-runs__name:hover { text-decoration: underline; text-underline-offset: var(--s-half); }
.mg-runs__name:active { text-decoration: underline var(--focus-w); text-underline-offset: var(--s-half); }

/* --- Today: what needs attention: each warning a row, its sign in the warning tone (7.2: negative is for warnings,
   never alone: the sign and the words carry it too), its words and its way out --- */
.mg-alerts { display: grid; margin: 0; padding: 0; list-style: none; }
.mg-alerts__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s2);
  padding-block: var(--s-tight); border-block-start: var(--hairline) solid var(--line); }
.mg-alerts__item > .mg-icon { color: var(--negative); }
.mg-alerts__text { font: var(--type-body-s); }

/* --- the campaign page's supporting cards: the send's facts in one column inside their card; the next step --- */
.mg-card .mg-about { grid-template-columns: minmax(0, 1fr); }
.mg-next > .mg-card__body { margin-block-start: var(--s1); }

/* --- an empty state that stands for a whole section (a new brand's first step, a result still to come) --- */
.mg-start { padding: var(--s4); }

/* --- while a page loads: blocks the size of what comes, with the sections' own gaps --- */
/* a sentence's or a name's second line is there only where it wraps (a phone) */
.mg-page--loading .mg-skel-text--body + .mg-skel-text--body,
.mg-page--loading .mg-skel-text--heading + .mg-skel-text--heading { display: none; }
.mg-skel--result { block-size: var(--skel-result); border: var(--hairline) solid var(--graphite-line); background: var(--graphite-2); }
.mg-skel--result::after { background: var(--shimmer-band-hero); }
.mg-skel--curve { block-size: var(--skel-curve); }
.mg-skel--days { block-size: var(--skel-days); }
.mg-skel--ltv-curve { block-size: var(--skel-ltv-curve); }
.mg-skel--ltv-days { block-size: var(--skel-ltv-days); }
.mg-skel--second { block-size: var(--skel-second); }
.mg-skel--cohorts { block-size: var(--skel-cohorts); }
.mg-skel--drivers-note { block-size: var(--skel-drivers-note); }
.mg-skel--drivers-products { block-size: var(--skel-drivers-products); }
.mg-skel--drivers-discount { block-size: var(--skel-drivers-discount); }
.mg-skel--drivers-channel { block-size: var(--skel-drivers-channel); }
.mg-skel--campaigns { block-size: var(--skel-campaigns); }
.mg-skel--flows { block-size: var(--skel-flows); }
.mg-skel--tests-next { block-size: var(--skel-tests-next); }
.mg-skel--tests-more { block-size: var(--skel-tests-more); }
.mg-skel--method-checks { block-size: var(--skel-method-checks); }
.mg-skel--method-bridge { block-size: var(--skel-method-bridge); }
.mg-skel--method-credit { block-size: var(--skel-method-credit); }
.mg-skel--pair { block-size: var(--skel-pair); }
.mg-skel--next { block-size: var(--skel-next); }

/* below 1280 px the main column is too narrow for the sentence and its bars side by side: the bars go under it */
@media (max-width: 1279px) {
  /* below 1280 px the main column is about the narrow page's own width: it starts on the column's edge again */
  .mg-page--narrow, .mg-page-wait--narrow { margin-inline: 0; }
  .mg-asks { grid-template-columns: minmax(0, 1fr); }
  .mg-face { grid-template-columns: minmax(0, 1fr); grid-template-areas: "eyebrow" "lead" "text" "bars" "foot"; }
  .mg-face > .mg-card__body { margin-block-start: var(--s2); }
  .mg-skel--ask { block-size: var(--skel-ask-mid); }
  .mg-skel--face { block-size: var(--skel-face-mid); }
  .mg-skel--alerts { block-size: var(--skel-alerts-mid); }
  .mg-skel--result { block-size: var(--skel-result-mid); }
  .mg-skel--pair { block-size: var(--skel-pair-mid); }
  .mg-skel--approve { block-size: var(--skel-approve-mid); }
}

@media (max-width: 767px) {
  .mg-ask, .mg-face, .mg-start { padding: var(--s3); }
  .mg-ask__facts, .mg-about { grid-template-columns: minmax(0, 1fr); }
  .mg-ask__fact:first-child { grid-column: auto; }
  /* the main button across the card; "Reject" and "See the details" on the line under it, at its two ends */
  .mg-ask > .mg-card__foot .mg-button:first-child { flex: 1 0 100%; }
  .mg-runs__item { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
  .mg-alerts__item { grid-template-areas: "sign words" ". button"; grid-template-columns: auto minmax(0, 1fr); }
  .mg-alerts__item > .mg-icon { grid-area: sign; }
  .mg-alerts__item > .mg-alerts__text { grid-area: words; }
  .mg-alerts__item > .mg-button { grid-area: button; justify-self: start; }
  .mg-page--loading .mg-skel-text--body + .mg-skel-text--body,
  .mg-page--loading .mg-skel-text--heading + .mg-skel-text--heading { display: block; margin-block-start: calc(-1 * var(--s1)); }
  .mg-skel--result { block-size: var(--skel-result-narrow); }
  .mg-skel--days { block-size: var(--skel-days-narrow); }
  .mg-skel--ask { block-size: var(--skel-ask-narrow); }
  .mg-skel--waiting { block-size: var(--skel-waiting-narrow); }
  .mg-skel--face { block-size: var(--skel-face-narrow); }
  .mg-skel--runs { block-size: var(--skel-runs-narrow); }
  .mg-skel--alerts { block-size: var(--skel-alerts-narrow); }
  .mg-skel--approve { block-size: var(--skel-approve-narrow); }
  .mg-skel--pair { block-size: var(--skel-pair-narrow); }
  .mg-skel--next { block-size: var(--skel-next-narrow); }
  .mg-waiting__list { grid-template-columns: minmax(0, 1fr) auto; }
  .mg-waiting__link { row-gap: var(--s-quarter); }
  .mg-waiting__kind { grid-column: 1 / -1; }
  /* no hover on a phone to show a cut name: it wraps to two lines instead */
  .mg-waiting__name { display: -webkit-box; white-space: normal; -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--clamp-lines); line-clamp: var(--clamp-lines); }
}

/* --- the screens before the panel (6.10): the wordmark, then one column with one job and one main button -------- */
.mg-auth { display: grid; grid-template-rows: auto minmax(0, 1fr); min-block-size: var(--shell-h); background: var(--bg); }
.mg-auth__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3) var(--s5); }
.mg-auth__mark { margin: 0; color: var(--ink); font: var(--type-wordmark); letter-spacing: var(--track-wordmark); }
.mg-auth__main { display: grid; align-content: start; justify-items: center; padding: var(--s5) var(--s3) var(--s8); }
.mg-auth__card { display: grid; gap: var(--s3); inline-size: 100%; max-inline-size: var(--auth-w); padding: var(--s5);
  border: var(--hairline) solid var(--line); border-radius: var(--r); background: var(--surface); }
.mg-auth__card--wide { max-inline-size: var(--auth-w-wide); }
/* a name or an address too long for the column breaks where it must (Stage 8 item 8: a long brand, a long email);
   an address breaks after its "@" and its dots first (address() puts the chances there) */
.mg-auth__title { margin: 0; font: var(--type-heading); letter-spacing: var(--track-heading); text-wrap: pretty;
  overflow-wrap: anywhere; }
.mg-auth__text { margin: 0; color: var(--ink-2); font: var(--type-body); text-wrap: pretty; overflow-wrap: anywhere; }
.mg-auth__line { display: block; color: var(--ink); }
.mg-auth__actions { display: grid; gap: var(--s1); }
.mg-auth__form { display: grid; gap: var(--s2); }
.mg-auth__form .mg-field__input--code { inline-size: 100%; }
/* the answers' place takes no room while it is empty, yet stays in the page so what comes into it is read out */
.mg-auth__form > .mg-auth__status:empty { position: absolute; }
/* setting up the authenticator: why, what to do and the code in the main column, the QR code and its key beside
   them; on a phone the QR code comes between the steps and the code, as it is read before the code is typed */
.mg-auth__setup { display: grid; gap: var(--s3) var(--s5); align-items: start;
  grid-template-columns: [main] minmax(0, 1fr) [side] auto [end];
  grid-template-areas: "why qr" "how qr" "form qr"; }
.mg-auth__setup > .mg-auth__text { grid-area: why; }
.mg-auth__setup > .mg-auth__how { grid-area: how; }
.mg-auth__setup > .mg-auth__qr { grid-area: qr; }
.mg-auth__setup > .mg-auth__form { grid-area: form; }
.mg-auth__how { display: grid; gap: var(--s1); margin: 0; padding: 0; list-style: decimal inside; color: var(--ink);
  font: var(--type-body); text-wrap: pretty; }
/* "or" between the link and the two other ways in, on a hairline */
.mg-auth__or { display: grid; grid-template-columns: [line] minmax(0, 1fr) [word] auto [after] minmax(0, 1fr); align-items: center;
  gap: var(--s2); margin: var(--s-half) 0; color: var(--ink-2); font: var(--type-caption); }
.mg-auth__or::before, .mg-auth__or::after { content: ""; block-size: var(--hairline); background: var(--line); }
.mg-auth__note { margin: 0; color: var(--ink-2); font: var(--type-body-s); overflow-wrap: anywhere; }
/* after signing out, or after the session's 12 hours, a calm line under the title; forgetting the password opens its
   one sentence under its link */
.mg-auth__said { margin: 0; padding: var(--s-tight) var(--s2); border-radius: var(--r-s); background: var(--soft);
  color: var(--ink); font: var(--type-body-s); text-wrap: pretty; }
.mg-auth__forgot { display: grid; justify-items: start; gap: var(--s1); }
.mg-auth__forgot > summary { cursor: pointer; list-style: none; }
.mg-auth__forgot > summary::-webkit-details-marker { display: none; }
/* a way to go, underlined so it reads as one; a button that sends something again looks the same */
.mg-auth__link { justify-self: start; padding: 0; border: 0; background: none; color: var(--ink); font: var(--type-label-quiet);
  text-decoration: underline; text-underline-offset: var(--s-half); }
.mg-auth__link:hover { text-decoration-thickness: var(--focus-w); }
.mg-auth__link:active { color: var(--ink-2); text-decoration-thickness: var(--focus-w); }
/* the code screen's two ways on one line: a lost phone, and back to signing in */
.mg-auth__ways { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
/* the button that shows what was typed stands at the end of the password's label line, in the label's quiet type;
   it comes after the field in the page's order, so that Tab reaches the field first */
.mg-auth__password { position: relative; }
.mg-auth__show { position: absolute; inset-block-start: 0; inset-inline-end: 0; padding: 0; border: 0; background: none;
  color: var(--ink-2); font: var(--type-label-quiet); cursor: pointer; text-decoration: underline;
  text-underline-offset: var(--s-half); }
.mg-auth__show:hover { color: var(--ink); }
.mg-auth__show:active { color: var(--ink); text-decoration-thickness: var(--focus-w); }
/* the QR code on its own light tile in both themes, its key under it for whoever cannot scan, with one press to copy */
.mg-auth__qr { display: grid; justify-items: center; gap: var(--s2); padding: var(--s3); border-radius: var(--r); background: var(--soft); }
.mg-qr { display: block; inline-size: var(--qr); block-size: var(--qr); border-radius: var(--r-s); }
.mg-qr__ground { fill: var(--on-dark); }
.mg-qr__dots { fill: var(--graphite); }
.mg-auth__key { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: var(--s1); margin: 0;
  font: var(--type-caption); }
.mg-auth__key-name { color: var(--ink-2); }
.mg-auth__key-value { font: var(--type-code); letter-spacing: var(--track-code); }
@media (max-width: 767px) {
  .mg-auth__top { padding: var(--s2) var(--s3); }
  .mg-auth__main { padding: var(--s3) var(--s2) var(--s6); }
  .mg-auth__card { padding: var(--s3); }
  .mg-auth__setup { grid-template-columns: [main] minmax(0, 1fr) [end]; grid-template-areas: "why" "how" "qr" "form"; }
}

/* --- Settings (6.8) and Customer value (the founder's decision 4): their parts in one row under the top bar, each at
   its own address ---------------------------------------------------------------------------------------------- */
:is(.mg-page--settings, .mg-page--parts) { row-gap: var(--s2); }
:is(.mg-page--settings, .mg-page--parts) > .mg-page-head { padding-block-end: var(--s2); }
:is(.mg-page--settings, .mg-page--parts) > .mg-sec, .mg-conn-wait > .mg-sec { padding-block-start: var(--s5); }
/* loading: the blocks under the head, with the page's own gaps, so that each stands where its content will; a
   heading's second line shows only on a phone, where the list's heading wraps */
.mg-conn-wait { display: grid; row-gap: var(--s2); }
.mg-conn-wait .mg-sec__head { row-gap: 0; }
.mg-conn-wait .mg-skel-text--heading + .mg-skel-text--heading { display: none; }
/* one row of links, the current part in ink with a rule under it; on a phone the row scrolls in its own box */
.mg-subnav { margin-block-end: var(--s2); border-block-end: var(--hairline) solid var(--line); overflow-x: auto; }
.mg-subnav__list { display: flex; gap: var(--s4); margin: 0; padding: 0; list-style: none; }
.mg-subnav__link { display: block; margin-block-end: calc(-1 * var(--hairline)); padding-block: var(--s1);
  border-block-end: var(--focus-w) solid transparent; color: var(--ink-2); font: var(--type-label-quiet);
  text-decoration: none; white-space: nowrap; }
.mg-subnav__link:hover { color: var(--ink); }
.mg-subnav__link:active { border-block-end-color: var(--line-strong); }
.mg-subnav__link[aria-current="page"] { border-block-end-color: var(--ink); color: var(--ink); font: var(--type-label); }

/* --- Connections: Klaviyo beside the emergency stop, then the orders file, what Megovia set up, what is hard to undo */
/* the stop comes first in the page's order, so that a phone holds it on its first screen; a wide screen sets it in
   the right column, beside Klaviyo */
.mg-conn-top { display: grid; grid-template-columns: [main] minmax(0, 2fr) [stop] minmax(0, 1fr) [end]; align-items: stretch;
  gap: var(--s2); }
.mg-conn-top > .mg-conn-stop, .mg-conn-top > .mg-skel--conn-stop { grid-column: stop; grid-row: 1; }
.mg-conn-top > :not(.mg-conn-stop):not(.mg-skel--conn-stop) { grid-column: main; grid-row: 1; }
.mg-conn-top--one { grid-template-columns: [main] minmax(0, 1fr) [end]; }
/* the page did not load: the stop alone, at a reading measure */
.mg-conn-top--stop { grid-template-columns: [stop] minmax(0, var(--text-max)) [end]; }
.mg-conn-card { padding: var(--s3); }
.mg-conn-card > .mg-card__body { gap: var(--s2); }
/* the card's state is its heading, close under its name */
.mg-conn-card > .mg-card__heading { margin-block-start: calc(-1 * var(--s1)); }
/* pilot Megovia: that it only reads, once, a plain sentence of the card (a sign beside it read as something done) */
.mg-conn__read-only { color: var(--ink); }
/* a connection that stopped working: its title on its own line over what it means, the sign on the first line */
.mg-conn-alert .mg-alerts__item { align-items: start; }
.mg-conn-alert .mg-alerts__item > .mg-icon { margin-block-start: var(--s-quarter); }
.mg-conn-alert .mg-alerts__item > .mg-button { align-self: center; }
.mg-conn-alert__title { display: block; }
/* the first download's note in the card's own size, under its bar */
.mg-conn-facts .mg-progress__note { font: var(--type-body-s); }
/* what Klaviyo will say, under the button that connects */
.mg-conn-card > .mg-conn__note-line { margin-block-start: var(--s1); color: var(--ink-2); font: var(--type-body-s); }
/* a connection that stopped working, said first as Today says what needs attention */
.mg-conn-alert .mg-alerts__item { padding-block: 0; border: 0; }
/* a card's one action follows its words, on their edge */
.mg-conn-card > .mg-card__foot { justify-content: flex-start; }
.mg-conn-card > .mg-card__foot > .mg-card__actions { align-items: center; margin-inline-start: 0; }
.mg-conn-card > .mg-card__foot > span:empty { display: none; }
.mg-conn__status:empty { display: none; }
/* names and values in rows, the names in one column so the values start on one line */
/* the names' column has one width on every card, so that values start on one line from card to card */
.mg-conn-facts { display: grid; grid-template-columns: [name] var(--facts-name) [value] minmax(0, 1fr) [end]; gap: var(--s1) var(--s3);
  margin: 0; }
.mg-conn-facts__row { display: grid; grid-column: name / end; grid-template-columns: subgrid; }
.mg-conn-facts__row dt { color: var(--ink-2); font: var(--type-body-s); }
.mg-conn-facts__row dd { margin: 0; font: var(--type-body-s); }
.mg-conn__other { align-self: center; color: var(--ink); font: var(--type-label-quiet); text-decoration: underline;
  text-underline-offset: var(--s-half); }
.mg-conn__other:hover { text-decoration-thickness: var(--focus-w); }
.mg-conn__other:active { color: var(--ink-2); }
.mg-conn-strip > .mg-paused { margin: 0; }
/* the orders file: what is known on the left, the place to upload the next one on the right */
.mg-conn-orders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--s3) var(--s6); }
.mg-conn-list { display: grid; gap: var(--s2); }
/* what removing a part ends: a sentence under its name and kind, wrapping in the part's column */
.mg-conn__note { display: block; margin-block-start: var(--s-half); color: var(--ink-2); font: var(--type-body-s);
  white-space: normal; }
/* the actions start on one line in every row, whether or not a part can still be removed */
.mg-conn__actions { flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: var(--s2); }
/* when and by whom: words, so they may take two lines on a laptop rather than push the actions out of the card; the
   columns keep their places from state to state */
.mg-conn-list .mg-table tbody > tr > td.mg-table__start { white-space: normal; }
.mg-conn-list .mg-table thead th:first-child { inline-size: var(--col-half); }
.mg-conn-list .mg-table thead th:nth-child(2) { inline-size: var(--col-quarter); }
/* hard to undo: each result beside its button, apart from every other button of the page */
.mg-hard { display: grid; margin: 0; padding: 0; border: var(--hairline) solid var(--line); border-radius: var(--r);
  background: var(--surface); list-style: none; }
.mg-hard__row { display: grid; grid-template-columns: [text] minmax(0, 1fr) [button] auto [end]; align-items: center;
  gap: var(--s3); padding: var(--s3); }
.mg-hard__row + .mg-hard__row { border-block-start: var(--hairline) solid var(--line); }
.mg-hard__text { max-inline-size: var(--text-max); color: var(--ink-2); font: var(--type-body-s); }
/* --- Users: the people with their roles and second step, what each role can do, the invitations waiting --- */
.mg-users-people { display: grid; gap: var(--s3); }
.mg-users-list { display: grid; gap: var(--s2); }
.mg-users-slot:empty { display: none; }
/* the box under the count keeps clear of the list it counts; the button that opened it stays pressed while it is open */
.mg-users-slot:not(:empty) { margin-block-end: var(--s2); }
.mg-list-tools .mg-button[aria-expanded="true"]::after { opacity: var(--veil-on); }
/* while the page loads, the count's place at the count's own height */
.mg-users-wait-count { display: flex; align-items: center; min-block-size: var(--control-h); }
/* an address keeps to one line, a long one ending with an ellipsis (whole on hover); an invitation's address, the
   row's name, takes its two lines and breaks where it must */
.mg-users__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-users-table .mg-table__title { overflow-wrap: anywhere; }
/* a box that asks for a code, in the page's flow: the approval box at a reading measure; the roles to choose from one
   under the other, each with what it can do */
.mg-users-box { justify-self: start; inline-size: 100%; }
.mg-users-box .mg-choice, .mg-users-actions .mg-choice { grid-template-columns: minmax(0, 1fr); }
/* a box under a person's row is the row band's content, not a card inside a card (the fresh reader's finding 12) */
.mg-users-actions .mg-approve { padding: 0; border: 0; border-radius: 0; background: none; }
.mg-users__you { display: inline-flex; align-items: center; block-size: var(--badge-h); margin-inline-start: var(--s1);
  padding-inline: var(--badge-pad); border: var(--hairline) solid var(--line-strong); border-radius: var(--r-s);
  color: var(--ink-2); font: var(--type-badge); vertical-align: middle; }
/* the second step in the server's words; in your own row, under them, the way to change your own app */
.mg-users__second { display: grid; justify-items: start; gap: var(--s-quarter); }
.mg-users__own { color: var(--ink); font: var(--type-caption); text-decoration: underline;
  text-underline-offset: var(--s-half); }
.mg-users__own:hover { text-decoration-thickness: var(--focus-w); }
.mg-users__own:active { color: var(--ink-2); text-decoration-thickness: var(--focus-w); }
.mg-hard--flat { border: 0; background: none; }
.mg-hard--flat > .mg-hard__row { padding-inline: 0; }
/* a row's actions in its band: the band's own edges hold them, s2 between them */
.mg-users-actions .mg-hard--flat > .mg-hard__row { padding-block: var(--s2); }
.mg-users-actions .mg-hard--flat > .mg-hard__row:first-child { padding-block-start: 0; }
.mg-users-actions .mg-hard--flat > .mg-hard__row:last-child { padding-block-end: 0; }
/* the people and the invitations share their columns' lines: the same shares in both lists, the opener last */
.mg-users-table .mg-table { table-layout: fixed; }
.mg-users-table .mg-table thead th:nth-child(1) { inline-size: var(--col-users-1); }
.mg-users-table .mg-table thead th:nth-child(2) { inline-size: var(--col-users-2); }
.mg-users-table .mg-table thead th:nth-child(3) { inline-size: var(--col-users-3); }
.mg-users-table .mg-table thead th:nth-child(4) { inline-size: var(--col-users-4); }
/* what each role can do, under the list: three short definitions side by side; while a box that chooses a role is
   open, the box says it, so they step aside */
.mg-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2) var(--s4); margin: 0; }
.mg-users-people--choosing .mg-roles { display: none; }
.mg-roles__row dt { font: var(--type-label); }
.mg-roles__row dd { margin: 0; color: var(--ink-2); font: var(--type-body-s); }
.mg-users__none { color: var(--ink-2); font: var(--type-body-s); }
/* the brand's only admin: a calm note with the way to invite a second, in the alerts' row */
.mg-users-alone { padding: var(--s-tight) var(--s3); border: var(--hairline) solid var(--line); border-radius: var(--r);
  background: var(--surface); }
.mg-users-alone .mg-alerts__item { padding-block: 0; border: 0; }
.mg-users-alone .mg-alerts__item > .mg-icon { color: var(--ink-2); }
/* --- Data: how long each kind of data is kept, the one setting under the list, the actions that are hard to undo --- */
.mg-data-kept { display: grid; gap: var(--s2); }
/* how long and when are words: they may take two lines rather than push the list past the page's edge, broken into
   lines of even length rather than leave one word alone */
.mg-data-table .mg-table { table-layout: fixed; }
.mg-data-table .mg-table thead th:nth-child(1) { inline-size: var(--col-data-1); }
.mg-data-table .mg-table thead th:nth-child(2) { inline-size: var(--col-data-2); }
.mg-page .mg-data-table .mg-table tbody > tr > td { white-space: normal; }
.mg-data-table .mg-table tbody > tr > * { text-wrap: balance; }
/* the setting is a line under the list, its sentence beside its button (6.8): not a box, so that it never reads as one
   of the actions that are hard to undo */
.mg-data-setting > .mg-hard { border: 0; background: none; }
.mg-data-setting > .mg-hard > .mg-hard__row { padding: 0; }
.mg-data-place { display: grid; }
/* a box that asks for a code, in the page's flow: the periods one under the other, each with what it means */
.mg-data-box { justify-self: start; inline-size: 100%; }
.mg-data-box .mg-choice { grid-template-columns: minmax(0, 1fr); }
/* the list is the page's first block after its head: closer to it than a later section is to the one before (the
   loading place says so with mg-wait-top: the loading words stand between the head and it) */
:is(.mg-page--settings, .mg-page--parts) > .mg-page-head + .mg-sec, .mg-wait-top > .mg-sec:first-child {
  padding-block-start: var(--s3); }
/* after a deletion of everything: what starts reading again, and the way to Connections */
.mg-data__way { color: var(--ink); text-decoration: underline; text-underline-offset: var(--s-half); }
.mg-data__way:hover { text-decoration-thickness: var(--focus-w); }
.mg-data__way:active { color: var(--ink-2); text-decoration-thickness: var(--focus-w); }
/* --- Security: the second step's card with the way to change the app, its boxes under it, the recent sign-ins --- */
.mg-security-top { display: grid; gap: var(--s2); }
.mg-security-place { gap: var(--s2); }
.mg-security-place:empty { display: none; }
.mg-security__lost { max-inline-size: var(--text-max); color: var(--ink-2); font: var(--type-body-s); text-wrap: pretty; }
/* the new app's setup, as on the setup screen: what to do beside the QR code and its key; on a phone, one under
   the other */
.mg-security__setup { display: grid; grid-template-columns: [how] minmax(0, 1fr) [qr] auto [end]; align-items: start;
  gap: var(--s3); }
/* a sign-in's time never breaks; "This sign-in" beside it, or under it on its left edge where there is no room */
.mg-security__when { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-half) var(--s1); }
.mg-security__time { white-space: nowrap; }
.mg-security__when > .mg-users__you { margin-inline-start: 0; }
.mg-skel--security-second { block-size: var(--skel-security-second); }
.mg-skel--security-signins { block-size: var(--skel-security-signins); }
/* --- Notifications: the emails a person can turn off, each beside its switch; the ones always on, listed apart --- */
.mg-notify { display: grid; margin: 0; padding: 0; border: var(--hairline) solid var(--line); border-radius: var(--r);
  background: var(--surface); list-style: none; }
.mg-notify__row { display: grid; gap: var(--s2); padding: var(--s3); }
.mg-notify__row + .mg-notify__row { border-block-start: var(--hairline) solid var(--line); }
.mg-notify__status:empty { display: none; }
/* the switch's state in a word beside its name; while off, what that means; the sentences at a reading measure */
.mg-notify__state { margin-inline-start: var(--s1); color: var(--ink-2); font: var(--type-body-s); }
.mg-notify .mg-switch__meaning, .mg-notify__off { max-inline-size: var(--text-max); text-wrap: pretty; }
.mg-notify__off { margin: 0; color: var(--ink); font: var(--type-body-s); }
.mg-notify__always { display: grid; margin: 0; border: var(--hairline) solid var(--line); border-radius: var(--r);
  background: var(--surface); }
.mg-notify__kind { display: grid; grid-template-columns: [name] var(--notify-name) [text] minmax(0, 1fr) [end];
  gap: var(--s3); padding: var(--s2) var(--s3); }
.mg-notify__kind + .mg-notify__kind { border-block-start: var(--hairline) solid var(--line); }
.mg-notify__kind dt { font: var(--type-label); }
.mg-notify__kind dd { margin: 0; color: var(--ink-2); font: var(--type-body-s); }
.mg-skel--notify-note { block-size: var(--skel-notify-note); }
.mg-skel--notify-choose { block-size: var(--skel-notify-choose); }
.mg-skel--notify-always { block-size: var(--skel-notify-always); }
/* a loading place whose lists lead with a sentence (Data, Notifications): the heading and its sentence keep the head's
   own gap; the sentence's further lines show from the width where its words take them (from-mid below 1280,
   from-narrow on a phone), one paragraph with the line above */
.mg-wait-lead .mg-sec__head { row-gap: var(--s1); }
.mg-skel-text--from-mid, .mg-skel-text--from-narrow { display: none; margin-block-start: calc(-1 * var(--s1)); }
/* a lead's next line goes on from the one before it, as the sentence's next line does (the campaigns' lead, P-038) */
.mg-wait-lead .mg-sec__head > .mg-skel-text--body + .mg-skel-text--body { margin-block-start: calc(-1 * var(--s1)); }
.mg-skel--data-kept { block-size: var(--skel-data-kept); }
.mg-skel--data-hard { block-size: var(--skel-data-hard); }
.mg-skel--conn-simulated { block-size: var(--skel-conn-simulated); }
.mg-skel--data-simulated { block-size: var(--skel-data-simulated); }
.mg-skel--users-people { block-size: var(--skel-users-people); }
.mg-skel--users-invited { block-size: var(--skel-users-invited); }
.mg-skel--conn-klaviyo { block-size: var(--skel-conn-klaviyo); }
.mg-skel--conn-stop { block-size: var(--skel-conn-stop); }
.mg-skel--conn-orders { block-size: var(--skel-conn-orders); }
.mg-skel--conn-set-up { block-size: var(--skel-conn-set-up); }
.mg-skel--conn-hard { block-size: var(--skel-conn-hard); }
.mg-skel--conn-klaviyo-read { block-size: var(--skel-conn-klaviyo-read); }
.mg-skel--conn-hard-read { block-size: var(--skel-conn-hard-read); }
@media (max-width: 1279px) {
  /* below 1280 the lists take the widths their words need: the role, the times and the opener keep to one line, the
     second step takes two rather than push the opener past the list's edge, and the names' column is narrower */
  .mg-users-table .mg-table { table-layout: auto; }
  .mg-users-table .mg-table thead th:nth-child(n) { inline-size: auto; }
  .mg-users-table .mg-table tbody > tr > :first-child { min-inline-size: var(--name-min-users); }
  .mg-users-table--people .mg-table tbody > tr > :nth-child(3) { white-space: normal; }
  .mg-skel--conn-klaviyo-read { block-size: var(--skel-conn-klaviyo-read-mid); }
  .mg-skel--conn-hard-read { block-size: var(--skel-conn-hard-read-mid); }
  .mg-conn-top { grid-template-columns: [main] minmax(0, 1fr) [end]; }
  /* one column, in the page's order: the stop first */
  .mg-conn-top > .mg-conn-stop, .mg-conn-top > .mg-skel--conn-stop,
  .mg-conn-top > :not(.mg-conn-stop):not(.mg-skel--conn-stop) { grid-column: main; grid-row: auto; }
  .mg-conn-orders { grid-template-columns: minmax(0, 1fr); }
  .mg-skel--conn-klaviyo { block-size: var(--skel-conn-klaviyo-mid); }
  .mg-skel--conn-stop { block-size: var(--skel-conn-stop-mid); }
  .mg-skel--conn-orders { block-size: var(--skel-conn-orders-mid); }
  .mg-skel--conn-set-up { block-size: var(--skel-conn-set-up-mid); }
  .mg-skel--conn-hard { block-size: var(--skel-conn-hard-mid); }
  .mg-skel--users-people { block-size: var(--skel-users-people-mid); }
  .mg-skel--users-invited { block-size: var(--skel-users-invited-mid); }
  .mg-skel--data-kept { block-size: var(--skel-data-kept-mid); }
  .mg-skel--data-hard { block-size: var(--skel-data-hard-mid); }
  .mg-skel-text--from-mid { display: block; }
  /* below 1280 the list's columns take the widths their words need, so a value breaks where its words do */
  .mg-data-table .mg-table { table-layout: auto; }
  .mg-data-table .mg-table thead th:nth-child(n) { inline-size: auto; }
  .mg-skel--notify-note { block-size: var(--skel-notify-note-mid); }
  .mg-skel--notify-choose { block-size: var(--skel-notify-choose-mid); }
  .mg-skel--notify-always { block-size: var(--skel-notify-always-mid); }
  .mg-skel--security-second { block-size: var(--skel-security-second-mid); }
  .mg-skel--security-signins { block-size: var(--skel-security-signins-mid); }
}
@media (max-width: 767px) {
  .mg-skel--conn-klaviyo { block-size: var(--skel-conn-klaviyo-narrow); }
  .mg-skel--conn-stop { block-size: var(--skel-conn-stop-narrow); }
  .mg-skel--conn-orders { block-size: var(--skel-conn-orders-narrow); }
  .mg-skel--conn-set-up { block-size: var(--skel-conn-set-up-narrow); }
  .mg-skel--conn-hard { block-size: var(--skel-conn-hard-narrow); }
  .mg-skel--users-people { block-size: var(--skel-users-people-narrow); }
  .mg-skel--users-invited { block-size: var(--skel-users-invited-narrow); }
  .mg-skel--data-kept { block-size: var(--skel-data-kept-narrow); }
  .mg-skel--data-hard { block-size: var(--skel-data-hard-narrow); }
  .mg-skel--conn-simulated { block-size: var(--skel-conn-simulated-narrow); }
  .mg-skel--data-simulated { block-size: var(--skel-data-simulated-narrow); }
  /* a list of words (Data's kinds, Security's sign-ins) reads down on a phone: each row's first cell, then every
     other value under its column's name, so that a value that takes two lines reads as a sentence (the fresh
     readers); the head would name only the first column, so it stays for screen readers alone, as on Connections */
  .mg-lines-table .mg-table--stack thead { position: absolute; inline-size: var(--hairline); block-size: var(--hairline);
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mg-lines-table .mg-table--stack tbody > tr:first-child { border-block-start: 0; }
  .mg-lines-table .mg-table--stack tbody > tr > th + .mg-table__line { margin-block-start: var(--s-three-quarter); }
  .mg-lines-table .mg-table--stack tbody > tr > .mg-table__line { display: grid; justify-content: stretch; gap: 0; }
  .mg-skel-text--from-narrow { display: block; }
  /* a phone reads each email that is always on down: its name, then when it comes */
  .mg-notify__kind { grid-template-columns: minmax(0, 1fr); gap: var(--s-half); }
  .mg-skel--notify-note { block-size: var(--skel-notify-note-narrow); }
  .mg-skel--notify-choose { block-size: var(--skel-notify-choose-narrow); }
  .mg-skel--notify-always { block-size: var(--skel-notify-always-narrow); }
  .mg-security__setup { grid-template-columns: minmax(0, 1fr); }
  .mg-skel--security-second { block-size: var(--skel-security-second-narrow); }
  .mg-skel--security-signins { block-size: var(--skel-security-signins-narrow); }
  .mg-skel--conn-klaviyo-read { block-size: var(--skel-conn-klaviyo-read-narrow); }
  .mg-skel--conn-hard-read { block-size: var(--skel-conn-hard-read-narrow); }
  .mg-roles { grid-template-columns: minmax(0, 1fr); }
  /* a stacked row's values sit on the right, a second step that takes two lines too (the fresh reader's finding 13) */
  .mg-table--stack .mg-users__second { justify-items: end; text-align: end; }
  .mg-users-table .mg-table tbody > tr > :first-child { min-inline-size: 0; }
  .mg-conn-wait .mg-skel-text--heading + .mg-skel-text--heading { display: block; }
  /* on a phone the parts of Settings take two lines rather than hide some past the screen's edge */
  .mg-subnav { overflow-x: visible; }
  .mg-subnav__list { flex-wrap: wrap; gap: 0 var(--s3); }
  .mg-conn-facts { grid-template-columns: [name] minmax(0, 1fr) [end]; }
  .mg-conn-facts__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mg-hard__row { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .mg-hard__row > .mg-button { justify-self: start; }
  /* a phone reads each part down: its name, kind and what removing it ends; when and with whose approval it was set
     up (its words say so, so the head keeps only the part's name in view); then its two actions */
  .mg-conn-list .mg-table--stack tr { grid-template-columns: [name] minmax(0, 1fr) [end]; }
  /* the head would name only the part: each row's words say what they are, so it stays for screen readers alone */
  .mg-conn-list .mg-table--stack thead { position: absolute; inline-size: var(--hairline); block-size: var(--hairline);
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mg-conn-list .mg-table--stack tbody > tr > .mg-table__pair { grid-column: name / end; margin-block-start: var(--s1);
    padding-inline: var(--s3); font-weight: var(--weight-regular); white-space: normal; }
  .mg-conn-list .mg-table--stack tbody > tr > .mg-table__line { justify-content: flex-start; margin-block-start: var(--s1); }
  .mg-conn-list .mg-table--stack tbody > tr:first-child { border-block-start: 0; }
}
