/* Public card page - "basic" layout, used until a reviewed layout is
   published. Company colours arrive as --brand / --accent. */
/* Company colours and font arrive as --brand, --on-brand, --paper (page),
   --panel, --ink (text) and --font; the rest is derived from them. */
:root {
  --brand: #1f4fd8; --on-brand: #fff; --accent: #f2a541; --ink: #1d2433; --paper: #f3f5f9; --panel: #fff;
  --muted: color-mix(in srgb, var(--ink) 62%, var(--panel));
  --line: color-mix(in srgb, var(--ink) 10%, var(--panel));
  --soft: color-mix(in srgb, var(--ink) 5%, var(--panel));
  --font: system-ui, -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.55 var(--font);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
.ic { width: 1.25em; height: 1.25em; flex: none; }
[hidden] { display: none !important; }

.preview-bar { background: #fff4d6; color: #7a5a00; text-align: center; font-size: 13px; padding: 8px 12px; font-weight: 600; }

/* The header grows with the logo/name size the company picks; its bottom
   padding keeps that content clear of the photo overlapping the cover. */
.cover {
  min-height: 170px; padding-bottom: 132px;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #000));
  background-size: cover; background-position: center; position: relative;
}
.cover-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand.stacked { flex-direction: column; align-items: flex-start; gap: 8px; }
.logo { height: var(--logo-h, 40px); width: auto; max-width: 60vw; object-fit: contain; flex: none;
  background: rgba(255, 255, 255, .92); border-radius: 10px; padding: 4px 8px; }
.co-name { color: var(--on-brand); font-weight: 700; font-size: var(--name-size, 16px); line-height: 1.25;
  text-shadow: var(--name-shadow, none); overflow-wrap: anywhere; }
.lang-form { margin: 0; display: flex; gap: 6px; flex: none; }
.lang-select { position: relative; display: inline-flex; align-items: center; color: var(--on-brand); }
.lang-select .ic { position: absolute; left: 9px; width: 16px; height: 16px; pointer-events: none; }
.lang-select select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 13px; color: var(--on-brand); cursor: pointer;
  padding: 5px 28px 5px 31px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--on-brand) 45%, transparent);
  background: color-mix(in srgb, var(--on-brand) 14%, transparent);
}
.lang-select select option { color: var(--ink); }
.lang-select .down { left: auto; right: 9px; width: 14px; height: 14px; transform: rotate(90deg); }
.lang-form button { font-size: 13px; border-radius: 99px; border: 0; padding: 4px 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page { max-width: 480px; margin: -70px auto 0; padding: 0 14px 40px; position: relative; }
.panel { background: var(--panel); border-radius: 20px; padding: 18px; margin-bottom: 12px; box-shadow: 0 4px 18px rgba(20, 30, 60, .06); }
.panel h2 { margin: 0 0 12px; font-size: 15px; }

.profile { text-align: center; padding-top: 0; }
.photo { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; margin: -58px auto 0; border: 5px solid var(--panel); background: var(--panel); box-shadow: 0 6px 18px rgba(20, 30, 60, .15); }
.initials { display: grid; place-items: center; font-size: 42px; font-weight: 700; color: var(--on-brand); background: var(--brand); }
.profile h1 { margin: 12px 0 0; font-size: 23px; line-height: 1.3; }
.title { margin: 2px 0 0; color: var(--brand); font-weight: 600; }
.org { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tagline { margin: 12px auto 0; max-width: 32em; color: #4a5263; font-size: 14px; font-style: italic; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 6px; margin: 18px 0 4px; }
.actions a { width: 66px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.actions .ic { width: 48px; height: 48px; padding: 13px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 14%, var(--panel)); color: var(--brand); }
.save-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-save { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border-radius: 14px; background: var(--brand); color: var(--on-brand); font-weight: 700; }
.btn-share { width: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--brand); display: grid; place-items: center; }
.btn-share.done { border-color: #1faa59; color: #1faa59; }

.list { padding: 4px 18px; }
.row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .ic { color: var(--brand); }
.row div { min-width: 0; }
.row small { display: block; color: var(--muted); font-size: 12px; }
.row span { overflow-wrap: anywhere; }
.pre { white-space: pre-line; }

.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.soc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; min-width: 0; }
.soc .ic { color: var(--brand); }
.soc span { overflow-wrap: anywhere; }

.qr-panel { display: none; }

.wa-send { display: flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.wa-send select, .wa-send input { border: 0; font: inherit; padding: 10px; min-width: 0; background: var(--panel); color: var(--ink); }
.wa-send select { flex: none; border-right: 1px solid var(--line); }
.wa-send input { flex: 1; }
.wa-send button { border: 0; padding: 0 14px; background: #1faa59; color: #fff; display: flex; align-items: center; gap: 6px; font-weight: 600; }


.row .chev { margin-left: auto; color: var(--muted); width: 18px; }

/* map-app picker: bottom sheet on phones, centred box on computers */
.sheet { border: 0; padding: 20px 18px calc(16px + env(safe-area-inset-bottom)); width: 100%; max-width: 100%;
  margin: auto 0 0; border-radius: 22px 22px 0 0; color: var(--ink); background: var(--panel); }
.sheet::backdrop { background: rgba(15, 20, 35, .45); }
.sheet h2 { margin: 0; font-size: 17px; }
.sheet-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sheet-list { margin: 14px 0 10px; display: grid; }
.sheet-list a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-weight: 600; }
.sheet-list a:last-child { border-bottom: 0; }
.sheet-list .chev { margin-left: auto; color: var(--muted); width: 18px; }
.map-badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.map-custom { background: var(--brand); } .map-custom::before { content: "★"; }
.map-google { background: #4285f4; } .map-google::before { content: "G"; }
.map-apple { background: #1d1d1f; }
.map-apple::before { content: "A"; }
.map-waze { background: #33ccff; } .map-waze::before { content: "W"; }
.map-amap { background: #2a6df4; } .map-amap::before { content: "高"; }
.map-baidu { background: #de2910; } .map-baidu::before { content: "百"; }
.sheet-close { width: 100%; padding: 13px; border: 0; border-radius: 14px; background: var(--soft); color: var(--ink); font-weight: 700; }

/* ---------- desktop: profile card left, details right ---------- */
@media (min-width: 900px) {
  .cover { min-height: 240px; padding-bottom: 176px; }
  .cover-top { max-width: 1040px; margin: 0 auto; padding: 20px 32px 0; }
  .logo { max-width: 360px; }
  .page { max-width: 1040px; margin-top: -96px; padding: 0 32px 48px; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
  .profile { position: sticky; top: 24px; padding: 0 26px 26px; }
  .photo { width: 148px; height: 148px; margin-top: -74px; }
  .sheet { max-width: 420px; margin: auto; border-radius: 20px; }
  .info { padding-top: 108px; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 0 18px; align-items: start; }
  .info > .list, .info > .panel:not(.qr-panel) { grid-column: 1; }
  .qr-panel { display: block; grid-column: 2; grid-row: 1 / span 2; text-align: center; }
  .qr-panel img { width: 100%; height: auto; }
  .qr-panel p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
}
