/* 온엑스두 스탬프 투어 — 화면 규칙
   판 하나 · 가는 줄 · 색은 작은 점 · 숫자는 크게. 글자는 또렷한 고딕, 보조 글자도 진하게. */
:root {
  --bg: #F6FAF7;
  --panel: #FFFFFF;
  --paper: #FBF8F0;
  --ink: #0E1512;
  --sub: #37443D;
  --mute: #5C6B63;
  --line: #D6E0DA;
  --green: #00A04A;
  --green-deep: #0B3D25;
  --bright: #00C853;
  --pale: #E4F3E9;
  --warn: #A3320B;
  --tab-h: 62px;
  --top-h: 52px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #E9EFEB; color: var(--ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }

#app { max-width: 480px; min-height: 100dvh; margin: 0 auto; background: var(--bg); position: relative; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }

/* 위 줄 */
#top { position: sticky; top: 0; z-index: 500; height: var(--top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.brand img { display: block; height: 17px; width: auto; }
.city { font-size: 14px; font-weight: 700; color: var(--sub); }

/* 아래 메뉴 */
#tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 600; width: 100%; max-width: 480px; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border-top: 1px solid var(--line); }
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--mute); }
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
#tabs a.on { color: var(--green); font-weight: 800; }

#view { outline: none; }
.pad { padding: 0 18px; }
.block { padding: 22px 18px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--green); }
h1 { font-size: 27px; line-height: 1.28; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.lead { color: var(--sub); margin-top: 10px; }
.sub { color: var(--sub); font-size: 14.5px; }
.small { font-size: 13.5px; color: var(--mute); }

.bignum { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; }
.bignum b { font-size: 60px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bignum span { font-size: 17px; font-weight: 700; color: var(--sub); }
.bar { height: 6px; background: var(--line); margin-top: 14px; }
.bar i { display: block; height: 100%; background: var(--green); }

/* 단추 */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; padding: 0 18px; border: 1.5px solid var(--green); border-radius: 8px; background: var(--green); color: #fff; font-size: 17px; font-weight: 800; }
.btn.line { background: transparent; color: var(--green); }
.btn.dark { background: var(--ink); border-color: var(--ink); }
.btn[disabled] { opacity: .5; }
.btn + .btn { margin-top: 10px; }
.textbtn { background: none; border: 0; padding: 8px 0; font-size: 14.5px; font-weight: 700; color: var(--sub); text-decoration: underline; text-underline-offset: 3px; }
.row-btns { display: flex; gap: 18px; flex-wrap: wrap; }

/* 줄 목록 */
.rows { margin-top: 12px; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.row .dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; }
.row .body { flex: 1; min-width: 0; }
.row .name { font-weight: 800; font-size: 16.5px; }
.row .desc { font-size: 14px; color: var(--sub); margin-top: 2px; }
.row .num { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .num small { font-weight: 700; font-size: 13px; color: var(--mute); }
.row .chev { color: var(--mute); font-size: 18px; }
.row.on { background: var(--pale); margin: 0 -18px; padding-left: 18px; padding-right: 18px; width: calc(100% + 36px); }
.tag { font-size: 12.5px; font-weight: 800; color: var(--green); white-space: nowrap; }
.check { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--mute); background: var(--panel); }
.check.done { background: var(--green); border-color: var(--green); color: #fff; }

.step { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.recent { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; padding: 14px 12px; background: var(--paper); border: 1px solid #E4DCC7; border-radius: 8px; }
.btn.two { flex-direction: column; gap: 1px; padding-top: 9px; padding-bottom: 9px; line-height: 1.3; }
.btn.two small { font-size: 13.5px; font-weight: 600; opacity: .9; }
button.row { cursor: pointer; }

/* 여권 줄(홈) */
.passline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--green-deep); color: #fff; }
.passline b { font-weight: 800; }
.passline span { font-size: 13.5px; opacity: .85; }
.passline a, .passline button { color: #fff; font-weight: 800; font-size: 14.5px; background: none; border: 1px solid rgba(255,255,255,.6); border-radius: 6px; padding: 8px 12px; white-space: nowrap; }

/* 장소 화면 */
.back { display: inline-flex; align-items: center; gap: 4px; padding: 14px 18px 0; font-size: 14.5px; font-weight: 700; color: var(--sub); }
.courses-of { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--sub); }
.courses-of span { display: inline-flex; align-items: center; gap: 6px; }
.courses-of i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.story { font-size: 16.5px; line-height: 1.7; color: var(--ink); margin-top: 14px; }
.tip { margin-top: 12px; font-size: 14.5px; color: var(--sub); }
.done-box { display: flex; align-items: center; gap: 16px; }
.done-box .stamp { width: 124px; height: 124px; flex: 0 0 124px; }
.note-in { width: 100%; min-height: 50px; padding: 12px 14px; margin-top: 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel); font: inherit; font-size: 16px; color: var(--ink); }
.note-in:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.photo { display: block; width: 100%; margin-top: 12px; border-radius: 8px; border: 1px solid var(--line); }
.trial { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* 지도 */
.seg { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); background: var(--bg); }
.seg a { padding: 14px 0; text-align: center; font-weight: 700; color: var(--mute); border-bottom: 3px solid transparent; }
.seg a.on { color: var(--ink); font-weight: 800; border-bottom-color: var(--green); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 14px; font-weight: 700; color: var(--sub); }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip.on { border-color: var(--ink); color: var(--ink); }
#map { width: 100%; height: 56vh; min-height: 320px; background: #dfe7e2; z-index: 1; }
#map.mine { height: 44vh; }
.pin { width: 22px; height: 22px; border-radius: 50%; border: 4px solid var(--c, #0E1512); background: #fff; box-shadow: 0 0 0 1.5px #fff; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; transition: transform .15s; }
.pin.done { background: var(--c, #0E1512); }
.pin.sel { transform: scale(1.4); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.pin.ghost { width: 12px; height: 12px; background: #fff; border: 2px solid #8C9A92; box-shadow: none; }
.pinwrap { position: relative; width: 22px; height: 22px; }
.pin-label { display: none; position: absolute; top: 26px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.95); color: var(--ink); font-size: 12.5px; font-weight: 700; line-height: 1.5; white-space: nowrap; pointer-events: none; }
#map.labels .pin-label { display: block; }
.mapnote { position: absolute; left: 12px; right: 70px; top: 12px; z-index: 460; margin: 0; padding: 12px 14px; background: #FFF6E0; border: 1px solid #EBD9A8; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: #5A4300; }
.pin-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; border: 2.5px solid #fff; box-shadow: 0 0 0 1.5px rgba(14,21,18,.55); }
.pin-no.off { background: #fff; color: var(--ink); }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #1565C0; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(21,101,192,.22); }
.mapcard { padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.mapcard .name { font-size: 18px; font-weight: 800; }
.locbtn { position: absolute; right: 12px; bottom: 12px; z-index: 450; width: 46px; height: 46px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.locbtn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
.mapwrap { position: relative; }

/* 나의 여행지도 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: var(--panel); }
.stats div { padding: 16px 0 14px 18px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats b { display: block; font-size: 24px; line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.stats b small { font-size: 13px; font-weight: 700; margin-left: 1px; }
.stats span { font-size: 13px; font-weight: 600; color: var(--sub); }
.summary { font-size: 17px; font-weight: 700; line-height: 1.5; }
.tl { margin-top: 12px; }
.tl-item { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding-bottom: 6px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 1.5px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-no { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.tl-no.off { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.tl-body { padding-bottom: 16px; min-width: 0; }
.tl-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tl-head b { font-size: 16.5px; font-weight: 800; }
.tl-head time { font-size: 14px; font-weight: 700; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-meta { font-size: 13.5px; color: var(--sub); margin-top: 2px; }
.tl-note { margin-top: 6px; font-size: 15px; }
.tl-gap { font-size: 13px; color: var(--mute); margin: -8px 0 10px 42px; }
.tl-photo { display: block; width: 100%; max-width: 240px; margin-top: 8px; border-radius: 6px; border: 1px solid var(--line); }
.empty { padding: 30px 18px; text-align: center; color: var(--sub); }
.empty b { display: block; font-size: 17px; color: var(--ink); margin-bottom: 6px; }

/* 여권 */
.cover { margin: 18px; padding: 26px 22px 22px; background: var(--green-deep); color: #F4EBD0; border-radius: 10px; }
.cover img { height: 16px; width: auto; display: block; opacity: .95; }
.cover .t1 { margin-top: 38px; font-size: 12.5px; letter-spacing: .32em; font-weight: 700; }
.cover .t2 { margin-top: 6px; font-size: 26px; font-weight: 800; letter-spacing: .01em; line-height: 1.25; color: #fff; }
.cover dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 34px 0 0; font-size: 14.5px; }
.cover dt { opacity: .75; }
.cover dd { margin: 0; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.page { background: var(--paper); border-top: 1px solid #E4DCC7; border-bottom: 1px solid #E4DCC7; padding: 20px 18px 8px; }
.page + .page { border-top: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-head .name { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.page-head i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 8px; margin-top: 10px; }
.grid a { display: block; padding: 4px; }
.stamp { display: block; width: 100%; height: auto; font-family: Pretendard, sans-serif; }
.stamp.slot { opacity: .9; }

/* 인증서 */
.cert-img { display: block; width: 100%; border: 1px solid var(--line); background: #fff; }

/* 혜택 */
.code { font-size: 44px; font-weight: 800; letter-spacing: .14em; font-variant-numeric: tabular-nums; text-align: center; padding: 18px 0 6px; }
.notice { margin: 0; padding: 12px 18px; background: #FFF6E0; border-bottom: 1px solid #EBD9A8; font-size: 13.5px; font-weight: 600; color: #5A4300; }

/* 시트 · 알림 */
#sheet { position: fixed; inset: 0; z-index: 900; background: rgba(14,21,18,.55); display: flex; align-items: flex-end; justify-content: center; }
#sheet[hidden] { display: none; }
.sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; background: var(--panel); border-radius: 14px 14px 0 0; padding: 24px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 21px; }
.sheet .stamp-big { width: 190px; margin: 6px auto 4px; animation: thump .42s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes thump { 0% { transform: scale(2.1) rotate(-8deg); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sheet .stamp-big { animation: none; } }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 10px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px); transform: translateX(-50%); z-index: 950; max-width: 420px; width: calc(100% - 36px); padding: 14px 16px; background: var(--ink); color: #fff; border-radius: 8px; font-size: 15px; font-weight: 600; }
#toast[hidden] { display: none; }
