:root {
  --bg: #F6F4EE; --card: #FFFFFF; --ink: #0E1311; --ink-2: #3B4440; --muted: #5E6762; --line: #E2DED3;
  --green: #1E5B43; --green-2: #174A36; --green-soft: #E3EDE7; --on-green: #FFFFFF;
  --amber: #8A5A00; --amber-soft: #FBF1DC;
  --radius: 18px; --tabs-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 50; border-radius: 10px; }
[hidden] { display: none !important; }

/* Shell */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.02em; font-size: 17px; min-height: 44px; }
.kk-badge { width: 32px; height: 32px; border-radius: 9px; background: var(--green); color: var(--on-green); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; letter-spacing: -.04em; }
.top-note { color: var(--muted); }
.demo-bar { background: var(--amber-soft); color: var(--amber); font-size: 13px; text-align: center; padding: 8px 16px; border-bottom: 1px solid #EEDDB8; }
main { max-width: 640px; margin: 0 auto; padding: 20px 16px; outline: none; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: #FFFFFF; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabs-h); text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; }
.tabs a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tabs a[aria-current="page"] { color: var(--green); }
.tabs a[aria-current="page"] svg { stroke-width: 2.1; }
@media (min-width: 720px) { .tabs { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: none; border-radius: 18px 18px 0 0; } }

/* Type */
h1, h2, h3 { margin: 0; letter-spacing: -.03em; }
.page-title { font-size: 34px; line-height: 1.02; font-weight: 700; letter-spacing: -.045em; }
.sub { color: var(--ink-2); font-size: 16px; line-height: 1.5; margin: 8px 0 0; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; }
.muted { color: var(--muted); }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; background: var(--green); color: var(--on-green); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--green-2); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: rgba(14,19,17,.05); }
.btn.soft { background: var(--green-soft); color: var(--green); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 16px -16px 0; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.field textarea { min-height: 88px; resize: vertical; }
.form { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Cards */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 12px; }
.deal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.deal + .deal { margin-top: 12px; }
.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deal-biz { font-weight: 600; font-size: 15px; }
.deal-meta { font-size: 13px; color: var(--muted); }
.deal h3 { font-size: 21px; line-height: 1.2; }
.deal p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.timer { display: flex; flex-direction: column; gap: 6px; }
.timer-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.timer-row .left { color: var(--green); font-variant-numeric: tabular-nums; }
.timer-row .left.urgent { color: #B42318; }
.bar { height: 6px; border-radius: 99px; background: var(--green-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width 1s linear; }
.bar i.urgent { background: #B42318; }
.kept-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 13px; white-space: nowrap; }
.demo-tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 600; letter-spacing: .04em; vertical-align: middle; }
.deal-actions { display: flex; gap: 8px; }
.deal-actions .btn { flex: 1; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* Directory */
.biz-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.biz-item:last-child { border-bottom: none; }
.biz-dot { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.biz-dot.live { background: var(--green); color: #fff; }
.biz-body { flex: 1; min-width: 0; }
.biz-name { font-weight: 600; font-size: 16px; }
.biz-perk { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.map { height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #E9E6DD; position: relative; }
.map .leaflet-tile-pane { filter: grayscale(1) contrast(.9) brightness(1.05); }
.map-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; color: var(--muted); font-size: 14px; }
.kk-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--green); border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; }
.kk-pin span { transform: rotate(45deg); color: #fff; font: 700 11px Geist, system-ui, sans-serif; letter-spacing: -.04em; }
.kk-pin.live { background: #0E1311; }

/* Member card */
.mcard { position: relative; aspect-ratio: 1.586; border-radius: 22px; background: var(--green); color: #fff; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; box-shadow: 0 20px 40px rgba(30,91,67,.28); }
.mcard::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.16), transparent 55%); pointer-events: none; }
.mcard-top { display: flex; justify-content: space-between; align-items: flex-start; }
.mcard-word { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.mcard-name { font-size: clamp(22px, 6vw, 28px); font-weight: 600; letter-spacing: -.03em; }
.mcard-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mcard-code { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 15px; letter-spacing: .12em; }
.mcard-kept { text-align: right; }
.mcard-kept b { display: block; font-size: 28px; letter-spacing: -.03em; line-height: 1; }
.mcard-kept span { font-size: 12px; opacity: .8; }
.qr-panel { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr-panel svg { width: min(240px, 70vw); height: auto; }
.visit { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.visit:last-child { border-bottom: none; }

/* Check-in */
.checkin-hero { text-align: center; padding: 8px 0 4px; }
.checkin-hero .biz-dot { margin: 0 auto 14px; width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.perk { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-weight: 600; text-align: center; }
.success { text-align: center; padding: 24px 8px; }
.success .big { font-size: 64px; font-weight: 700; letter-spacing: -.05em; color: var(--green); line-height: 1; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat b { display: block; font-size: 28px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.mini-deal { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-deal:last-child { border-bottom: none; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Sticker */
.sticker { max-width: 360px; margin: 0 auto; background: #fff; border-radius: 26px; padding: 26px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.sticker svg { width: 100%; height: auto; }
.sticker .name { font-size: 30px; font-weight: 700; letter-spacing: -.035em; }
@media print {
  .top, .tabs, .demo-bar, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  .sticker { border: 1px solid #ccc; }
}

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; transition: .25s; pointer-events: none; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast, .bar i { transition: none; } }

/* Directory */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { width: 100%; min-height: 50px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-flex; align-items: center; justify-content: center; font-style: normal; font: 700 8px Geist, system-ui, sans-serif; color: #fff; }
.lg-kk, .lg-live { width: 18px; height: 18px; border-radius: 50%; background: var(--green); }
.lg-live { background: #0E1311; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: #7D8782; border: 1px solid #fff; }
.biz-dot.listed { background: #EDEBE4; color: #5E6762; }
.notyet { display: flex; flex-direction: column; gap: 12px; text-align: center; margin-top: 16px; }
.wants { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wants b { font-size: 48px; letter-spacing: -.04em; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.wants span { color: var(--ink-2); font-size: 15px; }
.info { display: flex; flex-direction: column; gap: 4px; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.info-row span { color: var(--muted); flex: none; }
.info-row b, .info-row a { text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.claim { background: var(--green-soft); border-color: #CFE0D6; }
.pending { padding: 14px 16px; border-radius: 14px; background: var(--amber-soft); color: var(--amber); font-size: 14px; line-height: 1.5; }
