html:has(.aa-card-page) {
  --aa-card-header-height: var(--aa-navigation-height, 72px);
  scroll-padding-block-start: var(--aa-card-header-height);
}

.aa-card-page {
  --aa-card-gutter: clamp(1rem, 4vw, 3.5rem);
  --aa-card-page-background: var(--paper, #fffefb);
  max-width: 1440px;
  margin: auto;
  padding: clamp(.875rem, 2.5vw, 2rem) var(--aa-card-gutter) 2rem;
  background: var(--aa-card-page-background);
  color: var(--ink, #24252b);
}
.aa-card-title {
  max-width: 42rem;
  margin-block-end: clamp(1.25rem, 3vw, 2rem);
}
.aa-card-title h1 { margin-block: 0 .35em; font-size: clamp(2rem, 4vw, 3.5rem); }
.aa-card-title p { margin: 0; }
.aa-card-title .aa-card-register-link { margin-top: .65rem; }
.aa-card-hero-figure {
  --aa-card-hero-zoom: 7;
  position: relative;
  width: 100%;
  aspect-ratio: 1.65;
  margin: 0;
  overflow: hidden;
  border-radius: .875rem;
}
.aa-card-hero-scene {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  aspect-ratio: 3 / 2;
  transform-origin: top left;
  transform: scale(var(--aa-card-hero-zoom)) translate(-49.72%, -52.395%);
}
.aa-card-hero-image { display: block; width: 100%; height: auto; }
.aa-card-photo-preview {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(9.8% * var(--aa-card-hero-zoom));
  transform: translate(-50%, -50%);
}
/* Trace the original fingertips over the live card where they grip its edges. */
.aa-card-hero-foreground { pointer-events: none; }
.aa-card-hero-foreground::before,
.aa-card-hero-foreground::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/_allergy-card/card-handover-v3.webp") center / 100% 100% no-repeat;
}
.aa-card-hero-foreground::before {
  clip-path: polygon(44.076% 47.534%, 44.466% 48.291%, 44.775% 49.023%, 44.954% 49.414%, 45.150% 50.024%, 45.313% 50.513%, 45.394% 50.952%, 45.394% 51.245%, 45.329% 51.538%, 45.182% 51.807%, 45.003% 52.051%, 44.808% 52.222%, 44.596% 52.417%, 44.076% 52.661%);
}
.aa-card-hero-foreground::after {
  clip-path: polygon(55.273% 55.176%, 54.867% 55.054%, 54.606% 55.054%, 54.362% 55.127%, 54.134% 55.273%, 53.939% 55.518%, 53.825% 55.786%, 53.760% 56.104%, 53.727% 56.494%, 53.760% 56.934%, 53.678% 57.251%, 53.564% 57.593%, 53.369% 58.398%, 55.273% 58.398%);
}
.aa-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
}
.aa-card-preview { grid-column: 2; grid-row: 1; align-self: stretch; min-width: 0; }
.aa-card-size { container-type: inline-size; }
.aa-card-front-pin {
  position: sticky;
  inset-block-start: var(--aa-card-header-height);
  z-index: 2;
  padding-block: .45rem .65rem;
  background: var(--aa-card-page-background);
}
.aa-card-face {
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 85 / 55;
  border-radius: 2.4cqw;
  box-shadow: 0 .4rem 1.25rem #24252b18;
}
.aa-card-front {
  height: calc(100cqw * 55 / 85);
  padding: 3.25cqw 5cqw 5.5cqw;
  background: var(--paper, #fcfbf7);
  border: 1px solid var(--line, #dfded9);
  display: grid;
  --aa-card-allergy-indent: 4cqw;
  --aa-card-qr-rise: 0cqw;
  row-gap: 1.65cqw;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.aa-card-front-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2cqw;
}
.aa-card-front-heading h3 { margin: 0; min-inline-size: 0; font-size: 5.8cqw; line-height: 1.06; overflow-wrap: anywhere; }
.aa-card-photo-preview .aa-card-front { border: 0; border-radius: 1.2cqw; box-shadow: none; }
.aa-card-photo-preview .aa-card-front:has(.aa-card-allergens-nowrap):not(:has(.aa-card-allergens li:nth-child(10))) {
  --aa-card-qr-rise: 10cqw;
}
.aa-card-front:has(.aa-card-allergens li:nth-child(11)) {
  padding-block-start: 2.25cqw;
  row-gap: .55cqw;
}
.aa-card-front-heading img { display: block; flex: none; width: 29cqw; height: auto; }
.aa-card-allergens { min-block-size: 0; display: flex; }
.aa-card-front .aa-card-allergens ul {
  box-sizing: border-box;
  width: 100%;
  min-block-size: 0;
  padding: 2.25cqw var(--aa-card-allergy-indent) .75cqw;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: safe center;
  gap: .6cqw 3cqw;
  list-style: none;
  overflow: auto;
}
.aa-card-front .aa-card-allergens ul:has(li:nth-child(6)) {
  /* Keep column two at the card midpoint, including the gap between columns. */
  grid-template-columns: minmax(0, calc(50% - 3cqw)) minmax(0, 1fr);
  grid-template-rows: repeat(var(--aa-card-allergy-rows), max-content);
  grid-auto-flow: column;
}
.aa-card-front .aa-card-allergens li {
  display: flex;
  align-items: flex-start;
  gap: .75cqw;
  min-inline-size: 0;
  margin: 0;
  font-size: calc(5.2cqw * var(--aa-card-allergy-scale, 1));
  line-height: 1.02;
  font-weight: 700;
  text-align: start;
  overflow-wrap: anywhere;
}
.aa-card-front .aa-card-allergens ul:has(li:nth-child(11)) { padding-block: .25cqw; row-gap: .15cqw; }
.aa-card-allergens-nowrap li span { white-space: nowrap; }
.aa-card-photo-preview .aa-card-allergens-nowrap li:nth-child(5):last-child { max-inline-size: 64cqw; }
.aa-card-allergens li svg {
  flex: none;
  inline-size: 1em;
  block-size: 1em;
  fill: none;
  stroke: #000;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.aa-card-front-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34cqw;
  align-items: end;
  padding-inline-end: 1cqw;
  gap: 0 1.5cqw;
}
.aa-card-photo-preview .aa-card-front-footer { padding-inline-end: 6.5cqw; }
.aa-card-website {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  justify-items: end;
  gap: .65cqw;
  text-align: end;
  font-weight: 700;
  line-height: 1.1;
}
.aa-card-website > a { margin-block-start: calc(-1 * var(--aa-card-qr-rise)); }
.aa-card-website img { display: block; width: 12.5cqw; height: auto; }
.aa-card-website-copy { display: grid; gap: .35cqw; font-size: 3.15cqw; overflow-wrap: anywhere; }
.aa-card-website-copy a { color: inherit; text-decoration: none; }
.aa-card-website-copy a:hover, .aa-card-website-copy a:focus-visible { text-decoration: underline; }
.aa-card-food-preferences {
  grid-column: 1;
  grid-row: 1;
  padding-inline-start: var(--aa-card-allergy-indent);
  text-align: start;
  font-size: 3.65cqw;
  line-height: 1.15;
}
.aa-card-food-preferences[hidden] { display: none; }
.aa-card-food-preferences strong { display: block; font-size: 3.25cqw; margin-block-end: .55cqw; }
.aa-card-food-preference-values { display: flex; flex-wrap: wrap; gap: .35cqw 1.5cqw; }
.aa-card-form { grid-column: 1; grid-row: 1; min-width: 0; }
.aa-card-form fieldset { padding: 0; border: 0; margin: 0 0 1rem; min-width: 0; }
.aa-card-form legend { font-weight: 750; font-size: 1.4rem; margin-bottom: .45rem; padding: 0; }
.aa-card-form p { margin: .3rem 0 .7rem; }
.aa-card-form label:where(:not(.aa-card-choice, .aa-card-membership, .aa-card-payment-option)) { display: block; font-weight: 650; margin: .55rem 0; }
.aa-card-form small { font-weight: 400; }
.aa-card-form input:not([type="checkbox"], [type="radio"]) {
  box-sizing: border-box;
  width: 100%;
  display: block;
  border: 1px solid #a8aaa9;
  border-radius: .5rem;
  margin: .25rem 0;
  padding: .65rem .75rem;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 400;
}
.aa-card-form input[type="checkbox"] { accent-color: #237b55; width: 1.125rem; height: 1.125rem; flex: none; margin: 0; padding: 0; }
.aa-card-choices, .aa-card-address { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.aa-card-choices { max-inline-size: 27.25rem; gap: 10px; }
.aa-card-choice, .aa-card-membership { display: flex; align-items: center; gap: .5rem; font-size: .875rem; cursor: pointer; }
.aa-card-choices .aa-card-choice {
  position: relative;
  box-sizing: border-box;
  min-height: 54px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #dfe7dc;
  border-radius: 13px;
  background: #f8faf7;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.aa-card-choices .aa-card-choice > input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  clip-path: inset(50%);
}
.aa-card-choices .aa-card-choice:has(:focus-visible) {
  outline: 2px solid var(--purple, #5034b9);
  outline-offset: 2px;
}
.aa-card-icon { flex: none; width: 26px; font-size: 23px; line-height: 1; text-align: center; }
.aa-card-toggle {
  flex: none;
  position: relative;
  margin-inline-start: auto;
  inline-size: 34px;
  block-size: 21px;
  border-radius: 20px;
  background: #b9bfba;
}
.aa-card-toggle::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  inline-size: 15px;
  block-size: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
}
.aa-card-choices .aa-card-choice:has(:checked) { background: #edf7e8; border-color: #328361; }
.aa-card-choice input:checked ~ .aa-card-toggle { background: #237b55; }
.aa-card-choice input:checked ~ .aa-card-toggle::after { inset-inline-start: auto; inset-inline-end: 3px; }
.aa-card-form .aa-card-payment-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .75rem;
  margin: 0 0 .65rem;
  padding: .85rem;
  border: 1px solid #dfe7dc;
  border-radius: .6rem;
  background: #f8faf7;
  color: var(--ink, #24252b);
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
}
.aa-card-payment-option:has(:disabled) { cursor: default; }
.aa-card-payment-option:has(:checked:not(:disabled)) { border-color: #328361; background: #edf7e8; }
.aa-card-payment-option input[type="radio"] {
  inline-size: 1.125rem;
  block-size: 1.125rem;
  margin: .14rem 0 0;
  padding: 0;
  accent-color: #237b55;
}
.aa-card-payment-option:has(:focus-visible) { outline: 2px solid #237b55; outline-offset: 3px; }
.aa-card-payment-option strong,
.aa-card-payment-option small { display: block; overflow-wrap: anywhere; }
.aa-card-payment-option small { margin-block-start: .15rem; font-size: .9rem; }
.aa-card-card-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0 .65rem;
}
.aa-card-form .aa-card-card-option .aa-card-payment-option { align-content: center; margin: 0; }
.aa-card-form .aa-card-discount label { margin: 0; }
.aa-card-discount {
  display: grid;
  align-content: center;
  gap: .3rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid #dfe7dc;
  border-radius: .6rem;
}
.aa-card-discount-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem; }
.aa-card-form .aa-card-discount-entry input { min-width: 0; margin: 0; }
.aa-card-discount-entry button { min-height: 44px; align-self: stretch; white-space: nowrap; }
#aa-card-discount-status { grid-column: 1 / -1; margin: .35rem 0 0; }
#aa-card-discount-status:empty { display: none; }
#aa-card-discount-status[data-error] { color: #a51f27; }
#aa-card-order-confirmed { margin-top: 1rem; }
#aa-card-support-availability { font-weight: 650; }
.aa-card-checkout .aa-card-membership {
  align-items: start;
  gap: .75rem;
  margin: 1rem 0 .5rem;
  font-size: .95rem;
  line-height: 1.45;
}
.aa-card-checkout .aa-card-membership input { margin-block-start: .2rem; }
.aa-card-contribution {
  padding: clamp(1rem, 2vw, 1.5rem);
  margin: 1rem 0;
  border: 1px solid #c4d9c0;
  border-radius: .8rem;
  background: #edf7e8;
}
.aa-card-contribution h2 { margin: 0 0 .55rem; font-size: clamp(1.35rem, 2.5vw, 1.8rem); line-height: 1.15; }
.aa-card-contribution > p { margin: 0 0 1rem; font-size: 1.0625rem; line-height: 1.5; }
.aa-card-support-included { font-weight: 650; }
.aa-card-form .aa-card-contribution fieldset { margin-bottom: 0; }
.aa-card-form .aa-card-contribution .aa-card-frequency { margin-top: 1rem; }
.aa-card-contribution legend { font-size: 1rem; }
.aa-card-amounts { display: flex; flex-wrap: wrap; gap: .55rem; }
.aa-card-form .aa-card-amounts label {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 0 auto;
  min-height: 52px;
  margin: 0;
  padding: .4rem .75rem;
  border: 1px solid #719b7e;
  border-radius: .5rem;
  background: #fff;
  color: #143e2e;
  font-size: 1.0625rem;
  font-weight: 750;
  cursor: pointer;
}
.aa-card-amounts label:has(:checked) { border-color: #143e2e; background: #143e2e; color: #fff; }
.aa-card-amounts label:has(:focus-visible) { outline: 2px solid #143e2e; outline-offset: 2px; }
.aa-card-amounts input { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); }
.aa-card-checkout-note { font-size: .875rem; }
.aa-card-form .aa-card-checkout > button[type="submit"] { border-radius: .5rem; }
#aa-card-checkout-status[data-error] { color: #a51f27; }
.aa-card-form .aa-card-cereal-note { margin-block-start: .75rem; font-size: .9rem; }
.aa-card-form details { margin-top: 1rem; }
.aa-card-form summary { cursor: pointer; font-weight: 650; }
.aa-card-page .aa-card-error { color: #a51f27; }
.aa-card-movement { margin-top: 1.25rem; padding: 1rem; background: var(--lime, #def4aa); border-radius: 1rem; max-width: 55rem; }
.aa-card-movement h2 { margin: 0 0 .55rem; font-size: clamp(1.25rem, 3vw, 1.7rem); }
.aa-card-movement p { margin: .45rem 0; color: inherit; }
.aa-card-page [hidden] { display: none !important; }

@media (min-width: 721px) and (max-width: 1199px) {
  .aa-card-layout { display: block; }
  .aa-card-front-pin { position: static; max-width: 40rem; margin-inline: auto; }
  .aa-card-form { margin-top: 1rem; }
  .aa-card-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); max-inline-size: none; }
  .aa-card-movement { max-width: none; }
}

@media (max-width: 720px) {
  html:has(.aa-card-page) {
    scroll-padding-block-start: calc(var(--aa-card-header-height) + var(--aa-card-preview-height, 36svh) + .5rem);
  }
  .aa-card-hero-figure {
    --aa-card-hero-zoom: 8;
    aspect-ratio: 1.65;
    max-inline-size: min(30rem, calc(36svh * 1.65));
    margin-inline: auto;
  }
  .aa-card-layout { display: block; }
  .aa-card-preview { display: contents; }
  .aa-card-front-pin {
    margin-inline: calc(-1 * var(--aa-card-gutter));
    padding-inline: var(--aa-card-gutter);
  }
  .aa-card-form { margin-top: .9rem; }
}

@media (max-width: 480px) {
  .aa-card-card-option { grid-template-columns: minmax(0, 1fr); row-gap: .55rem; }
  .aa-card-choices .aa-card-choice { min-height: 50px; padding: 7px; gap: 5px; }
  .aa-card-choice .aa-card-icon { width: 20px; font-size: 19px; }
  .aa-card-toggle { inline-size: 30px; }
}
