/* MGP Visitor Access — styles (Airbnb-inspired: white canvas, bold type, soft cards, pill controls) */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-3: #ebebeb;
  --text: #222222;
  --muted: #6a6a6a;
  --faint: #929292;
  --border: #dddddd;
  --hairline: #ebebeb;
  --field-border: #b0b0b0;
  /* MGP gold (from the logo) takes the place of Airbnb's pink */
  --gold: #d7bb82;
  --gold-2: #c29d58;
  --gold-ink: #7a5a1e;
  --gold-soft: #f8f1e3;
  --brand-grad: linear-gradient(90deg, #e2c992 0%, #d7bb82 45%, #bf9852 100%);
  --brand: #222222;
  --brand-ink: #ffffff;
  --ok: #008a05;
  --ok-soft: #e8f5e9;
  --warn: #b25d00;
  --warn-soft: #fff4e5;
  --bad: #c13515;
  --bad-soft: #fdecea;
  --info: #1f5fbf;
  --info-soft: #e8f0fc;
  --neutral-soft: #f2f2f2;
  --avatar-bg-1: #e9e9e9;
  --avatar-bg-2: #d6d6d6;
  --avatar-fg: #a9a9a9;
  --note: #fbf6ea;
  --note-border: #e9d6ab;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-card: 0 6px 16px rgba(0, 0, 0, .12);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .28);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --font: "Circular", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --surface: #1c1c1c;
    --surface-2: #242424;
    --surface-3: #303030;
    --text: #f2f2f2;
    --muted: #a8a8a8;
    --faint: #7d7d7d;
    --border: #3a3a3a;
    --hairline: #2c2c2c;
    --field-border: #5a5a5a;
    --gold-ink: #e2c992;
    --gold-soft: #2e2617;
    --brand: #f2f2f2;
    --brand-ink: #121212;
    --ok: #4cc77a;
    --ok-soft: #14301e;
    --warn: #f0a650;
    --warn-soft: #36260f;
    --bad: #ff7a5c;
    --bad-soft: #3a1a12;
    --info: #7ea8f2;
    --info-soft: #182742;
    --neutral-soft: #2a2a2a;
    --avatar-bg-1: #3a3a3a;
    --avatar-bg-2: #2c2c2c;
    --avatar-fg: #5c5c5c;
    --note: #2e2819;
    --note-border: #5e4f2c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-card: 0 6px 16px rgba(0, 0, 0, .5);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
/* Dark theme chosen in Appearance (overrides the device setting) */
:root[data-theme="dark"] {
  --bg: #121212;
  --surface: #1c1c1c;
  --surface-2: #242424;
  --surface-3: #303030;
  --text: #f2f2f2;
  --muted: #a8a8a8;
  --faint: #7d7d7d;
  --border: #3a3a3a;
  --hairline: #2c2c2c;
  --field-border: #5a5a5a;
  --gold-ink: #e2c992;
  --gold-soft: #2e2617;
  --brand: #f2f2f2;
  --brand-ink: #121212;
  --ok: #4cc77a;
  --ok-soft: #14301e;
  --warn: #f0a650;
  --warn-soft: #36260f;
  --bad: #ff7a5c;
  --bad-soft: #3a1a12;
  --info: #7ea8f2;
  --info-soft: #182742;
  --neutral-soft: #2a2a2a;
  --avatar-bg-1: #3a3a3a;
  --avatar-bg-2: #2c2c2c;
  --avatar-fg: #5c5c5c;
  --note: #2e2819;
  --note-border: #5e4f2c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-card: 0 6px 16px rgba(0, 0, 0, .5);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .7);
  color-scheme: dark;
}


* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
a { color: var(--text); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- logo ---------- */
.logo { display: block; line-height: 0; }
.logo img { display: block; height: 18px; width: auto; }
.logo .logo-dark { display: none; }
:root[data-theme="dark"] .logo .logo-light { display: none; }
:root[data-theme="dark"] .logo .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo .logo-dark { display: block; }
}

/* ---------- boot / login ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark img { animation: pulse 1.4s ease-in-out infinite; height: auto; width: 220px; }
@keyframes pulse { 50% { opacity: .45; } }

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: var(--surface-2);
}
.login-card {
  width: 100%; max-width: 568px; background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-head {
  text-align: center; font-weight: 700; font-size: 1rem; padding: 18px 24px;
  border-bottom: 1px solid var(--hairline);
}
.login-body { padding: 28px 24px 32px; }
.login-card .brand { margin-bottom: 26px; }
.login-card .brand .logo img { height: 24px; }
.login-card h1 { font-size: 1.4rem; font-weight: 650; }
.login-sub { color: var(--muted); margin: 6px 0 22px; font-size: .95rem; }

/* Airbnb-style stacked inputs with the label inside the box */
.field-group { border: 1px solid var(--field-border); border-radius: var(--radius-sm); margin-bottom: 18px; }
.field-group .float + .float { border-top: 1px solid var(--field-border); }
.float {
  display: block; position: relative; padding: 9px 14px 7px; cursor: text;
  border-radius: var(--radius-sm);
}
.float span { display: block; font-size: .75rem; color: var(--muted); line-height: 1.2; }
.float input { display: block; width: 100%; border: 0; outline: none; background: transparent; padding: 2px 0 0; font-size: 1rem; min-height: 24px; }
.float:focus-within { box-shadow: 0 0 0 2px var(--text); z-index: 1; }

/* ---------- app shell ---------- */
.app-header { position: sticky; top: 0; z-index: 20; background: var(--surface); }
.topbar { padding: env(safe-area-inset-top) 0 0; border-bottom: 1px solid var(--hairline); }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 16px; position: relative; min-height: 72px;
}
.topbar .home { display: flex; align-items: center; padding: 6px 0; }
.topbar .logo img { height: 20px; }
.topbar .title {
  font-weight: 600; font-size: .95rem; line-height: 1.2; min-width: 0;
  padding-left: 16px; border-left: 1px solid var(--border);
}
.topbar .title small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.topbar .spacer { flex: 1; }
.live {
  display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted);
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--hairline);
}
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.live.on::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.menu-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px;
  padding: 5px 5px 5px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: box-shadow .2s;
}
.menu-btn:hover { box-shadow: var(--shadow-card); }
.menu-btn .burger { width: 16px; height: 16px; stroke-width: 2.2; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--bg);
  display: grid; place-items: center; font-weight: 600; font-size: .78rem; flex: none;
}

.dropdown {
  position: absolute; right: 24px; top: calc(100% - 4px); min-width: 260px; background: var(--surface); color: var(--text);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card), 0 0 0 1px rgba(0, 0, 0, .04); padding: 8px 0; z-index: 30;
}
.dropdown .head { padding: 12px 16px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.dropdown .head small { color: var(--muted); display: block; font-size: .82rem; }
.dropdown button {
  width: 100%; text-align: left; border: 0; background: none; padding: 11px 16px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 8px; font-size: .92rem;
}
.dropdown button:hover { background: var(--surface-2); }
.dropdown button small { color: var(--muted); }
.dropdown button[data-m="logout"] { border-top: 1px solid var(--hairline); margin-top: 8px; padding-top: 14px; }

.tabs { background: var(--surface); border-bottom: 1px solid var(--hairline); }
.tabs-inner { max-width: 1280px; margin: 0 auto; display: flex; gap: 28px; padding: 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tabs a {
  text-decoration: none; color: var(--muted); padding: 14px 0 12px; border-bottom: 2px solid transparent;
  white-space: nowrap; font-weight: 500; font-size: .9rem; display: flex; align-items: center; gap: 8px;
  transition: color .15s, border-color .15s;
}
.tabs a .ico { width: 18px; height: 18px; }
.tabs a:hover { color: var(--text); border-bottom-color: var(--border); }
.tabs a.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.tabs a .count {
  background: var(--bad); color: #fff; border-radius: 99px; font-size: .7rem; font-weight: 700;
  padding: 0 6px; min-width: 18px; line-height: 18px; text-align: center;
}

main { max-width: 1280px; margin: 0 auto; padding: 32px 24px calc(48px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .spacer { flex: 1; }
.page-head input[type=search] { width: 300px; max-width: 100%; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.section-title { font-size: 1.1rem; font-weight: 650; color: var(--text); margin: 0 0 14px; letter-spacing: -.01em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--text); background: var(--surface); color: var(--text);
  padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 44px; font-size: .95rem; transition: background .15s, transform .1s, box-shadow .15s, filter .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.25); }
.btn-brand { background: var(--brand-grad); border: 0; color: #1d1a14; }
.btn-brand:hover { background: var(--brand-grad); filter: brightness(1.05) saturate(1.1); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok); filter: brightness(1.1); }
.btn-bad { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn-bad:hover { background: var(--bad-soft); }
.btn-ghost { background: transparent; border-color: transparent; text-decoration: underline; padding-left: 10px; padding-right: 10px; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: .85rem; }
.btn-lg { min-height: 52px; font-size: 1rem; padding: 14px 24px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field label { font-size: .88rem; font-weight: 600; color: var(--text); }
.field label .req { color: var(--bad); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--field-border); background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; min-height: 50px; outline: none; transition: box-shadow .12s, border-color .12s;
}
textarea.input { resize: vertical; min-height: 96px; }
.input:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.input::placeholder { color: var(--faint); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.hint { color: var(--muted); font-size: .85rem; }
.error-box {
  background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: .9rem; margin-bottom: 16px; font-weight: 500;
}

/* status pills — white with a soft shadow, like Airbnb's "In 2 weeks" tags */
.badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 11px;
  font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.approved { background: var(--ok-soft); color: var(--ok); }
.badge.denied { background: var(--bad-soft); color: var(--bad); }
.badge.inside { background: var(--info-soft); color: var(--info); }
.badge.left, .badge.cancelled { background: var(--neutral-soft); color: var(--muted); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 8px 16px;
  font-size: .88rem; font-weight: 500; cursor: pointer; color: var(--text); display: inline-flex; gap: 8px; align-items: center;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--text); }
.chip b { font-weight: 600; color: var(--muted); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.active b { color: inherit; opacity: .75; }

.empty { text-align: center; color: var(--muted); padding: 64px 16px; font-size: 1rem; }
.empty .big { font-size: 2.6rem; margin-bottom: 12px; }
.card.empty { box-shadow: none; }

/* ---------- photo ---------- */
.photo {
  background: var(--neutral-soft); border-radius: var(--radius-md); object-fit: cover; flex: none; display: block;
  width: 72px; height: 72px;
}
.photo-ph {
  background: linear-gradient(180deg, var(--avatar-bg-1), var(--avatar-bg-2)); border-radius: var(--radius-md);
  flex: none; display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  width: 72px; height: 72px;
}
.photo-ph svg { width: 82%; height: 82%; fill: var(--avatar-fg); display: block; }
.photo-lg, .photo-ph.photo-lg { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius); font-size: 3rem; }
.photo-sm, .photo-ph.photo-sm { width: 40px; height: 40px; border-radius: 50%; font-size: .85rem; }
.photo-xl, .photo-ph.photo-xl { width: 140px; height: 140px; border-radius: var(--radius); font-size: 2.4rem; }
.zoomable { cursor: zoom-in; }

/* ---------- registration ---------- */
.register { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; }
.capture {
  aspect-ratio: 1; width: 100%; border: 1.5px dashed var(--field-border); border-radius: var(--radius); background: var(--surface-2);
  display: grid; place-items: center; text-align: center; cursor: pointer; color: var(--muted); padding: 16px; overflow: hidden; position: relative;
  transition: border-color .15s, background .15s;
}
.capture:hover { border-color: var(--text); color: var(--text); background: var(--surface); }
.capture .cam-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 10px; }
.capture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.capture.has-photo { border-style: solid; border-color: transparent; box-shadow: var(--shadow-card); }
.send-to {
  background: var(--gold-soft); border-radius: var(--radius-md); padding: 14px 16px; font-size: .9rem; margin-bottom: 18px;
  border: 1px solid var(--note-border);
}

/* camera modal */
.camera-view { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.camera-view video, .camera-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-view video.mirror { transform: scaleX(-1); }
.camera-view .frame { position: absolute; inset: 12%; border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; pointer-events: none; }

/* ---------- visitor cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.vcard {
  padding: 20px; display: flex; flex-direction: column; gap: 14px; border-radius: 20px;
  box-shadow: var(--shadow-card); border-color: transparent; transition: box-shadow .2s, transform .2s;
}
.vcard:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .14); }
.vcard.flash { animation: flash 2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--gold), var(--shadow-card); } 100% { box-shadow: var(--shadow-card); } }
.vcard-top { display: flex; gap: 14px; align-items: flex-start; }
.vcard-top .info { flex: 1; min-width: 0; }
.vcard-top .name { font-weight: 650; font-size: 1.12rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; letter-spacing: -.01em; }
.vcard-top .name a { color: inherit; text-decoration: none; }
.vcard-top .name a:hover { text-decoration: underline; }
.vcard-top .meta { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; margin-top: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.approver-row { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--hairline); }
.approver-chip { font-size: .78rem; border-radius: 99px; padding: 4px 10px; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--muted); }
.approver-chip.approve { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.approver-chip.deny { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.note {
  background: var(--note); border: 1px solid var(--note-border); border-radius: var(--radius-md); padding: 10px 14px; font-size: .9rem;
}
.note .by { font-size: .78rem; color: var(--muted); display: block; margin-bottom: 2px; }
.vcard .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.vcard .actions .btn { flex: 1; }

/* approver request cards */
.request {
  display: grid; grid-template-columns: 260px 1fr; gap: 28px; padding: 24px; border-radius: 20px;
  box-shadow: var(--shadow-card); border-color: transparent;
}
.request + .request { margin-top: 24px; }
.request .who { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.request .waiting { color: var(--warn); font-weight: 600; font-size: .9rem; }
.decide-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.request .decide { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.request .decide .wide { grid-column: 1 / -1; }

/* ---------- detail ---------- */
.detail { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--text); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 2px; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.ok::before { background: var(--ok); }
.timeline li.bad::before { background: var(--bad); }
.timeline li.note-ev::before { background: var(--gold); }
.timeline time { display: block; color: var(--muted); font-size: .8rem; }

/* ---------- stats & tables ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { padding: 20px; border-radius: var(--radius); }
.stat .label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat .value { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; letter-spacing: -.02em; }
.stat .sub { color: var(--faint); font-size: .8rem; }
.stat.accent-warn .value { color: var(--warn); }
.stat.accent-ok .value { color: var(--ok); }
.stat.accent-bad .value { color: var(--bad); }
.stat.accent-info .value { color: var(--info); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 18px; margin-bottom: 20px; align-items: end; }
.filters .field { margin: 0; }
.filters .input { min-height: 44px; padding: 9px 12px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 14px 16px;
  border-bottom: 1px solid var(--hairline); white-space: nowrap; background: var(--surface);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .nowrap { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--muted); }
.person { display: flex; align-items: center; gap: 12px; }
.person small { display: block; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: .88rem; }
.mini-list .row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.mini-list .row:last-child { border-bottom: 0; }
.mini-list .row:hover .grow b { text-decoration: underline; }
.mini-list .row .grow { flex: 1; min-width: 0; }
.mini-list .row small { color: var(--muted); display: block; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 10px; align-items: center; font-size: .88rem; }
.bar-row .track { background: var(--neutral-soft); border-radius: 99px; height: 8px; overflow: hidden; }
.bar-row .fill { background: var(--text); height: 100%; border-radius: 99px; width: 0; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; }
.audit-details { font-size: .84rem; color: var(--muted); max-width: 420px; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

/* radio cards, like Airbnb's "choose who to welcome" options */
.switch-group { display: grid; gap: 12px; }
.option {
  display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.option:hover { border-color: var(--text); }
.option:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); background: var(--surface-2); }
.option input { margin-top: 3px; accent-color: var(--text); width: 18px; height: 18px; }
.option small { display: block; color: var(--muted); margin-top: 2px; }

/* ---------- modal & toasts ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 50; display: grid; place-items: center; padding: 24px;
  animation: fade .2s ease-out;
}
.modal {
  width: 100%; max-width: 568px; max-height: calc(100vh - 48px); overflow: auto; background: var(--surface);
  border-radius: 12px; box-shadow: var(--shadow-lg); animation: rise .25s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { max-width: 780px; }
.modal-head {
  display: flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 64px; border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h2 { flex: 1; text-align: center; font-size: 1rem; font-weight: 700; order: 2; padding-right: 36px; }
.modal-head .icon-btn { order: 1; }
.modal-body { padding: 24px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 24px;
  border-top: 1px solid var(--hairline); position: sticky; bottom: 0; background: var(--surface);
}
.modal-foot .spacer { flex: 1; }
.icon-btn {
  border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.lightbox img { display: block; max-width: min(92vw, 640px); max-height: 85vh; border-radius: var(--radius); margin: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

.toasts { position: fixed; z-index: 60; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; max-width: min(400px, calc(100vw - 32px)); }
.toast {
  background: var(--surface); color: var(--text); border-radius: var(--radius-md); box-shadow: var(--shadow-card), 0 0 0 1px rgba(0, 0, 0, .04);
  padding: 14px 16px 14px 18px; display: flex; gap: 10px; align-items: flex-start; position: relative; overflow: hidden;
  animation: slide-in .25s ease-out; cursor: pointer;
}
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.toast.ok::before { background: var(--ok); }
.toast.bad::before { background: var(--bad); }
.toast.warn::before { background: var(--warn); }
.toast b { display: block; }
.toast small { color: var(--muted); }
@keyframes slide-in { from { transform: translateY(12px); opacity: 0; } }

.banner {
  background: var(--surface); color: var(--text); border: 1px solid var(--hairline); box-shadow: var(--shadow-card);
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 20px; font-size: .92rem;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.banner .spacer { flex: 1; }
.banner.page-banner { margin: 16px max(24px, calc((100% - 1232px) / 2)) 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .register, .detail, .two-col { grid-template-columns: 1fr; }
  .register .capture { max-width: 360px; margin: 0 auto; }
  .detail .photo-lg { max-width: 340px; margin: 0 auto; }
  .request { grid-template-columns: 1fr; gap: 20px; }
  .request .photo-lg { max-width: 100%; }
}
@media (max-width: 744px) {
  h1 { font-size: 1.6rem; }
  .topbar-inner { padding: 12px 16px; min-height: 64px; gap: 12px; }
  .topbar .title, .live span { display: none; }
  .live { padding: 6px; border: 0; }
  .tabs-inner { padding: 0 16px; gap: 22px; }
  .tabs a .ico { display: none; }
  main { padding: 24px 16px 32px; }
  .page-head input[type=search] { width: 100%; order: 3; }
  .card-pad { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .vcard, .request { padding: 18px; border-radius: 16px; }
  .request .who { font-size: 1.4rem; }
  .request .decide .btn { padding-left: 10px; padding-right: 10px; white-space: nowrap; }
  .stat .value { font-size: 1.7rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .toasts { left: 16px; right: 16px; max-width: none; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .dropdown { right: 16px; }
  .banner.page-banner { margin: 12px 16px 0; }

  /* modals become bottom sheets */
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .modal-body { padding: 20px 16px; }
  .modal-foot { padding: 14px 16px; }

  /* approver phones: Airbnb-style bottom tab bar */
  .has-bottom-nav .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; border-top: 1px solid var(--hairline); border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .has-bottom-nav .tabs-inner { justify-content: space-around; gap: 0; padding: 0; }
  .has-bottom-nav .tabs a {
    flex: 1; flex-direction: column; gap: 4px; padding: 10px 0 8px; border: 0; font-size: .7rem; font-weight: 500; position: relative;
  }
  .has-bottom-nav .tabs a .ico { display: block; width: 24px; height: 24px; }
  .has-bottom-nav .tabs a.active { color: var(--gold-ink); font-weight: 600; }
  .has-bottom-nav .tabs a.active .ico { stroke-width: 2; }
  .has-bottom-nav .tabs a .count { position: absolute; top: 4px; left: calc(50% + 6px); }
  .has-bottom-nav main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .has-bottom-nav ~ .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media print {
  .topbar, .tabs, .no-print, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
