/* Serve — shared styles (F design: bold, big, simple). Colors come from CSS variables set per person. */
:root {
  --bg: #0F172A; --card: #1E293B; --ink: #fff; --sub: #CBD5E1; --line: #334155; --primary: #60A5FA; --primaryInk: #0F172A;
  --soft: #334155; --yes: #22C55E; --yesInk: #052E16; --maybe: #FACC15; --maybeInk: #0F172A; --no: #DC2626; --noInk: #fff;
  --toast: #fff; --toastInk: #0F172A; --wait: #64748B;
  --r: 20px; --gap: 14px; --pad: 16px; --btnH: 56px;
}
html[data-layout="compact"] { --r: 14px; --gap: 9px; --pad: 11px; --btnH: 48px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: Lexend, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-size="small"] #app { zoom: 0.9; }
html[data-size="big"] #app { zoom: 1.1; }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
a.btn { text-decoration: none; }
.page { max-width: 520px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px 120px; display: flex; flex-direction: column; gap: var(--gap); }
.wide .page { max-width: 640px; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: .5px; color: var(--sub); text-transform: uppercase; }
.sub { font-size: 15px; font-weight: 600; color: var(--sub); }
.small { font-size: 14px; font-weight: 600; color: var(--sub); }
.label { font-size: 16px; font-weight: 800; display: block; }
.big { font-size: 24px; font-weight: 800; }
h1 { font-size: 28px; font-weight: 800; margin: 0; }
h2 { font-size: 24px; font-weight: 800; margin: 0; }
h3 { font-size: 19px; font-weight: 800; margin: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* Header */
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.head-btns { display: flex; gap: 8px; }
.head-btn { width: 64px; height: 58px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 800; }
.head-btn.go { background: var(--yes); color: var(--yesInk); border-color: transparent; }

/* Segmented control / tabs */
.seg { display: flex; gap: 6px; padding: 5px; border-radius: 18px; background: var(--soft); }
.seg button { flex: 1; min-height: 50px; border: none; border-radius: 14px; background: transparent; font-weight: 700; color: var(--ink); }
.seg button.on { background: var(--primary); color: var(--primaryInk); font-weight: 800; }

/* Cards */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: var(--pad); display: flex; flex-direction: column; gap: 12px; }
.tag { align-self: flex-start; background: var(--primary); color: var(--primaryInk); font-size: 12px; font-weight: 800; letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }
.date-tile { width: 76px; border-radius: 16px; overflow: hidden; flex-shrink: 0; display: flex; flex-direction: column; text-align: center; background: #fff; color: #0F172A; }
.date-tile b { background: #DC2626; color: #fff; font-size: 13px; padding: 3px 0; letter-spacing: 1px; }
.date-tile strong { font-size: 32px; line-height: 1.15; }
.date-tile span { font-size: 12px; font-weight: 700; color: #475569; padding-bottom: 5px; }
html[data-layout="compact"] .date-tile { width: 60px; }
html[data-layout="compact"] .date-tile strong { font-size: 24px; }
.who { display: flex; gap: 14px; align-items: center; }
.who .stack { gap: 3px; min-width: 0; }
.role { font-size: 24px; font-weight: 800; }
.info { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.info strong { font-size: 20px; }
.place { display: flex; align-items: center; gap: 6px; }
.place svg { color: var(--primary); flex-shrink: 0; }

/* Answer buttons: compact, colorful */
.answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ans { height: var(--btnH); border: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; font-size: 16px; font-weight: 800; padding: 0 4px; }
.ans.yes { background: var(--yes); color: var(--yesInk); }
.ans.maybe { background: var(--maybe); color: var(--maybeInk); }
.ans.no { background: var(--no); color: var(--noInk); }
.ans[disabled] { opacity: .5; }
.banner { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 18px; font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.banner .dot { width: 40px; height: 40px; border-radius: 20px; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.banner.yes { background: var(--yes); color: var(--yesInk); } .banner.yes .dot { color: #15803D; }
.banner.maybe { background: var(--maybe); color: var(--maybeInk); } .banner.maybe .dot { color: #92400E; }
.banner.no, .banner.unfilled { background: var(--no); color: var(--noInk); } .banner.no .dot, .banner.unfilled .dot { color: #B91C1C; }

/* Buttons */
.btn { min-height: 56px; border: none; border-radius: 18px; background: var(--primary); color: var(--primaryInk); font-size: 18px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; width: 100%; }
.btn.go { background: var(--yes); color: var(--yesInk); }
.btn.danger { background: var(--no); color: var(--noInk); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); font-weight: 700; }
.btn.ghost.danger { border-color: var(--no); color: var(--ink); background: transparent; }
.btn.small { min-height: 46px; font-size: 15px; border-radius: 14px; width: auto; }
.btn[disabled] { opacity: .5; }
.icon-btn { width: 46px; height: 46px; border-radius: 14px; border: none; background: var(--soft); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Lists */
.row { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 18px; padding: 10px 8px 10px 14px; min-height: 64px; text-align: left; }
html[data-layout="compact"] .row { min-height: 52px; padding: 6px 6px 6px 12px; border-radius: 14px; }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .title { font-size: 17px; font-weight: 800; }
.chev { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chip { font-size: 14px; font-weight: 800; padding: 6px 12px; border-radius: 999px; white-space: nowrap; background: var(--soft); color: var(--ink); }
.chip.yes { background: var(--yes); color: var(--yesInk); }
.chip.maybe { background: var(--maybe); color: var(--maybeInk); }
.chip.asked { background: var(--primary); color: var(--primaryInk); }
.chip.no, .chip.open { background: var(--no); color: var(--noInk); }
.chip.unfilled { background: transparent; border: 2px dashed var(--sub); color: var(--sub); }
.empty { text-align: center; padding: 30px 10px; }

/* Bottom sheets */
.scrim { position: fixed; inset: 0; background: rgba(5, 8, 20, .65); display: flex; flex-direction: column; justify-content: flex-end; z-index: 20; }
.sheet { background: var(--card); color: var(--ink); border-radius: 28px 28px 0 0; padding: 22px 18px max(26px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-height: 92vh; overflow-y: auto; width: 100%; max-width: 640px; margin: 0 auto; }
.sheet.center { align-items: center; text-align: center; }
.bigdot { width: 80px; height: 80px; border-radius: 40px; display: flex; align-items: center; justify-content: center; }
.bigdot.no { background: var(--no); color: var(--noInk); } .bigdot.maybe { background: var(--maybe); color: var(--maybeInk); } .bigdot.yes { background: var(--yes); color: var(--yesInk); }
.help-row { display: flex; align-items: center; gap: 14px; background: var(--bg); border-radius: 18px; padding: 12px; }
.help-row .num { width: 46px; height: 46px; border-radius: 23px; background: var(--primary); color: var(--primaryInk); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; flex-shrink: 0; }

/* Forms */
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password], select, textarea {
  width: 100%; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); padding: 10px 12px; font-weight: 600; font-size: 17px; }
textarea { resize: none; }
/* Phones (iPhone especially) draw date/time boxes wider than the screen allows: keep them inside their space. */
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
.field { min-width: 0; }
.dates { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) { .dates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 46px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 800; }
.pill.on { background: var(--primary); color: var(--primaryInk); border-color: var(--primary); }
.stepper { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 14px; padding: 4px 4px 4px 14px; }
.stepper .name { flex: 1; font-weight: 700; }
.stepper b { width: 28px; text-align: center; font-size: 20px; }

/* Color picker */
.look-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.look { min-height: 62px; border-radius: 14px; border: 3px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; font-size: 13px; font-weight: 800; }
.look.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); }
.look .dots { display: flex; gap: 2px; } .look .dots i { width: 13px; height: 13px; border-radius: 7px; display: block; }

/* Toast */
.toast { position: fixed; left: 12px; right: 12px; bottom: max(18px, env(safe-area-inset-bottom)); max-width: 600px; margin: 0 auto; background: var(--toast); color: var(--toastInk); border-radius: 18px; padding: 8px 6px 8px 16px; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 30; }
.toast span { flex: 1; font-size: 15px; font-weight: 700; }
.toast .undo { height: 46px; padding: 0 18px; border-radius: 12px; border: none; background: var(--primary); color: var(--primaryInk); font-size: 17px; font-weight: 800; }
.toast .x { width: 44px; height: 44px; border: none; background: transparent; color: inherit; display: flex; align-items: center; justify-content: center; }
body.has-nav .toast { bottom: 96px; }

/* Leader: service cards */
.svc { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; }
.svc-head { display: flex; align-items: center; gap: 10px; padding: 12px; width: 100%; border: none; background: transparent; color: var(--ink); text-align: left; }
html[data-layout="compact"] .svc-head { padding: 6px 10px; }
.svc-head .date-tile { width: 60px; } .svc-head .date-tile strong { font-size: 24px; }
.bar { display: flex; gap: 3px; } .bar i { flex: 1; height: 14px; border-radius: 5px; display: block; }
html[data-layout="compact"] .bar i { height: 10px; }
html[data-layout="compact"] .svc-sum { display: none; }
.bar .yes { background: var(--yes); } .bar .maybe { background: var(--maybe); } .bar .asked { background: var(--wait); } .bar .open { background: var(--no); } .bar .unfilled { background: var(--line); }
.svc-body { padding: 0 12px 12px; display: flex; flex-direction: column; }
.prow { display: flex; align-items: center; gap: 6px; border-top: 2px solid var(--line); padding: 4px 0; }
.prow > button.grow { flex: 1; display: flex; align-items: center; gap: 10px; border: none; background: transparent; color: var(--ink); min-height: 48px; text-align: left; min-width: 0; padding: 4px 0; }
.sdot { width: 20px; height: 20px; border-radius: 10px; flex-shrink: 0; }
.sdot.yes { background: var(--yes); } .sdot.maybe { background: var(--maybe); } .sdot.asked { background: var(--wait); } .sdot.open { background: var(--no); } .sdot.unfilled { background: transparent; border: 3px dashed var(--sub); }
.edit-tag { font-size: 12px; font-weight: 800; color: var(--sub); border: 2px solid var(--line); border-radius: 10px; padding: 4px 8px; flex-shrink: 0; }
.live { display: inline-flex; align-items: center; gap: 5px; background: var(--yes); color: var(--yesInk); padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.live i { width: 8px; height: 8px; border-radius: 4px; background: var(--yesInk); display: block; }
.ministry-btn { align-self: flex-start; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 6px max(14px, env(safe-area-inset-bottom)); background: var(--card); border-top: 2px solid var(--line); z-index: 10; }
.nav button { border: none; background: transparent; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 800; min-height: 56px; justify-content: center; position: relative; }
.nav button.on { color: var(--primary); }
.badge { position: absolute; top: 4px; right: calc(50% - 22px); background: var(--no); color: var(--noInk); font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 15px; font-weight: 600; }
.bubble.me { align-self: flex-end; background: var(--primary); color: var(--primaryInk); border-radius: 18px 18px 6px 18px; }
.bubble.them { align-self: flex-start; background: var(--soft); color: var(--ink); border-radius: 18px 18px 18px 6px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 64px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-size: 26px; font-weight: 800; }
.pin-dots { display: flex; justify-content: center; gap: 16px; padding: 8px 0; }
.pin-dots i { width: 20px; height: 20px; border-radius: 10px; border: 3px solid var(--sub); display: block; }
.pin-dots i.on { background: var(--primary); border-color: var(--primary); }
.notice { background: var(--maybe); color: var(--maybeInk); border-radius: 16px; padding: 12px 14px; font-weight: 700; }
.linkbox { background: var(--bg); border: 2px dashed var(--primary); border-radius: 16px; padding: 14px; text-align: center; font-size: 18px; font-weight: 800; word-break: break-all; }
.spin { opacity: .6; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Church logomark */
.mark { display: block; flex-shrink: 0; color: var(--ink); opacity: .9; }
.kicker.brand { display: flex; align-items: center; gap: 8px; }

/* Feel like an app: no double-tap or pinch zoom */
html, body { touch-action: manipulation; }

/* Bottom bar: hide when logged out, and paint below it so no gap ever shows */
body:not(.has-nav) #nav { display: none; }
.nav::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 300px; background: var(--card); }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100%; min-height: 100dvh; }
