/* CHA Lead Scanner — one stylesheet, dark by design.
 *
 * A scanner is held up to badges in conference halls and dim dinner venues, and
 * most of its life is a camera viewfinder; a dark surface keeps the glare off
 * the person you are talking to. Brand: CHA Navy #0E2459 as the ground, CHA
 * Blue #018EDC as the only accent, white type. Montserrat for headings (the
 * wordmark's face), the platform's own UI font for everything you read fast.
 */

:root {
  --navy: #0e2459;
  --deep: #060f2a;
  --deeper: #040a1d;
  --blue: #018edc;
  --blue-hi: #29a9f2;
  --ink: #f2f6fc;
  --ink-2: #b4c2d9;
  --ink-3: #7d8eab;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.08);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --hot: #fb7185;
  --radius: 20px;
  --radius-sm: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --head: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--deep);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(1, 142, 220, 0.22), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(14, 36, 89, 0.9), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--blue-hi); text-decoration: none; }
img { display: block; max-width: 100%; }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.ico-xs { width: 13px; height: 13px; opacity: .7; }
.ico-lg { width: 30px; height: 30px; stroke-width: 2; }

.eyebrow { font: 600 11px/1 var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--blue-hi); margin: 0 0 10px; }
.h2 { font: 700 20px/1.2 var(--head); margin: 0 0 6px; letter-spacing: -.01em; }
.h3 { font: 600 15px/1.2 var(--head); margin: 0; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }
.label { font: 600 11px/1 var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 10px; }
.fineprint { font-size: 12.5px; color: var(--ink-3); margin: 14px 0 0; line-height: 1.45; }

.view { min-height: 100vh; min-height: 100dvh; }

/* ── Boot ─────────────────────────────────────────────────────────────── */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--deep); z-index: 50; transition: opacity .35s ease; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-emblem { width: 76px; animation: breathe 1.6s ease-in-out infinite; filter: drop-shadow(0 0 24px rgba(1, 142, 220, .55)); }
@keyframes breathe { 50% { transform: scale(1.07); opacity: .8; } }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 999px; font: 600 15px/1 var(--head); letter-spacing: .01em; transition: transform .12s ease, background .2s ease, box-shadow .2s ease, opacity .2s; user-select: none; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: linear-gradient(180deg, var(--blue-hi), var(--blue)); color: #fff; box-shadow: 0 10px 30px -10px rgba(1, 142, 220, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.btn-soft { background: rgba(1, 142, 220, .14); color: var(--blue-hi); border: 1px solid rgba(41, 169, 242, .3); }
.btn-danger { background: rgba(248, 113, 113, .16); color: #fecaca; border: 1px solid rgba(248, 113, 113, .35); }
.btn-xl { min-height: 58px; font-size: 16.5px; width: 100%; }
.btn-lg { min-height: 52px; font-size: 15.5px; width: 100%; }
.banner-info { background: rgba(1, 142, 220, .12); border: 1px solid rgba(41, 169, 242, .32); color: #cfe9fb; }
.sheet-icon { width: 76px; height: 76px; border-radius: 18px; margin: 4px auto 14px; box-shadow: 0 14px 34px -12px rgba(1, 142, 220, .8); }
.pk-later { margin-top: 10px; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; margin-top: 12px; }
.x-team { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 14px; }
.x-team input { width: 18px; height: 18px; accent-color: var(--blue); }
.clay-actions { display: flex; flex-wrap: wrap; gap: 0 8px; }
.field-link { margin-left: auto; color: var(--blue-hi); font-weight: 700; text-decoration: none; letter-spacing: 0; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); }
.icon-btn:active { background: var(--glass-2); }
.link-btn { color: var(--blue-hi); font-weight: 600; }

/* ── Sign in ──────────────────────────────────────────────────────────── */
.signin { display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--safe-t) + 48px) 24px calc(var(--safe-b) + 28px); position: relative; overflow: hidden; max-width: 520px; margin: 0 auto; }
.signin-glow { position: absolute; width: 520px; height: 520px; left: 50%; top: -140px; transform: translateX(-50%); background: radial-gradient(circle, rgba(1, 142, 220, .32), transparent 62%); pointer-events: none; animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translateX(-46%) translateY(30px) scale(1.08); } }
.signin-body { position: relative; }
.signin-logo { width: 210px; margin-bottom: 64px; }
.signin-title { font: 800 38px/1.08 var(--head); letter-spacing: -.025em; margin: 0 0 16px; }
.signin-sub { color: var(--ink-2); font-size: 16.5px; margin: 0; max-width: 34ch; }
.signin-actions { position: relative; display: flex; flex-direction: column; gap: 12px; margin-top: 40px; }
.signin-actions .btn-ghost { font-size: 14px; font-family: var(--body); font-weight: 500; }

.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin: 0; }
.notice-error { background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .3); color: #fecaca; }
.notice-info { background: rgba(1, 142, 220, .12); border: 1px solid rgba(41, 169, 242, .3); color: #cfe9fb; }

/* ── Home ─────────────────────────────────────────────────────────────── */
.home { padding-bottom: calc(var(--safe-b) + 120px); max-width: 640px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 12px) 20px 12px; background: linear-gradient(180deg, rgba(6, 15, 42, .96) 60%, rgba(6, 15, 42, 0)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar-solid { background: rgba(6, 15, 42, .92); border-bottom: 1px solid var(--line); }
.topbar-logo { height: 30px; width: auto; }
.topbar-title { font: 600 15px/1 var(--head); margin: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), #1a3a7a); border: 1px solid var(--line-2); font: 700 14px/1 var(--head); color: #fff; }
.avatar-lg { width: 54px; height: 54px; font-size: 18px; flex: none; }

.banner { margin: 4px 20px 0; padding: 10px 14px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.banner-warn { background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .28); color: #fde68a; }
.banner .link-btn { margin-left: auto; }

.hero { padding: 18px 20px 6px; }
.event-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--ink); font-size: 14.5px; font-weight: 500; max-width: 100%; }
.event-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-chip.unset { color: var(--blue-hi); border-style: dashed; border-color: rgba(41, 169, 242, .45); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 12px; }
.stat-n { display: block; font: 700 26px/1 var(--head); letter-spacing: -.02em; }
.stat-l { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-3); }

.list-wrap { padding: 18px 20px 0; }
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.list-head .h2 { margin: 0; font-size: 17px; }
.lead-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lead-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); transition: transform .12s, background .2s; animation: rise .35s ease both; }
.lead-item:active { transform: scale(.985); background: var(--glass-2); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.thumb { width: 58px; height: 58px; border-radius: 14px; flex: none; background: linear-gradient(135deg, #12306e, var(--navy)); display: grid; place-items: center; overflow: hidden; font: 700 18px/1 var(--head); color: rgba(255, 255, 255, .85); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.lead-main { min-width: 0; flex: 1; }
.lead-name { font: 600 15.5px/1.25 var(--head); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-sub { margin: 3px 0 7px; color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.chev { color: var(--ink-3); }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font: 600 11px/1.2 var(--body); letter-spacing: .02em; background: var(--glass-2); color: var(--ink-2); border: 1px solid var(--line); margin: 0; white-space: nowrap; font-style: normal; }
.tag-ok { background: rgba(52, 211, 153, .12); color: #a7f3d0; border-color: rgba(52, 211, 153, .3); }
.tag-ai { background: rgba(1, 142, 220, .14); color: #bae6fd; border-color: rgba(41, 169, 242, .32); }
.tag-warn { background: rgba(251, 191, 36, .12); color: #fde68a; border-color: rgba(251, 191, 36, .3); }
.tag-bad { background: rgba(248, 113, 113, .12); color: #fecaca; border-color: rgba(248, 113, 113, .3); }
.tag-hot { background: rgba(251, 113, 133, .14); color: #fecdd3; border-color: rgba(251, 113, 133, .35); }
.tag-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-warn { background: var(--warn); }

.empty { text-align: center; padding: 48px 24px 24px; }
.empty-emblem { width: 72px; margin: 0 auto 18px; opacity: .9; filter: drop-shadow(0 0 22px rgba(1, 142, 220, .45)); }
.empty-title { font: 700 18px/1.2 var(--head); margin: 0 0 6px; }
.empty-sub { color: var(--ink-2); margin: 0 auto; max-width: 28ch; }

/* The dock: one thumb, one big button. */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: flex-end; justify-content: center; gap: 34px; padding: 14px 24px calc(var(--safe-b) + 14px); background: linear-gradient(0deg, rgba(4, 10, 29, .98) 55%, rgba(4, 10, 29, 0)); }
.dock-side { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px; color: var(--ink-2); font-size: 12px; font-weight: 500; padding-bottom: 6px; }
.dock-side .ico { width: 24px; height: 24px; }
.dock-side:active { color: #fff; }
.shutter-fab { width: 84px; height: 84px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; background: radial-gradient(circle at 50% 30%, var(--blue-hi), var(--blue) 70%); box-shadow: 0 0 0 6px rgba(1, 142, 220, .16), 0 18px 40px -10px rgba(1, 142, 220, .9); transition: transform .15s ease; }
.shutter-fab:active { transform: scale(.93); }
.fab-label { font: 700 11px/1 var(--head); letter-spacing: .08em; text-transform: uppercase; }

/* ── Camera ───────────────────────────────────────────────────────────── */
.camera { position: fixed; inset: 0; background: #000; z-index: 20; overflow: hidden; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-mask { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
/* A conference badge is tall (about 4 x 6 in), so the frame is too. A business
   card is wide, and the switch above the shutter changes the frame for it. */
.cam-frame { position: relative; width: min(74vw, 380px, calc(56vh * .68)); aspect-ratio: .68; border-radius: 22px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .52); transition: width .2s ease, aspect-ratio .2s ease; }
.cam-frame.card { width: min(86vw, 460px); aspect-ratio: 1.6; }
/* Several badges or cards laid out together: most of the screen. */
.cam-frame.group { width: 92vw; height: min(62vh, 620px); aspect-ratio: auto; }
.lock { position: fixed; inset: 0; z-index: 60; background: var(--bg, #050b1f); display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--safe-t) + 48px) 24px calc(var(--safe-b) + 28px); overflow: hidden; }
.lock-body { position: relative; max-width: 520px; width: 100%; margin: 0 auto; }
.lock .signin-actions { max-width: 520px; width: 100%; margin: 0 auto; }
.cam-tip { position: absolute; left: 16px; right: 16px; top: calc(var(--safe-t) + 76px); display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(4, 10, 29, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 13px; line-height: 1.4; }
.cam-tip p { margin: 0; flex: 1; }
.pill-btn { min-height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.pill-btn.on { background: var(--blue); color: #fff; box-shadow: 0 0 0 3px rgba(41, 169, 242, .35); }
.shutter { position: relative; }
.cam-count { position: absolute; top: -6px; right: -6px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--blue); color: #fff; font: 800 13px/26px var(--head); text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.cam-kind { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 128px); display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.cam-kind button { min-height: 34px; padding: 0 14px; border-radius: 999px; color: rgba(255, 255, 255, .8); font-size: 13px; font-weight: 600; white-space: nowrap; }
.cam-kind button.on { background: #fff; color: #000; }
.cam-frame i { position: absolute; width: 34px; height: 34px; border: 3px solid #fff; }
.cam-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.cam-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 22px; }
.cam-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 22px; }
.cam-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--safe-t) + 14px) 16px 0; }
.cam-hint { flex: 1; text-align: center; margin: 0; font-size: 14px; font-weight: 500; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-around; padding: 0 24px calc(var(--safe-b) + 30px); }
.round-btn { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; }
.round-btn.on { background: #fff; color: #000; }
.round-btn-spacer { width: 50px; }
.shutter { width: 82px; height: 82px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
.shutter span { width: 64px; height: 64px; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active span { transform: scale(.88); }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* ── Lead ─────────────────────────────────────────────────────────────── */
.lead { max-width: 640px; margin: 0 auto; }
.lead-scroll { padding: 14px 16px 0; }
.lead-photo { position: relative; margin: 0 0 14px; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, #0d2257, #091842); border: 1px solid var(--line); aspect-ratio: 1.6; }
/* contain, not cover: a tall badge in a wide box would lose its name. The box
   takes the photo's own shape (setPhotoShape), within reason. */
.lead-photo { max-height: 58vh; }
.lead-photo img { width: 100%; height: 100%; object-fit: contain; }
.lead-photo.manual { aspect-ratio: auto; height: 84px; display: grid; place-items: center; }
.status-pill { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(4, 10, 29, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); }
.status-pill.ok { color: #a7f3d0; }
.status-pill.bad { color: #fecaca; }
.status-pill.manual { position: static; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--blue-hi); animation: spin .8s linear infinite; flex: none; }
.status-pill.ok .spinner, .status-pill.bad .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.fields { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { min-height: 18px; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.field input, .input, .note { width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px; background: rgba(4, 10, 29, .55); border: 1px solid var(--line-2); outline: none; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .input:focus, .note:focus { border-color: var(--blue-hi); box-shadow: 0 0 0 3px rgba(41, 169, 242, .2); }
.fields.loading input { background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; color: transparent; }
@keyframes shimmer { to { background-position: -200% 0; } }
.note { min-height: 108px; resize: vertical; line-height: 1.45; }
.input { margin-top: 12px; }

.clay-mark { width: 16px; height: 16px; border-radius: 5px; background: conic-gradient(from 210deg, #ff7a59, #ffc045, #4fd1c5, #6c8cff, #ff7a59); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-3); }
.step-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; position: relative; }
.step.run { color: var(--ink); }
.step.run .step-dot { border-color: rgba(41, 169, 242, .3); border-top-color: var(--blue-hi); animation: spin .8s linear infinite; }
.step.done { color: var(--ink); }
.step.done .step-dot { background: var(--ok); border-color: var(--ok); }
.step.done .step-dot::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #04210f; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.step.miss .step-dot { border-color: var(--ink-3); border-style: dashed; }
.step-l { flex: none; }
.step-v { margin-left: auto; font-weight: 600; color: var(--ink); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; user-select: text; }
#clay-note { margin: 10px 0 0; }
#clay-changed { margin: 10px 0 0; }
#clay-note:empty { display: none; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: rgba(4, 10, 29, .55); border: 1px solid var(--line); }
.segmented button { min-height: 40px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s; }
.segmented button[aria-checked="true"] { background: var(--glass-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.segmented button[data-p="hot"][aria-checked="true"] { background: rgba(251, 113, 133, .2); color: #fecdd3; box-shadow: inset 0 0 0 1px rgba(251, 113, 133, .45); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 500; background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); transition: all .15s; }
.chip[aria-pressed="true"] { background: rgba(1, 142, 220, .18); border-color: rgba(41, 169, 242, .55); color: #e0f2fe; }

.lead-spacer { height: calc(var(--safe-b) + 100px); }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 14px 16px calc(var(--safe-b) + 14px); background: linear-gradient(0deg, rgba(4, 10, 29, .98) 60%, rgba(4, 10, 29, 0)); }
.savebar .btn { max-width: 608px; margin: 0 auto; display: flex; min-height: 54px; font-size: 16px; }

/* ── Sheets ───────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(2, 6, 18, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-width: 560px; margin: 0 auto; max-height: 88vh; max-height: 88dvh; overflow-y: auto; padding: 10px 20px calc(var(--safe-b) + 22px); border-radius: 26px 26px 0 0; background: linear-gradient(180deg, #0c1c4a, #081438); border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.sheet-tall { max-height: 92vh; max-height: 92dvh; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 16px; }
.sheet .h2 { margin-bottom: 6px; }
.row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

.me { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.me-name { font: 700 17px/1.2 var(--head); margin: 0 0 2px; }
.me .tag { margin-top: 8px; }
.menu-list { display: flex; flex-direction: column; padding: 8px 0; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; font-size: 15.5px; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); text-align: left; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .ico { color: var(--blue-hi); }
.menu-danger, .menu-danger .ico { color: #fca5a5; }

.wstep { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.wnum { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 700 14px/1 var(--head); background: rgba(1, 142, 220, .18); color: var(--blue-hi); border: 1px solid rgba(41, 169, 242, .4); }
.wstep.done .wnum { background: rgba(52, 211, 153, .18); color: var(--ok); border-color: rgba(52, 211, 153, .45); }
.wbody { flex: 1; min-width: 0; }
.wtitle { font: 600 16px/1.3 var(--head); margin: 2px 0 4px; }
.wbody .tag { margin-top: 10px; }
#w-done { margin-top: 20px; }

.install { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.istep { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: rgba(4, 10, 29, .5); border: 1px solid var(--line); font-size: 14.5px; }
.istep b { font-weight: 650; color: #fff; }
.iglyph { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--glass-2); color: var(--blue-hi); }
.iglyph .ico { width: 20px; height: 20px; }
.istep-n { font: 700 12px/1 var(--head); color: var(--ink-3); width: 14px; flex: none; }

.qr-wrap { margin: 16px auto; width: min(72vw, 280px); aspect-ratio: 1; padding: 16px; border-radius: 22px; background: #fff; box-shadow: 0 20px 50px -20px rgba(1, 142, 220, .7); }
.qr-wrap img { width: 100%; height: 100%; }

/* ── Admin entry, filters, team ───────────────────────────────────────── */
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.gear { color: var(--ink-2); }
.gear:active { color: #fff; }
.admin-head { display: flex; align-items: center; gap: 6px; padding: 6px 12px 0; }
.admin-title { font: 700 20px/1 var(--head); margin: 0; letter-spacing: -.01em; }
.team { padding-bottom: calc(var(--safe-b) + 28px); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 20px 0; padding: 4px; border-radius: 14px; background: rgba(4, 10, 29, .55); border: 1px solid var(--line); }
.tab { min-height: 40px; border-radius: 10px; font: 600 14px/1 var(--head); color: var(--ink-2); }
.tab[aria-selected="true"] { background: var(--glass-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.filters { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 4px 0 12px; }
.team .filters { grid-template-columns: 1fr 1fr; }
.search { margin: 0; min-height: 42px; padding: 9px 13px; }
.team .search { margin: 0 0 12px; }
.select { min-height: 42px; max-width: 170px; padding: 9px 12px; border-radius: 12px; background: rgba(4, 10, 29, .55); border: 1px solid var(--line-2); color: var(--ink); font-size: 14.5px; }
.team .select { max-width: none; }
/* A select sizes itself to its longest option ("Dallas Super Conference (12)"),
   and a grid track will not shrink below that unless told to. Without these two
   lines the team filters pushed the whole page 58px past a phone's width. */
.filters > * { min-width: 0; }
.select { width: 100%; text-overflow: ellipsis; }
.day-head { list-style: none; font: 600 11px/1 var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 10px 2px 2px; }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--line); }
.person:active { background: var(--glass-2); }
.person .avatar { flex: none; }
.person-main { flex: 1; min-width: 0; }
.person-name { font: 600 15px/1.25 var(--head); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.person-n { font: 700 20px/1 var(--head); text-align: right; }
.person-n small { display: block; font: 500 11px/1.4 var(--body); color: var(--ink-3); }
.by { color: var(--blue-hi); }
.pk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pk-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(4, 10, 29, .5); border: 1px solid var(--line); font-size: 14px; }
.pk-item span { flex: 1; min-width: 0; }
.pk-item small { display: block; color: var(--ink-3); font-size: 12px; }
.pk-remove { color: #fca5a5; font-weight: 600; font-size: 13.5px; padding: 6px 4px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.al-photo { width: 100%; border-radius: var(--radius-sm); margin: 0 0 14px; border: 1px solid var(--line); }
.al-tags { margin: 8px 0 4px; }
.al-fields { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 14px 0 0; font-size: 14.5px; }
.al-fields dt { color: var(--ink-3); font-size: 12.5px; font-weight: 600; padding-top: 2px; }
.al-fields dd { margin: 0; overflow-wrap: anywhere; user-select: text; }
.al-note { white-space: pre-wrap; margin: 0; font-size: 15px; user-select: text; }
.event-recent { margin: 14px 0 0; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px; background: rgba(12, 28, 74, .96); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; animation: drop .25s ease; }
.toast.ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.toast.bad::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
@keyframes drop { from { transform: translate(-50%, -12px); opacity: 0; } }

@media (min-width: 720px) {
  .signin { justify-content: center; gap: 24px; }
  .signin-logo { margin-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
