:root {
  color-scheme: light;
  --ink: #1d2334;
  --muted: #677080;
  --surface: #1d2334;
  --cream: #f2f3f3;
  --green: #a6d3c0;
  --green-dark: #7dbda2;
  --mint: #a6d3c0;
  --mint-light: #e9f5f0;
  --line: rgba(255, 255, 255, 0.16);
  --orange: #86d1f7;
  --navy: #1d2334;
  --navy-light: #283149;
  --blue: #86d1f7;
  --shadow: 0 32px 90px rgba(23, 30, 49, 0.26);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    linear-gradient(33deg, transparent 49.4%, rgba(29, 35, 52, 0.035) 49.7%, rgba(29, 35, 52, 0.035) 50.3%, transparent 50.6%),
    linear-gradient(117deg, transparent 49.4%, rgba(29, 35, 52, 0.028) 49.7%, rgba(29, 35, 52, 0.028) 50.3%, transparent 50.6%),
    radial-gradient(circle at 15% 30%, transparent 0 92px, rgba(29, 35, 52, 0.035) 93px 94px, transparent 95px),
    radial-gradient(circle at 86% 72%, transparent 0 130px, rgba(29, 35, 52, 0.028) 131px 132px, transparent 133px);
  background-size: 210px 210px, 260px 260px, 390px 390px, 520px 520px;
  font-family: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(3px);
  pointer-events: none;
}

.ambient-one {
  width: 320px;
  height: 320px;
  right: -170px;
  top: 15%;
  background: rgba(134, 209, 247, 0.13);
}

.ambient-two {
  width: 230px;
  height: 230px;
  left: -120px;
  bottom: 4%;
  background: rgba(166, 211, 192, 0.18);
}

.topbar {
  width: 100%;
  height: 82px;
  padding-inline: max(18px, calc((100% - 1120px) / 2));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--navy);
  border-bottom: 1px solid rgba(134, 209, 247, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(134, 209, 247, 0.36);
  border-radius: 50%;
  color: var(--blue);
  background: rgba(134, 209, 247, 0.08);
  box-shadow: 0 0 28px rgba(134, 209, 247, 0.12);
}

.brand-mark svg, .tap-hint-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.9; }
.brand-mark img { width: 25px; height: 25px; display: block; object-fit: contain; }

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.icon-button:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.14); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.public-badge {
  padding: 8px 11px;
  color: var(--blue);
  border: 1px solid rgba(134, 209, 247, .28);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#open-settings[hidden] { display: none; }

.page-shell {
  width: min(100% - 32px, 480px);
  margin: 30px auto 56px;
}

.demo-banner {
  margin: 0 4px 14px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  border: 1px solid rgba(29, 35, 52, 0.09);
  border-radius: 0;
  background: var(--mint);
  font-size: 0.79rem;
}

.demo-banner[hidden] { display: none; }
.demo-banner button { padding: 0; border: 0; color: var(--navy); background: transparent; font-weight: 800; cursor: pointer; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }

.profile-card {
  overflow: hidden;
  border: 1px solid rgba(134, 209, 247, 0.19);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cover-pattern {
  position: relative;
  height: 220px;
  overflow: hidden;
  background:
    linear-gradient(112deg, rgba(7, 37, 74, 0.98), rgba(29, 35, 52, 0.74)),
    linear-gradient(145deg, #0b2f57, var(--navy));
}

.cover-pattern::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.72;
  background-image:
    linear-gradient(90deg, rgba(134, 209, 247, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(134, 209, 247, 0.09) 1px, transparent 1px),
    radial-gradient(rgba(134, 209, 247, 0.9) 0.8px, transparent 0.8px);
  background-size: 38px 38px, 38px 38px, 13px 13px;
  z-index: 1;
}

.cover-pattern::after {
  content: "DIGITAL CONTACT  /  NFC READY";
  position: absolute;
  left: 28px;
  top: 28px;
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  z-index: 3;
}

.cover-hands {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  opacity: .86;
  pointer-events: none;
}

.cover-primary-brand {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 80px;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: white;
  transform: translateX(-50%);
  text-shadow: 0 3px 14px rgba(0, 0, 0, .5);
}

.cover-primary-brand img {
  width: 68px;
  height: 68px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 5px 16px rgba(0, 0, 0, .46));
}

.cover-primary-brand strong {
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cover-logo {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 14px;
  width: min(46%, 205px);
  height: auto;
  display: block;
  opacity: .82;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.38));
  pointer-events: none;
}

.orbit { position: absolute; z-index: 2; border: 1px solid rgba(134,209,247,.28); border-radius: 50%; }
.orbit-one { width: 260px; height: 260px; right: -76px; top: -92px; }
.orbit-two { width: 160px; height: 160px; right: -25px; top: -42px; }
.signal-dot { position: absolute; z-index: 2; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 7px rgba(166,211,192,.1), 0 0 18px rgba(166,211,192,.8); }
.dot-one { right: 92px; top: 38px; }
.dot-two { right: 185px; top: 100px; width: 5px; height: 5px; opacity: .8; }

.profile-content { position: relative; padding: 0 28px 30px; color: white; background: var(--navy); }

.avatar {
  width: 94px;
  height: 94px;
  margin-top: -50px;
  display: grid;
  place-items: center;
  border: 4px solid var(--navy);
  border-radius: 2px;
  color: var(--navy);
  background: linear-gradient(145deg, var(--mint), #7dbda2);
  box-shadow: 0 0 0 1px rgba(166,211,192,.42), 0 14px 36px rgba(0, 0, 0, .3);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.agency-credential {
  position: relative;
  min-height: 82px;
  margin: 18px 0 0;
  padding: 12px 13px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 78px 1fr 38px;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  border: 1px solid rgba(134, 209, 247, .82);
  border-radius: 2px;
  background:
    linear-gradient(100deg, rgba(255,255,255,.42), transparent 46%),
    linear-gradient(135deg, var(--mint), #86d1f7);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .23), inset 0 1px 0 rgba(255, 255, 255, .52);
}

.agency-credential::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -56px;
  top: -65px;
  border: 1px solid rgba(29, 35, 52, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 17px rgba(29, 35, 52, .05), 0 0 0 35px rgba(29, 35, 52, .04);
  pointer-events: none;
}

.credential-year {
  font-size: 2rem;
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.08em;
}

.credential-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  text-transform: uppercase;
}

.credential-copy small {
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.credential-copy strong {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: -.02em;
}

.credential-seal {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 4px 14px rgba(29, 35, 52, .28);
}

.credential-seal img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}

.eyebrow {
  margin: 19px 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(166,211,192,.12), 0 0 12px rgba(166,211,192,.55); }

h1, h2 { margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: -.045em; }
h1 { font-size: clamp(2.25rem, 9vw, 2.9rem); line-height: 1.02; font-weight: 800; }
h2 { font-size: 1.65rem; }
.role-line { margin: 10px 0 0; color: var(--mint); font-size: .96rem; font-weight: 800; }
.bio { margin: 18px 0 26px; color: rgba(255,255,255,.72); font-size: .93rem; line-height: 1.58; }

.primary-action, .secondary-action, .qr-action, .nfc-action, .text-action {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action { border: 1px solid var(--mint); color: var(--navy); background: var(--mint); box-shadow: 0 11px 26px rgba(0,0,0,.2); }
.primary-action:hover { transform: translateY(-1px); background: #b8dfcf; box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.primary-action svg, .secondary-action svg, .qr-action svg, .nfc-action svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.quick-actions {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quick-actions a {
  min-height: 82px;
  padding: 12px 7px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: white;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, .055);
  text-decoration: none;
  font-size: .75rem;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease;
}

.quick-actions a:hover { transform: translateY(-2px); border-color: rgba(166,211,192,.68); background: rgba(166,211,192,.08); }
.quick-actions a.is-disabled { opacity: .38; pointer-events: none; }
.quick-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--blue); border-radius: 50%; background: rgba(134,209,247,.1); }
.quick-icon svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.link-list { margin-bottom: 14px; }
.link-list > a { min-height: 68px; padding: 10px 13px; display: flex; align-items: center; gap: 12px; color: white; border: 1px solid var(--line); border-radius: 2px; background: rgba(255,255,255,.055); text-decoration: none; transition: border-color 160ms ease, background 160ms ease; }
.link-list > a:hover { border-color: var(--mint); background: rgba(166,211,192,.08); }
.link-list > a.is-disabled { display: none; }
.link-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; color: var(--navy); border-radius: 2px; background: var(--mint); }
.link-icon svg, .arrow-icon { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.link-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.link-copy strong { font-size: .85rem; }
.link-copy small { overflow: hidden; color: rgba(255,255,255,.55); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.arrow-icon { color: var(--blue); }

.secondary-action { border: 1px solid rgba(255,255,255,.25); color: var(--mint); background: transparent; }
.secondary-action:hover { background: rgba(166,211,192,.08); border-color: var(--mint); }

.qr-action { margin-top: 10px; border: 1px solid rgba(134,209,247,.38); color: var(--blue); background: rgba(134,209,247,.06); }
.qr-action:hover { background: rgba(134,209,247,.12); border-color: var(--blue); }
.qr-action[hidden] { display: none; }

.tap-hint { margin: 20px auto 0; display: flex; justify-content: center; align-items: center; gap: 11px; color: var(--muted); }
.tap-hint-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--navy); border: 1px solid rgba(29,35,52,.16); border-radius: 50%; background: var(--mint); }
.tap-hint > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.tap-hint strong { color: var(--navy); font-size: .75rem; }
.tap-hint small { font-size: .7rem; }

.settings-dialog {
  width: min(100% - 28px, 700px);
  max-height: min(90vh, 860px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: white;
  box-shadow: 0 32px 120px rgba(17,39,30,.32);
}

.qr-dialog {
  width: min(100% - 28px, 440px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: white;
  box-shadow: 0 32px 120px rgba(17, 25, 43, .42);
}

.qr-dialog::backdrop { background: rgba(11, 18, 34, .76); backdrop-filter: blur(9px); }
.qr-panel { padding: 26px; }
.qr-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.qr-dialog-header .eyebrow { margin: 0 0 6px; color: #38725f; }
.qr-dialog-header .icon-button { color: var(--navy); border-color: rgba(29,35,52,.16); background: #f5f6f7; }
.qr-intro { margin: 16px 0 20px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.qr-frame { position: relative; width: min(100%, 286px); aspect-ratio: 1; margin: 0 auto; padding: 16px; border: 1px solid #d9dee4; background: white; box-shadow: 0 16px 45px rgba(29,35,52,.12); }
.qr-frame img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.qr-corner { position: absolute; width: 24px; height: 24px; border-color: var(--blue); border-style: solid; pointer-events: none; }
.corner-one { left: -5px; top: -5px; border-width: 2px 0 0 2px; }
.corner-two { right: -5px; top: -5px; border-width: 2px 2px 0 0; }
.corner-three { right: -5px; bottom: -5px; border-width: 0 2px 2px 0; }
.corner-four { left: -5px; bottom: -5px; border-width: 0 0 2px 2px; }
.qr-profile-name { margin-top: 19px; display: block; color: var(--navy); font-size: 1rem; text-align: center; }
.qr-help { margin: 5px auto 0; max-width: 330px; color: var(--muted); font-size: .76rem; line-height: 1.45; text-align: center; }
.qr-environment-note { margin: 12px 0 0; padding: 9px 11px; color: #376b59; background: var(--mint-light); font-size: .7rem; font-weight: 700; line-height: 1.4; text-align: center; }
.qr-environment-note.is-warning { color: #76522e; background: #fff1dc; }
.qr-actions { margin-top: 16px; }
.qr-actions .primary-action { color: white; border-color: var(--navy); background: var(--navy); }
.qr-actions .text-action { min-height: 38px; color: var(--navy); }

.settings-dialog::backdrop { background: rgba(10, 24, 18, .58); backdrop-filter: blur(7px); }
.settings-panel { max-height: min(90vh, 860px); padding: 28px; overflow-y: auto; }
.settings-panel .icon-button { border-color: rgba(29,35,52,.16); color: var(--navy); background: #f5f6f7; }
.settings-panel .primary-action { border-color: var(--navy); color: white; background: var(--navy); }
.settings-panel .primary-action:hover { background: var(--navy-light); }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-header .eyebrow { margin: 0 0 5px; }
.dialog-intro { margin: 14px 0 23px; color: var(--muted); font-size: .88rem; line-height: 1.5; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; color: #435048; font-size: .73rem; font-weight: 800; }
.form-grid .span-two { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea { width: 100%; padding: 12px 13px; border: 1px solid #d9e0db; border-radius: 11px; outline: none; background: #fbfcfb; color: var(--ink); resize: vertical; transition: border-color 160ms ease, box-shadow 160ms ease; }
.form-grid input:focus, .form-grid textarea:focus { border-color: #6e9c86; box-shadow: 0 0 0 3px rgba(68,130,101,.11); }

.privacy-note { margin: 20px 0; padding: 13px; display: flex; gap: 10px; align-items: flex-start; color: #466052; border-radius: 12px; background: var(--mint-light); font-size: .75rem; line-height: 1.45; }
.privacy-note svg { width: 19px; flex: 0 0 auto; fill: none; stroke: var(--green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.dialog-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
.dialog-actions .text-action { grid-column: 1 / -1; min-height: 36px; }
.nfc-action { border: 1px solid var(--navy); color: var(--navy); background: white; }
.nfc-action:hover { background: var(--mint-light); }
.nfc-action:disabled { opacity: .45; cursor: not-allowed; }
.text-action { border: 0; color: var(--navy); background: transparent; }
.text-action:hover { text-decoration: underline; }
.payload-size { margin: 12px 0 0; color: #376b59; font-size: .72rem; font-weight: 800; text-align: center; }
.payload-size.is-too-large { color: #a6492f; }
.nfc-support { min-height: 20px; margin: 5px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.4; text-align: center; }

.toast { position: fixed; z-index: 10; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); padding: 11px 16px; color: white; border-radius: 999px; background: #17211c; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: .8rem; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .topbar { height: 70px; }
  .page-shell { margin-top: 4px; }
  .cover-pattern { height: 196px; }
  .cover-primary-brand { top: 69px; gap: 5px; }
  .cover-primary-brand img { width: 60px; height: 60px; }
  .cover-primary-brand strong { font-size: .68rem; }
  .cover-logo { right: 13px; bottom: 12px; width: 46%; }
  .profile-content { padding: 0 20px 22px; }
  .avatar { width: 86px; height: 86px; margin-top: -45px; border-radius: 24px; }
  .agency-credential { grid-template-columns: 68px 1fr 34px; gap: 8px; padding: 11px; }
  .credential-year { font-size: 1.72rem; }
  .credential-copy small { font-size: .52rem; }
  .credential-copy strong { font-size: .91rem; }
  .credential-seal { width: 34px; height: 34px; }
  .credential-seal img { width: 23px; height: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: auto; }
  .dialog-actions { grid-template-columns: 1fr; }
  .dialog-actions .text-action { grid-column: auto; }
  .settings-panel { padding: 22px 18px; }
  .qr-panel { padding: 22px 18px; }
  .qr-frame { width: min(100%, 250px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
