/* Clear card action and a QR code that is visible without opening a dialog. */
#identity .flip-card {
  min-width: 188px;
  min-height: 54px;
  padding: 12px 18px;
  gap: 24px;
  justify-content: space-between;
  border: 2px solid var(--ink);
  background: var(--red);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 15px;
  font-weight: 750;
  transition: transform .18s, box-shadow .18s, background .18s;
}
#identity .flip-card b { font: 30px/1 Arial, sans-serif; }
#identity .flip-card:hover { background: var(--red-light); transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }
#identity .flip-card:active { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--ink); }
#identity .flip-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 8px; }
#contact .contact-channels { top: 20%; bottom: 112px; max-height: none; }
#contact:not([inert]) .contact-channels { pointer-events: auto; }
body[data-view="4"] #field { touch-action: pan-y; }
#contact .wechat-inline {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
  margin: 20px 0 0;
  padding: 18px 0;
  border: 0;
  background: transparent;
  color: inherit;
}
#contact .wechat-qr {
  position: relative;
  flex: none;
  width: clamp(256px, 20vw, 320px);
  aspect-ratio: 1;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}
/* Show the original code with a quiet zone of 68 source pixels on all sides.
   The 736px square starts at (76,244) in the unmodified 888x1131 image. */
#contact .wechat-qr img {
  position: absolute;
  width: 120.652174%;
  height: 153.668478%;
  max-width: none;
  left: -10.326087%;
  top: -33.152174%;
  /* Recolor only the source's dark modules; the background stays transparent. */
  filter: url(#wechat-white-pattern);
}
#contact .wechat-inline-copy { display: grid; gap: 12px; min-width: 0; }
#contact .wechat-inline-copy h3 { font-size: clamp(22px, 2vw, 30px); font-weight: 750; white-space: nowrap; }
#contact .wechat-inline-copy p { font-size: 12px; line-height: 1.8; }
#contact .wechat-save { justify-self: start; padding: 8px 0; margin-top: 6px; border-bottom: 1px solid currentColor; font-size: 11px; }
#contact .wechat-save:focus-visible { outline-color: currentColor; }
#contact #contact-feedback:empty { min-height: 0; margin-top: 0; }
@media (min-width: 601px) and (max-height: 760px) {
  #contact .contact-channels { top: 19%; bottom: 85px; }
  #contact .contact-label { margin-bottom: 14px; }
  #contact .contact-row { padding-bottom: 12px; }
  #contact .contact-row.phone { margin-top: 12px; padding-bottom: 12px; }
  #contact .wechat-inline { margin-top: 10px; padding: 10px 0; }
  #contact .wechat-qr { width: 224px; }
  #contact .contact-replay { margin-top: 8px; }
}
@media (min-width: 601px) and (max-width: 900px) {
  #contact .wechat-inline { gap: 12px; }
  #contact .wechat-qr { width: 208px; }
  #contact .wechat-inline-copy h3 { font-size: 19px; }
  #contact .wechat-inline-copy p { font-size: 11px; }
}
@media (max-width: 600px) {
  #identity .flip-card { bottom: max(11%, 84px); min-width: 168px; min-height: 48px; padding: 10px 14px; font-size: 14px; gap: 22px; }
  #identity .flip-card b { font-size: 26px; }
  #contact .contact-heading { top: 15%; }
  #contact .contact-channels { display: flex; flex-direction: column; top: 29%; bottom: 84px; }
  #contact .wechat-inline { order: -1; flex: none; flex-direction: column; gap: 6px; margin: 0 0 18px; padding: 0 0 16px; }
  #contact .wechat-qr { width: min(256px, 100%); }
  #contact .wechat-inline-copy { width: 100%; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; }
  #contact .wechat-inline-copy h3 { font-size: 23px; }
  #contact .wechat-inline-copy p { font-size: 11px; grid-column: 1; }
  #contact .wechat-save { grid-column: 2; grid-row: 1 / 3; margin-top: 0; font-size: 11px; }
  #contact .contact-label { margin-bottom: 10px; }
  #contact .contact-row { padding-bottom: 12px; }
  #contact .contact-row.phone { margin-top: 12px; }
}
@media (max-width: 600px) and (max-height: 680px) {
  #contact .contact-heading { top: 14%; }
  #contact .contact-channels { top: 31%; bottom: 72px; }
  #contact .wechat-qr { width: 224px; }
}
@media (prefers-reduced-motion: reduce) {
  #identity .flip-card { transition: none; }
}

/* The contact scene alone uses white foregrounds over the existing red. */
body[data-view="4"] {
  --fg: #fff;
  --fg-muted: #ffffffc4;
  --rule: #ffffff60;
}
body[data-view="4"] .field-brand { color: var(--ink); }
body[data-view="4"] .field-brand img {
  content: url("assets/mark-contact-black.svg");
  filter: none;
}
body[data-view="4"] :is(.chapter-state>span:first-child, .field-watermark>span) { color: #fff; }
body[data-view="4"] .contact-heading h2>span { color: var(--ink); }
body[data-view="4"] :is(#field-progress, #transition-meter) { background: #fff; }
body[data-view="4"] .chapter-nav [aria-current] { background: #ffffff24; color: #fff; }
body[data-view="4"] .field-navigation button:hover:not(:disabled) { color: #fff; background: #ffffff24; }
body[data-view="4"] :is(.contact-row, .contact-replay) { border-color: #ffffff80; }
body[data-view="4"] :is(button, a):focus-visible { outline-color: #fff; }
body[data-view="4"] .contact-channels { scrollbar-color: #ffffffa6 transparent; }
body[data-view="4"] .target-cursor-wrapper { mix-blend-mode: normal; }
