@font-face { font-family: Switzer; src: url(/fonts/Switzer-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Switzer; src: url(/fonts/Switzer-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Switzer; src: url(/fonts/Switzer-Semibold.woff2) format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: Newsreader; src: url(/fonts/Newsreader-60pt-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --tan: #C4A882; --tan-soft: #E9DFD0; --ink: #15120F; --ink-2: #4A433C; --muted: #857B70;
  --paper: #F5F2EC; --card: #FFFFFF; --line: #E2DBD0;
  --ok: #4F6F52; --ok-soft: #E3EBE2; --warn: #B4682B; --warn-soft: #F5E6D8; --bad: #9A3B2E; --bad-soft: #F3DFDB;
  --radius: 14px; --serif: Newsreader, Georgia, 'Times New Roman', serif;
  --sans: Switzer, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; background: var(--ink); color: var(--paper); }
.logo { height: 24px; width: auto; display: block; }
.wordmark { font-family: var(--serif); letter-spacing: .12em; font-size: 18px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.app-tag { font-size: 11px; font-weight: 600; letter-spacing: .14em; color: var(--ink); background: var(--tan); border-radius: 999px; padding: 3px 9px; }
.clock { font-size: 12px; color: var(--tan-soft); font-variant-numeric: tabular-nums; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 120px); }
h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; margin: 8px 0 6px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; margin: 4px 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.q { margin-bottom: 12px; }
.q-title { font-weight: 500; margin-bottom: 4px; }
.q-title .req { color: var(--bad); margin-left: 2px; }
.q-desc { color: var(--muted); font-size: 13px; margin: -2px 0 8px; }
.q.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.q .err { color: var(--bad); font-size: 13px; margin-top: 6px; display: none; }
.q.invalid .err { display: block; }

input[type=text], input[type=number], input[type=date], input[type=search], input[inputmode], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #FCFBF8; padding: 12px; min-height: 46px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--tan); box-shadow: 0 0 0 3px var(--tan-soft); }
textarea { min-height: 84px; resize: vertical; }
.money { position: relative; }
.money::before { content: '₱'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money input { padding-left: 28px; }

.seg { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 8px; }
.seg button { border: 1px solid var(--line); background: #FCFBF8; border-radius: 10px; min-height: 46px; padding: 8px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed=true][data-v=Yes] { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg button[aria-pressed=true][data-v=No] { background: var(--bad); border-color: var(--bad); color: #fff; }
.seg button[aria-pressed=true][data-v="N/A"] { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.opts { display: grid; gap: 8px; }
.opts button { text-align: left; border: 1px solid var(--line); background: #FCFBF8; border-radius: 10px; padding: 12px 14px; min-height: 46px; cursor: pointer; }
.opts button[aria-pressed=true] { border-color: var(--ok); background: var(--ok); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; min-height: 50px; padding: 0 20px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--ok); color: #fff; }
.btn-primary:active { background: #3F5A42; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-tan { background: var(--tan); color: var(--ink); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--ink-2); text-decoration: underline; padding: 6px 0; cursor: pointer; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(245,242,236,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); }
.bar-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 4px 0 14px; }
.progress > i { display: block; height: 100%; background: var(--tan); transition: width .25s; }
.steps { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.people { display: grid; gap: 8px; max-height: 52vh; overflow: auto; margin-top: 10px; }
.person { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #FCFBF8; cursor: pointer; }
.person small { color: var(--muted); }
.otp { letter-spacing: .5em; text-align: center; font-size: 26px; font-variant-numeric: tabular-nums; }

.branch-list { display: grid; gap: 6px; max-height: 46vh; overflow: auto; margin-top: 8px; }
.branch { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #FCFBF8; padding: 10px 12px; cursor: pointer; }
.branch b { font-weight: 600; margin-right: 6px; }
.branch small { display: block; color: var(--muted); }
.branch[aria-pressed=true] { border-color: var(--ok); background: var(--ok); color: #fff; }
.branch[aria-pressed=true] small { color: #E3EBE2; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--tan-soft); color: var(--ink-2); }
.chip.new { background: var(--warn-soft); color: var(--warn); }
.group-label { font-size: 12px; color: var(--muted); margin: 10px 2px 2px; letter-spacing: .08em; text-transform: uppercase; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.photo { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(21,18,15,.75); color: #fff; cursor: pointer; }
.photo .st { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; padding: 4px 6px; background: rgba(21,18,15,.7); color: #fff; }
.camera-btn { width: 100%; border: 1.5px dashed var(--tan); background: #FBF7F1; border-radius: 12px; min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-weight: 600; }
.camera-btn small { font-weight: 400; color: var(--muted); }

.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.notice.warn { background: var(--warn-soft); color: #6B3D17; }
.notice.bad { background: var(--bad-soft); color: #5C221A; }
.notice.ok { background: var(--ok-soft); color: #2C4230; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 28px; font-weight: 400; }
.stat span { font-size: 12px; color: var(--muted); }
.review-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.review-row:last-child { border-bottom: 0; }
.review-row span:last-child { text-align: right; font-weight: 500; }
.pill-no { color: var(--bad); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14px; transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--tan); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; }
.hero-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 30px; margin: 20px auto 10px; }
.center { text-align: center; }
.now { text-align: center; padding: 18px 16px; }
.now-time { font-family: var(--serif); font-size: 44px; line-height: 1.1; font-variant-numeric: tabular-nums; }
input[type=email] { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #FCFBF8; padding: 12px; min-height: 46px; outline: none; }
input[type=email]:focus { border-color: var(--tan); box-shadow: 0 0 0 3px var(--tan-soft); }

/* --- steps / jump menu --- */
button.steps { width: 100%; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.steps-btn { color: var(--ok); font-weight: 600; }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(21,18,15,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; max-height: 80vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); }
.jump { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 6px; cursor: pointer; }
.jump.current { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok-soft); }
.jump small { color: var(--muted); }
.jump-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--line); color: var(--ink-2); }
.jump-ic.done { background: var(--ok); color: #fff; }
.jump-ic.part { background: var(--warn-soft); color: var(--warn); }

/* --- compact checklist --- */
.checklist { padding: 4px 14px; }
.ck { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ck:last-child { border-bottom: 0; }
.ck.invalid { box-shadow: none; border-color: var(--line); background: var(--bad-soft); margin: 0 -14px; padding: 12px 14px; }
.ck-title { font-size: 15px; margin-bottom: 8px; }
.ck-code { display: inline-block; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--tan-soft); border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.seg.sm button { min-height: 36px; padding: 4px; font-size: 14px; }
.ck-note { margin-top: 8px; min-height: 40px !important; font-size: 14px; border-color: var(--bad) !important; }

/* --- branch dropdown --- */
.dd { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #FCFBF8; padding: 12px 14px; min-height: 52px; cursor: pointer; }
.dd.has { border-color: var(--ok); background: var(--ok-soft); }
.dd-label b { font-weight: 600; }
.dd-label small { display: block; color: var(--muted); font-size: 12px; }
.dd-caret { color: var(--muted); transition: transform .15s; }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd-panel { margin-top: 8px; }

/* --- offline banner --- */
.netbar { position: sticky; top: calc(env(safe-area-inset-top) + 48px); z-index: 19; background: var(--warn-soft); color: #6B3D17; font-size: 13px; text-align: center; padding: 8px 16px; }

.ck-title .req { color: var(--bad); margin-left: 2px; }
