/* READABLE LAYOUT (owner report: text in lumps inside half-width boxes). Loaded after typo-fit.css; only widths, spacing and columns, never fonts or colours.
   Rules: content uses the screen width (container up to 1320px, 16px gutters on phones); pure prose keeps a comfortable line length (about 90 characters)
   and sits beside cards or in columns instead of in a narrow centred box; blocks are separated by one spacing scale. A page whose narrow width is deliberate adds class xag-narrow-ok. */
:root { --xag-w-content: 1320px; --xag-measure: 90ch; --xag-sp-1: .4rem; --xag-sp-2: .75rem; --xag-sp-3: 1.25rem; --xag-sp-4: 2rem; --xag-sp-5: 3rem; }

/* 1. WIDTH: wrappers of the standalone public pages */
.sp-head, .sp-foot, main.sp, main.legal, #cnRoot, .wrap:not(.xag-narrow-ok) { max-width: var(--xag-w-content); }
.sp-head, .sp-foot, main.sp, main.legal { margin-inline: auto; padding-inline: 16px; }
@media (min-width: 900px) { .sp-head, .sp-foot, main.sp, main.legal { padding-inline: 24px; } }

/* home / app pages and the About information blocks */
.home, .page, .ia-wrap { max-width: var(--xag-w-content); }
.page-sub, .legal-page p, .legal-page li, .classroom-note, .th-intro { max-width: var(--xag-measure); }
.legal-page p, .legal-page li { max-width: var(--xag-measure); }
.news-feed, .course-list:not(.xag-narrow-ok) { max-width: none; }
.xs-quotes, .rr-tc, #xagAgency, .rp-card, #page-myhome .xh-wrap { max-width: var(--xag-w-content); }

/* 2. LINE LENGTH: plain prose directly in the page flow */
/* input then button, stacked: the button sits one standard spacing step (--xag-sp-2) below the field. Add class xag-field-btn to the wrapper. */
.xag-field-btn > :is(input, select, textarea) + :is(button, .btn, .mk-btn, .xag-btn-pri) { display: block; margin-block-start: var(--xag-sp-2); }
main.sp > p, main.sp > ul, main.sp > ol, main.legal > p, main > p.note, main > p.meta, main > p.lt { max-width: var(--xag-measure); }
/* /legal/* and the Trust and legal section: heading, chip row, note and boxes share ONE left edge and the full column width (owner 2026-11-04) */
main.legal > .note, main.legal > .trans, main.legal > .chips { max-width: none; margin-inline: 0; }
main > ol.policy p, main > ol.policy li { overflow-wrap: anywhere; }
main > ol.policy ul { margin: 0 0 var(--xag-sp-2); padding-inline-start: 1.2rem; }
main > ol.policy p { margin-block: 0 var(--xag-sp-2); }
main.sp > .sp-note, main.sp > .sp-grid, main.sp > .sp-form, main.sp > table, main.sp > .sp-cmp-wrap, main.sp > .sp-cta { max-width: none; }

/* 3. SPACING: one scale between blocks */
main.sp > p, main.sp > ul, main.sp > ol { margin-block: 0 var(--xag-sp-3); }
main.sp > h2 { margin-block: var(--xag-sp-4) var(--xag-sp-2); }
main.sp > h3 { margin-block: var(--xag-sp-3) var(--xag-sp-1); }
main.sp ul, main.sp ol, .legal ol.policy ul { padding-inline-start: 1.3rem; }
main.sp li, .legal ol.policy li li { margin-block: 0 var(--xag-sp-1); }
.sp-card p, .sp-card ul { margin-block: 0 var(--xag-sp-2); }
.sp-card ul { padding-inline-start: 1.2rem; }
.sp-card li { margin-block: 0 .3rem; }
.sp-grid { gap: var(--xag-sp-2) var(--xag-sp-3); }
.legal ol.policy p { margin-block: 0 var(--xag-sp-2); }
.legal ol.policy ul { margin: 0 0 var(--xag-sp-2); }
.legal ol.policy li > ul li { margin-bottom: .3rem; }

/* 4. COLUMNS on wide screens: cards side by side instead of one tall narrow stack */
@media (min-width: 900px) {
  .sp-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
  .legal ol.policy, main > ol.policy { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--xag-sp-3); align-items: start; }
  .legal ul.docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main.sp > ul:not(.sp-cta):not(.chips) { columns: 2; column-gap: var(--xag-sp-4); max-width: none; }
  main.sp > ul > li { break-inside: avoid; }
}
@media (min-width: 1500px) { main > ol.policy:not(.legal ol) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 5. PHONES: full width with 16px gutters */
@media (max-width: 640px) {
  main.sp, main.legal, .sp-head, .sp-foot { padding-inline: 16px; }
  main.sp > p, main.sp > ul, main.sp > ol { max-width: none; }
}

/* 6. SPACING SCALE (crowding pass 2026-11-02): only 4, 8, 12, 16, 24, 32, 48 px. 24 below a page title block, 16 between paragraphs and bullets,
      12 under a section heading, 32 between sections, 24 padding inside cards. Pages that set their own tighter margins are lifted here. */
:root { --xag-s-1: 4px; --xag-s-2: 8px; --xag-s-3: 12px; --xag-s-4: 16px; --xag-s-5: 24px; --xag-s-6: 32px; --xag-s-7: 48px; }
/* Pages owned by other work streams (trust, agency, recruitment) are left as they are until their owners finish. */
html:not(:has(link[rel="canonical"][href*="/trust/"], link[rel="canonical"][href*="/agency/"], link[rel="canonical"][href*="/recruitment/"])) {
  /* page title, then its one-line lead, then the content */
  main > h1, #cnRoot > h1, #mktRoot > h1 { margin-block: var(--xag-s-2) var(--xag-s-3); }
  main > h1 + p, #cnRoot > h1 + p, #mktRoot > h1 + p, main > .meta, main > .lead { margin-block: 0 var(--xag-s-5); }
  /* section headings anywhere in the page text: at least 12 below (card headings were 3 to 6 px) */
  main h2, #cnRoot h2, #mktRoot h2 { margin-bottom: var(--xag-s-3); }
  main h3, #cnRoot h3, #mktRoot h3 { margin-bottom: var(--xag-s-2); }
  /* section headings: room above, a clear step below, never glued to the text */
  main > h2, main > section > h2, #cnRoot h2, #mktRoot h2 { margin-block: var(--xag-s-6) var(--xag-s-3); }
  main h2 + p, main h2 + ul, main h2 + ol, main h2 + .sp-lead { margin-top: 0; }
  main > h3, main > section > h3 { margin-block: var(--xag-s-5) var(--xag-s-2); }
  main h3 + p, main h3 + ul { margin-top: 0; }
  /* policy cards (legal pages): 24 padding, heading 12 above its text, 16 between paragraphs, 32 before whatever follows the list */
  .legal ol.policy > li { padding: var(--xag-s-5) var(--xag-s-5) var(--xag-s-5) 3.4rem; }
  .legal ol.policy > li::before { top: var(--xag-s-5); }
  .legal ol.policy h2, main > ol.policy h2 { margin: 0 0 var(--xag-s-3); }
  .legal ol.policy p, main > ol.policy p { margin-block: 0 var(--xag-s-4); }
  .legal ol.policy p:last-child, main > ol.policy p:last-child, .legal ol.policy ul:last-child { margin-bottom: 0; }
  .legal ol.policy ul, main > ol.policy ul { margin: 0 0 var(--xag-s-4); }
  .legal ol.policy li > ul li, main > ol.policy li > ul li { margin-bottom: var(--xag-s-2); }
  .legal ol.policy, main > ol.policy { margin-bottom: var(--xag-s-6); }
  .legal .disc-card h2 { margin: 0 0 var(--xag-s-3); }
  .legal .disc-card { padding: var(--xag-s-5); margin-bottom: var(--xag-s-4); }
  .legal .disc-card .disc-meta, .legal .disc-card .disc-text, .legal .disc-card .disc-rel { margin-block: 0 var(--xag-s-3); }
  @media (max-width: 640px) { .legal ol.policy > li { padding: var(--xag-s-4) var(--xag-s-4) var(--xag-s-4) 3.2rem; } .legal ol.policy > li::before { top: var(--xag-s-4); } .legal .disc-card { padding: var(--xag-s-4); } }
  /* cards on the standalone pages */
  .sp-card { padding: var(--xag-s-5); }
  .sp-card h3 { margin: 0 0 var(--xag-s-2); }
  .sp-price { margin: var(--xag-s-2) 0; }
  .sp-grid { gap: var(--xag-s-4) var(--xag-s-5); }
  .sp-note, .sp-table + p, table.sp-table + p { margin-top: var(--xag-s-4); }
  /* small print under plan cards: wraps instead of being cut off with an ellipsis */
  p.nw, .small.nw { white-space: normal; overflow: visible; text-overflow: clip; }
  .plan-grid + p, p.small.nw { margin-block: var(--xag-s-3) 0; }
  /* the consultancy intro and the Clarity header strip */
  .ia-wrap p { margin-block: 0 var(--xag-s-4); }
  .xc-head { margin-bottom: var(--xag-s-2); }
  .xc-promise { margin-bottom: var(--xag-s-3); }
}

/* PRIVACY NOTICE alignment (owner 2026-11-04, this page only: main.legal[data-doc="privacy"]:not(#xag)): ONE shared left edge for the title, chips, note, cards, headings, text, links and the notices box;
   cards stacked at the full content width with equal 24px inner padding; the number badge sits at the right so heading and text start at the same edge; no short wrapped last lines. */
main.legal[data-doc="privacy"]:not(#xag) > :is(h1, .chips, .note, .trans, .contact, .legal-nav, ol.policy) { max-width: none; margin-inline: 0; }
main.legal[data-doc="privacy"]:not(#xag) ol.policy { grid-template-columns: minmax(0, 1fr); gap: var(--xag-s-4); align-items: stretch; }
main.legal[data-doc="privacy"]:not(#xag) ol.policy > li { box-sizing: border-box; width: 100%; padding: var(--xag-s-5); }
main.legal[data-doc="privacy"]:not(#xag) ol.policy > li::before { left: auto; right: var(--xag-s-5); top: var(--xag-s-5); }
main.legal[data-doc="privacy"]:not(#xag) ol.policy > li > h2 { padding-inline-end: calc(1.8rem + var(--xag-s-3)); }
main.legal[data-doc="privacy"]:not(#xag) ol.policy :is(p, li) { max-width: none; text-wrap: balance; }
@media (max-width: 640px) { main.legal[data-doc="privacy"]:not(#xag) ol.policy > li { padding: var(--xag-s-4); } main.legal[data-doc="privacy"]:not(#xag) ol.policy > li::before { right: var(--xag-s-4); top: var(--xag-s-4); } }

/* Field hint: one short line of help under a form field (for example the job description: no school name). Tokens only. */
.xag-field-hint { margin: var(--xag-sp-1) 0 0; font-size: .85rem; line-height: 1.4; opacity: .85; }
