:root {
  color-scheme: dark;
  --page-bg: #000000;
  --card-bg: #050505;
  --surface: #0d0d0d;
  --surface-raised: #151515;
  --gold: #f3c45b;
  --gold-light: #ffe59b;
  --gold-deep: #b98522;
  --text: #ffffff;
  --text-muted: #d5d5d5;
  --text-subtle: #9e9e9e;
  --gold-border: rgba(243, 196, 91, 0.35);
  --soft-border: rgba(255, 255, 255, 0.16);
  --card-radius: 18px;
  --button-radius: 18px;
  --focus-ring: 0 0 0 3px rgba(243, 196, 91, 0.38);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--page-bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -18%, rgba(243, 196, 91, 0.09), transparent 33rem),
    var(--page-bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gold);
  color: #080808;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.card-shell {
  position: relative;
  width: min(calc(100% - 24px), 470px);
  min-height: 100dvh;
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid rgba(243, 196, 91, 0.78);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.34), transparent 25rem),
    var(--card-bg);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.66),
    inset 0 0 40px rgba(243, 196, 91, 0.018);
  isolation: isolate;
}

.card-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    );
  content: "";
  pointer-events: none;
}

.brand-hero {
  position: relative;
  height: 224px;
}

.brand-hero::after {
  position: absolute;
  top: -58px;
  left: 50%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 196, 91, 0.13), transparent 68%);
  content: "";
  filter: blur(4px);
  pointer-events: none;
  transform: translateX(-50%);
}

.header-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 224px;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 34px;
}

.brand-logo {
  width: 82px;
  height: 82px;
  filter: drop-shadow(0 0 12px rgba(243, 196, 91, 0.25));
}

.brand-name {
  margin: 3px 0 0;
  background: linear-gradient(112deg, #ffe8a7 0%, var(--gold) 44%, #ad7415 100%);
  background-clip: text;
  color: transparent;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
}

.profile {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -34px;
  padding: 0 24px;
  text-align: center;
}

.avatar-frame {
  position: relative;
  width: 142px;
  height: 142px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff0b9 0%, var(--gold) 36%, #976313 100%);
  box-shadow:
    0 12px 25px rgba(0, 0, 0, 0.62),
    0 0 22px rgba(243, 196, 91, 0.28);
}

.avatar-frame::after {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(243, 196, 91, 0.08);
  border-radius: 50%;
  content: "";
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #777777;
  object-fit: cover;
  object-position: center 34%;
}

.profile h1 {
  margin: 18px 0 1px;
  font-size: clamp(28px, 7.3vw, 36px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.profile-role {
  margin: 6px 0 0;
  color: var(--gold);
  font-size: clamp(18px, 4.8vw, 22px);
  font-weight: 500;
}

.profile-company {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: clamp(16px, 4.2vw, 19px);
}

.primary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 24px 28px 0;
}

.primary-button {
  display: inline-flex;
  min-width: 0;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(243, 196, 91, 0.82);
  border-radius: var(--button-radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
  text-decoration: none;
  transition:
    filter 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 100ms ease;
}

.save-button {
  background:
    linear-gradient(108deg, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(126deg, #d79a2c 0%, #ffe28c 52%, #d79a2c 100%);
  box-shadow:
    0 7px 20px rgba(185, 133, 34, 0.29),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: #070707;
}

.save-button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

.qr-button {
  background: linear-gradient(155deg, #1a1a1a, #0b0b0b);
  color: var(--gold);
}

.primary-button:hover {
  filter: brightness(1.08);
}

.primary-button:active {
  transform: scale(0.98);
}

.primary-button:focus-visible,
.action-card:focus-visible,
.share-button:focus-visible,
.modal-close:focus-visible,
.modal-copy-button:focus-visible,
.business-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.content-section {
  padding: 0 28px;
}

.section-divider {
  display: grid;
  grid-template-columns: minmax(18px, 1fr) 6px auto 6px minmax(18px, 1fr);
  gap: 8px;
  align-items: center;
  margin: 27px 0 17px;
}

.section-divider h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.divider-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243, 196, 91, 0.7));
}

.divider-line:last-child {
  background: linear-gradient(90deg, rgba(243, 196, 91, 0.7), transparent);
}

.divider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(243, 196, 91, 0.45);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.action-card {
  display: flex;
  min-width: 0;
  min-height: 100px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 11px 4px 10px;
  overflow: hidden;
  border: 1px solid var(--soft-border);
  border-radius: var(--card-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 42%),
    linear-gradient(160deg, var(--surface-raised), #080808);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    filter 150ms ease,
    transform 100ms ease;
}

.action-card:hover {
  border-color: var(--gold-border);
  filter: brightness(1.1);
}

.action-card:active {
  transform: scale(0.97);
}

.action-card .icon {
  width: 33px;
  height: 33px;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(243, 196, 91, 0.2));
}

.action-label {
  display: block;
  width: 100%;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-section .section-divider {
  margin-top: 30px;
}

.business-card {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  min-height: 128px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: var(--card-radius);
  background:
    radial-gradient(circle at 14% 50%, rgba(243, 196, 91, 0.06), transparent 30%),
    linear-gradient(145deg, #111111, #080808);
}

.business-card-qr {
  display: none;
}

.card-export-host {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 470px;
  background: #000000;
  pointer-events: none;
}

.card-export-root {
  width: 470px;
  background: #000000;
  color: #ffffff;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.business-icon {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgba(243, 196, 91, 0.48);
  border-radius: 50%;
  background: rgba(243, 196, 91, 0.03);
  color: var(--gold);
}

.business-icon .icon {
  width: 34px;
  height: 34px;
}

.business-copy {
  min-width: 0;
}

.business-copy h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.business-slogan {
  margin: 3px 0 8px;
  color: var(--gold);
  font-size: 13px;
}

.business-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px 9px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.meta-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.business-link {
  max-width: 100%;
  border-radius: 4px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.business-link:hover {
  color: var(--gold-light);
}

.meta-separator {
  width: 1px;
  height: 16px;
  background: rgba(243, 196, 91, 0.45);
}

.meta-item .icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--gold);
}

.share-section {
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
}

.share-section .section-divider {
  margin-top: 30px;
}

.share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
}

.share-button {
  display: grid;
  width: 51px;
  height: 51px;
  flex: 0 0 51px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 15px rgba(0, 0, 0, 0.34);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  transition:
    filter 150ms ease,
    transform 100ms ease;
}

.share-button:hover {
  filter: brightness(1.12);
}

.share-button:active {
  transform: scale(0.94);
}

.share-button .icon {
  width: 27px;
  height: 27px;
}

.share-button.whatsapp {
  background: linear-gradient(145deg, #3ddd73, #10a948);
}

.share-button.email {
  background: linear-gradient(145deg, #ef5a5a, #bd2020);
}

.share-button.wechat {
  background: linear-gradient(145deg, #45dd72, #11a944);
}

.share-button.telegram {
  background: linear-gradient(145deg, #35b7f0, #1183c1);
}

.share-button.copy {
  background: linear-gradient(145deg, #5f5f5f, #292929);
}

.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.icon-user-plus {
  --icon-url: url("../icons/user-plus.svg");
}

.icon-download {
  --icon-url: url("../icons/download.svg");
}

.icon-qr-code {
  --icon-url: url("../icons/qr-code.svg");
}

.icon-business {
  --icon-url: url("../icons/business.svg");
}

.icon-location-small {
  --icon-url: url("../icons/location.svg");
}

.icon-website-small {
  --icon-url: url("../icons/website.svg");
}

.icon-close {
  --icon-url: url("../icons/close.svg");
}

.icon-copy {
  --icon-url: url("../icons/copy.svg");
}

.icon-check {
  --icon-url: url("../icons/check.svg");
}

.modal[hidden],
.toast[hidden] {
  display: none;
}

.modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.79);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 355px);
  max-height: calc(100dvh - 32px);
  padding: 27px 24px 23px;
  overflow-y: auto;
  border: 1px solid rgba(243, 196, 91, 0.62);
  border-radius: var(--card-radius);
  background:
    radial-gradient(circle at 50% 0, rgba(243, 196, 91, 0.1), transparent 38%),
    #0b0b0b;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.75);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: #171717;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close .icon {
  width: 18px;
  height: 18px;
}

.modal-kicker {
  margin: 0 45px 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.modal h2 {
  margin: 0 32px 18px;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.qr-frame {
  width: min(100%, 250px);
  margin: 0 auto;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
}

.qr-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.modal-url,
.wechat-id {
  margin: 15px 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.wechat-id strong {
  color: var(--gold-light);
}

.modal-copy-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid rgba(243, 196, 91, 0.75);
  border-radius: 13px;
  background: linear-gradient(135deg, #f6cd70, #bd8120);
  color: #080808;
  cursor: pointer;
  font-weight: 750;
}

.modal-copy-button:active {
  transform: scale(0.98);
}

.toast {
  position: fixed;
  z-index: 70;
  right: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(243, 196, 91, 0.45);
  border-radius: 13px;
  background: #181818;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.58);
  color: var(--text);
  font-size: 14px;
  transform: translateX(50%);
}

.toast .icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.noscript-profile {
  margin: 20px 28px 28px;
  padding: 16px;
  border: 1px solid var(--gold-border);
  border-radius: var(--card-radius);
  background: var(--surface);
}

.noscript-profile h2,
.noscript-profile p {
  margin: 0 0 8px;
}

@media (max-width: 500px) {
  .card-shell {
    width: calc(100% - 8px);
    margin: 4px auto;
    border-radius: 12px;
  }
}

@media (max-width: 380px) {
  .brand-hero,
  .header-wave {
    height: 210px;
  }

  .brand-lockup {
    padding-top: 31px;
  }

  .brand-logo {
    width: 75px;
    height: 75px;
  }

  .brand-name {
    font-size: 25px;
  }

  .profile {
    margin-top: -29px;
  }

  .avatar-frame {
    width: 132px;
    height: 132px;
  }

  .primary-actions,
  .content-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .primary-actions {
    gap: 8px;
  }

  .primary-button {
    min-height: 56px;
    gap: 7px;
    border-radius: 15px;
    font-size: 14px;
  }

  .primary-button .icon {
    width: 21px;
    height: 21px;
  }

  .section-divider {
    grid-template-columns: minmax(10px, 1fr) 5px auto 5px minmax(10px, 1fr);
    gap: 6px;
  }

  .section-divider h2 {
    font-size: 16px;
  }

  .divider-dot {
    width: 5px;
    height: 5px;
  }

  .action-grid {
    gap: 7px;
  }

  .action-card {
    min-height: 88px;
    gap: 9px;
    padding: 8px 2px;
    border-radius: 15px;
  }

  .action-card .icon {
    width: 28px;
    height: 28px;
  }

  .action-label {
    font-size: 11px;
  }

  .business-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    min-height: 118px;
    padding: 15px 13px;
    border-radius: 15px;
  }

  .business-icon {
    width: 56px;
    height: 56px;
  }

  .business-icon .icon {
    width: 30px;
    height: 30px;
  }

  .business-copy h3 {
    font-size: 17px;
  }

  .business-slogan,
  .business-meta {
    font-size: 11px;
  }

  .share-actions {
    gap: 9px;
  }

  .share-button {
    width: 47px;
    height: 47px;
    flex-basis: 47px;
  }

  .share-button .icon {
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 335px) {
  .primary-actions,
  .content-section {
    padding-right: 12px;
    padding-left: 12px;
  }

  .primary-button {
    font-size: 13px;
  }

  .action-grid {
    gap: 6px;
  }

  .action-card {
    min-height: 84px;
  }

  .section-divider h2 {
    font-size: 15px;
  }

  .share-actions {
    gap: 7px;
  }

  .share-button {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
}

/* Round 2: deeper black-gold finish and explicit viewport-fit behavior. */
:root {
  --page-bg: #030303;
  --card-bg: #090909;
  --surface: #111111;
  --surface-raised: #181818;
  --gold-light: #ffd66b;
  --gold: #e9b94f;
  --gold-deep: #8f6115;
  --gold-border: rgba(233, 185, 79, 0.42);
  --soft-border: rgba(255, 255, 255, 0.14);
}

body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(233, 185, 79, 0.14), transparent 32rem),
    radial-gradient(ellipse at 16% 76%, rgba(143, 97, 21, 0.07), transparent 28rem),
    linear-gradient(145deg, #010101 0%, #070604 52%, #020202 100%);
}

.card-stage {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
}

.card-shell {
  background:
    radial-gradient(ellipse at 52% 5%, rgba(255, 214, 107, 0.07), transparent 22rem),
    linear-gradient(180deg, rgba(24, 24, 24, 0.38), transparent 23rem),
    linear-gradient(145deg, #0a0a0a 0%, #030303 58%, #080705 100%);
  box-shadow:
    0 28px 85px rgba(0, 0, 0, 0.82),
    0 0 0 1px rgba(255, 214, 107, 0.04),
    inset 0 1px 0 rgba(255, 230, 158, 0.12),
    inset 0 0 70px rgba(143, 97, 21, 0.025);
}

.card-shell::before {
  background-image:
    repeating-linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.014) 0,
      rgba(255, 255, 255, 0.014) 1px,
      transparent 1px,
      transparent 4px
    ),
    repeating-linear-gradient(
      24deg,
      rgba(233, 185, 79, 0.008) 0,
      rgba(233, 185, 79, 0.008) 1px,
      transparent 1px,
      transparent 9px
    );
}

.brand-hero {
  isolation: isolate;
}

.brand-hero::before {
  position: absolute;
  z-index: -1;
  top: -23%;
  left: -22%;
  width: 152%;
  height: 104%;
  background:
    linear-gradient(
      132deg,
      transparent 31%,
      rgba(90, 55, 7, 0.04) 37%,
      rgba(233, 185, 79, 0.22) 43%,
      rgba(255, 244, 192, 0.96) 46.2%,
      rgba(255, 205, 84, 0.55) 48%,
      rgba(57, 34, 4, 0.09) 53%,
      transparent 61%
    );
  content: "";
  filter: blur(0.25px) drop-shadow(0 0 12px rgba(233, 185, 79, 0.34));
  opacity: 0.86;
  pointer-events: none;
  transform: rotate(-4deg);
}

.brand-hero::after {
  background:
    radial-gradient(circle, rgba(255, 214, 107, 0.18), rgba(143, 97, 21, 0.04) 46%, transparent 70%);
  filter: blur(7px);
}

.header-wave {
  z-index: 0;
  filter:
    saturate(1.14)
    contrast(1.08)
    drop-shadow(0 0 6px rgba(233, 185, 79, 0.18));
  opacity: 0.96;
}

.brand-lockup {
  z-index: 2;
}

.brand-logo {
  filter:
    drop-shadow(0 1px 0 rgba(255, 238, 180, 0.34))
    drop-shadow(0 0 13px rgba(233, 185, 79, 0.32));
}

.brand-lockup--official {
  padding-top: 28px;
}

.brand-lockup--official::before {
  position: absolute;
  z-index: -1;
  top: 12px;
  left: 50%;
  width: 196px;
  height: 178px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(255, 225, 145, 0.43) 0%, rgba(233, 185, 79, 0.2) 44%, transparent 73%);
  content: "";
  filter: blur(6px);
  pointer-events: none;
  transform: translateX(-50%);
}

.brand-lockup--official::after {
  position: absolute;
  z-index: -1;
  top: 102px;
  left: 50%;
  width: 172px;
  height: 74px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(255, 225, 151, 0.5) 0%, rgba(233, 185, 79, 0.25) 48%, transparent 74%);
  content: "";
  filter: blur(5px);
  pointer-events: none;
  transform: translateX(-50%);
}

.brand-logo--official {
  width: 142px;
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 1px rgba(255, 238, 184, 0.94))
    drop-shadow(0 0 2px rgba(233, 185, 79, 0.62))
    drop-shadow(0 0 11px rgba(233, 185, 79, 0.28));
}

.brand-lockup--official .brand-name {
  display: none;
}

.brand-name {
  background: linear-gradient(
    106deg,
    #fff0ba 0%,
    #ffd66b 30%,
    #bd8124 62%,
    #f4cb68 84%,
    #8f6115 100%
  );
  background-clip: text;
  text-shadow: 0 7px 18px rgba(0, 0, 0, 0.76);
}

.avatar-frame {
  background:
    linear-gradient(135deg, #fff1bc 0%, #ffd66b 28%, #b77918 58%, #ffe298 81%, #8f6115 100%);
  box-shadow:
    0 15px 30px rgba(0, 0, 0, 0.72),
    0 0 24px rgba(233, 185, 79, 0.31),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.profile h1 {
  text-shadow: 0 2px 13px rgba(0, 0, 0, 0.9);
}

.save-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 224, 139, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 23%),
    linear-gradient(
      104deg,
      #a96d16 0%,
      #e9b94f 19%,
      #ffe69d 46%,
      #f3c65e 70%,
      #a96d16 100%
    );
  box-shadow:
    0 9px 25px rgba(143, 97, 21, 0.42),
    0 0 17px rgba(233, 185, 79, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 5px rgba(93, 52, 4, 0.32);
}

.save-button::after {
  position: absolute;
  top: 0;
  left: -38%;
  width: 46%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  content: "";
  pointer-events: none;
  transform: skewX(-18deg);
}

.save-button:hover::after {
  left: 112%;
  transition: left 560ms ease;
}

.qr-button {
  border-color: rgba(255, 214, 107, 0.86);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.065), transparent 40%),
    linear-gradient(155deg, #202020 0%, #090909 64%, #151106 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -10px 22px rgba(0, 0, 0, 0.38),
    0 7px 18px rgba(0, 0, 0, 0.42);
}

.qr-button span:last-child {
  white-space: nowrap;
}

.divider-line {
  background: linear-gradient(90deg, transparent, rgba(143, 97, 21, 0.52), rgba(255, 214, 107, 0.76));
}

.divider-line:last-child {
  background: linear-gradient(90deg, rgba(255, 214, 107, 0.76), rgba(143, 97, 21, 0.52), transparent);
}

.action-card {
  position: relative;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.055), transparent 32%),
    radial-gradient(circle at 50% 0, rgba(233, 185, 79, 0.04), transparent 42%),
    linear-gradient(160deg, #181818 0%, #080808 62%, #0d0b07 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    inset 0 -13px 25px rgba(0, 0, 0, 0.27),
    0 7px 16px rgba(0, 0, 0, 0.25);
}

.action-card::after {
  position: absolute;
  right: 12%;
  bottom: 0;
  left: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 185, 79, 0.22), transparent);
  content: "";
  pointer-events: none;
}

.business-card {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.05), transparent 33%),
    radial-gradient(circle at 13% 50%, rgba(233, 185, 79, 0.095), transparent 29%),
    linear-gradient(145deg, #161616 0%, #070707 73%, #100d07 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.065),
    inset 0 -18px 30px rgba(0, 0, 0, 0.2),
    0 8px 18px rgba(0, 0, 0, 0.26);
}

.business-icon {
  background:
    radial-gradient(circle at 34% 27%, rgba(255, 230, 157, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(233, 185, 79, 0.08), rgba(0, 0, 0, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 143, 0.15),
    0 0 18px rgba(143, 97, 21, 0.12);
}

.share-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -8px 15px rgba(0, 0, 0, 0.2),
    0 7px 16px rgba(0, 0, 0, 0.44);
}

.icon.icon-image {
  display: block;
  background: none;
  object-fit: contain;
  -webkit-mask: none;
  mask: none;
}

.action-card .icon-image {
  filter:
    brightness(0)
    saturate(100%)
    invert(85%)
    sepia(50%)
    saturate(978%)
    hue-rotate(350deg)
    brightness(99%)
    contrast(91%)
    drop-shadow(0 0 5px rgba(233, 185, 79, 0.3));
}

.share-button .icon-image {
  filter:
    brightness(0)
    invert(1)
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.34));
}

.modal-panel {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 214, 107, 0.14), transparent 36%),
    linear-gradient(150deg, #171717 0%, #080808 67%, #110e07 100%);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

@media (min-width: 801px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    display: grid;
    min-height: 100dvh;
    place-items: center;
    padding: 12px;
  }

  .card-stage {
    width: 520px;
    height: auto;
  }

  .card-shell {
    width: 520px;
    min-height: 0;
    margin: 0;
    border-radius: 15px;
    transform-origin: top left;
  }

  .brand-hero,
  .header-wave {
    height: 160px;
  }

  .brand-lockup {
    padding-top: 17px;
  }

  .brand-lockup--official {
    padding-top: 4px;
  }

  .brand-lockup--official::before {
    top: -1px;
    width: 166px;
    height: 146px;
  }

  .brand-lockup--official::after {
    top: 84px;
    width: 136px;
    height: 55px;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .brand-logo--official {
    width: 120px;
    height: auto;
  }

  .brand-name {
    margin-top: 1px;
    font-size: 22px;
  }

  .profile {
    margin-top: -20px;
    padding: 0 25px;
  }

  .avatar-frame {
    width: 96px;
    height: 96px;
    padding: 2px;
  }

  .profile h1 {
    margin: 8px 0 0;
    font-size: 25px;
  }

  .profile-role {
    margin-top: 2px;
    font-size: 16px;
  }

  .profile-company {
    margin-top: 1px;
    font-size: 14px;
  }

  .primary-actions {
    gap: 10px;
    padding: 10px 26px 0;
  }

  .primary-button {
    min-height: 46px;
    gap: 8px;
    border-radius: 14px;
    font-size: 14px;
  }

  .primary-button .icon {
    width: 20px;
    height: 20px;
  }

  .content-section {
    padding: 0 26px;
  }

  .section-divider {
    grid-template-columns: minmax(18px, 1fr) 5px auto 5px minmax(18px, 1fr);
    gap: 7px;
    margin: 12px 0 9px;
  }

  .section-divider h2 {
    font-size: 15px;
  }

  .divider-dot {
    width: 5px;
    height: 5px;
  }

  .action-grid {
    gap: 7px;
  }

  .action-card {
    min-height: 64px;
    gap: 5px;
    padding: 6px 3px 5px;
    border-radius: 13px;
  }

  .action-card .icon {
    width: 24px;
    height: 24px;
  }

  .action-label {
    font-size: 11px;
  }

  .business-section .section-divider,
  .share-section .section-divider {
    margin-top: 13px;
  }

  .business-card {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 11px;
    min-height: 76px;
    padding: 10px 13px;
    border-radius: 13px;
  }

  .business-icon {
    width: 50px;
    height: 50px;
  }

  .business-icon .icon {
    width: 27px;
    height: 27px;
  }

  .business-copy h3 {
    font-size: 16px;
  }

  .business-slogan {
    margin: 1px 0 4px;
    font-size: 11px;
  }

  .business-meta {
    gap: 4px 7px;
    font-size: 10px;
  }

  .meta-separator {
    height: 12px;
  }

  .meta-item .icon {
    width: 14px;
    height: 14px;
  }

  .share-section {
    padding-bottom: 11px;
  }

  .share-actions {
    gap: 16px;
  }

  .share-button {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .share-button .icon {
    width: 23px;
    height: 23px;
  }
}

.card-shell.is-card-export {
  width: 470px;
  min-height: 0;
  margin: 0;
  transform: none !important;
}

.card-shell.is-card-export .primary-actions {
  display: none;
}

.card-shell.is-card-export #personal-information .section-divider {
  margin-top: 8px;
}

.card-shell.is-card-export .business-card {
  grid-template-columns: 50px minmax(0, 1fr) 76px;
  gap: 11px;
}

.card-shell.is-card-export .business-card-qr {
  display: grid;
  width: 76px;
  height: 76px;
  align-self: end;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(243, 196, 91, 0.72);
  border-radius: 9px;
  background: #ffffff;
}

.card-shell.is-card-export .business-card-qr img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .modal-backdrop {
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: none;
  }
}

/* Additional templates keep the original DOM and behavior; only the visual system changes. */
html[data-template="blueprint"] {
  color-scheme: dark;
  --page-bg: #08111f;
  --card-bg: #0f172a;
  --surface: #16233a;
  --surface-raised: #1e293b;
  --gold-light: #67e8f9;
  --gold-deep: #155e75;
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --gold-border: rgba(34, 211, 238, 0.42);
  --soft-border: rgba(148, 163, 184, 0.28);
  --card-radius: 8px;
  --button-radius: 8px;
}
html[data-template="blueprint"] body {
  background-color: var(--page-bg);
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
}
html[data-template="blueprint"] .card-shell {
  border-color: rgba(34, 211, 238, 0.72);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 12px 12px 0 rgba(8, 145, 178, 0.16);
}
html[data-template="blueprint"] .card-shell::before { background: none; }
html[data-template="blueprint"] .brand-hero { height: 174px; border-bottom: 1px solid var(--gold-border); }
html[data-template="blueprint"] .header-wave { display: none; }
html[data-template="blueprint"] .brand-hero::after {
  inset: 20px 24px auto auto; width: 92px; height: 92px; border: 1px solid var(--gold-border);
  border-radius: 0; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(34,211,238,.13) 8px 9px); filter: none; transform: none;
}
html[data-template="blueprint"] .brand-lockup { align-items: flex-start; padding: 32px; }
html[data-template="blueprint"] .brand-logo { width: 62px; height: 62px; filter: drop-shadow(0 0 10px rgba(34,211,238,.25)); }
html[data-template="blueprint"] .brand-name { margin-top: 12px; background: none; color: var(--text); font-size: 24px; letter-spacing: .02em; }
html[data-template="blueprint"] .profile { align-items: flex-start; margin-top: -24px; padding: 0 32px; text-align: left; }
html[data-template="blueprint"] .avatar-frame { width: 112px; height: 112px; border-radius: 10px; background: var(--gold); box-shadow: 8px 8px 0 rgba(8,145,178,.2); }
html[data-template="blueprint"] .avatar-frame::after { border-radius: 10px; }
html[data-template="blueprint"] .avatar { border-radius: 7px; }
html[data-template="blueprint"] .profile h1 { letter-spacing: -.02em; }
html[data-template="blueprint"] .section-divider h2 { letter-spacing: .12em; text-transform: uppercase; }

html[data-template="paper"] {
  color-scheme: light;
  --page-bg: #e9e4da;
  --card-bg: #fdfbf7;
  --surface: #f4f0e8;
  --surface-raised: #ffffff;
  --gold-light: #1a1a1a;
  --gold-deep: #1a1a1a;
  --text: #1a1a1a;
  --text-muted: #45413b;
  --text-subtle: #6f6a61;
  --gold-border: rgba(26, 26, 26, 0.45);
  --soft-border: rgba(26, 26, 26, 0.2);
  --card-radius: 0;
  --button-radius: 0;
  --focus-ring: 0 0 0 3px rgba(26,26,26,.24);
}
html[data-template="paper"] body { background: var(--page-bg); font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif; }
html[data-template="paper"] .card-shell { border: 1px solid #bcb5a8; border-radius: 0; background: var(--card-bg); box-shadow: 8px 10px 0 rgba(76,68,55,.12); }
html[data-template="paper"] .card-shell::before { background: repeating-linear-gradient(0deg, rgba(26,26,26,.018) 0 1px, transparent 1px 4px); }
html[data-template="paper"] .brand-hero { height: 164px; border-bottom: 3px double #1a1a1a; }
html[data-template="paper"] .header-wave { display: none; }
html[data-template="paper"] .brand-hero::after { display: none; }
html[data-template="paper"] .brand-lockup { align-items: flex-start; padding: 32px; }
html[data-template="paper"] .brand-logo { width: 58px; height: 58px; filter: grayscale(1) contrast(1.4); }
html[data-template="paper"] .brand-name { width: calc(100% - 132px); margin-top: 14px; background: none; color: var(--text); font-size: 27px; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
html[data-template="paper"] .profile { align-items: flex-end; margin-top: -60px; padding: 0 32px; text-align: right; }
html[data-template="paper"] .avatar-frame { width: 112px; height: 112px; padding: 2px; border-radius: 0; background: #1a1a1a; box-shadow: none; }
html[data-template="paper"] .avatar-frame::after { display: none; }
html[data-template="paper"] .avatar { border-radius: 0; filter: grayscale(.35); }
html[data-template="paper"] .profile h1 { font-size: clamp(30px,8vw,40px); font-weight: 700; }
html[data-template="paper"] .profile-role { font-style: italic; }
html[data-template="paper"] .section-divider h2 { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
html[data-template="paper"] .action-card, html[data-template="paper"] .share-button, html[data-template="paper"] .business-card { border-radius: 0; box-shadow: none; }

html[data-template="studio"] {
  color-scheme: light;
  --page-bg: #dfe5ff;
  --card-bg: #eef2ff;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --gold-light: #4ade80;
  --gold-deep: #15803d;
  --text: #1e1b4b;
  --text-muted: #433f75;
  --text-subtle: #625e8c;
  --gold-border: rgba(49, 46, 129, 0.28);
  --soft-border: rgba(49, 46, 129, 0.16);
  --card-radius: 28px;
  --button-radius: 14px;
  --focus-ring: 0 0 0 3px rgba(22,163,74,.28);
}
html[data-template="studio"] body { background: radial-gradient(circle at 12% 5%, rgba(255,255,255,.85), transparent 24rem), var(--page-bg); }
html[data-template="studio"] .card-shell { border: 0; border-radius: 28px; background: var(--card-bg); box-shadow: 0 24px 70px rgba(49,46,129,.24); }
html[data-template="studio"] .card-shell::before { background: radial-gradient(circle at 92% 12%, rgba(22,163,74,.16) 0 80px, transparent 81px); }
html[data-template="studio"] .brand-hero { height: 210px; overflow: hidden; border-radius: 28px 28px 56px 0; background: #312e81; }
html[data-template="studio"] .header-wave { display: none; }
html[data-template="studio"] .brand-hero::after { top: -110px; left: auto; right: -60px; width: 270px; height: 270px; background: #16a34a; filter: none; transform: none; opacity: .9; }
html[data-template="studio"] .brand-lockup { align-items: flex-start; padding: 34px 32px; }
html[data-template="studio"] .brand-logo { width: 72px; height: 72px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.25)); }
html[data-template="studio"] .brand-name { margin-top: 14px; background: none; color: #ffffff; font-size: 26px; letter-spacing: -.01em; }
html[data-template="studio"] .profile { align-items: flex-start; margin-top: -42px; padding: 0 32px; text-align: left; }
html[data-template="studio"] .avatar-frame { width: 132px; height: 132px; border-radius: 34px 8px 34px 8px; background: #16a34a; box-shadow: 0 14px 26px rgba(49,46,129,.2); }
html[data-template="studio"] .avatar-frame::after { border-radius: 38px 12px 38px 12px; border-color: rgba(49,46,129,.14); }
html[data-template="studio"] .avatar { border-radius: 30px 6px 30px 6px; }
html[data-template="studio"] .profile h1 { color: #312e81; }
html[data-template="studio"] .section-divider h2 { color: #312e81; letter-spacing: .06em; }
html[data-template="studio"] .action-card, html[data-template="studio"] .business-card, html[data-template="studio"] .share-button { box-shadow: 0 7px 18px rgba(49,46,129,.08); }

/* Template-specific contrast pairs: keep normal text at WCAG AA or better. */
html[data-template="gold"] .brand-name {
  max-width: calc(100% - 48px);
  padding: 7px 13px 8px;
  border: 1px solid rgba(255,217,120,.55);
  border-radius: 10px;
  background: rgba(3,3,3,.84);
  background-clip: padding-box;
  color: #fff3c4;
  line-height: 1.15;
  text-shadow: 0 2px 8px #000000;
}
html[data-template="gold"] .profile-role,
html[data-template="gold"] .business-slogan { color: #ffd978; }
html[data-template="gold"] .action-card { border-color: rgba(255,217,120,.42); background: #13110d; }
html[data-template="gold"] .business-card { border-color: rgba(255,217,120,.4); background: #12100c; }
html[data-template="gold"] .action-label,
html[data-template="gold"] .business-copy h3 { color: #fffdf5; }
html[data-template="gold"] .business-meta { color: #e7e2d6; }

html[data-template="blueprint"] .profile h1,
html[data-template="blueprint"] .profile-company,
html[data-template="blueprint"] .action-label,
html[data-template="blueprint"] .business-copy h3 { color: #f8fafc; text-shadow: none; }
html[data-template="blueprint"] .profile-role,
html[data-template="blueprint"] .business-slogan { color: #67e8f9; }
html[data-template="blueprint"] .action-card { border-color: rgba(103,232,249,.65); background: #1b2b46; }
html[data-template="blueprint"] .business-card { border-color: rgba(103,232,249,.58); background: #17253d; }
html[data-template="blueprint"] .business-meta { color: #e2e8f0; }
html[data-template="blueprint"] .share-button.copy { background: #334155; }
html[data-template="blueprint"] .share-button.email { background: #9f1239; }
html[data-template="blueprint"] .share-button.whatsapp,
html[data-template="blueprint"] .share-button.wechat { background: #166534; }

html[data-template="gold"] .action-label,
html[data-template="blueprint"] .action-label { font-size: 12px; font-weight: 650; line-height: 1.25; }
html[data-template="gold"] .business-slogan,
html[data-template="blueprint"] .business-slogan { font-size: 12px; font-weight: 600; }
html[data-template="gold"] .business-meta,
html[data-template="blueprint"] .business-meta { font-size: 11px; }

html[data-template="paper"] .profile h1,
html[data-template="paper"] .profile-role,
html[data-template="paper"] .profile-company,
html[data-template="paper"] .action-label,
html[data-template="paper"] .business-copy h3 { color: #1a1a1a; text-shadow: none; }
html[data-template="paper"] .action-card { border-color: #81796d; background: #fffdf9; color: #1a1a1a; }
html[data-template="paper"] .action-card .icon-image { filter: brightness(0) saturate(100%); }
html[data-template="paper"] .business-card { border-color: #81796d; background: #f4f0e8; color: #1a1a1a; }
html[data-template="paper"] .business-slogan { color: #3f3a33; }
html[data-template="paper"] .business-meta { color: #45413b; }
html[data-template="paper"] .share-button.copy { background: #292524; }
html[data-template="paper"] .share-button.email { background: #9f1239; }
html[data-template="paper"] .share-button.whatsapp,
html[data-template="paper"] .share-button.wechat { background: #166534; }

html[data-template="studio"] .profile h1,
html[data-template="studio"] .profile-company,
html[data-template="studio"] .action-label,
html[data-template="studio"] .business-copy h3 { color: #1e1b4b; text-shadow: none; }
html[data-template="studio"] .profile-role,
html[data-template="studio"] .business-slogan { color: #166534; }
html[data-template="studio"] .action-card { border-color: rgba(49,46,129,.42); background: #ffffff; color: #1e1b4b; }
html[data-template="studio"] .action-card .icon-image { filter: brightness(0) saturate(100%) invert(19%) sepia(35%) saturate(2468%) hue-rotate(217deg) brightness(83%) contrast(96%); }
html[data-template="studio"] .business-card { border-color: rgba(49,46,129,.42); background: #ffffff; color: #1e1b4b; }
html[data-template="studio"] .business-meta { color: #433f75; }
html[data-template="studio"] .share-button.copy { background: #312e81; }
html[data-template="studio"] .share-button.email { background: #9f1239; }
html[data-template="studio"] .share-button.whatsapp,
html[data-template="studio"] .share-button.wechat { background: #166534; }

.qr-frame svg,
#image-qr svg {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.wechat-qr {
  width: min(260px, 100%);
  margin: 16px auto;
  border: 8px solid #fff;
  border-radius: 12px;
  background: #fff;
}

.card-shell.is-card-export .share-section {
  display: none;
}
