/* Nullware canvas — tablet and phone overlay.
   Desktop (≥1101px) stays the 1440 board. Inline styles need !important.
   From 1101 to 1280 the board still fits the window badly: a fixed
   side column crushes the text beside it, and the footer clips. */

.canvas-page,
.canvas-page * {
  box-sizing: border-box;
}

/* iOS drops transform animations on layers marked will-change
   inside a clipped page. Let the seal, staff and marquee run. */
.seal-layer,
.staff-a,
.staff-b,
.staff-bead,
.staff-line,
.marquee {
  will-change: auto;
}

/* Just under the 1440 board. Stack fixed side columns and the footer
   before the full tablet layout at 1100px. */
@media (max-width: 1280px) {
  .canvas-page [style*="minmax(0, 1fr) 560px"],
  .canvas-page [style*="minmax(0, 1fr) 520px"],
  .canvas-page [style*="minmax(0, 1fr) 500px"],
  .canvas-page [style*="minmax(0, 1fr) 480px"],
  .canvas-page [style*="minmax(0, 1fr) 460px"],
  .canvas-page [style*="minmax(0, 1fr) 440px"],
  .canvas-page [style*="minmax(0, 1fr) 420px"],
  .canvas-page [style*="minmax(0, 1fr) 400px"],
  .canvas-page [style*="minmax(0, 1fr) 360px"],
  .canvas-page [style*="minmax(0, 1fr) 600px"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .canvas-footer > div:first-of-type {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 36px !important;
  }

  .canvas-footer-cols {
    flex-wrap: wrap !important;
    white-space: normal !important;
    gap: 32px 40px !important;
    width: 100%;
  }

  .canvas-footer-cols > div {
    flex: 1 1 140px;
  }

  /* The 560px seal column stacks here, but its -136px tuck was
     meant for the side-by-side hero. Left in place it covers
     "What it means". */
  .canvas-page[data-canvas="home"] [style*="margin-top: -136px"] {
    margin-top: 32px !important;
  }

  .canvas-page[data-canvas="home"] > section:first-of-type .fadeup {
    position: relative;
    z-index: 2;
  }
}

.canvas-page {
  min-width: 0;
  overflow-wrap: break-word;
}

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  body {
    overflow-x: hidden;
    overflow-x: clip;
  }

  .canvas-page {
    --gutter: 40px;
    overflow-x: clip;
    max-width: 100%;
  }

  .canvas-page > * {
    min-width: 0;
    max-width: 100%;
  }

  .canvas-page [style*="padding:"][style*="96px"],
  .canvas-page [style*="padding:"][style*="76px"],
  .standing-main {
    padding-left: var(--gutter) !important;
    padding-right: var(--gutter) !important;
  }

  .canvas-ticker,
  .canvas-nav {
    padding-left: var(--gutter) !important;
    padding-right: var(--gutter) !important;
  }

  .canvas-ticker {
    height: auto !important;
    min-height: 40px;
    flex-wrap: nowrap !important;
    gap: 12px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    letter-spacing: 0.06em !important;
  }

  .canvas-ticker span,
  .canvas-ticker a {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .canvas-nav {
    height: auto !important;
    flex-wrap: wrap;
    position: relative;
    row-gap: 12px;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    align-items: center;
  }

  .canvas-nav-brand {
    flex: 1 1 auto;
    padding-right: 92px;
  }

  .canvas-nav-links {
    flex-wrap: nowrap !important;
    width: 100%;
    gap: 10px !important;
    justify-content: space-between !important;
    font-size: 13px;
  }

  .canvas-nav-links a {
    white-space: nowrap !important;
    flex: 0 0 auto;
  }

  .canvas-nav-apply {
    position: absolute;
    top: 12px;
    right: var(--gutter, 40px);
    padding: 8px 16px !important;
    font-size: 14px !important;
  }

  .canvas-page .join-diagram {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: stretch !important;
    align-items: start !important;
    gap: 20px !important;
  }

  .canvas-page .join-diagram span[aria-hidden="true"][style*="margin-left: auto"] {
    display: none !important;
  }

  .canvas-page .join-diagram > div:last-child {
    justify-self: center !important;
    width: min(244px, 100%) !important;
    height: auto !important;
  }

  .canvas-page h1,
  .canvas-page [style*="font-size: 136px"],
  .canvas-page [style*="font-size: 128px"],
  .canvas-page [style*="font-size: 124px"],
  .canvas-page [style*="font-size: 120px"],
  .canvas-page [style*="font-size: 112px"],
  .canvas-page [style*="font-size: 104px"] {
    font-size: clamp(48px, 7vw, 88px) !important;
    line-height: 1.02 !important;
    white-space: normal !important;
    max-width: 100%;
    text-wrap: wrap !important;
  }

  .canvas-page h2,
  .canvas-page [style*="font-size: 96px"],
  .canvas-page [style*="font-size: 92px"],
  .canvas-page [style*="font-size: 88px"],
  .canvas-page [style*="font-size: 84px"],
  .canvas-page [style*="font-size: 80px"],
  .canvas-page [style*="font-size: 72px"],
  .canvas-page [style*="font-size: 68px"] {
    font-size: clamp(36px, 5.5vw, 64px) !important;
    line-height: 1.04 !important;
    white-space: normal !important;
  }

  .canvas-footer-tagline {
    font-size: clamp(40px, 7vw, 64px) !important;
    white-space: normal !important;
  }

  .canvas-page .mask,
  .canvas-page .mask > span {
    max-width: 100%;
    white-space: normal !important;
  }

  .canvas-page [style*="font-size: 64px"],
  .canvas-page [style*="font-size: 56px"] {
    font-size: clamp(32px, 4.8vw, 52px) !important;
    white-space: normal !important;
  }

  .canvas-page [style*="width: 300px"],
  .canvas-page [style*="width: 320px"],
  .canvas-page [style*="width: 360px"],
  .canvas-page [style*="width: 380px"],
  .canvas-page [style*="width: 400px"],
  .canvas-page [style*="width: 420px"],
  .canvas-page [style*="width: 460px"],
  .canvas-page [style*="width: 480px"],
  .canvas-page [style*="width: 500px"],
  .canvas-page [style*="width: 560px"],
  .canvas-page [style*="width: 600px"],
  .canvas-page [style*="width: 640px"] {
    max-width: 100% !important;
  }

  .canvas-page [style*="width: 420px"][style*="flex-shrink: 0"],
  .canvas-page [style*="width: 320px"] {
    width: 100% !important;
    flex-shrink: 1 !important;
  }

  .canvas-page [style*="display: flex"][style*="gap: 80px"] {
    flex-direction: column !important;
    gap: 28px !important;
  }

  .canvas-page section [style*="justify-content: space-between"][style*="align-items: center"][style*="gap: 48px"],
  .canvas-page section [style*="justify-content: space-between"][style*="align-items: center"][style*="gap: 24px"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px !important;
  }

  .canvas-page form[style*="min-width: 300px"] {
    min-width: 0 !important;
    width: 100%;
  }

  .canvas-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .canvas-page textarea,
  .canvas-page select {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Wide data tables overflow a 768 board */
  .canvas-page [style*="grid-template-columns: 170px"],
  .canvas-page [style*="grid-template-columns: 120px 320px"],
  .canvas-page [style*="grid-template-columns: 260px"],
  .canvas-page [style*="grid-template-columns: 64px 280px"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px 16px !important;
  }

  .canvas-page [style*="grid-template-columns: 170px"][style*="text-transform: uppercase"] {
    display: none !important;
  }

  .canvas-page section svg[width="500"] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .canvas-footer > div:first-of-type {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 36px !important;
  }

  .canvas-footer-cols {
    flex-wrap: wrap !important;
    white-space: normal !important;
    gap: 32px 40px !important;
    width: 100%;
  }

  .canvas-footer-cols > div {
    flex: 1 1 140px;
  }

  .canvas-page [style*="margin: 150px 48px"],
  .canvas-page [style*="margin: 0 48px"] {
    margin-left: 24px !important;
    margin-right: 24px !important;
  }

  /* Keep 2-up cards; collapse 3+ and wide side-by-side figures */
  .canvas-page [style*="repeat(3, minmax(0, 1fr))"],
  .canvas-page [style*="repeat(4, minmax(0, 1fr))"],
  .canvas-page [style*="repeat(5, minmax(0, 1fr))"],
  .canvas-page [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .canvas-page [style*="minmax(0, 1fr) 560px"],
  .canvas-page [style*="minmax(0, 1fr) 520px"],
  .canvas-page [style*="minmax(0, 1fr) 500px"],
  .canvas-page [style*="minmax(0, 1fr) 480px"],
  .canvas-page [style*="minmax(0, 1fr) 460px"],
  .canvas-page [style*="minmax(0, 1fr) 440px"],
  .canvas-page [style*="minmax(0, 1fr) 420px"],
  .canvas-page [style*="minmax(0, 1fr) 400px"],
  .canvas-page [style*="minmax(0, 1fr) 360px"],
  .canvas-page [style*="minmax(0, 1fr) 600px"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .standing-main h1 {
    font-size: clamp(48px, 8vw, 72px) !important;
  }

  .canvas-page [style*="margin-top: -136px"] {
    margin-top: 12px !important;
  }

  .canvas-seal {
    width: min(400px, calc(100vw - 80px)) !important;
    height: min(400px, calc(100vw - 80px)) !important;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .canvas-page {
    --gutter: 20px;
  }

  .canvas-page [style*="padding:"][style*="96px"],
  .canvas-page [style*="padding:"][style*="76px"],
  .standing-main,
  .canvas-ticker,
  .canvas-nav,
  .canvas-footer {
    padding-left: var(--gutter) !important;
    padding-right: var(--gutter) !important;
  }

  .canvas-page h1,
  .canvas-page [style*="font-size: 136px"],
  .canvas-page [style*="font-size: 128px"],
  .canvas-page [style*="font-size: 124px"],
  .canvas-page [style*="font-size: 120px"],
  .canvas-page [style*="font-size: 112px"],
  .canvas-page [style*="font-size: 104px"] {
    font-size: clamp(40px, 11vw, 58px) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.04em !important;
    max-width: 100%;
    text-wrap: wrap !important;
  }

  .canvas-page .mask,
  .canvas-page .mask > span {
    max-width: 100%;
    white-space: normal !important;
  }

  .join-diagram {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    flex-shrink: 1 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: stretch !important;
    align-items: start !important;
    gap: 12px !important;
  }

  .join-diagram > div:first-child {
    width: 100%;
    max-width: 100%;
  }

  .join-diagram span[aria-hidden="true"][style*="margin-left: auto"] {
    display: none !important;
  }

  .join-diagram > div:last-child {
    justify-self: center !important;
    width: min(244px, 100%) !important;
    height: auto !important;
    margin-top: 8px;
  }

  .year-bead,
  .join-diagram svg circle[r="5.5"] {
    display: none !important;
  }

  /* Only large figures — never 44px ticks / 32px step dots */
  .canvas-page section [style*="flex-shrink: 0"][style*="width: 400px"],
  .canvas-page section [style*="flex-shrink: 0"][style*="width: 460px"],
  .canvas-page section [style*="flex-shrink: 0"][style*="width: 480px"],
  .canvas-page section [style*="flex-shrink: 0"][style*="width: 560px"],
  .canvas-page section [style*="flex-shrink: 0"][style*="width: 600px"],
  .canvas-page section [style*="flex-shrink: 0"][style*="width: 640px"] {
    flex-shrink: 1 !important;
    max-width: 100% !important;
  }

  .canvas-page h2,
  .canvas-page [style*="font-size: 96px"],
  .canvas-page [style*="font-size: 92px"],
  .canvas-page [style*="font-size: 88px"],
  .canvas-page [style*="font-size: 84px"],
  .canvas-page [style*="font-size: 80px"],
  .canvas-page [style*="font-size: 72px"],
  .canvas-page [style*="font-size: 68px"],
  .canvas-page [style*="font-size: 64px"],
  .canvas-page [style*="font-size: 56px"],
  .canvas-page [style*="font-size: 48px"] {
    font-size: clamp(28px, 8vw, 40px) !important;
    line-height: 1.08 !important;
    white-space: normal !important;
  }

  .canvas-footer-tagline {
    font-size: clamp(36px, 10vw, 48px) !important;
  }

  .canvas-page [style*="font-size: 30px"] {
    font-size: 24px !important;
  }

  /* Stack almost every multi-column grid */
  .canvas-page [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
  }

  /* Keep icon + text / numbered legend rows as two columns */
  .canvas-page [style*="grid-template-columns: 22px"],
  .canvas-page [style*="grid-template-columns: 48px"],
  .canvas-page [style*="grid-template-columns: 52px"],
  .canvas-page .leg {
    grid-template-columns: 52px minmax(0, 1fr) !important;
  }

  .canvas-page .join-diagram {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    justify-items: stretch !important;
  }

  .canvas-page [style*="justify-content: space-between"][style*="align-items: flex-end"],
  .canvas-page [style*="justify-content: space-between"][style*="align-items: flex-start"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }

  .canvas-page [style*="display: flex"][style*="gap: 64px"],
  .canvas-page [style*="display: flex"][style*="gap: 48px"] {
    flex-wrap: wrap !important;
  }

  .canvas-page [style*="margin-top: -136px"] {
    margin-top: 12px !important;
  }

  .canvas-page [style*="border-left: 1.5px solid"],
  .canvas-page [style*="border-left: 1px solid"][style*="padding-left: 36px"],
  .canvas-page [style*="border-left: 1px solid"][style*="padding-left: 56px"] {
    border-left: none !important;
    border-top: 1.5px solid #DDD9D1 !important;
    padding-left: 0 !important;
    padding-top: 24px !important;
  }

  /* Table header rows (uppercase track labels) */
  .canvas-page [style*="grid-template-columns"][style*="text-transform: uppercase"][style*="letter-spacing: 0.12em"] {
    display: none !important;
  }

  .canvas-seal {
    width: min(340px, calc(100vw - 40px)) !important;
    height: min(340px, calc(100vw - 40px)) !important;
    margin-left: auto;
    margin-right: auto;
  }

  .canvas-page [style*="margin: 150px 48px"],
  .canvas-page [style*="margin: 0 48px"] {
    margin-left: 12px !important;
    margin-right: 12px !important;
    border-radius: 20px !important;
  }

  .canvas-footer {
    padding-top: 56px !important;
    padding-bottom: 28px !important;
    gap: 40px !important;
  }

  .canvas-footer > svg {
    display: none !important;
  }

  .canvas-footer > div:first-of-type {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 32px !important;
    position: relative;
    z-index: 1;
  }

  .canvas-footer-cols {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    flex-direction: unset !important;
    gap: 24px 28px !important;
    width: 100%;
    white-space: normal !important;
  }

  .canvas-footer-cols > div {
    flex: none;
  }

  .canvas-footer-meta {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding-top: 22px !important;
    position: relative;
    z-index: 1;
  }

  .canvas-footer-meta > span {
    line-height: 1.45;
  }

  .canvas-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .canvas-page textarea,
  .canvas-page select,
  .standing-form input,
  .standing-form textarea {
    font-size: 16px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .standing-form,
  .standing-main {
    max-width: none;
  }

  .standing-main h1 {
    font-size: clamp(40px, 11vw, 58px) !important;
  }

  .canvas-page form [style*="repeat(2, minmax(0, 1fr))"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Button rows wrap */
  .canvas-page [style*="display: flex"][style*="gap: 12px"] {
    flex-wrap: wrap !important;
  }

  .chip span {
    white-space: normal !important;
  }

  .canvas-nav-links {
    font-size: 10px;
    gap: 4px !important;
    justify-content: flex-start !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .canvas-nav-links a {
    flex: 0 1 auto;
  }

  .canvas-ticker {
    font-size: 10px !important;
    letter-spacing: 0.04em !important;
  }

  /* Consent tick on the left; note above the send button */
  .canvas-page .canvas-consent[style*="gap: 12px"] {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    align-items: flex-start !important;
    gap: 16px !important;
    width: 100%;
  }

  .canvas-consent input[type="checkbox"] {
    margin-top: 4px !important;
  }

  .canvas-form-actions,
  .canvas-page form [style*="justify-content: space-between"][style*="align-items: center"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }

  .canvas-form-actions > div,
  .canvas-page form [style*="justify-content: space-between"][style*="align-items: center"] > div {
    max-width: 100% !important;
    padding-top: 0 !important;
  }

  .canvas-form-actions button,
  .canvas-page form [style*="justify-content: space-between"][style*="align-items: center"] button {
    width: 100%;
    margin-top: 0 !important;
    align-self: stretch;
  }

  .canvas-page form[style*="padding: 56px"] {
    padding: 28px 20px !important;
  }
}

/* Home: seal under the lede */
@media (max-width: 720px) {
  .canvas-page[data-canvas="home"] > section:first-of-type [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Standard staff: on phones, drop the 480px engraving and stack the clause list */
@media (max-width: 720px) {
  .canvas-page[data-canvas="standard"] [style*="flex-direction: column; width: 480px"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible;
  }

  .canvas-staff {
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
    position: relative !important;
  }

  .canvas-staff > svg,
  .canvas-staff svg,
  .canvas-staff .staff-a,
  .canvas-staff .staff-b,
  .canvas-staff .staff-moss,
  .canvas-staff .staff-line,
  .canvas-staff .staff-bead {
    display: none !important;
  }

  .canvas-staff > [style*="border-radius: 50%"] {
    display: none !important;
  }

  .canvas-staff > [style*="position: absolute"],
  .canvas-staff a.staff-row {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    padding: 10px 0 !important;
  }

  .canvas-staff [style*="white-space: nowrap"] {
    white-space: normal !important;
  }

  .canvas-page[data-canvas="standard"] text[transform*="rotate(90)"] {
    display: none;
  }
}

@media (max-width: 1100px) and (min-width: 721px) {
  .canvas-staff {
    width: 480px !important;
    height: 759px !important;
    transform: scale(0.85);
    transform-origin: top left;
    margin-bottom: calc(759px * -0.15);
  }
}

/* Self-check */
@media (max-width: 1100px) {
  .canvas-sc-toolbar {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding-left: var(--gutter, 40px) !important;
    padding-right: var(--gutter, 40px) !important;
    grid-template-columns: none !important;
  }

  .canvas-sc-toolbar > *,
  .canvas-sc-toolbar nav[aria-label="Questions"] {
    min-width: 0 !important;
    max-width: 100%;
  }

  .canvas-sc-toolbar nav[aria-label="Questions"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .qrow,
  .canvas-page [style*="76px minmax(0, 1fr) 286px 430px"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .canvas-page [style*="76px minmax(0, 1fr) 286px 430px"]:not(.qrow) {
    display: none !important;
  }

  .canvas-sc-toolbar [style*="display: flex"][style*="align-items: center"][style*="gap: 20px"] {
    flex-wrap: wrap !important;
    gap: 10px 14px !important;
  }

  .canvas-sc-toolbar [style*="padding-left: 4px"] {
    flex: 1 1 100%;
  }

  .canvas-sc-toolbar .barbtn,
  .canvas-sc-toolbar a[href="#result"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block;
    text-align: center;
  }

  .canvas-page [style*="grid-template-columns"][style*="300px"],
  .canvas-page [style*="grid-template-columns"][style*="240px"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 720px) {
  .qrow {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  .qrow > div {
    border-top: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .qrow > div:first-child {
    padding-bottom: 8px !important;
  }

  .seg {
    display: flex !important;
    width: 100%;
    box-sizing: border-box;
  }

  .seg label {
    flex: 1 1 0;
    min-height: 44px;
  }

  .seg span {
    text-align: center;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 8px !important;
    box-sizing: border-box;
  }

  .parthead {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 22px 0 !important;
  }

  .canvas-page[data-canvas="self-check"] [style*="width: 340px"],
  .canvas-page[data-canvas="self-check"] [style*="width: 360px"],
  .canvas-page[data-canvas="self-check"] [style*="width: 280px"] {
    width: min(280px, 100%) !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Meaning cell: ink rule on the left */
  .qrow > [aria-live] {
    border-left: 1.5px solid #1A1A18 !important;
    border-top: 1px solid #DDD9D1 !important;
    padding: 16px 0 24px 16px !important;
    margin-top: 8px;
  }

  .canvas-sc-toolbar nav[aria-label="Questions"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* The ring is drawn in a 460px box: the score and the A–F
     labels are placed in that space. Forcing the box to 280px
     scaled only the svg, so the score dropped out of the hole
     and the labels missed the ring. Scale the whole box. */
  .canvas-page[data-canvas="self-check"] [style*="flex-direction: column"][style*="width: 460px"] {
    width: 100% !important;
    max-width: 100% !important;
    container-type: inline-size;
  }

  .canvas-page[data-canvas="self-check"] section .canvas-sc-ring {
    width: 460px !important;
    height: 460px !important;
    max-width: none !important;
    flex-shrink: 0 !important;
    transform: scale(calc(100cqw / 460px));
    transform-origin: top left;
    margin-right: calc(100cqw - 460px);
    margin-bottom: calc(100cqw - 460px);
  }

  .canvas-page[data-canvas="self-check"] .canvas-sc-ring svg,
  .canvas-page[data-canvas="self-check"] .canvas-sc-ring [style*="width: 460px"] {
    width: 460px !important;
    height: 460px !important;
    max-width: none !important;
  }

  .canvas-page[data-canvas="self-check"] .canvas-sc-ring [style*="font-size: 124px"] {
    font-size: 124px !important;
  }

  .canvas-page[data-canvas="self-check"] .canvas-sc-ring > div {
    pointer-events: none;
  }
}

/* Badge: legend under the stage; click panels stack with arrows down */
@media (max-width: 720px) {
  .canvas-page[data-canvas="badge"] [style*="minmax(0, 1fr) 56px minmax(0, 1fr) 56px"] > div:nth-child(even) {
    transform: rotate(90deg);
    justify-self: center;
    height: 40px;
    width: 40px;
  }
}

/* Where data goes: scale the boundary figure to the gutter */
@media (max-width: 1100px) {
  .canvas-boundary {
    width: 600px !important;
    height: 520px !important;
    transform: scale(min(1, calc((100vw - 80px) / 600)));
    transform-origin: top left;
    margin-bottom: calc(520px * (min(1, (100vw - 80px) / 600) - 1));
  }
}

@media (max-width: 720px) {
  .canvas-boundary {
    transform: scale(min(1, calc((100vw - 40px) / 600)));
    margin-bottom: calc(520px * (min(1, (100vw - 40px) / 600) - 1));
  }
}

/* Members: compact card with the arrow on the right, not a lonely last row */
@media (max-width: 720px) {
  .canvas-page a.pledge {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .canvas-page [style*="grid-template-columns: 2fr 1.2fr 1fr 1.4fr 120px"][style*="padding-bottom: 14px"] {
    display: none !important;
  }

  .canvas-page a.rowlink[style*="grid-template-columns: 2.2fr"],
  .canvas-page [style*="grid-template-columns: 2fr 1.2fr 1fr 1.4fr 120px"] {
    display: grid !important;
    grid-template-columns: auto auto minmax(0, 1fr) 44px !important;
    column-gap: 0 !important;
    row-gap: 4px !important;
    align-items: center !important;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
  }

  .canvas-page a.rowlink[style*="2.2fr"] > :nth-child(1),
  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(1) {
    grid-column: 1 / 4;
    grid-row: 1;
    font-size: 17px !important;
  }

  .canvas-page a.rowlink[style*="2.2fr"] > :nth-child(2),
  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    font-size: 14px !important;
    color: #6B6862 !important;
    padding-right: 8px;
  }

  .canvas-page a.rowlink[style*="2.2fr"] > :nth-child(3),
  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    font-size: 14px !important;
    color: #6B6862 !important;
  }

  .canvas-page a.rowlink[style*="2.2fr"] > :nth-child(3)::before,
  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(3)::before {
    content: "·";
    margin-right: 8px;
    color: #C9C4BA;
  }

  .canvas-page a.rowlink[style*="2.2fr"] > :nth-child(4),
  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(4) {
    grid-column: 1 / 4;
    grid-row: 3;
    margin-top: 8px;
    justify-self: start;
  }

  .canvas-page a.rowlink[style*="2.2fr"] > :nth-child(5),
  .canvas-page a.rowlink .arrow,
  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(5) {
    grid-column: 4;
    grid-row: 1 / 4;
    align-self: center;
    justify-self: end;
    text-align: right;
    color: #355241;
    font-size: 18px;
  }

  .canvas-page [style*="grid-template-columns: 2fr 1.2fr 1fr 1.4fr 120px"]:not([style*="padding-bottom: 14px"]) {
    position: relative;
  }

  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(5) a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 0 !important;
    line-height: 1;
    text-decoration: none;
  }

  /* The arrow is the visible control. The stretch covers the card,
     because a font-size of 0 collapsed the link to 18×0. */
  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(5) a::before {
    content: "";
    position: absolute;
    inset: 0;
  }

  .canvas-page [style*="2fr 1.2fr 1fr 1.4fr 120px"] > :nth-child(5) a::after {
    content: "→";
    font-size: 18px;
    line-height: 1;
    font-weight: 500;
    color: #355241;
  }

  .canvas-page[data-canvas="home"] [style*="justify-content: space-between"][style*="padding-top: 18px"][style*="border-top: 1px solid #DDD9D1"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .canvas-page section[style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .canvas-page h1 .mask,
  .canvas-page h1 .mask > span {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal !important;
  }

  .canvas-page img {
    max-width: 100%;
    height: auto;
  }

  .canvas-page a[style*="border-radius: 999px"] {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Circles stay circles — never let a squeezed flex row turn a tick into an oval */
.canvas-status-tick,
.canvas-page [style*="border-radius: 50%"][style*="width: 44px"][style*="height: 44px"] {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  flex: 0 0 44px !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box !important;
}

/* Home moss-band: badge card goes full column, not a skinny centred chip */
@media (max-width: 1100px) {
  .canvas-page[data-canvas="home"] section[style*="background: #355241"] {
    padding-top: 80px !important;
    padding-bottom: 80px !important;
    gap: 40px !important;
  }

  .canvas-badge-stage {
    height: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-content: stretch !important;
  }

  .canvas-badge-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 40px 32px !important;
    box-sizing: border-box;
  }

  .canvas-member-badge {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    justify-content: flex-start !important;
  }
}

@media (max-width: 720px) {
  .canvas-page[data-canvas="home"] section[style*="background: #355241"] {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
    margin-top: 72px !important;
    gap: 28px !important;
  }

  .canvas-badge-card {
    padding: 28px 18px !important;
    gap: 20px !important;
    border-radius: 24px !important;
  }

  .canvas-member-badge {
    padding: 14px 18px 14px 12px !important;
    gap: 14px !important;
  }

  .canvas-member-badge svg {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
  }

  .canvas-member-badge [style*="font-size: 22px"] {
    font-size: 18px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  .canvas-member-badge [style*="font-size: 19px"] {
    font-size: 14px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
  }

  .canvas-badge-legend {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 12px !important;
    width: 100% !important;
    font-size: 12px !important;
    text-align: center;
    justify-content: stretch !important;
  }

  .canvas-badge-legend span {
    white-space: nowrap !important;
  }

  /* Certified / special-member chip: tick stays a circle, scan sits underneath */
  .canvas-status-chip {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: start !important;
    column-gap: 14px !important;
    row-gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    align-self: stretch !important;
    padding: 18px !important;
    box-sizing: border-box;
  }

  .canvas-status-tick {
    grid-column: 1;
    grid-row: 1;
  }

  .canvas-status-chip > div:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .canvas-status-rule {
    display: none !important;
  }

  .canvas-status-chip > div:last-child {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 12px;
    border-top: 1px solid #C9D6CC;
  }

  .canvas-status-chip [style*="font-size: 26px"] {
    font-size: 22px !important;
  }

  /* Validity dial and about mark: scale to the gutter */
  .canvas-dial,
  .canvas-figure-400,
  .canvas-page [style*="width: 400px"][style*="height: 400px"] {
    width: min(400px, calc(100vw - 40px)) !important;
    height: min(400px, calc(100vw - 40px)) !important;
    max-width: 100% !important;
    margin-left: auto;
    margin-right: auto;
  }

  .canvas-dial svg,
  .canvas-figure-400 svg,
  .canvas-page [style*="width: 400px"][style*="height: 400px"] svg {
    width: 100% !important;
    height: 100% !important;
  }

  .canvas-dial [style*="font-size: 42px"] {
    font-size: clamp(26px, 8vw, 42px) !important;
    white-space: nowrap !important;
  }

  /* Chip rows (gap: 10px) and label+pill rows (gap: 16px) must wrap, not clip */
  .canvas-page [style*="display: flex"][style*="gap: 10px"],
  .canvas-page [style*="display: flex"][style*="gap: 16px"] {
    flex-wrap: wrap !important;
  }

  .canvas-page [style*="white-space: nowrap"][style*="border-radius: 999px"] {
    white-space: normal !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .canvas-page [style*="display: flex"][style*="gap: 80px"] {
    flex-direction: column !important;
    gap: 28px !important;
  }

  .canvas-page [style*="width: 360px"],
  .canvas-page [style*="width: 380px"],
  .canvas-page [style*="width: 420px"] {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
  }

  .canvas-sc-toolbar .barbtn,
  .canvas-sc-toolbar a[href="#result"] {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .canvas-page[data-canvas="badge"] .fx[style*="height: 540px"] {
    height: auto !important;
    min-height: 240px;
    padding: 28px 12px;
    overflow: hidden;
  }

  .canvas-page[data-canvas="badge"] .fx[style*="height: 540px"] > .fx {
    transform: scale(0.58);
    transform-origin: center center;
    margin: -40px 0;
  }

  .canvas-page [style*="flex: 0 0 160px"] {
    flex: 0 1 auto !important;
  }

  .canvas-nav-links {
    padding-right: 2px;
  }
}
