:root {
  /* Philippines x Kuwait: PH blue, sun yellow, the shared red, Kuwait green and black */
  --ph-blue: #0038A8;
  --ph-red: #CE1126;
  --sun: #FCD116;
  --kw-green: #007A3D;
  --kw-black: #141414;
  --flag-stripe: linear-gradient(90deg, var(--ph-blue) 0 30%, var(--ph-red) 30% 50%, var(--sun) 50% 58%, var(--kw-green) 58% 82%, var(--kw-black) 82% 100%);

  --ink: #0B1F4D;          /* text and dark surfaces: deep Philippine blue */
  --ink-2: #2E3F6B;
  --muted: #55607A;
  --brand: var(--ph-blue); /* main buttons */
  --brand-deep: #002878;
  --line: #DCE3F1;
  --field: #B7C2DC;
  --paper: #F4F6FB;
  --card: #FFFFFF;
  --tint: #E9EFFC;         /* light blue panels */
  --accent: var(--sun);
  --good: var(--kw-green);
  --warn: #B45309;
  --bad: var(--ph-red);
  --radius: 16px;
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); border-top: 6px solid transparent; border-image: var(--flag-stripe) 1; font-size: 18px; line-height: 1.45; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
a { color: var(--ink); }
.en { display: block; color: var(--muted); font-size: 0.85em; font-weight: 500; }

.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.wrap.wide { max-width: 1100px; }
.topbar { display: flex; align-items: center; gap: 8px; }
.topbar .brand { margin-right: auto; min-width: 0; }
.topbar .tag, .topbar #langBtn { flex: none; }
#langBtn { min-height: 40px; padding: 6px 12px; font-size: 14px; border-radius: 999px; }
@media (max-width: 400px) {
  .brand { font-size: 13px; letter-spacing: 0.02em; gap: 8px; }
  .tag { font-size: 12px; padding: 3px 8px; }
}
.brand { font-weight: 800; font-size: 15px; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.brand .brand-pass { color: var(--brand); }
body.door .brand .brand-pass { color: #FCD116; }
.brand .brand-sub { font-weight: 600; opacity: .8; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--ink); font-size: 13px; font-weight: 700; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card.dark { background: linear-gradient(160deg, var(--brand), var(--ink)); color: #fff; border-color: var(--brand-deep); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid2.dates { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
input[type="datetime-local"] { font-size: 18px; min-width: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 17px; }
label .hint { font-weight: 500; color: var(--muted); font-size: 14px; }
input, select, textarea {
  font: inherit; font-size: 20px; padding: 12px 14px; min-height: 54px; border-radius: 12px;
  border: 2px solid var(--field); background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--sun); outline-offset: 1px; border-color: var(--brand); }
input.pin { letter-spacing: 0.5em; text-align: center; font-size: 28px; max-width: 220px; }
.check { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 500; }
.check input { width: 28px; min-height: 28px; height: 28px; flex: none; margin-top: 2px; }

button, .btn {
  font: inherit; font-size: 20px; font-weight: 800; min-height: 58px; padding: 12px 20px; border-radius: 14px;
  border: 2px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-align: center;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button.secondary, .btn.secondary { background: #fff; color: var(--brand); }
button:not(.secondary):not(.link):not(.good):not(.bad):hover:not(:disabled) { background: var(--brand-deep); border-color: var(--brand-deep); }
button.secondary:hover:not(:disabled), .btn.secondary:hover { background: var(--tint); }
button.small, .btn.small { font-size: 16px; min-height: 48px; padding: 8px 14px; border-radius: 12px; }
button.good { background: var(--good); border-color: var(--good); }
button.bad { background: var(--bad); border-color: var(--bad); }
button:disabled { opacity: 0.55; cursor: progress; }
button:active:not(:disabled), .btn:active { transform: scale(0.98); }
button, .btn { transition: transform 80ms ease, background-color 120ms ease; -webkit-tap-highlight-color: transparent; }
button:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--bad); background: #FFF6F7; }
button.link { background: none; border: none; color: var(--ink); text-decoration: underline; min-height: 48px; padding: 4px; font-weight: 600; font-size: 16px; }

.msg { padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.msg.error { background: #FCE8EA; color: var(--bad); }
.msg.ok { background: #E3F3EA; color: var(--good); }
.msg.info { background: var(--tint); color: var(--ink); }

/* ---------- Event Pass ---------- */
.pass { background: linear-gradient(165deg, var(--brand) 0%, var(--ink) 75%); color: #fff; border-radius: 24px; padding: 24px 20px 30px; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.pass .label { font-size: 14px; font-weight: 800; letter-spacing: 0.14em; color: var(--accent); }
.pass .who { font-size: 30px; font-weight: 800; line-height: 1.1; }
.pass .what { font-size: 18px; color: #D6E0F7; }
.pass::after, .member-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--flag-stripe); }
.pass .qr { background: #fff; padding: 14px; border-radius: 16px; }
.pass .qr img, .pass .qr canvas { display: block; width: 220px; height: 220px; }
.pass .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: 0.08em; }
.pass .live { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pass .dot { width: 18px; height: 18px; border-radius: 50%; background: #3DDC84; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 1; transform: scale(1); } to { opacity: 0.35; transform: scale(0.75); } }
.daycolour { width: 100%; border-radius: 12px; padding: 10px; font-weight: 800; font-size: 18px; color: #fff; border: 3px solid rgba(255,255,255,0.9); }
.present { background: var(--good); border-radius: 14px; padding: 12px 16px; font-weight: 800; font-size: 20px; width: 100%; }

.notice { border-left: 0; border-radius: 12px; padding: 14px; background: #fff; border: 2px solid var(--line); }
.notice.warning { border-color: #E0A800; background: #FFF8DC; }
.notice.emergency { border-color: var(--bad); background: #FCE8EA; }
.notice .k { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Staff scan result ---------- */
.result { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; color: #fff; text-align: center; }
.result.good { background: var(--good); }
.result.warn { background: var(--warn); }
.result.bad { background: var(--bad); }
.result .big { font-size: 44px; font-weight: 800; line-height: 1.05; }
.result .name { font-size: 32px; font-weight: 700; }
.result button { background: #fff; color: var(--ink); border-color: #fff; min-width: 220px; }
#reader { width: 100%; max-width: 420px; margin: 0 auto; border-radius: 16px; overflow: hidden; }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { background: #fff; color: var(--brand); border-color: var(--line); font-size: 16px; min-height: 46px; }
.tabs button[aria-selected="true"] { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: inset 0 -4px 0 var(--sun); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 34px; font-weight: 800; line-height: 1.1; }
.stat b.small { font-size: 22px; }
.stat span { color: var(--muted); font-size: 14px; font-weight: 600; }
.table-box { overflow-x: auto; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--tint); font-weight: 800; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.chip.sent, .chip.open { background: #E3F3EA; color: var(--good); }
.chip.pending_approval, .chip.scheduled { background: #FFF4D6; color: var(--warn); }
.chip.cancelled { background: var(--tint); color: var(--muted); }
.chip.rejected, .chip.closed { background: #FCE8EA; color: var(--bad); }
.modal { position: fixed; inset: 0; background: rgba(11, 31, 77, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal .card { max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; }
.small-print { font-size: 14px; color: var(--muted); }

@media print {
  body * { visibility: hidden; }
  .printable, .printable * { visibility: visible; }
  .printable { position: absolute; inset: 0; border: none; }
  .printable button { display: none; }
}

/* ---------- Member card (credit-card shape, prints at real size) ---------- */
.member-card { background: linear-gradient(150deg, var(--brand) 0%, var(--ink) 80%); color: #fff; position: relative; overflow: hidden; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-width: 420px; width: 100%; margin: 0 auto; aspect-ratio: 85.6 / 54; }
.mc-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent); }
.mc-body { display: flex; gap: 14px; align-items: center; flex: 1; }
.mc-qr { background: #fff; padding: 8px; border-radius: 10px; flex: none; }
.mc-qr img, .mc-qr canvas { display: block; width: 120px; height: 120px; }
.mc-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mc-name { font-size: 20px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.mc-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; letter-spacing: 0.08em; }
.mc-since { font-size: 12px; color: #D6E0F7; }
.mc-note { font-size: 11px; color: #D6E0F7; line-height: 1.3; }
@media print {
  .member-card.printable { position: absolute; inset: 10mm auto auto 10mm; width: 85.6mm; height: 54mm; max-width: none; aspect-ratio: auto; padding: 4mm; border-radius: 3mm; gap: 2mm;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .member-card .mc-qr img, .member-card .mc-qr canvas { width: 30mm; height: 30mm; }
  .member-card .mc-name { font-size: 12pt; } .member-card .mc-code { font-size: 9pt; }
  .member-card .mc-top, .member-card .mc-since, .member-card .mc-note { font-size: 6.5pt; }
}

/* ---------- Feedback rating ---------- */
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rating button { flex-direction: column; gap: 2px; font-size: 30px; padding: 8px 2px; min-height: 76px; background: #fff; color: var(--ink); border-color: var(--line); }
.rating button span { font-size: 12px; font-weight: 700; }
.rating button[aria-checked="true"] { background: var(--sun); border-color: var(--brand); }

/* ---------- Member page: welcome, register steps, account ---------- */
.steps-intro { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps-intro li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.steps-intro b { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-size: 17px; }
.steps-intro + h2 { padding-top: 14px; border-top: 2px solid var(--line); }

.stepper { display: flex; flex-direction: column; gap: 8px; }
.stepper-label { font-size: 14px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stepper-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stepper-bar i { height: 8px; border-radius: 99px; background: var(--line); }
.stepper-bar i.on { background: var(--brand); }
.stepper-bar i.on:last-child { background: var(--kw-green); }
.step { display: flex; flex-direction: column; gap: 14px; }
#vRegister .notice { font-size: 16px; }
#vRegister .notice ul { line-height: 1.4; }

/* <details> can't be a flex box everywhere, so space its children directly */
details.card { display: block; }
details.card > * + *, details details > * + * { margin-top: 14px; }
details.card > button, details.card > label { width: 100%; }
details.card > button.link { width: auto; }
details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ""; width: 10px; height: 10px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); margin-right: 6px; flex: none; transition: transform 150ms ease; }
details[open] > summary::after { transform: rotate(-135deg); }
#vAccount > summary { font-size: 20px; }
#vAccount details { border-top: 2px solid var(--line); padding-top: 4px; }
#vAccount label.check { flex-direction: row; }

/* Pass screen: event details sit under the pass */
#vPass + #eventHead { margin-top: -4px; }
#vPass + #eventHead > span.small-print:first-child { display: none; }
#vPass + #eventHead h1 { font-size: 22px; }

.notice-more > summary { min-height: 44px; }
.notice-more > summary b::after { content: " · tap to read"; font-weight: 600; color: var(--muted); }
.notice-more[open] > summary b::after { content: ""; }
html[lang="fil"] .notice-more > summary b::after { content: " · pindutin para mabasa"; }
html[lang="fil"] .notice-more[open] > summary b::after { content: ""; }
.brand { line-height: 1.2; }
@media (max-width: 400px) { .brand-sub { display: none; } }

/* Flag-colour touches */
.tag { border-color: var(--brand); color: var(--brand); }
h1, h2 { color: var(--ink); }
.card.dark h1, .card.dark h2, .result h1, .result h2 { color: #fff; }
.steps-intro b { background: var(--sun); color: var(--ink); }
.steps-intro li:nth-child(2) b { background: var(--ph-red); color: #fff; }
.steps-intro li:nth-child(3) b { background: var(--kw-green); color: #fff; }
.mc-top { color: var(--sun); }
.pass .label { color: var(--sun); }
@media print { body { border-top: 0; } }

/* ID card photos (sign-up, My account, staff/admin viewer) */
.idshots { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.shot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 110px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; cursor: pointer; overflow: hidden; font-weight: 700; color: var(--brand, #0038A8); margin: 0; }
.shot small { font-weight: 500; color: var(--muted); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot.has span { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(19,33,60,.75); color: #fff; font-size: 13px; padding: 3px; }
.shot.has span small, .shot.has span br { display: none; }
.shot.busy { opacity: .6; }
.id-photos { display: flex; flex-direction: column; gap: 10px; }
.id-photos img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
input.filled { background: #EEF7EE; }

/* ================= App look (inspired by event-app references) ================= */
/* Soft, rounded surfaces instead of outlines */
.card { border: 0; border-radius: 24px; box-shadow: 0 1px 2px rgba(11, 31, 77, 0.06), 0 10px 28px rgba(11, 31, 77, 0.08); }
button, .btn { border-radius: 18px; }
button.small, .btn.small { border-radius: 999px; }
h1 { letter-spacing: -0.02em; }
h2 { letter-spacing: -0.015em; }
.pass { border-radius: 28px; box-shadow: 0 14px 34px rgba(0, 40, 120, 0.28); }
input, select, textarea { border-radius: 14px; }

/* Greeting header: only on the home screen */
.hello { display: none; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
body[data-view="vHome"] .hello { display: flex; }
.hello-sub { display: block; font-size: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ph-red); }
.hello h1 { font-size: 34px; line-height: 1.1; margin-top: 4px; overflow-wrap: anywhere; }
.avatar { flex: none; width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50%; border: 3px solid #fff;
  background: linear-gradient(140deg, var(--sun), #F2A900); color: var(--ink); font-size: 20px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(11, 31, 77, 0.18); }
button.avatar:hover:not(:disabled) { background: linear-gradient(140deg, #FFE04D, var(--sun)); border-color: #fff; }

/* Home */
.home { display: flex; flex-direction: column; gap: 14px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec-head h2 { font-size: 22px; }

/* Event cards row */
.ev-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 14px; scrollbar-width: none; }
.ev-rail::-webkit-scrollbar { display: none; }
.ev-rail:has(> .ev-card:only-child) { grid-auto-columns: 100%; }
.ev-card { --g1: var(--ph-blue); --g2: var(--ink); --fg: #fff; --sunc: rgba(252, 209, 22, 0.95);
  position: relative; overflow: hidden; isolation: isolate; scroll-snap-align: start; min-height: 300px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px;
  border-radius: 28px; color: var(--fg); text-decoration: none;
  background: linear-gradient(160deg, var(--g1) 0%, var(--g2) 100%);
  box-shadow: 0 12px 26px rgba(11, 31, 77, 0.22); transition: transform 120ms ease; }
.ev-card:active { transform: scale(0.98); }
.ev-card:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
.ev-card.light { --fg: var(--ink); --sunc: rgba(255, 255, 255, 0.95); }
.ev-card.past { filter: saturate(0.35); opacity: 0.85; }
/* Sunrise motif from the KabayanPass logo */
.ev-sun { position: absolute; z-index: -1; right: -40px; top: 70px; width: 240px; height: 120px;
  background: radial-gradient(circle at 50% 100%, var(--sunc) 0 38%, transparent 39%),
    repeating-conic-gradient(from -90deg at 50% 100%, var(--sunc) 0deg 7deg, transparent 7deg 22.5deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, #000 0 70%, transparent 71%);
  mask: radial-gradient(circle at 50% 100%, #000 0 70%, transparent 71%); opacity: 0.55; }
.ev-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ev-count { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--sun); color: var(--ink); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-card.light .ev-count { background: #fff; }
.ev-count:empty { display: none; }
.ev-count[data-state="live"] { background: #3DDC84; color: #0B2E1A; }
.ev-count[data-state="live"]::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: pulse 1s infinite alternate; }
.ev-count[data-state="ended"] { background: rgba(255, 255, 255, 0.85); color: var(--ink); }
.ev-date { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 62px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.95); color: var(--ink); line-height: 1; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12); }
.ev-date:empty { display: none; }
.ev-date b { font-size: 26px; font-weight: 800; }
.ev-date span { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; margin-top: 4px; color: var(--ph-red); }
.ev-foot { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 22px;
  background: rgba(6, 16, 40, 0.32); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ev-card.light .ev-foot { background: rgba(255, 255, 255, 0.6); }
.ev-name { font-size: 22px; font-weight: 800; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-foot small { font-size: 14px; font-weight: 600; opacity: 0.9; }
.ev-status { align-self: flex-start; margin-top: 6px; padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 800;
  background: #fff; color: var(--ink); }
.ev-status.ok { background: #3DDC84; color: #0B2E1A; }
.ev-card.skeleton { background: linear-gradient(100deg, #E3E8F3 30%, #F1F4FA 50%, #E3E8F3 70%); background-size: 300% 100%;
  animation: shimmer 1.2s linear infinite; box-shadow: none; }
@keyframes shimmer { to { background-position: -150% 0; } }

.empty { align-items: center; text-align: center; }
.empty-art { width: 76px; height: 76px; border-radius: 20px; background: url("favicon.svg") center / cover; box-shadow: 0 8px 18px rgba(0, 56, 168, 0.25); }

/* Quick tiles */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 120px; padding: 16px; text-align: left;
  border: 0; border-radius: 24px; background: #fff; color: var(--ink); font-size: 16px; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 2px rgba(11, 31, 77, 0.06), 0 10px 28px rgba(11, 31, 77, 0.08); }
button.tile:hover:not(:disabled), a.tile:hover { background: var(--tint); border-color: transparent; }
.tile b { display: block; font-size: 17px; font-weight: 800; line-height: 1.2; }
.tile small { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.tile-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--tint); color: var(--brand); }
.tile-ico.red { background: #FCE8EA; color: var(--ph-red); }
.tile-ico svg, .tabbar svg { width: 24px; height: 24px; }

/* Bottom tab bar */
.tabbar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(528px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; border-radius: 26px; background: #fff;
  box-shadow: 0 10px 30px rgba(11, 31, 77, 0.2), 0 0 0 1px rgba(11, 31, 77, 0.05); }
.tabbar[hidden] { display: none; }
.tabbar button, .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 58px; padding: 6px 2px; border: 0; border-radius: 18px; background: none; color: var(--muted);
  font-size: 13px; font-weight: 800; text-decoration: none; }
.tabbar button:hover:not(:disabled), .tabbar a:hover { background: var(--tint); border-color: transparent; color: var(--brand); }
.tabbar [aria-current] { background: var(--tint); color: var(--brand); box-shadow: inset 0 -4px 0 var(--sun); }
body.has-tabs .wrap { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
body.has-tabs .help-foot { display: none; }

/* Event header: coloured hero before joining, plain card under the pass */
#eventHead { --g1: var(--ph-blue); --g2: var(--ink); position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, var(--g1), var(--g2)); color: #fff; }
#eventHead.light { color: var(--ink); }
#eventHead h1 { color: inherit; }
#eventHead .small-print { color: inherit; opacity: 0.85; }
#eventHead .ev-kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; color: var(--sun); }
#eventHead.light .ev-kicker { color: var(--ink); }
.ev-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ev-hero-top:has(.ev-count:empty):has(.ev-date:empty) { display: none; }
#eventHead .btn.secondary, #eventHead button.secondary { border-color: #fff; }
#vPass + #eventHead { background: #fff; color: var(--ink); }
#vPass + #eventHead .ev-hero-top, #vPass + #eventHead .ev-kicker { display: none; }

@media (max-width: 360px) {
  .quick { grid-template-columns: 1fr; }
  .hello h1 { font-size: 28px; }
}
@media print { .tabbar, .hello { display: none !important; } }
.ev-rail.open { grid-auto-columns: 70%; }
.ev-rail.open .ev-card { min-height: 250px; }
.ev-status.join { background: var(--sun); color: var(--ink); }
.ev-card.light .ev-status.join { background: var(--ink); color: #fff; }
.ev-rail[hidden] { display: none; }

/* Welcome hero */
.card.welcome { padding: 0 20px 20px; overflow: hidden; gap: 14px; }
.card.welcome > .welcome-hero { margin: 0 -20px 6px; }
.welcome-hero { --sunc: rgba(252, 209, 22, 0.95); position: relative; isolation: isolate; overflow: hidden;
  padding: 24px 20px 28px; color: #fff; background: linear-gradient(160deg, var(--ph-blue) 0%, var(--ink) 100%); }
.welcome-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--flag-stripe); }
.welcome-hero .ev-sun { right: -90px; top: auto; bottom: 6px; opacity: 0.28; }
.welcome-hero h1, .welcome-hero p, .welcome-hero .hello-sub { position: relative; }
.welcome-hero .hello-sub { color: var(--sun); }
.welcome-hero h1 { color: #fff; font-size: 28px; line-height: 1.15; margin-top: 6px; max-width: 15ch; }
.welcome-hero p { margin-top: 10px; color: #D6E0F7; font-weight: 600; max-width: 24ch; }

/* Narrow phones: keep the brand and the top-bar pills from touching */
@media (max-width: 389px) {
  .topbar { gap: 6px; }
  .brand { font-size: 13px; gap: 6px; }
  .brand img { width: 24px; height: 24px; }
  .topbar .tag { font-size: 11px; padding: 3px 7px; }
  #langBtn { font-size: 13px; padding: 5px 10px; min-height: 38px; }
}

/* DEMO banner (every page) and About line */
.demo-banner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px;
  background: var(--sun); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; text-align: center; }
.demo-banner b { padding: 2px 8px; border-radius: 6px; background: var(--ink); color: var(--sun); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; }
.about { margin-top: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.door-wrap .about { color: rgba(255, 255, 255, 0.7); margin: 0; }
@media print { .demo-banner { border: 2px solid #000; } }

/* =====================================================================
   Member app shell (body.app): native-style chrome instead of a web page
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body.app {
  --nav-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --app-bg: #F2F3F7;
  --hair: rgba(11, 31, 77, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, Roboto, 'Segoe UI', 'Figtree', sans-serif;
  background: var(--app-bg); border-top: 0; border-image: none;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
body.app button, body.app .btn, body.app .navbar, body.app .tabbar, body.app summary, body.app .tile, body.app .ev-card,
body.app h1, body.app h2, body.app .row { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.app .wrap { padding-top: calc(var(--nav-h) + var(--safe-t) + 8px); padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
body.app.has-tabs .wrap { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }

/* ---- Top bar ---- */
.navbar { display: none; }
body.app .navbar { position: fixed; z-index: 50; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 8px; height: calc(var(--nav-h) + var(--safe-t)); padding: var(--safe-t) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: rgba(242, 243, 247, 0.82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 160ms ease; }
body.app .navbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--flag-stripe); opacity: 0.9; }
body.app.nav-shadow .navbar { box-shadow: 0 1px 0 var(--hair); }
.nav-left { display: flex; align-items: center; min-width: 0; }
.nav-brand { font-size: 17px; }
body.app.has-back .nav-brand { display: none; }
.nav-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 0; margin-left: -6px; border: 0; background: none;
  color: var(--brand); font-size: 17px; font-weight: 500; }
.nav-back[hidden] { display: none; }
.nav-back svg { width: 26px; height: 26px; }
button.nav-back:hover:not(:disabled) { background: none; color: var(--brand-deep); }
.nav-title { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 700; color: var(--ink);
  opacity: 0; transform: translateY(6px); transition: opacity 160ms ease, transform 160ms ease; }
body.app.scrolled .nav-title, body.app.title-fixed .nav-title { opacity: 1; transform: none; }
.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
body.app .nav-right .tag { font-size: 12px; }
.demo-pill { min-height: 30px; padding: 3px 10px; border-radius: 999px; border: 0; background: var(--sun); color: var(--ink);
  font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }
button.demo-pill:hover:not(:disabled) { background: #FFE04D; border: 0; }
body.app #langBtn { min-height: 30px; padding: 3px 10px; border: 0; border-radius: 999px; background: rgba(0, 56, 168, 0.1); color: var(--brand);
  font-size: 13px; font-weight: 700; }
body.app.has-tabs #langBtn { display: none; } /* signed in: language lives in Account */
@media (max-width: 380px) { body.app .brand-name { font-size: 15px; } body.app .nav-brand img { width: 26px; height: 26px; } }

/* DEMO note: on sign-up / log-in screens, or when the pill is tapped */
body.app .demo-banner { display: none; border-radius: 16px; justify-content: flex-start; text-align: left; padding: 12px 14px; font-size: 15px; }
body.app[data-view="vRegister"] .demo-banner, body.app[data-view="vLogin"] .demo-banner, body.app.show-demo .demo-banner { display: flex; flex-wrap: nowrap; }

/* ---- Screens: no web "cards" around forms; big titles; slide in ---- */
body.app main > .card:not(#eventHead):not(#vAccount) { background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
body.app main > .card > h2:first-child, body.app .step > h2:first-child, body.app .screen-title {
  font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -0.025em; margin: 2px 0 2px; }
body.app h1, body.app h2, body.app h3 { font-family: inherit; }
body.app #vAccount > summary { display: none; }
.screen-title { display: none; }
body.app .screen-title { display: block; }
body.app main > .enter { animation: screen-in 240ms cubic-bezier(.2, .8, .2, 1); }
@keyframes screen-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body.app main > .enter { animation: none; } }

/* Account is its own tab; it never trails under other screens */
body.app:not([data-view="vAccount"]):not([data-view="vConsent"]) #vAccount { display: none !important; }

/* ---- Native-style controls ---- */
body.app button, body.app .btn { min-height: 54px; border-radius: 14px; font-size: 17px; font-weight: 650; letter-spacing: 0; }
body.app button.secondary, body.app .btn.secondary { background: rgba(0, 56, 168, 0.1); border-color: transparent; color: var(--brand); }
body.app button.secondary:hover:not(:disabled), body.app .btn.secondary:hover { background: rgba(0, 56, 168, 0.16); border-color: transparent; }
body.app button.small, body.app .btn.small { min-height: 40px; font-size: 15px; }
body.app button.link { min-height: 44px; text-decoration: none; color: var(--brand); font-weight: 600; font-size: 16px; }
body.app button.link:hover:not(:disabled) { background: none; }
body.app label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
body.app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), body.app select, body.app textarea {
  min-height: 54px; border: 1px solid #DDE2EC; border-radius: 14px; background: #fff; font-size: 18px; font-weight: 500; color: var(--ink);
  box-shadow: none; outline: none; }
body.app input:focus, body.app select:focus, body.app textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 56, 168, 0.18); outline: none; }
body.app .hint { font-weight: 500; }
body.app .msg { border-radius: 14px; }
body.app .help-foot { display: none; text-align: center; margin: 0; }
body.app[data-view="vWelcome"] .help-foot { display: block; }
body.app .help-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
body.app > main > .about { display: none; }
body.app[data-view="vWelcome"] > main > .about { display: block; }
body.app.has-tabs .rp-btn { display: none; } /* signed in: "Report a problem" is a row in Account */
body.app #rgBack, body.app #vLogin [data-back], body.app #cBack { display: none; } /* back is in the top bar */

/* Welcome: full-bleed hero */
body.app #vWelcome { gap: 18px; }
body.app #vWelcome .welcome-hero { border-radius: 26px; }
body.app #vWelcome .steps-intro { background: #fff; border-radius: 20px; padding: 16px; }
body.app #vWelcome .steps-intro + h2 { border-top: 0; padding-top: 4px; font-size: 22px; letter-spacing: -0.01em; }

/* Home greeting is the large title */
body.app .hello h1 { font-size: 32px; letter-spacing: -0.025em; }
body.app .avatar { width: 48px; height: 48px; min-height: 0; font-size: 18px; border-radius: 50%; }

/* ---- Tab bar: floating glass ---- */
body.app .tabbar { grid-template-columns: repeat(3, 1fr); width: min(420px, calc(100% - 32px)); padding: 6px; border-radius: 30px;
  background: rgba(255, 255, 255, 0.78); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 8px 28px rgba(11, 31, 77, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 0 0.5px rgba(11, 31, 77, 0.12); }
body.app .tabbar button { min-height: 54px; border-radius: 24px; font-size: 12px; font-weight: 600; gap: 2px; }
body.app .tabbar [aria-current] { box-shadow: none; background: rgba(0, 56, 168, 0.1); }
body.app .tabbar svg { width: 25px; height: 25px; }

/* ---- Account: settings list ---- */
body.app #vAccount { background: transparent; box-shadow: none; padding: 0; border-radius: 0; display: flex; flex-direction: column; gap: 8px; }
body.app #vAccount[hidden] { display: none; }
.acct-profile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 6px; background: #fff; border-radius: 20px; }
.acct-profile .avatar { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: linear-gradient(140deg, var(--sun), #F2A900); color: var(--ink); font-size: 20px; font-weight: 800; box-shadow: none; }
.acct-profile b { display: block; font-size: 19px; }
.acct-profile small { color: var(--muted); font-size: 14px; font-weight: 500; }
.group-label { margin: 14px 16px 0; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.group { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: #fff; border-radius: 20px; }
.group.list { gap: 0; padding: 0 0 0 16px; overflow: hidden; }
.group.list > .row, .group.list > details > summary { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: 8px 16px 8px 0;
  border: 0; border-radius: 0; background: none; color: var(--ink); font-size: 17px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.group.list > * + * { box-shadow: 0 -0.5px 0 var(--hair); }
.group.list > .row::after, .group.list > details > summary::after { content: ""; margin-left: auto; flex: none; width: 8px; height: 8px;
  border-right: 2.2px solid #B9C0CE; border-bottom: 2.2px solid #B9C0CE; transform: rotate(-45deg); margin-right: 4px; transition: transform 150ms ease; }
.group.list > details[open] > summary::after { transform: rotate(45deg); }
body.app .group.list > .row:hover:not(:disabled), .group.list > a.row:hover { background: none; color: var(--ink); }
.group.list > .row:active, .group.list > details > summary:active { background: rgba(11, 31, 77, 0.05); }
.group.list > details { border-top: 0 !important; padding: 0 !important; }
.group.list > details[open] { padding: 0 16px 16px 0 !important; }
.group.list > details[open] > summary { margin-bottom: 4px; }
.group.list > details > *:not(summary) { margin-top: 12px; }
.group.list > details > button, .group.list > details > label { width: 100%; }
.row-text { flex: 1; min-width: 0; }
.row-val { color: var(--muted); font-size: 16px; }
.row-ico { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; }
.row-ico svg { width: 19px; height: 19px; }
.row-ico.green { background: var(--kw-green); } .row-ico.red { background: var(--ph-red); }
.row-ico.purple { background: #5B4BC4; } .row-ico.orange { background: #E8590C; } .row-ico.gray { background: #8A93A6; }
.group.list > details.danger > summary { color: var(--ph-red); }
body.app #vAccount .about { margin: 10px 0 0; }
body.app #vAccount .check { flex-direction: row; }

/* Member card + pass screens */
body.app #vCard .screen-title { margin-bottom: 4px; }
body.app .pass { border-radius: 30px; }

/* ---- App shell fixes ---- */
/* Small controls in the bar keep their own size (not full button height) */
body.app .demo-pill { min-height: 30px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
body.app .nav-back { min-height: 44px; padding: 0 8px 0 0; border-radius: 10px; font-size: 17px; font-weight: 500; }
body.app.scrolled .nav-brand, body.app.title-fixed .nav-brand { opacity: 0; pointer-events: none; }
.nav-brand { transition: opacity 140ms ease; }
/* Touch screens: no sticky "hover" colours on app controls */
body.app .tabbar button:hover:not(:disabled) { background: none !important; color: var(--muted) !important; border-color: transparent !important; }
body.app .tabbar [aria-current]:hover:not(:disabled), body.app .tabbar [aria-current] { background: rgba(0, 56, 168, 0.1) !important; color: var(--brand) !important; }
body.app .nav-back:hover:not(:disabled) { background: none !important; border-color: transparent !important; color: var(--brand) !important; }
body.app .demo-pill:hover:not(:disabled) { background: var(--sun) !important; color: var(--ink) !important; }
body.app .group.list > .row:hover:not(:disabled) { background: none !important; color: var(--ink) !important; border-color: transparent !important; }
body.app .group.list > .row:active { background: rgba(11, 31, 77, 0.06) !important; }
body.app button.avatar:hover:not(:disabled) { background: linear-gradient(140deg, var(--sun), #F2A900) !important; border-color: #fff !important; color: var(--ink) !important; }
body.app .tile:hover { background: #fff !important; }
body.app button:not(.secondary):not(.link):not(.good):not(.bad):active:not(:disabled) { background: var(--brand-deep); }
/* Welcome hero sits inside the screen margins */
body.app #vWelcome .welcome-hero { margin: 0; padding: 24px 20px 26px; }
/* Jumping to a screen or field never hides it under the top bar */
body.app main > *, body.app input, body.app .step { scroll-margin-top: calc(var(--nav-h) + var(--safe-t) + 16px); }
/* Member card has its own back button when it is not a tab (help-desk device) */
body.app:not(.has-tabs) #cBack { display: block; }
/* Signed out: "Report a problem" is a small round button that doesn't cover forms */
body.app .rp-btn { width: 46px; height: 46px; min-height: 0; padding: 0; border: 0; border-radius: 50%; font-size: 0; overflow: hidden;
  background: rgba(255, 255, 255, 0.9); color: var(--brand); box-shadow: 0 4px 14px rgba(11, 31, 77, 0.2); }
body.app .rp-btn::before { content: ""; display: block; width: 22px; height: 22px; margin: auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M5 21V4M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M5 21V4M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E") center / contain no-repeat; }
body.app .rp-btn:hover:not(:disabled) { background: #fff !important; color: var(--brand) !important; border: 0 !important; }
/* Secondary app pages (Help & hotlines) */
body.app .large-title { font-size: 32px; line-height: 1.12; font-weight: 800; letter-spacing: -0.025em; margin: 2px 0 0; }
body.app a.nav-back { text-decoration: none; }
body.app[data-view="help"] .card { box-shadow: none; border-radius: 20px; }
body.app[data-view="help"] > main > .about { display: block; }
body.app span.demo-pill { display: inline-flex; align-items: center; background: var(--sun); color: var(--ink); }
/* iPhone app runs edge to edge: the top bar covers the status bar area, the tab bar the home-indicator area */
#vNotices:has(#noticeList:empty) { display: none !important; }
/* Top bar: the brand name only, on one line */
body.app .navbar .brand-sub { display: none; }
body.app .navbar .brand { white-space: nowrap; }
/* No empty space when a row has no cards */
.ev-rail:empty { display: none; }

/* =====================================================================
   Look from Chris's mockup canvas ("KabayanPass App Mockup", 2026-11-07)
   ===================================================================== */
body.app {
  --nav-h: 59px;
  --app-bg: #F4F6FB;
  --mk-ink: #0B1F4D; --mk-muted: #4B5872; --mk-label: #6B7690;
  --mk-tint: #E6ECF8; --mk-field: #E9EDF5; --mk-line: #E1E6F0; --mk-row: #EEF1F6;
  --mk-stripe: linear-gradient(90deg, #0038A8 0 40%, #FCD116 40% 55%, #CE1126 55% 75%, #007A3D 75%);
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--app-bg); color: var(--mk-ink);
}

/* Top bar: flag stripe on top, white bar, logo or back + screen name, pills on the right */
body.app .navbar { display: flex; justify-content: space-between; gap: 10px; padding: calc(var(--safe-t) + 5px) 18px 0;
  background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--mk-line); box-shadow: none; }
body.app .navbar::before { content: ""; position: absolute; left: 0; right: 0; top: var(--safe-t); height: 5px; background: var(--mk-stripe); }
body.app .navbar::after { display: none; }
body.app.nav-shadow .navbar { box-shadow: none; }
body.app .nav-left { flex: 1; gap: 6px; min-width: 0; }
body.app .nav-brand { font-size: 16px; font-weight: 800; gap: 8px; }
body.app .nav-brand img { width: 26px; height: 26px; border-radius: 7px; }
body.app .brand-pass { color: var(--mk-ink); }
body.app.has-title .nav-brand { display: none; }
body.app .nav-back { margin-left: -8px; padding: 0 2px 0 0; min-height: 44px; min-width: 32px; }
body.app .nav-back span { display: none; }
body.app .nav-back svg { width: 24px; height: 24px; }
body.app .nav-title { opacity: 1; transform: none; max-width: none; flex: 1; min-width: 0; font-size: 16px; font-weight: 800; color: var(--mk-ink); }
body.app .nav-title:empty { display: none; }
body.app .nav-right { gap: 6px; }
body.app .demo-pill, body.app #langBtn { min-height: 0; height: auto; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; line-height: 1.3; }
body.app #langBtn, body.app.has-tabs #langBtn { display: inline-flex; background: var(--mk-tint); color: #0038A8; font-size: 0; }
body.app #langBtn::after { content: "EN · TL"; font-size: 11px; }
body.app #langBtn:hover:not(:disabled) { background: var(--mk-tint) !important; color: #0038A8 !important; }
body.app .wrap { padding-top: calc(var(--nav-h) + var(--safe-t) + 18px); padding-left: 20px; padding-right: 20px; gap: 14px; }

/* Type, buttons, fields */
body.app main > .card > h2:first-child, body.app .step > h2:first-child, body.app .screen-title, body.app .welcome-title {
  font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -0.01em; color: var(--mk-ink); margin: 0; }
body.app button, body.app .btn { min-height: 52px; border-radius: 16px; font-size: 16px; font-weight: 700; }
body.app button:not(.secondary):not(.link):not(.good):not(.bad):not(.row):not(.tile):not(.avatar):not(.nav-back):not(.demo-pill):not(#langBtn):not(.rp-btn) { background: #0038A8; border-color: #0038A8; }
body.app button.secondary, body.app .btn.secondary { background: var(--mk-tint); color: #0038A8; border-color: transparent; }
body.app label { font-size: 13px; font-weight: 700; color: var(--mk-muted); }
body.app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), body.app select, body.app textarea {
  min-height: 50px; border: 0; border-radius: 14px; background: var(--mk-field); font-size: 16px; font-weight: 600; color: var(--mk-ink); }
body.app input:focus, body.app select:focus, body.app textarea:focus { box-shadow: 0 0 0 2px #0038A8; background: #fff; }
body.app .small-print, body.app .hint { color: var(--mk-muted); }

/* Welcome */
body.app .welcome-title { font-size: 30px; margin-top: 10px; }
body.app .welcome-sub { margin: -4px 0 4px; color: var(--mk-muted); font-size: 16px; line-height: 1.4; }
.steps-list { background: #fff; border-radius: 18px; overflow: hidden; }
.step-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--mk-row); }
.step-row:first-child { border-top: 0; }
.step-row .num { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #0038A8; color: #fff; font-weight: 800; }
.step-row .num.green { background: #007A3D; }
.step-row b { display: block; font-size: 15px; }
.step-row small { display: block; color: var(--mk-muted); font-size: 14px; }
body.app #vWelcome > h2 { margin-top: 6px; font-size: 18px; font-weight: 800; }
body.app[data-view="vWelcome"] > main > .about { font-size: 11px; color: var(--mk-label); margin-top: 10px; }

/* Register */
body.app .stepper-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.app .stepper-bar i { height: 6px; border-radius: 3px; background: #D3DAE8; }
body.app .stepper-bar i.on, body.app .stepper-bar i.on:last-child { background: #0038A8; }
.stepper-names { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--mk-muted); }
#vRegister[data-step="1"] .stepper-names span:nth-child(1), #vRegister[data-step="2"] .stepper-names span:nth-child(2),
#vRegister[data-step="3"] .stepper-names span:nth-child(3) { color: #0038A8; }
body.app .step > h2:first-child { font-size: 26px; }
body.app .shot { border: 0 !important; background: var(--mk-tint) !important; color: #0038A8; border-radius: 16px !important; font-weight: 700; }

/* Home */
body.app .hello-sub { font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--mk-muted); }
body.app .hello h1 { font-size: 28px; letter-spacing: -0.01em; margin-top: 0; }
body.app .avatar, body.app button.avatar:hover:not(:disabled), .acct-profile .avatar { width: 46px; height: 46px; border: 0 !important; box-shadow: none;
  background: #0038A8 !important; color: #fff !important; font-size: 16px; font-weight: 800; }
body.app .sec-head h2 { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mk-label); margin: 4px 4px -4px; }
body.app #evRailHint { display: none !important; }
body.app .ev-rail { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; overflow: visible; scroll-snap-type: none; }
.ev-card2 { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 24px;
  background: #0038A8; color: #fff; text-decoration: none; box-shadow: 0 10px 24px rgba(0, 56, 168, 0.3); transition: transform 120ms ease; }
.ev-card2:active { transform: scale(0.98); }
.ev-card2.past { filter: saturate(0.4); opacity: 0.75; }
.ev-blob { position: absolute; z-index: -1; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(252, 209, 22, 0.18); }
.ev-head { display: flex; align-items: center; gap: 12px; }
.ev-date2 { flex: none; width: 58px; padding: 6px 0; border-radius: 14px; background: #fff; color: var(--mk-ink); text-align: center; line-height: 1; }
.ev-date2:empty { display: none; }
.ev-date2 .m { display: block; font-size: 11px; font-weight: 800; color: #CE1126; }
.ev-date2 b { display: block; font-size: 24px; font-weight: 800; margin: 3px 0; }
.ev-date2 .w { display: block; font-size: 11px; font-weight: 700; }
.ev-title { min-width: 0; }
.ev-title b { display: block; font-size: 19px; font-weight: 800; line-height: 1.2; }
.ev-title small { display: block; margin-top: 2px; font-size: 13px; opacity: 0.9; }
.ev-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-pills .ev-count, .ev-pills .pill { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.ev-pills .pill.soft { background: rgba(255, 255, 255, 0.18); font-weight: 700; }
.ev-pills .pill.ok { background: #007A3D; color: #fff; }
body.app .ev-rail.open { gap: 0; background: #fff; border-radius: 18px; overflow: hidden; }
.open-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--mk-row);
  color: var(--mk-ink); text-decoration: none; }
.open-row:first-child { border-top: 0; }
.open-row:active { background: rgba(11, 31, 77, 0.05); }
.open-text b { display: block; font-size: 15px; }
.open-text small { display: block; color: var(--mk-muted); font-size: 13px; }
.join-pill { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--mk-tint); color: #0038A8; font-size: 13px; font-weight: 800; }
body.app .tile { min-height: 0; padding: 14px; gap: 6px; border-radius: 18px; box-shadow: none; }
body.app .tile small { display: none; }
body.app .tile b { font-size: 14px; }
body.app .tile-ico { width: 24px; height: 24px; background: none !important; border-radius: 0; place-items: start; }
body.app .tile-ico.red { color: #CE1126; }
body.app #evEmpty { box-shadow: none; border-radius: 18px; }

/* Tab bar: plain white bar along the bottom */
body.app .tabbar { left: 0; right: 0; bottom: 0; transform: none; width: auto; display: flex; justify-content: space-around; gap: 0;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 12px)); border-radius: 0; background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--mk-line); box-shadow: none; }
body.app .tabbar button { flex: 0 0 auto; min-width: 72px; min-height: 48px; padding: 2px 6px; border-radius: 12px; font-size: 11px; font-weight: 700; color: var(--mk-label); }
body.app .tabbar [aria-current], body.app .tabbar [aria-current]:hover:not(:disabled) { background: none !important; color: #0038A8 !important; }
body.app .tabbar svg { width: 24px; height: 24px; }
body.app.has-tabs .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* Event Pass screen: date line and two calendar buttons under the pass */
body.app .pass { border-radius: 26px; }
body.app #vPass + #eventHead { background: transparent; box-shadow: none; padding: 0; gap: 10px; }
body.app #vPass + #eventHead h1, body.app #vPass + #eventHead #evVenue { display: none; }
body.app #vPass + #eventHead #evWhen { text-align: center; color: var(--mk-muted); font-size: 14px; margin: 0; }
body.app #eventHead .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.app #vPass + #eventHead .row .btn, body.app #vPass + #eventHead .row button { min-height: 46px; font-size: 14px; background: var(--mk-tint); color: #0038A8; border: 0; }

/* Member card: details left, QR right */
body.app .mc-body { flex-direction: row-reverse; }
body.app .member-card { border-radius: 20px; box-shadow: 0 10px 24px rgba(0, 56, 168, 0.3); }
body.app #cReissue { width: 100%; }

/* Account */
body.app #vAccount .screen-title { display: none; }
body.app .acct-profile { background: none; padding: 0; margin: 0 0 4px; }
body.app .acct-profile .avatar { width: 52px; height: 52px; font-size: 18px; }
body.app .acct-profile b { font-size: 20px; font-weight: 800; }
body.app .acct-profile small { font-size: 14px; color: var(--mk-muted); }
body.app .group-label { margin: 6px 4px -2px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--mk-label); }
body.app .group { border-radius: 18px; }
body.app .group.list { padding: 0; }
body.app .row-ico { display: none; }
body.app .group.list > .row, body.app .group.list > details > summary { min-height: 0; padding: 13px 16px; font-size: 15px; font-weight: 500; color: var(--mk-ink); }
body.app .group.list > * + * { box-shadow: none; border-top: 1px solid var(--mk-row); }
body.app .group.list > details[open] { padding: 0 16px 16px !important; }
body.app .group.list > details[open] > summary { padding-left: 0; padding-right: 0; }
body.app .row-val { color: var(--mk-label); font-size: 15px; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
body.app .row-val.ok { color: #007A3D; font-weight: 700; }
body.app .group.list > .row::after, body.app .group.list > details > summary::after { width: 7px; height: 7px; margin-left: 8px; border-width: 0 2px 2px 0; border-color: var(--mk-label); }
body.app .switch-row::after, body.app #logout::after, body.app #delSection > summary::after { display: none !important; }
body.app #logout { color: #0038A8; font-weight: 700; }
body.app #delSection > summary { color: #CE1126; font-weight: 700; }
body.app .switch-row { cursor: pointer; }
input.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 46px; height: 28px; min-height: 0; margin: 0; border-radius: 999px;
  background: #C9D1E0; transition: background 150ms ease; cursor: pointer; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 150ms ease; }
input.switch:checked { background: #007A3D; }
input.switch:checked::after { transform: translateX(18px); }
.contact-actions { display: flex; flex-direction: column; gap: 10px; }
.contact-actions:not(:has(button:not([hidden]))) { display: none; }
body.app #vAccount .about { font-size: 11px; color: var(--mk-label); }
/* fixes: tab buttons are not primary buttons; switch row lays out in one line */
body.app .tabbar button:not([aria-current]), body.app .tabbar button:not([aria-current]):hover:not(:disabled) { background: none !important; border-color: transparent !important; color: var(--mk-label) !important; }
body.app .group.list > label.switch-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
  font-size: 15px; font-weight: 500; color: var(--mk-ink); }

/* ---- Softer edges (like Chris's reference apps): shadows instead of hairlines ---- */
body.app { --soft: 0 1px 2px rgba(11, 31, 77, 0.04), 0 8px 24px rgba(11, 31, 77, 0.07); }
/* Top bar: no line at rest; a soft shadow once content scrolls under it */
body.app .navbar { border-bottom: 0; transition: box-shadow 160ms ease; }
body.app.nav-shadow .navbar { box-shadow: 0 1px 0 rgba(11, 31, 77, 0.06), 0 6px 18px rgba(11, 31, 77, 0.06); }
/* Tab bar: lifted with a soft upward shadow, no top line */
body.app .tabbar { border-top: 0; box-shadow: 0 -1px 0 rgba(11, 31, 77, 0.04), 0 -8px 24px rgba(11, 31, 77, 0.06); }
/* White surfaces: rounder, with a soft shadow */
body.app .steps-list, body.app .group, body.app #evEmpty, body.app .ev-rail.open, body.app .tile, body.app .notice, body.app #noticeList > * {
  border: 0; border-radius: 22px; box-shadow: var(--soft); }
body.app .ev-rail.open, body.app .group.list, body.app .steps-list { overflow: hidden; }
/* Dividers start at the text, not at the card edge */
body.app .step-row, body.app .open-row, body.app .group.list > * + * { border-top: 0 !important; position: relative; }
body.app .step-row + .step-row::before, body.app .open-row + .open-row::before, body.app .group.list > * + *::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: rgba(11, 31, 77, 0.08); }
body.app .step-row + .step-row::before { left: 64px; }
/* Tinted buttons and pills: no outline */
body.app button.secondary, body.app .btn.secondary, body.app .join-pill, body.app .demo-pill, body.app #langBtn { border: 0; }
/* Event cards and pass: same soft depth */
body.app .ev-card2 { box-shadow: 0 2px 4px rgba(0, 56, 168, 0.12), 0 12px 28px rgba(0, 56, 168, 0.22); }
body.app .pass, body.app .member-card { box-shadow: 0 2px 4px rgba(0, 40, 120, 0.12), 0 14px 32px rgba(0, 40, 120, 0.22); }
/* Fields: no border; gentle inner fill */
body.app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), body.app select, body.app textarea { border: 0 !important; }
body.app .notice.warning { border: 2px solid #E0A800; }
body.app .notice.emergency { border: 2px solid var(--bad); }

/* ----- Time slots and service queue (pass screen) ----- */
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 8px; }
.slot-list button.slot { min-height: 64px; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #fff !important; color: var(--brand) !important; border: 2px solid var(--line) !important; border-radius: 14px; font-size: 17px; }
.slot-list button.slot b { color: var(--ink); }
.slot-list button.slot span { font-size: 13px; font-weight: 700; color: var(--muted); }
.slot-list button.slot.on { border-color: var(--good) !important; background: #E3F3EA !important; color: var(--good) !important; }
.slot-list button.slot:disabled { opacity: .45; cursor: default; }
.slot-mine { margin: 6px 0; }
.q-ticket { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--tint); border-radius: 18px; padding: 14px; margin: 8px 0; }
.q-ticket b { font-size: 54px; line-height: 1; font-weight: 900; letter-spacing: .02em; }
.q-ticket .q-k { font-size: 13px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.q-ticket.turn { background: var(--sun); color: var(--ink); animation: qpulse 1.2s ease-in-out infinite; }
.q-ticket.turn .q-k { color: var(--ink); }
.q-ticket .q-go { font-size: 24px; font-weight: 900; }
@keyframes qpulse { 50% { transform: scale(1.03); } }
.q-services { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.q-svc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.q-svc button { flex: 0 0 auto; }
.push-card { padding: 12px 16px; }
.push-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.push-row button { flex: 0 0 auto; }
