:root {
  --navy: #0B3C8C;
  --navy-deep: #082A63;
  --green: #19B36B;
  --amber: #F5A623;
  --bg: #F3F5F9;
  --card: #FFFFFF;
  --ink: #17202E;
  --sub: #5E6B7D;
  --line: #E1E6EE;
  --danger: #D93843;
  --radius: 16px;
  --tabs-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--ink); background: #DDE2EA;
  -webkit-text-size-adjust: 100%; word-break: keep-all; overflow-wrap: anywhere;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* ── 스플래시 ── */
.splash {
  position: fixed; inset: 0; z-index: 50; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .35s ease;
}
.splash.out { opacity: 0; pointer-events: none; }
.splash-logo { width: min(62vw, 250px); height: auto; animation: pop .6s ease both; }
.splash-title { font-size: 19px; font-weight: 800; color: var(--navy); margin-top: 12px; }
.splash-sub { font-size: 13px; color: var(--sub); }
@keyframes pop { from { transform: scale(.86); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── 공통 틀 ── */
.app, .auth { max-width: 480px; margin: 0 auto; min-height: 100%; background: var(--bg); }
.app { display: flex; flex-direction: column; padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.top-logo { height: 26px; width: auto; }
.top-title { font-weight: 700; font-size: 14px; color: var(--sub); margin-left: auto; }
.view { flex: 1; padding: 14px 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(16, 32, 64, .06); }
.card h2 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.card h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
.hint { font-size: 13px; color: var(--sub); }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.mt { margin-top: 12px; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--navy); color: #fff; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { background: #C3CAD6; color: #fff; cursor: default; }
.btn.block { display: flex; width: 100%; }
.btn.green { background: var(--green); }
.btn.ghost { background: #EDF1F7; color: var(--navy); }
.btn.danger { background: #FDECEE; color: var(--danger); }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.input, select.input {
  width: 100%; min-height: 46px; padding: 0 13px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; outline: none; font-size: 16px;
}
.input:focus { border-color: var(--navy); }
label.field { display: block; font-size: 13px; font-weight: 700; color: var(--sub); margin: 12px 0 5px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #E7EEFB; color: var(--navy); }
.badge.green { background: #E2F6EC; color: #0E7C49; }
.badge.gray { background: #ECEFF3; color: var(--sub); }
.badge.amber { background: #FFF2D9; color: #9A6200; }

/* ── 하단 탭 ── */
.tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 20;
  width: 100%; max-width: 480px; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: #fff; border-top: 1px solid var(--line);
}
.tab {
  flex: 1; min-width: 0; border: 0; background: none; padding: 7px 0 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: #8A95A6; letter-spacing: -.3px;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--navy); font-weight: 800; }

/* ── 배너 · 토스트 · 모달 ── */
.banner { margin: 12px 14px 0; padding: 13px 14px; border-radius: 14px; font-weight: 700; display: flex; gap: 10px; align-items: flex-start; }
.banner.ok { background: #E2F6EC; color: #0B6B3F; }
.banner.info { background: #FFF2D9; color: #7A4E00; }
.banner.err { background: #FDECEE; color: #A8242E; }
.banner .x { margin-left: auto; border: 0; background: none; font-size: 18px; line-height: 1; padding: 2px 4px; color: inherit; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(88vw, 420px); padding: 12px 18px; border-radius: 99px;
  background: rgba(23, 32, 46, .94); color: #fff; font-weight: 700; font-size: 14px; text-align: center;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(10, 20, 40, .55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { width: 100%; max-width: 360px; background: #fff; border-radius: 20px; padding: 22px 20px; text-align: center; }
.modal-box h2 { font-size: 17px; margin-bottom: 6px; }
.code-big { font-size: 42px; font-weight: 800; letter-spacing: 8px; color: var(--navy); margin: 14px 0 6px; font-variant-numeric: tabular-nums; }

/* ── 가입 ── */
.auth { padding: 26px 18px 40px; }
.auth-logo { height: 34px; width: auto; display: block; }
.auth h1 { font-size: 22px; font-weight: 800; margin: 18px 0 4px; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; color: var(--sub); }
.seg input:checked + span { border-color: var(--navy); background: #E7EEFB; color: var(--navy); }
.seg input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.consent { margin-top: 16px; padding: 13px 14px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); font-size: 13px; color: var(--sub); }
.consent b { color: var(--ink); }
.consent ul { margin: 6px 0 8px; padding-left: 18px; }
.check { display: flex; gap: 9px; align-items: center; margin-top: 10px; font-weight: 700; color: var(--ink); font-size: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--navy); flex: none; }
.form-err { margin-top: 12px; padding: 11px 13px; border-radius: 12px; background: #FDECEE; color: #A8242E; font-weight: 600; font-size: 14px; }
.nfc-note { margin-top: 14px; padding: 13px 14px; border-radius: 14px; background: #E2F6EC; color: #0B6B3F; font-weight: 700; }
.linkbtn { border: 0; background: none; color: var(--navy); font-weight: 700; text-decoration: underline; padding: 10px 4px; }

/* ── 리플렛 ── */
.lf { position: relative; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(16, 32, 64, .06); }
.lf-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.lf-track::-webkit-scrollbar { display: none; }
.lf-page { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.lf-page img { display: block; width: 100%; height: auto; aspect-ratio: 975 / 1409; background: #EEF1F5; }
.lf-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .88); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); font-size: 18px; font-weight: 800; color: var(--navy); line-height: 1; }
.lf-nav.prev { left: 8px; } .lf-nav.next { right: 8px; }
.lf-nav[disabled] { opacity: .25; }
.lf-foot { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px; }
.dots { display: flex; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #CBD2DD; border: 0; padding: 0; transition: all .2s; }
.dot.on { width: 22px; border-radius: 4px; background: var(--navy); }
.lf-count { font-size: 12px; color: var(--sub); font-weight: 700; }
.booth-list { list-style: none; margin: 8px 0 0; padding: 0; }
.booth-list li { display: flex; gap: 11px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.booth-list li:first-child { border-top: 0; }
.b-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: color-mix(in srgb, var(--c) 16%, #fff); }
.b-name { font-weight: 700; font-size: 14px; }
.b-meta { font-size: 12px; color: var(--sub); }

/* ── 확대 보기 ── */
.zoom { position: fixed; inset: 0; z-index: 40; background: #10151D; display: flex; flex-direction: column; }
.zoom-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.zoom-scroll img { display: block; width: 100%; height: auto; margin: 0 auto; }
.zoom-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px calc(10px + var(--safe-b)); background: #1B222D; color: #fff; }
.zoom-bar button { min-width: 46px; height: 42px; border: 0; border-radius: 11px; background: #2C3644; color: #fff; font-size: 20px; font-weight: 700; }
.zoom-bar .zoom-close { font-size: 14px; padding: 0 16px; margin-left: 10px; background: #fff; color: #10151D; }
#zoomPct { min-width: 52px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── 스탬프 ── */
.coin-card { background: linear-gradient(135deg, var(--navy), var(--navy-deep)); color: #fff; border-radius: var(--radius); padding: 18px; }
.coin-label { font-size: 13px; opacity: .8; font-weight: 600; }
.coin-num { display: flex; align-items: baseline; gap: 6px; font-size: 44px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.coin-num small { font-size: 16px; font-weight: 700; opacity: .85; }
.coin-ico { align-self: center; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE08A, #F5A623); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: #8A5A00; margin-right: 4px; }
.coin-sub { font-size: 13px; opacity: .85; margin-top: 2px; }
.prog { margin-top: 12px; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 8px; background: var(--green); transition: width .5s; }
.prog-txt { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; opacity: .9; }
.stamp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; margin-top: 12px; }
.stamp { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.stamp-shape { position: relative; width: min(21vw, 84px); aspect-ratio: 1; background: #C5CBD5; clip-path: var(--shape); display: flex; align-items: center; justify-content: center; }
.stamp-shape::before { content: ""; position: absolute; inset: 7%; background: #EEF0F4; clip-path: var(--shape); }
.stamp-ico { position: relative; font-size: min(8.2vw, 32px); line-height: 1; filter: grayscale(1); opacity: .4; }
.stamp-no { position: absolute; z-index: 1; bottom: 13%; font-size: 10px; font-weight: 800; color: #9AA3B0; }
.stamp-name { font-size: 12px; font-weight: 600; color: #8A95A6; text-align: center; line-height: 1.3; padding: 0 2px; }
.stamp-day { display: block; font-size: 10.5px; font-weight: 600; color: #A3ACB9; }
.stamp.got .stamp-shape { background: var(--c); transform: rotate(-7deg); }
.stamp.got .stamp-shape::before { background: color-mix(in srgb, var(--c) 15%, #fff); }
.stamp.got .stamp-ico { filter: none; opacity: 1; }
.stamp.got .stamp-no { color: var(--c); }
.stamp.got .stamp-name { color: var(--ink); font-weight: 700; }
.stamp.new .stamp-shape { animation: stampIn .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampIn { from { transform: rotate(-7deg) scale(1.9); opacity: 0; } to { transform: rotate(-7deg) scale(1); opacity: 1; } }

/* ── 내 정보 ── */
.me-card { text-align: center; padding: 26px 16px; }
.me-name { font-size: 34px; font-weight: 800; line-height: 1.2; }
.me-org { font-size: 20px; font-weight: 700; color: var(--sub); margin-top: 6px; }
.me-kind { margin-top: 12px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.me-kind .badge { font-size: 14px; padding: 4px 13px; }

/* ── 운영 화면 ── */
.person { border: 1.5px solid var(--line); border-radius: 13px; padding: 12px; margin-top: 10px; }
.person.sel { border-color: var(--navy); background: #F5F8FE; }
.p-name { font-weight: 800; font-size: 16px; }
.p-meta { font-size: 13px; color: var(--sub); }
.p-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.menu-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.menu-row .grow { flex: 1; font-weight: 700; }
.menu-row small { display: block; font-weight: 600; color: var(--sub); font-size: 12px; }
.step { display: flex; align-items: center; gap: 4px; }
.step button { width: 38px; height: 38px; border-radius: 10px; border: 0; background: #EDF1F7; font-size: 20px; font-weight: 800; color: var(--navy); }
.step b { min-width: 30px; text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; border-top: 2px solid var(--ink); font-weight: 800; }
.total b { font-size: 22px; }
.total.over b { color: var(--danger); }
.list { list-style: none; margin: 6px 0 0; padding: 0; }
.list li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list b { font-size: 14px; }
.mono { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 21px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--sub); font-weight: 600; }
.bar-row { display: grid; grid-template-columns: 1fr 44px; gap: 2px 8px; align-items: center; padding: 5px 0; font-size: 13px; }
.bar-row .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--navy)); }
.price-in { width: 64px; min-height: 38px; text-align: center; padding: 0 6px; }
.tag-url { font-size: 12px; min-height: 36px; padding: 0 9px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px 3px 9px; margin: 3px 4px 0 0; border-radius: 99px; background: #EDF1F7; font-size: 12px; font-weight: 600; }
.chip button { border: 0; background: #fff; border-radius: 50%; width: 20px; height: 20px; line-height: 1; color: var(--danger); font-weight: 800; padding: 0; }
.empty { padding: 18px 0 6px; text-align: center; color: var(--sub); font-size: 13px; }

@media (min-width: 481px) { .tabs { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
