/* Customer screens: join, email, card, confirmation, restore. Everything hangs off .cx, sheets and the
   Wallet handoff, so owner and counter pages are untouched. */
:root {
  --cx-ink: #17332c;
  --cx-ink-2: #566c63;
  --cx-line: #dfe6dc;
  --cx-bg: #f7f8f2;
  --cx-surface: #fff;
  --cx-brand: #185b4a;
  --cx-brand-press: #124a3c;
  --cx-gold: #e8a421;
  --cx-ok: #1d7a52;
  --cx-ok-bg: #e2f1e8;
  --cx-warn-ink: #7a4d00;
  --cx-warn-bg: #fff2d3;
  --cx-bad-ink: #8c2f2f;
  --cx-bad-bg: #fdeceb;
  --cx-radius: 18px;
}

/* Every tappable control shares one feel: no text selection or iOS callout on a long press,
   no grey tap flash, and a press that springs back (cx-pressed, set by customer/press.ts). */
:where(
  .cx-primary,
  .cx-secondary,
  .cx-danger,
  .cx-badge,
  .cx-card-row,
  .cx-switch-row,
  .cx-consent,
  .cx-ack,
  .cx-choice,
  .cx-link,
  .cx-back,
  .cx-foot a,
  .cx-foot button,
  .cx-topic summary,
  .customer-screen .help,
  .dev-tag
) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

/* Kept in place during page transitions (see the end of this file). */
header {
  view-transition-name: site-header;
}

/* Compact chrome on customer routes: the cafe is the hero, so the primary button stays above the fold. */
.customer-screen > header {
  padding: 8px 16px;
  border-bottom: 0;
}
.customer-screen .brand img {
  height: 22px;
  width: auto;
  display: block;
  opacity: 0.85;
}
.customer-screen .help {
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: var(--cx-ink-2);
  background: transparent;
}
.customer-screen main {
  max-width: 440px;
  margin-top: 4px;
  padding: 0 20px 28px;
}

.cx {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 400px;
  margin: 0 auto;
  color: var(--cx-ink);
}
.cx h1 {
  margin: 0;
  font-size: clamp(30px, 8.6vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.cx h2 {
  margin: 0;
}
.cx p {
  margin: 0;
}
.cx-center {
  align-items: center;
  text-align: center;
  padding-top: 18px;
}
.cx-center > * {
  max-width: 100%;
}
.cx-sub {
  color: var(--cx-ink-2);
  font-size: 18px;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.cx-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The cafe's logo keeps its own shape: a rounded tile sized by logo-tile.ts from the logo's real
   proportions, on the colour the logo was designed on. Until the logo is measured it is a square. */
:root {
  --u: 1px;
}
.cx-tile {
  --s: 88;
  --pad: 9;
  position: relative;
  flex: none;
  width: calc(var(--tw, var(--s)) * var(--u));
  height: calc(var(--th, var(--s)) * var(--u));
  max-width: 100%;
}
.cx-tile.cx-lg {
  --s: 124;
  --pad: 12;
}
.cx-tile.cx-sm {
  --s: 44;
  --pad: 5;
}
.cx-tile-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: calc(var(--tr, calc(var(--s) * 0.22)) * var(--u));
  background: var(--fill, #fff);
  box-shadow:
    0 0 0 1px var(--cx-line),
    0 14px 28px -14px color-mix(in srgb, var(--cafe, #185b4a) 60%, transparent);
}
.cx-sm .cx-tile-face {
  box-shadow: 0 0 0 1px var(--cx-line);
}
.cx-tile-art {
  position: relative;
  width: calc(var(--lw, calc(var(--s) - var(--pad) * 2)) * var(--u));
  height: calc(var(--lh, calc(var(--s) - var(--pad) * 2)) * var(--u));
}
.cx-logo-img {
  position: absolute;
  display: block;
  width: var(--iw, 100%);
  height: var(--ih, 100%);
  left: var(--ix, 0);
  top: var(--iy, 0);
  max-width: none;
  object-fit: contain;
}
.cx-tile-anim,
.cx-tile-anim .cx-tile-face,
.cx-tile-anim .cx-tile-art,
.cx-tile-anim .cx-logo-img {
  transition-duration: 0.5s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.cx-tile-anim {
  transition-property: width, height;
}
.cx-tile-anim .cx-tile-face {
  transition-property: border-radius, background-color;
}
.cx-tile-anim .cx-tile-art {
  transition-property: width, height;
}
.cx-tile-anim .cx-logo-img {
  transition-property: width, height, left, top;
}

/* The cafe seal for screens that know no cafe: a glyph in a round medallion. */
.cx-medallion {
  --box: 104px;
  --logo: 92px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--box);
  height: var(--box);
  flex: none;
}
.cx-medallion.cx-lg {
  --box: 188px;
  --logo: 116px;
}
.cx-medallion.cx-sm {
  --box: 48px;
  --logo: 48px;
}
.cx-logo {
  display: grid;
  place-items: center;
  width: var(--logo);
  height: var(--logo);
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 1px var(--cx-line),
    0 14px 28px -14px color-mix(in srgb, var(--cafe, #185b4a) 60%, transparent);
}
.cx-sm .cx-logo {
  box-shadow: 0 0 0 1px var(--cx-line);
}
.cx-logo.cx-glyph {
  color: var(--cx-brand);
}
/* One dot per purchase under the logo; the last is the reward. */
.cx-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}
.cx-dots span {
  display: flex;
  gap: 9px;
}
.cx-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cafe, #185b4a) 22%, transparent);
}
.cx-dots i.on {
  background: var(--cafe, #185b4a);
}
.cx-dots i.gift {
  background: var(--cx-gold);
  box-shadow: 0 0 0 2px var(--cx-bg);
  outline: 1.5px solid var(--cx-gold);
}
.cx-seal {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cx-ok);
  color: #fff;
  border: 3px solid var(--cx-bg);
}
.cx-medallion .cx-seal {
  right: 4px;
  bottom: 4px;
}
.cx-seal .cx-check {
  width: 20px;
  height: 20px;
}
.cx-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  isolation: isolate;
}
.cx-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 360px;
  height: 360px;
  translate: -50% -58%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--cafe, #185b4a) 11%, transparent),
    transparent
  );
  pointer-events: none;
}
.cx-hero:has(.cx-sm)::before {
  display: none;
}
.cx-hero-row {
  flex-direction: row;
  justify-content: center;
  gap: 12px;
}
.cx-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--cx-ink);
  text-align: center;
  overflow-wrap: anywhere;
}
.cx-offer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -2px;
}
.cx-offer p {
  text-align: center;
  font-size: 20px;
  color: var(--cx-ink-2);
}

/* Actions */
.cx-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.cx-primary,
.cx-secondary,
.cx-danger {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border-radius: var(--cx-radius);
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}
.cx-primary {
  margin: 0;
  background: var(--cx-brand);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 24px -14px var(--cx-brand);
}
.cx-primary:active,
.cx-primary.cx-pressed {
  background: var(--cx-brand-press);
}
.cx-secondary {
  background: var(--cx-surface);
  color: var(--cx-ink);
  border: 1.5px solid var(--cx-line);
  min-height: 52px;
  font-size: 17px;
}
.cx-danger {
  margin: 0;
  background: var(--cx-bad-ink);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 24px -14px var(--cx-bad-ink);
}
.cx-danger:active,
.cx-danger.cx-pressed {
  background: #732626;
}
.cx-primary:disabled,
.cx-secondary:disabled,
.cx-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cx-primary[aria-busy="true"]::before,
.cx-secondary[aria-busy="true"]::before,
.cx-danger[aria-busy="true"]::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cx-spin 0.8s linear infinite;
}
.cx-link {
  align-self: center;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--cx-brand);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.cx-note,
.cx-fine {
  font-size: 14.5px;
  color: var(--cx-ink-2);
  text-align: center;
  line-height: 1.4;
}
.cx-fine {
  overflow-wrap: anywhere;
}
.cx-fine a {
  color: inherit;
  text-underline-offset: 3px;
}
.cx-warning {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--cx-warn-bg);
  color: var(--cx-warn-ink);
  font-size: 17px;
  line-height: 1.35;
}
.cx-alert {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--cx-bad-bg);
  color: var(--cx-bad-ink);
  font-size: 16.5px;
  line-height: 1.35;
}
.cx-alert[hidden],
#recover-sent[hidden] {
  display: none;
}
.cx-alert a {
  color: inherit;
  font-weight: 700;
}

/* Wallet badges: Apple's and Google's artwork, unaltered */
.cx-badge {
  width: 100%;
  padding: 0;
  display: flex;
  justify-content: center;
  border: 0;
  background: none;
  cursor: pointer;
}
.cx-badge-art {
  display: block;
  height: 56px;
  width: auto;
  max-width: 100%;
}
.cx-badge-google .cx-badge-art {
  height: 52px;
}
.cx-badge:disabled,
.cx-badge[aria-busy="true"] {
  opacity: 0.55;
  cursor: default;
}

/* Forms */
.cx-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cx-field {
  display: block;
}
.cx-field input,
.cx-field textarea {
  width: 100%;
  min-height: 60px;
  padding: 0 18px;
  border: 1.5px solid var(--cx-line);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  color: var(--cx-ink);
  font: inherit;
  font-size: 19px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.cx-field textarea {
  display: block;
  min-height: 132px;
  padding: 16px 18px;
  font-size: 18px;
  line-height: 1.35;
  resize: vertical;
}
.cx-field input::placeholder,
.cx-field textarea::placeholder {
  color: #9aaba3;
}
.cx-field input:focus,
.cx-field textarea:focus {
  border-color: var(--cx-brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cx-brand) 18%, transparent);
}
.cx-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 4px 8px;
  font-size: 16.5px;
  font-weight: 700;
}
.cx-optional {
  padding: 1px 9px;
  border-radius: 99px;
  background: var(--cx-line);
  color: var(--cx-ink-2);
  font-size: 13.5px;
  font-weight: 500;
}
.cx-group > .cx-alert {
  margin-top: 10px;
}
.cx-caption {
  margin: 10px 0 0;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 15.5px;
  line-height: 1.35;
  color: var(--cx-ink-2);
  text-align: center;
  text-wrap: balance;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}
.cx-caption[data-state="empty"] {
  background: var(--cx-warn-bg);
  color: var(--cx-warn-ink);
}
/* Opens with the height of its content, so nothing jumps; inert keeps a closed choice out of reach. */
.cx-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}
.cx-reveal[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
}
.cx-reveal > div {
  min-height: 0;
  overflow: hidden;
}
.cx-consent {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 16px;
  border: 1.5px solid var(--cx-line);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
.cx-consent:has(input:checked) {
  border-color: var(--cx-brand);
  background: color-mix(in srgb, var(--cx-brand) 6%, var(--cx-surface));
}
.cx-consent input {
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  border: 2px solid #8fa198;
  border-radius: 9px;
  background: #fff;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.cx-consent input::after {
  content: "";
  width: 13px;
  height: 7px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  rotate: -45deg;
  translate: 0 -1px;
  scale: 0;
  transition: scale 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cx-consent input:checked {
  background: var(--cx-brand);
  border-color: var(--cx-brand);
}
.cx-consent input:checked::after {
  scale: 1;
}
.cx-consent-note {
  margin-top: 8px;
}
.cx-reveal .cx-consent {
  margin-top: 12px;
}
.cx-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 58px;
  margin-top: 2px;
  padding: 0 4px;
  border: 0;
  border-top: 1px solid var(--cx-line);
  border-radius: 0;
  background: transparent;
  color: var(--cx-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cx-switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 99px;
  background: #c3cec7;
  transition: background-color 0.2s ease;
}
.cx-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 51, 44, 0.3);
  transition: translate 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.cx-switch-row[aria-checked="true"] .cx-switch {
  background: var(--cx-brand);
}
.cx-switch-row[aria-checked="true"] .cx-switch i {
  translate: 20px 0;
}
.cx-email .cx-hero-row {
  margin-bottom: 2px;
}
.cx-email h1 {
  font-size: clamp(28px, 8vw, 34px);
}

/* Done: one quiet surface, the Wallet row first, the email row second. */
.cx-done {
  gap: 20px;
}
.cx-done .cx-hero {
  gap: 4px;
}
#hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cx-done h1 {
  font-size: clamp(28px, 8vw, 34px);
}
.cx-stack {
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: 24px;
  overflow: hidden;
}
.cx-stack:not(:has(.cx-block)) {
  display: none;
}
.cx-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}
#wallet-slot:not(:empty) + #email-slot:not(:empty) {
  border-top: 1px solid var(--cx-line);
}
.cx-status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
}
.cx-status b {
  display: block;
  font-size: 19px;
  line-height: 1.15;
}
.cx-status span:not(.cx-tick):not(.cx-pulse) {
  display: block;
  margin-top: 2px;
  font-size: 15.5px;
  color: var(--cx-ink-2);
  overflow-wrap: anywhere;
}
.cx-tick {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.cx-ok .cx-tick {
  background: var(--cx-ok-bg);
  color: var(--cx-ok);
}
.cx-warn .cx-tick {
  background: var(--cx-warn-bg);
  color: var(--cx-warn-ink);
}
.cx-status.cx-wait {
  min-height: 0;
  gap: 12px;
}
.cx-pulse {
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 7px;
  border-radius: 50%;
  background: var(--cx-gold);
}
.cx-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--cx-gold);
  opacity: 0;
  animation: cx-pulse 1.8s ease-out infinite;
}
.cx-hint {
  text-align: center;
  font-size: 15px;
  color: var(--cx-ink-2);
}
.cx-quiet {
  font-size: 16.5px;
  line-height: 1.35;
  color: var(--cx-ink-2);
}
.cx-block > .cx-link {
  align-self: flex-start;
  padding-left: 0;
}
.cx-block > .cx-quiet + .cx-link,
.cx-block > .cx-inline .cx-link {
  align-self: flex-start;
  padding-left: 0;
}
.cx-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cx-inline .cx-secondary {
  width: auto;
  min-height: 46px;
  padding: 0 22px;
  font-size: 16.5px;
}
.cx-block .cx-primary {
  min-height: 54px;
  font-size: 18px;
}
.cx-foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.cx-foot a,
.cx-foot button {
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15.5px;
  font-weight: 400;
  color: var(--cx-ink-2);
  text-decoration: none;
  cursor: pointer;
}
.cx-foot a:active,
.cx-foot button:active {
  color: var(--cx-ink);
}

/* Confirmation and restore */
.cx-confirmed .cx-tile {
  margin-top: 8px;
}
.cx-loading {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--cx-brand);
}
.cx-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.cx-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--cx-line);
  border-radius: 20px;
  background: var(--cx-surface);
  color: var(--cx-ink);
  text-decoration: none;
  text-align: left;
}
.cx-card-name {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.cx-count {
  font-size: 17px;
  color: var(--cx-ink-2);
  white-space: nowrap;
}
.cx-count b {
  color: var(--cx-ink);
  font-size: 22px;
}
.cx-ask {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}
.cx-ask[hidden] {
  display: none;
}
.cx-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cx-sent h2 {
  font-size: clamp(30px, 8.6vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.cx-center .cx-form,
.cx-center .cx-primary {
  width: 100%;
}
.cx-center .cx-primary {
  margin-top: 4px;
}
.cx-center .cx-actions {
  width: 100%;
}

/* Help: one quiet surface of disclosure rows */
.cx-help {
  gap: 14px;
}
.cx-help h1,
.cx-delete h1 {
  font-size: clamp(28px, 8vw, 34px);
}
.cx-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: -8px;
  padding: 0 12px 0 4px;
  border-radius: 10px;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--cx-ink-2);
  text-decoration: none;
}
.cx-back:active {
  color: var(--cx-ink);
}
.cx-back-icon {
  width: 22px;
  height: 22px;
}
.cx-topics {
  background: var(--cx-surface);
  border: 1px solid var(--cx-line);
  border-radius: 24px;
  overflow: hidden;
}
.cx-topic + .cx-topic {
  border-top: 1px solid var(--cx-line);
}
.cx-topic summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 18px;
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.25;
  list-style: none;
  cursor: pointer;
}
.cx-topic summary::-webkit-details-marker {
  display: none;
}
.cx-chevron {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--cx-ink-2);
  transition: rotate 0.2s ease;
}
.cx-topic[open]:not(.cx-closing) .cx-chevron {
  rotate: 180deg;
}
.cx-topic-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px 18px;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--cx-ink-2);
}
.cx-topic-body p {
  margin: 0;
}
.cx-topic-body .cx-secondary {
  min-height: 48px;
  font-size: 16.5px;
}

/* Card deletion */
.cx-delete {
  gap: 16px;
}
.cx-balance {
  font-size: 16px;
  color: var(--cx-ink-2);
  text-align: center;
}
.cx-ack {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 16px;
  border: 1.5px solid var(--cx-line);
  border-radius: var(--cx-radius);
  background: var(--cx-surface);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}
.cx-ack:has(input:checked) {
  border-color: var(--cx-bad-ink);
}
.cx-ack input {
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 2px solid #8fa198;
  border-radius: 8px;
  background: #fff;
}
.cx-ack input::after {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  rotate: -45deg;
  translate: 0 -1px;
  scale: 0;
  transition: scale 0.12s ease;
}
.cx-ack input:checked {
  background: var(--cx-bad-ink);
  border-color: var(--cx-bad-ink);
}
.cx-ack input:checked::after {
  scale: 1;
}

/* Sheets and the Wallet handoff */
/* The library lays the dialog over the viewport; undo the app's generic dialog box styles. */
.cx-sheet {
  position: fixed;
  inset: 0;
  top: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.cx-sheet::backdrop {
  background: rgb(23 51 44 / 0.4);
  backdrop-filter: blur(3px);
}
/* pure-web-bottom-sheet draws the panel, its grabber and the swipe; these set its look. */
.cx-sheet-body {
  --sheet-background: var(--cx-surface);
  --sheet-border-radius: 28px;
  --sheet-max-height: 92dvh;
  color: var(--cx-ink);
}
/* Our own snap point: the library's default one is an inline style, which the CSP refuses. */
.cx-sheet-snap {
  --snap: 100%;
}
.cx-sheet:focus,
.cx-sheet:focus-visible,
.cx-sheet-body:focus,
.cx-sheet-body:focus-visible {
  outline: none;
}
/* The sheet scrolls to swipe; its scrollbar would take width on desktop browsers. */
.cx-sheet-body {
  scrollbar-width: none;
}
.cx-sheet-body::-webkit-scrollbar {
  display: none;
}
.cx-sheet-body::part(sheet) {
  width: min(100%, 480px);
  margin-inline: auto;
  box-shadow: 0 -20px 40px -24px rgb(23 51 44 / 0.35);
}
.cx-sheet-body::part(handle) {
  background: #cfd9d1;
}
.cx-sheet-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 2px 22px calc(18px + env(safe-area-inset-bottom));
}
/* The page underneath stays put while a sheet is open. */
html.cx-sheet-open,
html.cx-sheet-open body {
  overflow: hidden;
  overscroll-behavior: none;
}
.cx-sheet h2 {
  margin: 4px 0 2px;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
}
.cx-sheet p {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}
.cx-choice {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cx-choice b {
  font-size: 19px;
}
.cx-choice-icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf1e6;
  color: var(--cx-brand);
}
.cx-sheet .cx-primary {
  margin-top: 4px;
}
.cx-qr {
  align-self: center;
  width: min(240px, 66vw);
  height: auto;
  padding: 10px;
  border: 1px solid var(--cx-line);
  border-radius: 20px;
  background: #fff;
}
.cx-code {
  text-align: center;
  color: var(--cx-ink-2);
}
.cx-code b {
  color: var(--cx-ink);
  font-size: 22px;
}
.cx-handoff {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--cx-bg);
  color: var(--cx-ink);
}
.cx-handoff-body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}
.cx-handoff-body h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.cx-handoff-body .cx-primary {
  max-width: 360px;
}
.cx-handoff-body .cx-sub {
  max-width: 340px;
}
.cx-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cx-spin 0.8s linear infinite;
}
.cx-spinner-lg {
  width: 44px;
  height: 44px;
  border-width: 4px;
  color: var(--cx-brand);
}

.cx a:focus-visible,
.cx button:focus-visible,
.cx summary:focus-visible,
.cx-ack:has(input:focus-visible),
.cx-consent:has(input:focus-visible),
.cx-sheet a:focus-visible,
.cx-sheet button:focus-visible,
.cx-handoff button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cx-brand) 55%, transparent);
  outline-offset: 3px;
}
.cx-topic summary:focus-visible {
  outline-offset: -4px;
}
.cx-badge:focus-visible {
  outline-color: #3b82f6;
}

.cx-tick svg {
  width: 22px;
  height: 22px;
}
.cx-choice-icon svg {
  width: 24px;
  height: 24px;
}
.cx-logo.cx-glyph svg {
  width: 46%;
  height: 46%;
}
.cx-status.cx-wait b {
  font-size: 17px;
  font-weight: 700;
  color: var(--cx-ink-2);
}

@keyframes cx-spin {
  to {
    rotate: 360deg;
  }
}
@keyframes cx-pulse {
  0% {
    opacity: 0.7;
    scale: 0.6;
  }
  100% {
    opacity: 0;
    scale: 1.6;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cx-pulse::after {
    animation: none;
    opacity: 0.35;
    scale: 1.2;
  }
  .cx-tile-anim,
  .cx-tile-anim * {
    transition: none;
  }
  .cx-spinner,
  .cx-primary::before,
  .cx-secondary::before {
    animation-duration: 2.4s;
  }
  .cx-primary,
  .cx-secondary,
  .cx-danger,
  .cx-badge,
  .cx-card-row,
  .cx-chevron,
  .cx-ack input::after,
  .cx-consent input::after,
  .cx-reveal,
  .cx-switch,
  .cx-switch i,
  .cx-caption {
    transition: none;
  }
}
@media (max-width: 360px) {
  .customer-screen main {
    padding: 0 16px 24px;
  }
  :root {
    --u: 0.88px;
  }
  .cx-medallion.cx-lg {
    --box: 168px;
    --logo: 104px;
  }
}
@media (max-height: 700px) {
  :root {
    --u: 0.88px;
  }
  .cx-join .cx-medallion.cx-lg {
    --box: 164px;
    --logo: 100px;
  }
  .cx-join {
    gap: 14px;
  }
}

/* Press: every tappable control shrinks while held and springs back on release.
   cx-pressed comes from customer/press.ts, so a quick tap on iOS is visible too. */
.cx-primary.cx-pressed,
.cx-secondary.cx-pressed,
.cx-danger.cx-pressed,
.cx-badge.cx-pressed,
.cx-card-row.cx-pressed,
.cx-switch-row.cx-pressed,
.cx-consent.cx-pressed,
.cx-ack.cx-pressed,
.cx-choice.cx-pressed,
.customer-screen .help.cx-pressed {
  transform: scale(0.96);
  transition-duration: 0.08s;
  transition-timing-function: ease-out;
}
.cx-switch-row.cx-pressed,
.cx-consent.cx-pressed {
  transform: scale(0.97);
  transition-duration: 0.08s;
  transition-timing-function: ease-out;
}
.cx-link.cx-pressed,
.cx-back.cx-pressed,
.cx-foot a.cx-pressed,
.cx-foot button.cx-pressed,
.cx-topic summary.cx-pressed {
  transform: scale(0.94);
  opacity: 0.6;
  transition-duration: 0.08s;
  transition-timing-function: ease-out;
}
.cx-secondary.cx-pressed,
.cx-card-row.cx-pressed {
  background: var(--cx-line);
}
@media (prefers-reduced-motion: reduce) {
  .cx-pressed {
    transform: none;
  }
  .cx-primary.cx-pressed,
  .cx-secondary.cx-pressed,
  .cx-danger.cx-pressed,
  .cx-badge.cx-pressed,
  .cx-card-row.cx-pressed {
    opacity: 0.75;
  }
}

/* Page loader: appears only when a page takes a moment, then breathes in the brand colour. */
.page-loader {
  min-height: 46vh;
  display: grid;
  place-items: center;
  opacity: 0;
  animation: page-loader-in 0.3s ease 0.15s forwards;
}
.page-loader-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3.5px solid rgb(24 91 74 / 0.14);
  border-top-color: #185b4a;
  animation: cx-spin 0.85s cubic-bezier(0.5, 0.15, 0.5, 0.85) infinite;
}
@keyframes page-loader-in {
  to {
    opacity: 1;
  }
}

/* The browser's own page transitions; the header stays put while the page cross-fades. */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: page-out 0.18s ease-in both;
}
::view-transition-new(root) {
  animation: page-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes page-out {
  to {
    opacity: 0;
    translate: 0 -6px;
  }
}
@keyframes page-in {
  from {
    opacity: 0;
    translate: 0 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none;
  }
  .page-loader {
    animation-duration: 0.01s;
  }
  .page-loader-ring {
    animation-duration: 2.4s;
  }
}
