/* QTAI Cards — the card itself. One markup structure, six templates.
   Colours and fonts arrive as --qc-* variables set inline by QC.designVars(). */
.qc-page-body { margin: 0; min-height: 100vh; background: #f1f2f6; -webkit-text-size-adjust: 100%; }
.qc-page-body #root { padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); }

.qc-card { position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding-bottom: 20px; overflow: hidden; border-radius: 24px;
  background: var(--qc-surface); color: var(--qc-ink); font-family: var(--qc-body); font-size: 15px; line-height: 1.45; text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 14px 36px rgba(0, 0, 0, 0.12); -webkit-font-smoothing: antialiased; }
.qc-card *, .qc-card *::before, .qc-card *::after { box-sizing: border-box; }
.qc-card h1, .qc-card h2, .qc-card p, .qc-card ul { margin: 0; }
.qc-card.is-preview a, .qc-card.is-preview button { pointer-events: none; }

.qc-top { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 24px; }
.qc-band { position: absolute; inset: 0 0 auto 0; height: 116px; background: var(--qc-accent); }
.qc-logo { position: absolute; top: 14px; right: 14px; z-index: 2; display: flex; align-items: center; justify-content: center; height: 46px; min-width: 46px; max-width: 124px; padding: 6px 9px;
  border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.qc-logo img { display: block; max-height: 34px; max-width: 106px; object-fit: contain; }
.qc-photo { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 116px; height: 116px; margin-top: 54px; overflow: hidden; border-radius: 50%;
  border: 4px solid var(--qc-surface); background: var(--qc-soft); color: var(--qc-accent-text); font: 700 40px/1 var(--qc-display); }
.qc-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.qc-id { min-width: 0; max-width: 100%; padding-top: 14px; }
.qc-name { font: 700 27px/1.15 var(--qc-display); letter-spacing: -0.01em; overflow-wrap: anywhere; text-wrap: balance; }
.qc-title { margin-top: 7px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.qc-company { margin-top: 2px; font-size: 14px; color: var(--qc-muted); overflow-wrap: anywhere; }
.qc-bio { padding: 14px 28px 0; font-size: 14.5px; color: var(--qc-muted); white-space: pre-line; overflow-wrap: anywhere; }

.qc-cta { display: flex; flex-wrap: wrap; gap: 10px; padding: 20px 20px 0; }
.qc-btn { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 14px; border-radius: 15px; border: 1.5px solid transparent;
  font: 600 15px/1 var(--qc-body); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qc-btn svg { flex: none; width: 18px; height: 18px; }
.qc-btn-primary { background: var(--qc-btn); color: var(--qc-btn-ink); }
.qc-btn-ghost { background: transparent; color: var(--qc-ink); border-color: var(--qc-line); }
.qc-btn:focus-visible, .qc-row:focus-visible, .qc-social a:focus-visible { outline: 3px solid var(--qc-accent-text); outline-offset: 2px; }
.qc-btn:disabled { opacity: 0.55; cursor: default; }

.qc-alt { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; font-size: 12.5px; color: var(--qc-muted); }
.qc-alt-b { display: flex; flex-wrap: wrap; gap: 8px; }
.qc-alt-b a, .qc-alt-b button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--qc-line); background: var(--qc-surface); color: var(--qc-ink); font: 600 13px/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; }
.qc-alt-b svg { width: 15px; height: 15px; color: var(--qc-accent-text); }
.qc-fwd { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 20px 0; font-size: 12.5px; font-weight: 600; color: var(--qc-muted); }
.qc-fwd .qc-alt-b { justify-content: center; }
.tpl-edge .qc-fwd, .tpl-split .qc-fwd { align-items: flex-start; }
.tpl-edge .qc-fwd .qc-alt-b, .tpl-split .qc-fwd .qc-alt-b { justify-content: flex-start; }
.qc-rows { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 0; list-style: none; text-align: left; }
.qc-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 12px; border-radius: 15px; background: var(--qc-soft); color: inherit; text-decoration: none; }
.qc-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--qc-surface); color: var(--qc-accent-text); }
.qc-ico svg { width: 18px; height: 18px; }
.qc-row-t { display: flex; flex-direction: column; min-width: 0; }
.qc-row-t small { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--qc-muted); }
.qc-row-t b { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }

.qc-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 18px 20px 0; }
.qc-social a { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--qc-soft); color: var(--qc-ink); }
.qc-social svg { width: 19px; height: 19px; }

.qc-back { display: flex; flex-direction: column; gap: 10px; margin: 16px 20px 0; padding: 18px 16px; border-radius: 18px; border: 1.5px solid var(--qc-line); text-align: left; }
.qc-back[hidden] { display: none; }
.qc-back h2 { font: 700 18px/1.2 var(--qc-display); }
.qc-back-lead { font-size: 13.5px; color: var(--qc-muted); }
.qc-back label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; }
.qc-back label em { font-style: normal; font-weight: 400; color: var(--qc-muted); }
.qc-back .qc-btn { flex: none; width: 100%; }
.qc-back input, .qc-back textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1.5px solid var(--qc-line); background: var(--qc-surface); color: var(--qc-ink); font: 400 16px/1.3 var(--qc-body); resize: vertical; }
.qc-back input:focus, .qc-back textarea:focus { outline: none; border-color: var(--qc-accent-text); }
.qc-back .qc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.qc-back-msg { min-height: 0; font-size: 13.5px; font-weight: 600; }
.qc-back-msg:empty { display: none; }
.qc-back-msg.is-err { color: #c62828; }
.qc-card[class*="tpl-luxe"] .qc-back-msg.is-err, .qc-card[class*="tpl-bold"] .qc-back-msg.is-err { color: inherit; text-decoration: underline; }

.qc-show { padding: 24px 20px 0; text-align: left; }
.qc-show-h { font: 700 13px/1.2 var(--qc-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--qc-muted); }
.qc-proj { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--qc-soft); }
.qc-proj + .qc-proj { margin-top: 12px; }
.qc-proj-imgs { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: -14px -14px 12px; padding: 14px 14px 0; }
.qc-proj-imgs.n1 { grid-template-columns: minmax(0, 1fr); }
.qc-proj-imgs.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qc-proj-imgs img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--qc-surface); }
.qc-proj-imgs.n1 img { aspect-ratio: 16 / 10; }
.qc-proj-t { font: 700 16px/1.25 var(--qc-display); overflow-wrap: anywhere; }
.qc-proj-s { margin-top: 5px; font-size: 14px; line-height: 1.45; color: var(--qc-muted); white-space: pre-line; overflow-wrap: anywhere; }
.qc-proj-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qc-proj-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--qc-surface); border: 1px solid var(--qc-line); color: var(--qc-accent-text); font-size: 13px; font-weight: 600; text-decoration: none; }
.qc-proj-links a svg { width: 14px; height: 14px; }
.qc-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 20px 0; }
.qc-qr canvas { width: 168px; height: 168px; padding: 8px; border-radius: 16px; background: #fff; border: 1px solid var(--qc-line); }
.qc-qr p { font-size: 12.5px; color: var(--qc-muted); }
.qc-foot { padding: 20px 20px 0; font-size: 12px; color: var(--qc-muted); }
.qc-foot a { color: inherit; font-weight: 600; }

/* ---- Portrait: the photo fills the top of the card ---- */
.tpl-portrait .qc-top { align-items: stretch; padding: 0; text-align: left; }
.tpl-portrait .qc-band { display: none; }
.tpl-portrait .qc-photo { width: 100%; height: auto; aspect-ratio: 1 / 1; margin: 0; border: 0; border-radius: 0; background: var(--qc-accent); color: var(--qc-on-accent); font-size: 104px; }
.tpl-portrait.no-photo .qc-photo { aspect-ratio: 16 / 11; }
.tpl-portrait .qc-photo::after { content: ""; position: absolute; inset: 40% 0 0 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.74)); }
.tpl-portrait .qc-id { position: absolute; z-index: 2; left: 22px; right: 22px; bottom: 18px; padding: 0; color: #fff; }
.tpl-portrait .qc-company { color: rgba(255, 255, 255, 0.84); }
.tpl-portrait .qc-logo { left: 14px; right: auto; }
.tpl-portrait .qc-bio { padding: 16px 22px 0; text-align: left; }

/* ---- Split: photo left, name right, heavy rule ---- */
.tpl-split { text-align: left; }
.tpl-split .qc-band { display: none; }
.tpl-split .qc-top { flex-flow: row wrap; align-items: center; gap: 16px; padding: 24px 22px 22px; border-bottom: 4px solid var(--qc-accent); }
.tpl-split .qc-photo { width: 84px; height: 84px; margin: 0; border: 0; border-radius: 22px; font-size: 30px; }
.tpl-split .qc-id { flex: 1 1 0; padding: 0; }
.tpl-split .qc-name { font-size: 23px; overflow-wrap: break-word; }
/* The logo sits on its own line above the photo and name, like a letterhead. */
.tpl-split .qc-logo { position: static; order: -1; flex: 0 0 100%; justify-content: flex-start; height: auto; max-width: none; padding: 0; background: none; box-shadow: none; }
.tpl-split .qc-logo img { max-height: 44px; max-width: 150px; padding: 6px 8px; border-radius: 11px; background: #fff; border: 1px solid var(--qc-line); }
.tpl-split .qc-bio { padding: 16px 22px 0; text-align: left; }
.tpl-split .qc-social { justify-content: flex-start; }

/* ---- Minimal: hairlines instead of fills ---- */
.tpl-minimal .qc-band { display: none; }
.tpl-minimal .qc-photo { width: 92px; height: 92px; margin-top: 40px; border: 0; font-size: 32px; }
.tpl-minimal .qc-logo { top: 18px; right: 18px; }
.tpl-minimal .qc-name { font-weight: 600; }
.tpl-minimal .qc-rows { gap: 0; }
.tpl-minimal .qc-row { padding: 10px 2px; border-radius: 0; border-top: 1px solid var(--qc-line); background: transparent; }
.tpl-minimal .qc-rows li:last-child .qc-row { border-bottom: 1px solid var(--qc-line); }
.tpl-minimal .qc-ico { background: transparent; }
.tpl-minimal .qc-btn-primary { background: transparent; color: var(--qc-ink); border-color: var(--qc-ink); }
.tpl-minimal .qc-social a { background: transparent; border: 1px solid var(--qc-line); }

/* ---- Bold: the accent becomes the card ---- */
.tpl-bold .qc-band { display: none; }
.tpl-bold .qc-photo { margin-top: 44px; border: 3px solid var(--qc-ink); }
.tpl-bold .qc-name { font-size: 31px; font-weight: 800; }

/* ---- Luxe: fine inner frame, centred ---- */
.tpl-luxe::before { content: ""; position: absolute; inset: 10px; z-index: 3; border: 1px solid var(--qc-accent); border-radius: 16px; opacity: 0.6; pointer-events: none; }
.tpl-luxe .qc-band { display: none; }
.tpl-luxe .qc-photo { width: 108px; height: 108px; margin-top: 52px; border: 2px solid var(--qc-accent); }
.tpl-luxe .qc-logo { top: 26px; right: 26px; }
.tpl-luxe .qc-name { font-weight: 600; letter-spacing: 0.01em; }
.tpl-luxe .qc-title { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--qc-accent-text); }
.tpl-luxe .qc-cta, .tpl-luxe .qc-rows, .tpl-luxe .qc-social, .tpl-luxe .qc-qr { padding-left: 28px; padding-right: 28px; }
.tpl-luxe .qc-back { margin-left: 28px; margin-right: 28px; }
.tpl-luxe .qc-btn { border-radius: 999px; }
.tpl-luxe .qc-row { background: transparent; border: 1px solid var(--qc-line); }
.tpl-luxe .qc-ico { background: var(--qc-soft); }
.tpl-luxe .qc-social a { background: transparent; border: 1px solid var(--qc-line); }
.tpl-luxe { padding-bottom: 28px; }

@media (prefers-reduced-motion: no-preference) {
  .qc-btn, .qc-row, .qc-social a { transition: transform 0.12s ease, opacity 0.12s ease; }
  .qc-btn:active, .qc-row:active, .qc-social a:active { transform: scale(0.98); }
}

/* ---- Aurora: a soft gradient band and a ringed photo ---- */
.tpl-aurora .qc-band { height: 132px; background: linear-gradient(135deg, var(--qc-accent), color-mix(in srgb, var(--qc-accent) 55%, var(--qc-surface))); }
.tpl-aurora .qc-band::after { content: ""; position: absolute; left: -20%; right: -20%; bottom: -40px; height: 80px; border-radius: 50%; background: var(--qc-surface); }
.tpl-aurora .qc-photo { margin-top: 66px; border: 5px solid var(--qc-surface); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.tpl-aurora .qc-logo { top: 16px; left: 16px; right: auto; }
.tpl-aurora .qc-title { color: var(--qc-accent-text); }
.tpl-aurora .qc-btn, .tpl-aurora .qc-row { border-radius: 999px; }
.tpl-aurora .qc-btn-primary { background: linear-gradient(135deg, var(--qc-accent), color-mix(in srgb, var(--qc-accent) 70%, #000)); }

/* ---- Edge: an accent stripe down the left, everything left aligned ---- */
.tpl-edge { text-align: left; border-left: 10px solid var(--qc-accent); border-radius: 18px 24px 24px 18px; }
.tpl-edge .qc-band { display: none; }
.tpl-edge .qc-top { align-items: flex-start; padding: 26px 22px 0; }
.tpl-edge .qc-photo { width: 96px; height: 96px; margin: 0; border: 0; border-radius: 18px; font-size: 34px; }
.tpl-edge .qc-logo { top: 22px; right: 18px; box-shadow: none; border: 1px solid var(--qc-line); }
.tpl-edge .qc-id { padding-top: 16px; }
.tpl-edge .qc-name { font-size: 29px; }
.tpl-edge .qc-title { color: var(--qc-accent-text); }
.tpl-edge .qc-bio { padding: 14px 22px 0; }
.tpl-edge .qc-social { justify-content: flex-start; }
.tpl-edge .qc-row, .tpl-edge .qc-btn { border-radius: 10px; }
.tpl-edge .qc-row { border-left: 3px solid var(--qc-accent); }

/* ---- Curve: the colour header ends in a curve ---- */
.tpl-curve .qc-band { height: 150px; border-radius: 0 0 60% 60% / 0 0 54px 54px; }
.tpl-curve .qc-photo { margin-top: 84px; border: 4px solid var(--qc-surface); }
.tpl-curve .qc-logo { top: 16px; left: 50%; right: auto; transform: translateX(-50%); }
.tpl-curve .qc-name { font-size: 26px; }
.tpl-curve .qc-btn { border-radius: 999px; }
.tpl-curve .qc-row { border-radius: 20px; }

/* ---- Badge: a lanyard slot and a square photo, like an event badge ---- */
.tpl-badge { border-radius: 18px; }
.tpl-badge .qc-band { height: 64px; }
.tpl-badge .qc-band::before { content: ""; position: absolute; top: 14px; left: 50%; width: 92px; height: 12px; transform: translateX(-50%); border-radius: 999px; background: var(--qc-surface); opacity: 0.9; }
.tpl-badge .qc-photo { width: 132px; height: 132px; margin-top: 82px; border-radius: 16px; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.tpl-badge .qc-logo { top: 72px; right: 18px; }
.tpl-badge .qc-name { font-size: 30px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.tpl-badge .qc-title { display: inline-block; margin-top: 10px; padding: 5px 12px; border-radius: 6px; background: var(--qc-accent); color: var(--qc-on-accent); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.tpl-badge .qc-row, .tpl-badge .qc-btn { border-radius: 8px; }

/* ---- Outline: a thick frame on warm paper ---- */
.tpl-outline { border: 4px solid var(--qc-accent); box-shadow: none; }
.tpl-outline .qc-band { display: none; }
.tpl-outline .qc-top { padding-top: 10px; }
.tpl-outline .qc-top::before { content: ""; display: block; width: 56px; height: 6px; margin: 22px auto 0; border-radius: 3px; background: var(--qc-accent); }
.tpl-outline .qc-photo { margin-top: 18px; border: 3px solid var(--qc-accent); }
.tpl-outline .qc-logo { top: 18px; right: 18px; box-shadow: none; border: 1px solid var(--qc-line); }
.tpl-outline .qc-name { color: var(--qc-accent-text); }
.tpl-outline .qc-row { background: transparent; border: 1.5px solid var(--qc-line); }
.tpl-outline .qc-btn-ghost { border-color: var(--qc-accent); color: var(--qc-accent-text); }
.tpl-outline .qc-social a { background: transparent; border: 1.5px solid var(--qc-line); }

/* ---- Night: dark, with a glow behind the photo ---- */
.tpl-night .qc-band { height: 180px; background: radial-gradient(circle at 50% 10%, color-mix(in srgb, var(--qc-accent) 55%, transparent), transparent 65%); }
.tpl-night .qc-photo { margin-top: 56px; border: 2px solid var(--qc-accent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--qc-accent) 22%, transparent), 0 0 40px color-mix(in srgb, var(--qc-accent) 35%, transparent); }
.tpl-night .qc-logo { top: 20px; right: 20px; background: rgba(255, 255, 255, 0.06); box-shadow: none; border: 1px solid var(--qc-line); }
.tpl-night .qc-name { font-weight: 700; }
.tpl-night .qc-title { color: var(--qc-accent-text); }
.tpl-night .qc-row { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--qc-line); }
.tpl-night .qc-ico { background: rgba(255, 255, 255, 0.06); }
.tpl-night .qc-social a { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--qc-line); }
.tpl-night .qc-btn { border-radius: 999px; }
.tpl-night .qc-btn-primary { box-shadow: 0 0 24px color-mix(in srgb, var(--qc-accent) 45%, transparent); }

/* ---- Name prefix (Dr, Eng, Prof…) ---- */
.qc-prefix { font-weight: 500; opacity: 0.85; }
