/* The public card page (abrm.app/c/<code>): phone first, the card is the hero. */
:root { color-scheme: dark; --ink: #eef2f8; --muted: rgba(238, 242, 248, 0.64); --line: rgba(255, 255, 255, 0.09); --panel: rgba(255, 255, 255, 0.045); --accent: #64b5f6; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: #070b14; }
body.cp {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: #070b14;
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.cp-ambient {
  position: fixed; inset: -20vh -20vw; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40vmax 34vmax at 22% 12%, var(--a1, rgba(19, 33, 58, 0.6)), transparent 70%),
    radial-gradient(36vmax 30vmax at 85% 28%, var(--a2, rgba(100, 181, 246, 0.2)), transparent 70%),
    radial-gradient(60vmax 40vmax at 50% 110%, var(--a3, rgba(7, 13, 24, 0.9)), transparent 70%);
  filter: saturate(1.1);
}
.cp-main { position: relative; z-index: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); }
.cp-stage { width: min(100%, 460px); margin: 18px auto 0; touch-action: pan-y; }
/* A portrait card on a phone: smaller, so the card, the name, Save contact and the first contact
   row are all in the first screen (390 × 800); the bigger size from 760 px wide (below). */
.cp-stage.is-portrait { width: min(56%, 300px); }
.cp-demo { display: flex; align-self: center; gap: 4px; padding: 4px; margin: 0 auto 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); width: max-content; }
.cp-demo a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 18px; border-radius: 99px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.cp-demo a[aria-current="page"] { color: var(--ink); background: rgba(127, 127, 127, 0.22); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cp-demo a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-under { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; margin-top: 22px; flex-wrap: wrap; }
.cp-hint { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; transition: opacity 0.6s ease; }
.cp-hint span { display: inline-flex; align-items: center; gap: 7px; }
.cp-hint .ic { width: 15px; height: 15px; }
.cp-hint.is-done { opacity: 0; }
.cp-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.cp-chip .ic { width: 15px; height: 15px; }
.cp-chip[aria-pressed="true"] { color: var(--muted); border-color: transparent; background: transparent; }
.cp-chip[aria-pressed="true"] .ic { color: var(--accent); }
.cp-head { text-align: center; margin-top: 14px; }
.cp-head h1 { margin: 0; font-size: 30px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; overflow-wrap: anywhere; }
.cp-head p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.cp-actions { margin-top: 24px; display: grid; gap: 10px; }
/* Add to Apple Wallet / Add to Google Wallet: black, white text, like each wallet's own button
   (worker/page.js walletHtml; card/page.js shows the one for the device). */
.cp-wallet { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.cp-wallet[hidden], .cp-wallet > [hidden] { display: none; }
.cp-wbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 16px; min-width: 0;
  border-radius: 12px; border: 1px solid #a6a6a6; background: #000; color: #fff; text-decoration: none;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; -webkit-tap-highlight-color: transparent;
}
.cp-wbtn-google { border-radius: 999px; border-color: #747775; background: #1f1f1f; }
.cp-wbtn .ic { width: 20px; height: 20px; flex: none; }
.cp-wbtn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-wbtn:focus-visible { outline: 2px solid var(--accent, #7cf2ff); outline-offset: 2px; }
.cp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.cp-row > [hidden] { display: none; }
.cp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; padding: 0 16px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent; min-width: 0;
}
.cp-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-btn .ic { width: 19px; height: 19px; flex: none; }
.cp-btn:hover { border-color: rgba(255, 255, 255, 0.2); }
.cp-btn:active { transform: scale(0.98); }
.cp-btn:focus-visible, .cp-chip:focus-visible, .cp-list a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-primary { background: #f4f7fb; color: #08111f; border-color: transparent; font-size: 16px; min-height: 56px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.cp-primary:hover { border-color: transparent; background: #fff; }
.cp-buttons { display: grid; gap: 10px; }
.cp-cta { background: var(--accent); color: #06101f; border-color: transparent; }
.cp-outline { background: var(--panel); border: 1.5px solid var(--accent); }
.cp-outline:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.08); }
.cp-list { list-style: none; margin: 28px 0 0; padding: 6px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.cp-list li + li { border-top: 1px solid var(--line); }
.cp-list a { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 12px; color: var(--ink); text-decoration: none; border-radius: 14px; }
.cp-list a:hover { background: rgba(255, 255, 255, 0.04); }
.cp-list .ic { width: 20px; height: 20px; flex: none; color: var(--accent); }
.cp-list span { display: flex; flex-direction: column; min-width: 0; }
.cp-list b { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.cp-list small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cp-bio { margin-top: 20px; padding: 18px 18px 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.cp-bio h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cp-bio p { margin: 0; line-height: 1.55; font-size: 15px; }
.cp-foot { margin-top: 30px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 13px; }
.cp-foot .cp-report { font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.cp-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); text-decoration: none; }
.cp-foot a:hover { color: var(--ink); }
.cp-foot b { font-family: 'Geist Mono', ui-monospace, monospace; font-weight: 500; color: var(--ink); margin: 0 4px; }
.cp-offline { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; background: rgba(20, 26, 38, 0.92); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.cp-offline .ic { width: 16px; height: 16px; }

/* ---------- sheets (share, QR) ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 20; background: rgba(3, 6, 12, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s ease; }
.sheet-back.is-open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  width: 100%; max-width: 520px; margin: 0 auto; padding: 10px 18px max(22px, env(safe-area-inset-bottom));
  background: #0f1625; border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; color: var(--ink);
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
}
.sheet.is-open { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, 0.18); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.sheet-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.06); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.sheet-x .ic { width: 20px; height: 20px; }
.sheet-qr { width: min(78vw, 300px); margin: 18px auto 6px; padding: 14px; border-radius: 22px; background: #fff; line-height: 0; }
.sheet-qr svg { width: 100%; height: auto; }
.sheet-qr-cap { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 16px; }
.sheet-link { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.sheet-link code { flex: 1; min-width: 0; font: 500 14px/1.3 'Geist Mono', ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-link .cp-btn { min-height: 44px; padding: 0 14px; border-radius: 11px; }
.sheet-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.sheet-opts .cp-btn { flex-direction: column; gap: 6px; min-height: 76px; font-size: 13px; font-weight: 500; }
.sheet-note { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 6px 0 4px; }
.toast { visibility: hidden; position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); z-index: 30; transform: translate(-50%, -140%); transition: transform 0.25s ease; padding: 11px 16px; border-radius: 99px; background: #f4f7fb; color: #08111f; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; }
.toast .ic { width: 17px; height: 17px; }

/* ---------- Report this card ---------- */
.rp { display: grid; gap: 8px; margin-top: 4px; }
.rp-reasons { border: 0; padding: 0; margin: 4px 0 6px; display: grid; gap: 4px; }
.rp-reasons legend, .rp-lab { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 4px; }
.rp-lab { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0 0; }
.rp-lab small { font-weight: 400; }
.rp-opt { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 15px; }
.rp-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.rp-opt:has(input:checked) { border-color: var(--accent); }
.rp-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp textarea, .rp input[type="email"], .rp input[type="tel"], .rp input:not([type]) { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--ink); font: inherit; font-size: 16px; }
.rp textarea { resize: vertical; min-height: 96px; }
.rp textarea:focus-visible, .rp input[type="email"]:focus-visible, .rp input[type="tel"]:focus-visible, .rp input:not([type]):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rp a { color: var(--accent); text-underline-offset: 2px; }
.rp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rp-err { margin: 0; min-height: 0; color: #ff9b9b; font-size: 14px; }
.rp-err:empty { display: none; }
.rp-send { width: 100%; }
.rp-send:disabled { opacity: 0.6; cursor: default; }
.rp-done { text-align: center; padding: 18px 0 6px; outline: none; }
.rp-done > .ic { width: 40px; height: 40px; color: #6ee7a8; }
.rp-done h3 { margin: 8px 0 4px; font-size: 18px; }
.rp-done .cp-btn { margin: 12px auto 0; min-width: 140px; }

/* ---------- Share your info back ---------- */
.cp-lead { width: 100%; }
.cp-lead[hidden] { display: none; }
.ld-consent { min-height: 52px; padding: 10px 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; margin-top: 6px; }
.ld-consent input { margin-top: 1px; }
#lead-done .cp-btn { display: flex; }

/* ---------- missing card ---------- */
.cp-missing .cp-main { min-height: 100vh; display: grid; place-items: center; }
.cp-empty { text-align: center; max-width: 360px; }
.cp-empty-card { width: 220px; aspect-ratio: 1000 / 571; margin: 0 auto 28px; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, 0.2); background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)); transform: rotate(-6deg); }
.cp-empty h1 { font-size: 24px; margin: 0 0 10px; }
.cp-empty p { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }

@media (min-width: 760px) {
  .cp-main { padding-top: 56px; }
  .cp-stage.is-portrait { width: min(72%, 300px); }
  .cp-head h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-back, .toast, .cp-hint { transition: none; }
}

/* ---------- the page's own style (Pro: card.page, worker/page.js pageVars) ---------- */
.cp-styled { --ink: var(--pg-ink); --muted: var(--pg-muted); }
.cp-styled.cp-light { color-scheme: light; --line: rgba(17, 24, 39, 0.12); --panel: rgba(255, 255, 255, 0.55); background: #f3f5f8; }
.cp-styled.cp-light .cp-ambient { opacity: 0.35; }
.cp-styled.cp-bg-solid, .cp-styled.cp-bg-preset, .cp-styled.cp-bg-card { background: var(--pg-bg) fixed; }
.cp-styled.cp-bg-solid .cp-ambient, .cp-styled.cp-bg-preset .cp-ambient, .cp-styled.cp-bg-image .cp-ambient, .cp-styled.cp-bg-card .cp-ambient { display: none; }
/* The page from the card's own design (model.designPage): its accent for focus rings and icons too. */
.cp-bg-card { --accent: var(--pg-accent); }
.cp-bg-card .cp-list .ic, .cp-bg-card .cp-chip[aria-pressed="true"] .ic { color: var(--pg-accent); }
.cp-photo { position: fixed; inset: -40px; z-index: 0; background: center / cover no-repeat; filter: blur(var(--pg-blur, 8px)); transform: scale(1.04); }
.cp-photo-dim { position: fixed; inset: 0; z-index: 0; background: rgba(7, 11, 20, var(--pg-dim, 0.45)); }
.cp-light .cp-photo-dim { background: rgba(243, 245, 248, var(--pg-dim, 0.45)); }
/* Text over a photo sits on panels, so it stays readable whatever the image. */
.cp-bg-image .cp-head { padding: 12px 16px; border-radius: 20px; background: var(--panel); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cp-bg-image.cp-dark { --panel: rgba(7, 11, 20, 0.62); }
.cp-bg-image.cp-light { --panel: rgba(255, 255, 255, 0.78); }
.cp-styled .cp-btn { border-radius: var(--pg-radius); }
.cp-styled .cp-primary, .cp-styled .cp-cta { background: var(--pg-accent); color: var(--pg-accent-ink); }
.cp-styled .cp-outline { border-color: var(--pg-accent); }
.cp-styled .cp-primary:hover { background: var(--pg-accent); filter: brightness(1.06); }
.cp-styled .cp-list, .cp-styled .cp-bio { border-radius: max(6px, min(var(--pg-radius), 20px)); }
.cp-styled .cp-list .ic { color: var(--ink); }
.cp-styled .cp-foot b { color: var(--ink); }
.cp-light .cp-btn:hover { border-color: rgba(17, 24, 39, 0.25); }
.cp-light .cp-list a:hover { background: rgba(17, 24, 39, 0.05); }
/* Sheets and the offline note keep their dark look on any page style. */
.cp-styled .sheet, .cp-styled .cp-offline { --ink: #eef2f8; --muted: rgba(238, 242, 248, 0.64); --line: rgba(255, 255, 255, 0.09); --panel: rgba(255, 255, 255, 0.045); color: var(--ink); }
