:root {
  --red: #e8222a;
  --red-dark: #c8161d;
  --navy: #1d3e7b;
  --ink: #111;
  --muted: #6b7280;
  --white: #fff;
  --radius: 999px;
  --font: 'Quicksand', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #e9e9ec;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.35;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.card {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--white);
  box-shadow: 0 0 30px rgba(0, 0, 0, .12);
  overflow: hidden;
}
.loading { padding: 40vh 0; text-align: center; color: var(--muted); }

/* ---------- Header ---------- */
.top { padding: 22px 18px 18px; }
.top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.logo { display: flex; flex-direction: column; }
.logo-main { display: flex; align-items: center; gap: 2px; font-weight: 700; font-size: 30px; letter-spacing: -.5px; line-height: 1; }
.logo-sg { position: relative; font-family: Georgia, serif; font-style: italic; color: var(--navy); font-size: 30px; }
.logo-sg b { color: var(--red); }
.logo-name { color: var(--red); }
.logo-url { color: var(--navy); font-size: 11px; font-weight: 700; margin: 2px 0 0 46px; }
.head-qr { width: 92px; margin-top: 34px; flex-shrink: 0; position: relative; }
.head-qr svg { width: 100%; height: auto; display: block; }
.qr-badge {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  background: #fff; border-radius: 4px; padding: 1px 3px;
  font: italic 700 11px Georgia, serif; color: var(--navy);
}
.qr-badge b { color: var(--red); }

.person { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 4px; gap: 10px; }
.person h1 { margin: 0 0 2px; font-size: 19px; font-weight: 700; }
.person .line { font-size: 14px; }
.person .contacts { margin-top: 14px; font-size: 14px; }
.badge-sme { width: 92px; flex-shrink: 0; text-align: center; font-family: Georgia, serif; color: #111; }
.badge-sme svg { width: 34px; height: 34px; margin: 0 auto; }
.badge-sme .s1 { font-size: 18px; letter-spacing: -.5px; line-height: 1; }
.badge-sme .s2 { font-size: 10px; letter-spacing: .5px; }
.badge-sme .s3 { font-size: 7px; letter-spacing: .5px; }

/* ---------- Red contact block ---------- */
.red { background: var(--red); color: var(--white); padding: 26px 22px 30px; }
.c-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; font-size: 15px; font-weight: 700; }
.c-ico { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; }
.c-ico svg { width: 22px; height: 22px; }
.ico-wa { background: #25d366; }
.ico-call { background: linear-gradient(135deg, #6b4cff, #d14bff); }
.ico-web { background: #fff; }
.ico-web svg { width: 30px; height: 30px; }
.ico-mail { background: #1e88e5; }
.ico-map { background: transparent; }
.ico-map svg { width: 32px; height: 32px; }

.wa-send { display: flex; justify-content: center; gap: 8px; margin: 26px 0 14px; }
.cc {
  display: flex; align-items: center; gap: 4px; background: #fff; color: #111;
  border-radius: var(--radius); padding: 0 10px; height: 34px; font-size: 13px; border: 0;
}
.cc select { border: 0; background: transparent; font: inherit; color: inherit; outline: none; }
.wa-send input {
  width: 46%; max-width: 190px; height: 34px; border: 0; border-radius: var(--radius);
  padding: 0 14px; font: inherit; font-size: 13px; text-align: center; outline: none;
}
.btn-navy {
  background: var(--navy); color: #fff; border: 0; border-radius: var(--radius);
  height: 34px; padding: 0 18px; font-weight: 700; font-size: 13px;
}
.btn-white {
  background: #fff; color: #111; border: 0; border-radius: var(--radius);
  height: 36px; padding: 0 22px; font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.btn-row { display: flex; justify-content: center; gap: 12px; }

/* The headline feature: AirDrop + Nearby share buttons */
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 6px; }
.btn-airdrop, .btn-nearby {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; border: 0; border-radius: 14px; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.btn-airdrop { background: linear-gradient(135deg, #1a8cff, #3fc3ff); color: #fff; animation: pulse 2.6s ease-in-out infinite; }
.btn-nearby { background: #fff; color: var(--red); }
.btn-airdrop .airdrop-ico, .btn-nearby .airdrop-ico { width: 24px; height: 24px; }
.btn-nearby .count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,.2), 0 0 0 0 rgba(255,255,255,.7); } 50% { box-shadow: 0 6px 18px rgba(0,0,0,.2), 0 0 0 8px rgba(255,255,255,0); } }

.social { display: flex; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.social a, .social button { width: 30px; height: 30px; display: grid; place-items: center; background: none; border: 0; padding: 0; }
.social svg { width: 28px; height: 28px; }

/* ---------- Content sections ---------- */
.section { padding: 26px 22px 6px; }
.section h2 { text-align: center; font-size: 21px; font-weight: 700; margin: 0 0 18px; }
.facts { display: grid; grid-template-columns: auto 12px 1fr; row-gap: 4px; font-size: 13px; margin-bottom: 14px; }
.about p { font-size: 13.5px; text-align: justify; margin: 0 0 18px; }
.gallery { display: grid; gap: 12px; }
.gallery img { width: 100%; border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.video {
  position: relative; aspect-ratio: 16 / 10; background: #fff; border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); display: grid; place-items: center; overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play { width: 56px; height: 56px; border-radius: 50%; background: #666; border: 0; display: grid; place-items: center; }
.play::after { content: ''; border-left: 18px solid #111; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }

/* ---------- Enquiry ---------- */
.enquiry { background: var(--red); color: #fff; padding: 24px 18px 22px; margin-top: 24px; display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.enquiry h2 { grid-column: 2; text-align: center; margin: 0 0 6px; font-size: 19px; }
.certs { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 10px; }
.certs svg { width: 80px; height: auto; }
.enquiry form { display: flex; flex-direction: column; gap: 9px; align-items: center; }
.enquiry input, .enquiry textarea {
  width: 100%; border: 0; border-radius: 18px; padding: 9px 16px; font: inherit; font-size: 12.5px; outline: none;
}
.enquiry textarea { min-height: 54px; resize: vertical; border-radius: 16px; }
.footer { text-align: center; font-size: 12px; padding: 12px; }
.footer a { color: var(--red); }

/* ---------- Share sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); animation: fade .2s; }
.sheet-panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: #f6f6f8; border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
  animation: up .25s ease-out;
}
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: #ccc; margin: 0 auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 18px; margin: 4px 0 12px; }
.icon-btn { background: #e4e4e8; border: 0; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; }

.airdrop-ico {
  display: inline-block;
  background: currentColor;
  -webkit-mask: url('img/airdrop.svg') center / contain no-repeat;
  mask: url('img/airdrop.svg') center / contain no-repeat;
}

.nearby { background: #fff; border-radius: 16px; padding: 14px; }
.nearby-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.nearby h3 { margin: 0; font-size: 14px; }
.muted { color: var(--muted); font-size: 12px; }
.peer-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.peer { width: 76px; text-align: center; background: none; border: 0; padding: 0; color: var(--ink); }
.peer-ava {
  position: relative; width: 60px; height: 60px; margin: 0 auto 6px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, var(--red), #ff7a59);
}
.peer-ava svg { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; background: #fff; border-radius: 50%; padding: 3px; color: #333; }
.peer-name { font-size: 12px; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-sub { font-size: 10.5px; color: var(--muted); display: block; }
.peer.busy .peer-ava::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 3px solid #1a8cff; border-right-color: transparent; animation: spin 1s linear infinite;
}
.peer.done .peer-ava { background: #22c55e; }
@keyframes spin { to { transform: rotate(360deg); } }

.radar { position: relative; height: 96px; display: grid; place-items: end center; overflow: hidden; }
.radar span {
  position: absolute; left: 50%; top: 38px; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid #1a8cff; animation: ping 2.4s ease-out infinite; opacity: 0;
}
.radar span:nth-child(2) { animation-delay: .8s; }
.radar span:nth-child(3) { animation-delay: 1.6s; }
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(6); opacity: 0; } }
.radar p { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.link-btn { background: none; border: 0; color: #1a6fd6; font-size: 12px; padding: 6px 0 0; }
.code-form { display: flex; gap: 8px; margin-top: 8px; }
.code-form input { flex: 1; min-width: 0; height: 34px; border: 1px solid #ddd; border-radius: var(--radius); padding: 0 14px; font: inherit; font-size: 13px; }

.qr-share { background: #fff; border-radius: 16px; padding: 14px; margin-top: 12px; text-align: center; }
.sheet-qr { width: 170px; margin: 0 auto; }
.sheet-qr svg { width: 100%; height: auto; display: block; }
.qr-share p { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff; border: 0; border-radius: 14px; padding: 10px 4px; font-size: 11.5px; color: var(--ink);
}
.quick span { font-size: 20px; }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal-box { width: 100%; max-width: 360px; background: #fff; border-radius: 20px; padding: 22px; text-align: center; }
.modal-box h3 { margin: 10px 0 6px; font-size: 18px; }
.modal-box p { margin: 0; color: var(--muted); font-size: 14px; }
.modal-ava { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--red), #ff7a59); color: #fff; font-size: 26px; font-weight: 700; }
.mini-card { margin-top: 14px; border-radius: 14px; overflow: hidden; text-align: left; border: 1px solid #eee; }
.mini-card .mc-top { padding: 12px 14px; }
.mini-card .mc-top strong { font-size: 16px; display: block; }
.mini-card .mc-red { background: var(--red); color: #fff; padding: 10px 14px; font-size: 13px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button { flex: 1; height: 42px; border-radius: 12px; border: 0; font-weight: 700; }
.modal-actions .primary { background: var(--red); color: #fff; }
.modal-actions .secondary { background: #eee; color: #111; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: #111; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13px;
  max-width: calc(100% - 32px); text-align: center; animation: fade .2s;
}

/* ---------- Card switcher ---------- */
.card-links { display: flex; gap: 8px; padding: 12px 18px 0; }
.card-link {
  flex: 1; display: flex; align-items: center; justify-content: center;
  height: 38px; border-radius: var(--radius); border: 2px solid var(--red);
  color: var(--red); font-weight: 700; font-size: 14px;
}
.card-link.is-current { background: var(--red); color: #fff; }

.received-banner { background: #111; color: #fff; text-align: center; font-size: 13px; padding: 8px 12px; }
.received-banner a { text-decoration: underline; }

/* ---------- Bump to share ---------- */
.btn-bump {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 14px;
  background: rgba(0, 0, 0, .14); color: #fff; font-weight: 700; font-size: 15px;
}
.bump { position: fixed; inset: 0; z-index: 55; background: rgba(10, 12, 20, .72); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.bump-panel {
  position: relative; width: 100%; max-width: 380px; background: #fff; border-radius: 24px;
  padding: 28px 22px 20px; text-align: center;
}
.bump-close { position: absolute; top: 12px; right: 12px; }
.bump-orb {
  width: 120px; height: 120px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center;
  font-size: 52px; background: radial-gradient(circle at 35% 30%, #ff6b6b, var(--red)); color: #fff;
  box-shadow: 0 10px 30px rgba(232, 34, 42, .35); position: relative;
}
.bump.is-listening .bump-orb::before, .bump.is-listening .bump-orb::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--red);
  animation: ripple 1.8s ease-out infinite;
}
.bump.is-listening .bump-orb::after { animation-delay: .9s; }
@keyframes ripple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
.bump-orb.is-hit { animation: hit .45s ease-out; }
@keyframes hit { 30% { transform: scale(.88); } 60% { transform: scale(1.08); } }
.bump.is-matched .bump-orb { background: radial-gradient(circle at 35% 30%, #4ade80, #16a34a); box-shadow: 0 10px 30px rgba(22, 163, 74, .35); }
.bump-panel h2 { margin: 0 0 6px; font-size: 20px; }
.bump-panel > p { margin: 0; color: var(--muted); font-size: 14px; }
.bump-meter { height: 8px; border-radius: 4px; background: #eee; margin: 16px 0 0; overflow: hidden; }
.bump-meter div { height: 100%; width: 0; background: #f59e0b; transition: width .08s linear; }
.bump-meter div.is-over { background: #16a34a; }
.bump-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.chip { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: #f1f1f4; color: #555; }
.chip-on { background: #dcfce7; color: #166534; }
.chip-off { background: #fee2e2; color: #991b1b; }
.chip-na { background: #fef3c7; color: #92400e; }
.bump-count { min-height: 18px; margin: 10px 0 0 !important; font-size: 13px !important; color: var(--ink) !important; }
.bump-btn {
  width: 100%; height: 50px; margin-top: 10px; border: 0; border-radius: 14px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 16px;
}
.bump-btn:disabled { opacity: .6; }
.bump-note { margin-top: 12px !important; font-size: 11.5px !important; }

/* ---------- Received card (slides up) ---------- */
.got { z-index: 65; }
.got-panel { background: #fff; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.got-badge { margin: 4px 0 12px; text-align: center; font-size: 14px; color: #16a34a; font-weight: 700; }
.got-card { border-radius: 16px; overflow: hidden; box-shadow: 0 6px 22px rgba(0, 0, 0, .12); border: 1px solid #eee; }
.got-top { display: flex; gap: 14px; align-items: center; padding: 16px; }
.got-ava {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red), #ff7a59); color: #fff; font-size: 24px; font-weight: 700;
}
.got-top h2 { margin: 0; font-size: 20px; }
.got-top p { margin: 2px 0 0; font-size: 13px; }
.got-company { color: var(--muted); }
.got-red { background: var(--red); color: #fff; padding: 12px 16px; font-size: 13.5px; display: grid; gap: 3px; }
.got-red:empty { display: none; }
.got-open {
  width: 100%; height: 52px; margin-top: 16px; border: 0; border-radius: 14px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 17px;
}
.got-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.got-secondary { height: 44px; border: 0; border-radius: 12px; background: #f1f1f4; color: #111; font-weight: 700; }
