:root {
  --burgundy: #432525;
  --green: #3D3921;
  --copper: #8F5638;
  --oatmeal: #EDE5DC;
  --sage: #E6E3D6;
  --light-oat: #F7F2EC;
  --soft-oat: #D9CFC3;
  --muted: #6B4F4A;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--oatmeal); color: var(--burgundy); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
#app { max-width: 480px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px calc(110px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.loading { text-align: center; padding: 120px 0; color: var(--muted); }
a { color: var(--burgundy); }
h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; margin: 0; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; }
p { margin: 0; line-height: 1.5; }
.eyebrow { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; font-weight: 700; color: var(--copper); margin: 0; }
.section-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: 8px 4px 0; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 6px; }
.head { display: flex; flex-direction: column; gap: 6px; }
.center { text-align: center; align-items: center; }

.card { background: var(--light-oat); border: 1px solid var(--soft-oat); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.sage { background: var(--sage); border-color: var(--sage); }
.card.green { background: var(--green); border-color: var(--green); color: var(--light-oat); }
.row { display: flex; gap: 12px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.name { font-size: 17px; font-weight: 700; }
.meta { font-size: 13px; color: var(--muted); }
.bio { font-size: 14px; line-height: 1.45; }

.avatar { width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; background: var(--sage); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 24px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 104px; height: 104px; font-size: 44px; }
.avatar.sm { width: 44px; height: 44px; font-size: 20px; }

.btn { appearance: none; border: 1px solid var(--green); background: var(--green); color: #fff; font-family: var(--sans); font-size: 15px; font-weight: 700; min-height: 48px; padding: 0 20px; border-radius: 26px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; width: 100%; }
.btn.secondary { background: transparent; color: var(--burgundy); border-color: var(--soft-oat); }
.btn.quiet { background: var(--light-oat); color: var(--muted); border-color: var(--soft-oat); }
.btn.danger { background: transparent; color: #8A2B2B; border-color: #C9A6A6; }
.btn.small { min-height: 44px; font-size: 13px; width: auto; padding: 0 16px; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }
.link-btn { background: none; border: 0; font: inherit; color: var(--burgundy); text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 4px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
input[type=text], input[type=email], input[type=tel], input[type=month], input[type=date], input[type=time], textarea, select {
  font-family: var(--sans); font-size: 16px; color: var(--burgundy); background: #fff; border: 1px solid var(--soft-oat); border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 48px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, .chip:focus-visible, a:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--muted); }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); flex-shrink: 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { appearance: none; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--soft-oat); background: transparent; color: var(--burgundy); font: 700 13px var(--sans); cursor: pointer; }
.chip[aria-pressed=true] { background: var(--green); color: #fff; border-color: var(--green); }
.seg { display: flex; gap: 8px; }
.seg .chip { flex: 1; }

.photo-pick { align-self: center; width: 104px; height: 104px; border-radius: 50%; border: 2px dashed #C4B6A6; background: var(--light-oat); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 12px; cursor: pointer; overflow: hidden; position: relative; }
.photo-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.stamps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed #C4B6A6; }
.card.green .stamp { border-color: rgba(247,242,236,.5); }
.stamp.on { border: 0; background: var(--copper); display: flex; align-items: center; justify-content: center; color: var(--light-oat); }
.stamp.on svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.pill { font-size: 12px; font-weight: 700; border-radius: 12px; padding: 4px 10px; background: var(--sage); color: var(--green); align-self: flex-start; white-space: nowrap; }
.code { border: 1px dashed #C4B6A6; border-radius: 12px; padding: 12px; text-align: center; font-family: var(--serif); font-size: 28px; letter-spacing: 3px; }

.banner { display: flex; gap: 12px; align-items: center; background: var(--green); color: #fff; border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.4; text-decoration: none; }
.banner svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--light-oat); border-top: 1px solid var(--soft-oat); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.nav a { flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; min-height: 48px; justify-content: center; position: relative; }
.nav a[aria-current=page] { color: var(--green); }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--copper); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); background: var(--burgundy); color: #fff; padding: 12px 18px; border-radius: 22px; font-size: 14px; z-index: 20; max-width: 90vw; text-align: center; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.qr { background: #fff; border-radius: 16px; padding: 16px; align-self: center; }
.qr img { display: block; width: 220px; height: 220px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td { padding: 10px 4px; border-top: 1px solid var(--soft-oat); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media print {
  .nav, .no-print { display: none !important; }
  body, html { background: #fff; }
}
