:root {
  --header: #60B3F9;
  --bg: #EAF4FE;
  --accent: #2E86DE;
  --text: #1A3A5C;
  --muted: #7A93AD;
  --border: #D3E6FA;
  --white: #fff;
  --green: #2B9A5B;
  --green-bg: #E3F4E8;
  --danger: #C0392B;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* header */
.hero { background: var(--header); color: var(--white); text-align: center; padding: 26px 20px 20px; padding-top: calc(26px + env(safe-area-inset-top)); }
.hero-logo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 12px; }
.hero h1 { font-size: 25px; line-height: 1.2; font-weight: 700; margin: 0 0 8px; }
.hero.compact { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top)); }
.hero.compact .hero-logo { width: 44px; height: 44px; margin: 0; flex: none; }
.hero.compact h1 { font-size: 18px; margin: 0; text-align: left; }
.hero p { font-size: 16px; margin: 0; opacity: .95; }

/* content */
.view { flex: 1; padding: 20px 24px 120px; }
.has-nav .view { padding-bottom: 110px; }

/* pill tabs */
.pills { display: flex; gap: 8px; margin-bottom: 20px; }
.pill {
  flex: 1; border: 1px solid var(--border); background: var(--white); color: var(--muted);
  border-radius: 12px; padding: 10px 4px; font-size: 14px; font-weight: 600; text-align: center;
}
.pill.active { background: var(--header); border-color: var(--header); color: var(--white); }
.pills.four .pill { font-size: 12.5px; padding: 10px 2px; }

/* forms */
.lead { text-align: center; color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 22px; }
.field { margin-bottom: 18px; }
.label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; line-height: 1.6; }
.input { width: 100%; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; font-size: 16px; color: var(--text); outline: none; }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: #A4B6C9; }
.fineprint { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.btn { width: 100%; border: 0; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 600; background: var(--accent); color: var(--white); display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn:disabled { background: var(--border); color: var(--muted); cursor: default; }
.btn.secondary { background: var(--white); color: var(--accent); border: 1px solid var(--border); }
.btn.small { width: auto; padding: 9px 18px; font-size: 14px; border-radius: 10px; }
.msg { text-align: center; font-size: 14px; margin: 14px 0 0; min-height: 20px; color: var(--accent); font-weight: 500; }
.msg.error { color: var(--danger); }

/* loading and error states */
.center-note { text-align: center; color: var(--muted); padding: 60px 24px; font-size: 15px; }

/* bottom nav */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px;
  display: flex; background: var(--white); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); z-index: 20;
}
.nav-item { flex: 1; background: none; border: 0; padding: 12px 0 10px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.nav-item.active { color: var(--accent); }

/* modal sheet */
.overlay { position: fixed; inset: 0; background: rgba(26, 58, 92, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--white); border-radius: 24px 24px 0 0; padding: 28px 24px calc(28px + env(safe-area-inset-bottom)); }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.sheet h2 { margin: 0 0 6px; font-size: 20px; text-align: center; }
.sheet .sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 18px; }

/* home */
.greet { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.greet h2 { margin: 0; font-size: 21px; font-weight: 600; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.stats { display: flex; gap: 14px; margin-bottom: 20px; }
.stat { flex: 1; background: var(--white); border: 1px solid var(--border); border-radius: 18px; padding: 18px 8px; text-align: center; }
.stat-num { font-size: 32px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: 14px; color: var(--muted); margin-top: 6px; }
.section-title { font-size: 17px; font-weight: 600; margin: 26px 0 12px; }

.voucher-card { position: relative; display: block; width: 100%; text-align: center; background: var(--green-bg); border: 2px solid var(--green); border-radius: 18px; padding: 16px 14px; margin-bottom: 14px; color: var(--text); font-family: inherit; overflow: hidden; }
.voucher-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.voucher-sub { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.voucher-img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; display: block; }

.promo { background: var(--white); border: 1px solid var(--border); border-radius: 18px; margin-bottom: 16px; overflow: visible; position: relative; }
.promo-media { position: relative; }
.promo-media img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 18px 18px 0 0; }
.promo-noimg { height: 8px; }
.promo-text { padding: 14px 16px 16px; }
.promo-title { font-size: 17px; font-weight: 700; }
.promo-body { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* red starburst badge: the image is blank, the badge text is overlaid */
.burst { position: absolute; top: -12px; left: -8px; width: 86px; height: 86px; background: url('/starburst.png') center / contain no-repeat; color: #fff; font-weight: 700; font-size: 11px; line-height: 1.15; text-align: center; display: flex; align-items: center; justify-content: center; padding: 16px 14px; transform: rotate(-12deg); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); z-index: 2; word-break: break-word; }
.burst.small { width: 62px; height: 62px; font-size: 8.5px; padding: 11px 9px; top: -6px; left: -6px; }

/* QR sheet */
.qr-box { display: flex; justify-content: center; margin: 4px 0 14px; }
.qr-canvas { display: block; border-radius: 14px; border: 1px solid var(--border); }
.cashier { text-align: center; color: var(--muted); font-size: 14px; margin: 0; }

/* membership card */
.card-box { background: var(--white); border-radius: 28px; padding: 22px 20px 26px; text-align: center; box-shadow: 0 1px 0 var(--border); }
.member-name { font-size: 17px; font-weight: 600; margin-top: 18px; }
.member-no { font-size: 15px; color: var(--muted); margin-top: 2px; }
.card-box .cashier { margin-top: 6px; font-weight: 500; }
.card-box .qr-box { margin-top: 16px; margin-bottom: 0; }

.tier-badge { position: relative; border-radius: 22px; padding: 22px 16px 20px; color: #fff; overflow: hidden; }
.tier-glyph { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .22); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.tier-glyph img { width: 34px; height: auto; display: block; }
.tier-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .9; font-weight: 600; }
.tier-name { font-size: 32px; font-weight: 700; line-height: 1.15; margin: 2px 0 4px; }
.tier-mult { font-size: 14px; font-weight: 500; opacity: .95; }
.tier-badge.cub { background: linear-gradient(135deg, #7DBEFA, #2E86DE); }
.tier-badge.honey { background: linear-gradient(135deg, #F8D060, #E39A12); color: #4A3000; }
.tier-badge.honey .tier-glyph { background: rgba(74, 48, 0, .12); }
.tier-badge.honey .tier-glyph img { filter: brightness(0.25) sepia(1) hue-rotate(5deg) saturate(3); }
.tier-badge.huggy { background: linear-gradient(135deg, #F7B6CE, #E1799F); }
.tier-badge.elite { background: linear-gradient(135deg, #1A3A5C, #2E6FB5); color: #FFE08A; box-shadow: inset 0 0 0 3px rgba(255, 224, 138, .55); }
.tier-badge.elite .tier-glyph { background: rgba(255, 224, 138, .18); }

.progress { margin-top: 22px; text-align: center; }
.progress-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.bar { height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.progress-note { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 10px 0 0; }

/* check-in */
.ck-head { text-align: center; margin-bottom: 14px; }
.bear-badge { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 5px var(--border); }
.bear-badge img { width: 28px; height: auto; display: block; }
.ck-title { font-size: 18px; font-weight: 700; }
.ck-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.points-circle { width: 128px; height: 128px; border-radius: 50%; margin: 0 auto 16px; background: var(--white); border: 6px solid var(--header); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 0 5px var(--border); }
.pc-num { font-size: 34px; font-weight: 700; color: var(--accent); line-height: 1; }
.pc-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ck-card { background: var(--white); border: 1px solid var(--border); border-radius: 22px; padding: 20px 14px 18px; }
.days { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-circle { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--border); color: var(--muted); }
.day-circle.big { width: 42px; height: 42px; font-size: 13px; }
.day-circle.done { background: var(--accent); color: #fff; font-size: 15px; }
.day-circle.next { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 2.5px var(--accent); }
.day-label { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.ck-btn { padding: 14px; }
.btn-bear { height: 24px; width: auto; display: block; }
.ck-card .msg { margin: 12px 0 0; min-height: 40px; font-size: 13.5px; }
.btn:disabled .btn-bear { filter: brightness(0) opacity(.3); }

/* rewards */
.rw-balance { background: var(--white); border: 1px solid var(--border); border-radius: 22px; padding: 20px 10px; text-align: center; margin-bottom: 16px; }
.rw-num { font-size: 44px; font-weight: 700; color: var(--accent); line-height: 1.05; }
.rw-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.rw-card { background: var(--white); border: 1px solid var(--border); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.rw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rw-title { font-size: 17px; font-weight: 700; }
.rw-cost { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.rw-btn { min-width: 96px; }
.rw-need { margin-top: 12px; }
.rw-need-text { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.rw-notes { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.55; }
.rw-notes p { margin: 0 0 6px; }
.rw-balance + .msg, .tab-body > .msg { margin: 0 0 12px; }

/* faq */
.faq-heading { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 10px; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 44px 16px 16px; font-size: 15px; font-weight: 600; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ''; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-answer { padding: 0 16px 16px; color: var(--text); font-size: 14px; line-height: 1.6; }
.faq-answer p { margin: 0 0 10px; color: #4B6783; }
.faq-tiers { margin-top: 6px; }
.faq-tier { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-radius: 12px; background: var(--bg); margin-bottom: 8px; }
.faq-tier.current { box-shadow: inset 0 0 0 2px var(--accent); background: #fff; }
.faq-tier-name { font-weight: 600; font-size: 15px; }
.faq-tier-rule { font-size: 12.5px; color: var(--muted); }
.faq-tier-mult { font-size: 20px; font-weight: 700; color: var(--accent); }
.faq-lines { margin-bottom: 10px; }
.faq-line { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--bg); margin-bottom: 8px; font-size: 14px; }
.faq-days { display: flex; gap: 6px; margin: 4px 0 12px; }
.faq-day { flex: 1; text-align: center; background: var(--bg); border-radius: 10px; padding: 8px 0; }
.faq-day.last { background: var(--header); color: #fff; }
.faq-day-pts { font-weight: 700; font-size: 14px; }
.faq-day-lbl { font-size: 10.5px; opacity: .8; margin-top: 2px; }

/* points history */
.hist { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 4px 16px; }
.hist-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.hist-row:last-child { border-bottom: 0; }
.hist-title { font-weight: 600; font-size: 14.5px; color: var(--text); }
.hist-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hist-pts { font-weight: 700; font-size: 16px; }
.hist-pts.up { color: #1F8A5B; }
.hist-pts.down { color: #C0392B; }
