/* Layout: 애플처럼 조용한 흰 바탕 + 말차 포인트. 글꼴은 Gowun Batang(제목) + IBM Plex Sans KR(본문) */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --fill: rgba(118, 118, 128, .12);
  --accent: #a6c184;        /* 말차 */
  --accent-ink: #26321f;
  --accent-deep: #6f8c50;
  --deep: #1d1d1f;
  --deep-fg: #f5f5f7;
  --soft: #f0f0f3;
  --c-matcha: #a6c184;
  --c-berry: #d993b1;
  --c-yuzu: #e7c85f;
  --c-mint: #7dbba6;
  --c-sky: #82b9d9;
  --c-lav: #b19acf;
  --c-apricot: #e2a07a;
  --c-tan: #c4ae8e;
  --c-grey: #b5bac6;
  --ok: #4f7a3a;
  --pass: #c0392b;
  --warn: #9a6a10;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .06);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .05), 0 24px 48px rgba(0, 0, 0, .10);
  --font-display: "Gowun Batang", "AppleMyungjo", "Noto Serif KR", serif;
  --font-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --ink: #f5f5f7; --muted: #98989d; --line: #38383a; --fill: rgba(118, 118, 128, .24);
    --accent: #a6c184; --accent-ink: #1e2819; --accent-deep: #b9d199; --deep: #1c1c1e; --deep-fg: #f5f5f7; --soft: #2c2c2e;
    --ok: #a6c184; --pass: #ff6b5e; --warn: #e7c85f; --shadow: 0 0 0 1px #2c2c2e; --shadow-lg: 0 0 0 1px #38383a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --ink: #f5f5f7; --muted: #98989d; --line: #38383a; --fill: rgba(118, 118, 128, .24);
  --accent: #a6c184; --accent-ink: #1e2819; --accent-deep: #b9d199; --deep: #1c1c1e; --deep-fg: #f5f5f7; --soft: #2c2c2e;
  --ok: #a6c184; --pass: #ff6b5e; --warn: #e7c85f; --shadow: 0 0 0 1px #2c2c2e; --shadow-lg: 0 0 0 1px #38383a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.7;
  word-break: keep-all; overflow-wrap: break-word;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
.eyebrow { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lead { color: var(--muted); max-width: 62ch; }
section { padding-block: 72px; }
.section-head { display: grid; gap: 10px; margin-bottom: 36px; }

/* 상단 바 */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.logo-mark svg { width: 17px; height: 17px; }
.nav { display: flex; gap: 22px; font-size: .92rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font: inherit; font-weight: 600; padding: 12px 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 8px 16px; font-size: .9rem; }

/* 히어로 */
.hero { padding-block: 64px 80px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 3.6rem); margin-block: 14px 18px; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 70%, transparent) 62%); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.dots { margin-top: 28px; display: flex; gap: 6px; }
.dots span { width: 22px; height: 8px; border-radius: 4px; }

/* 기차표 형태의 교환 카드 */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px -26px rgba(46,58,43,.45); min-width: 0; }
.ticket-head { background: var(--deep); color: var(--deep-fg); padding: 14px 20px; display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; }
.ticket-body { padding: 22px 20px; display: grid; gap: 18px; }
.route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.city { min-width: 0; }
.city .code { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 500; letter-spacing: .02em; line-height: 1.1; }
.city .name { font-size: .88rem; color: var(--muted); }
.city.right { text-align: right; }
.swap { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1.2rem; }
.ticket-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px dashed var(--line); padding-top: 16px; }
.ticket-meta dt { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.ticket-meta dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ticket-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { font-size: .78rem; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.sample-note { font-size: .78rem; color: var(--muted); text-align: right; padding: 0 20px 14px; }

/* 기능 소개 */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 12px; align-content: start; }
.feature .tag { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.feature ul { margin: 4px 0 0; padding-left: 1.1em; color: var(--muted); display: grid; gap: 4px; }

/* 나라 → 도시 선택 */
.picker { display: grid; gap: 12px; min-width: 0; }
.picker-step { font-size: .82rem; color: var(--muted); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font: inherit; font-size: .9rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.pill:hover { border-color: var(--accent-deep); }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.city-pill[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: var(--deep-fg); }
.cities-box { background: var(--soft); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.cities-box[hidden] { display: none; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; }
.picked button { font: inherit; font-size: .82rem; padding: 3px 6px 3px 12px; border-radius: 999px; border: 0; background: var(--deep); color: var(--deep-fg); cursor: pointer; }
.picked button span { margin-left: 6px; opacity: .7; }

/* 스와이프 */
.swipe-layout { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .swipe-layout { grid-template-columns: 1fr; } }
.swipe-side { display: grid; gap: 28px; min-width: 0; }
.where-to { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; }
.where-to h3 { font-size: 1.25rem; }
.result-line { font-size: .9rem; color: var(--muted); }
.card-parts { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.card-parts li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; align-items: baseline; color: var(--muted); font-size: .95rem; }
.card-parts li::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--sw); transform: translateY(1px); }
.card-parts strong { color: var(--ink); font-weight: 600; }

.deck-wrap { display: grid; gap: 14px; justify-items: center; min-width: 0; }
.deck-label { font-size: .85rem; color: var(--muted); text-align: center; }
.deck { position: relative; width: 100%; max-width: 360px; height: 520px; }
.pcard.dragging { transition: none; cursor: grabbing; }
.pcard.behind { transform: scale(.95) translateY(12px); pointer-events: none; }
.stamp { position: absolute; top: 16px; z-index: 3; padding: 4px 12px; border: 3px solid; border-radius: 8px; font-family: var(--font-mono); font-weight: 500; font-size: 1.1rem; letter-spacing: .1em; opacity: 0; background: rgba(255,255,255,.85); }
.stamp.like { right: 16px; color: #4f7a3a; border-color: #4f7a3a; transform: rotate(-12deg); }
.stamp.pass { left: 16px; color: #b5577e; border-color: #b5577e; transform: rotate(12deg); }
.deck-actions { display: flex; gap: 18px; }
.round { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.4rem; display: grid; place-items: center; }
.round.pass { color: var(--pass); }
.round.like { color: var(--accent-deep); }
.round:disabled { opacity: .4; cursor: default; }
.deck-empty { position: absolute; inset: 0; border: 1px dashed var(--line); border-radius: 22px; display: grid; place-items: center; text-align: center; padding: 28px; color: var(--muted); }
.match { position: absolute; inset: 0; z-index: 5; border-radius: 22px; background: linear-gradient(160deg, var(--c-matcha), var(--c-mint)); color: #22301c; display: grid; place-items: center; text-align: center; padding: 28px; gap: 10px; align-content: center; animation: pop .35s ease; }
.match h3 { font-size: 1.8rem; }
.match p { font-size: .95rem; }
.match .btn { background: #2e3a2b; color: #f1f3ea; margin-top: 8px; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 매칭 후 */
.after { background: var(--deep); color: var(--deep-fg); }
.after .eyebrow, .after .lead { color: color-mix(in srgb, var(--deep-fg) 72%, transparent); }
.after-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .after-grid { grid-template-columns: 1fr; } }
.role { border: 1px solid color-mix(in srgb, var(--deep-fg) 22%, transparent); border-radius: var(--radius); padding: 22px; display: grid; gap: 12px; align-content: start; }
.role.us { border-color: var(--accent); }
.role ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; color: color-mix(in srgb, var(--deep-fg) 82%, transparent); font-size: .95rem; }
.role .k { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; color: var(--accent); }
.checklist { margin-top: 32px; display: grid; gap: 12px; }
.checklist h3 { font-size: 1.05rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.checks span { border: 1px solid color-mix(in srgb, var(--deep-fg) 22%, transparent); border-radius: 10px; padding: 10px 12px; font-size: .9rem; display: flex; gap: 10px; align-items: baseline; }
.checks span::before { content: ""; flex: none; width: 12px; height: 12px; border: 1.5px solid var(--accent); border-radius: 3px; transform: translateY(1px); }
.after .fine { margin-top: 22px; font-size: .85rem; color: color-mix(in srgb, var(--deep-fg) 65%, transparent); max-width: 70ch; }

/* 시나리오 */
.scenario { display: grid; grid-template-columns: 300px 1fr; gap: 40px; }
@media (max-width: 860px) { .scenario { grid-template-columns: 1fr; } }
.people { display: grid; gap: 14px; align-content: start; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.person .avatar { width: 44px; height: 44px; font-size: 1rem; border: 0; }
.person small { color: var(--muted); display: block; line-height: 1.5; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: step; }
.timeline li { position: relative; padding: 0 0 26px 52px; counter-increment: step; }
.timeline li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-family: var(--font-mono); font-size: .85rem; }
.timeline li::after { content: ""; position: absolute; left: 17px; top: 36px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; }
.timeline p { color: var(--muted); font-size: .95rem; }
.who { display: inline-block; margin-left: 6px; font-family: var(--font-mono); font-size: .7rem; padding: 1px 8px; border-radius: 4px; vertical-align: 2px; font-weight: 500; }
.who.app { background: var(--accent); color: var(--accent-ink); }
.who.self { border: 1px solid var(--muted); color: var(--muted); }

/* 인증 */
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .trust-grid { grid-template-columns: 1fr; } }
.trust-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 10px; align-content: start; }
.trust-item .k { display: inline-flex; align-self: start; justify-self: start; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--chip) 35%, var(--surface)); }
.trust-item p { color: var(--muted); font-size: .94rem; }
.trust-item code { font-family: var(--font-mono); font-size: .82rem; background: var(--soft); padding: 1px 6px; border-radius: 4px; }
.verify-flow { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .92rem; color: var(--muted); }
.verify-flow b { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 500; }

/* 동행 게시판 */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.board-bar .spacer { flex: 1; }
.board-bar .sample { font-size: .78rem; color: var(--muted); }
.post { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.post:last-child { border-bottom: 0; }
@media (max-width: 600px) { .post { grid-template-columns: 1fr; gap: 6px; } }
.post .when { font-family: var(--font-mono); font-size: .85rem; font-variant-numeric: tabular-nums; }
.post .where { font-size: .8rem; color: var(--muted); }
.post .title { font-weight: 600; }
.post .info { font-size: .85rem; color: var(--muted); }
.post .seats { font-size: .8rem; white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: var(--soft); justify-self: start; }
.verified { color: var(--ok); font-size: .8rem; font-weight: 500; }

/* 로드맵 */
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
@media (max-width: 760px) { .roadmap { grid-template-columns: 1fr; } }
.phase { padding: 24px; display: grid; gap: 10px; align-content: start; border-right: 1px solid var(--line); }
.phase:last-child { border-right: 0; }
@media (max-width: 760px) { .phase { border-right: 0; border-bottom: 1px solid var(--line); } .phase:last-child { border-bottom: 0; } }
.phase.now { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.phase .when { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); letter-spacing: .08em; }
.phase ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .94rem; display: grid; gap: 4px; }

/* 사전신청 + 카드 만들기 */
.signup { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.signup-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .signup-layout { grid-template-columns: 1fr; } }
.preview-col { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); display: grid; gap: 12px; justify-items: center; min-width: 0; }
@media (max-width: 860px) { .preview-col { position: static; order: -1; } }
.preview-col .pcard { position: relative; inset: auto; width: 100%; max-width: 360px; cursor: default; }
form { display: grid; gap: 20px; min-width: 0; }
.form-part { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
label, legend, .label { font-weight: 600; font-size: .92rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: .9rem; background: var(--bg); font-weight: 400; }
.opt input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.opt.tagopt input:checked + span { background: color-mix(in srgb, var(--chip) 45%, var(--surface)); border-color: var(--chip); color: var(--ink); }
.opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt input:disabled + span { opacity: .4; cursor: not-allowed; }
.space-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.space-opts .opt span { display: grid; gap: 2px; border-radius: 12px; padding: 12px 14px; height: 100%; }
.space-opts .opt small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.space-opts .opt input:checked + span small { color: var(--accent-ink); }
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upload input[type="file"] { font: inherit; font-size: .85rem; max-width: 100%; }
.count { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); font-weight: 400; }
.consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-weight: 400; font-size: .88rem; color: var(--muted); }
.consent input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--accent-deep); }
.error { color: #b3261e; font-size: .85rem; min-height: 1.2em; }
:root[data-theme="dark"] .error { color: #ff8a80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .error { color: #ff8a80; } }
.result { border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 6px; }
.result.ok { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.result.demo { background: color-mix(in srgb, var(--c-yuzu) 25%, var(--surface)); }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 760px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 10px; color: var(--muted); font-size: .95rem; }

/* 신뢰 레벨 아이콘 */
.lv { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.28em; color: var(--accent-deep); }
.lv svg { width: 100%; height: 100%; display: block; }
.meta .lvname { color: var(--accent-deep); font-weight: 600; }
.meta .sn { color: var(--accent-deep); font-weight: 600; }
.verifs { font-size: .76rem; color: var(--muted); }

.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 860px) { .levels { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .levels { grid-template-columns: 1fr 1fr; } }
.level { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 14px; display: grid; gap: 4px; justify-items: center; text-align: center; transition: border-color .2s ease, background .2s ease; }
.level .lv { width: 56px; height: 56px; margin-bottom: 4px; }
.level b { font-family: var(--font-display); font-size: 1.1rem; }
.level span { font-size: .8rem; color: var(--muted); font-family: var(--font-mono); }
.level.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.level.super { border-style: dashed; }
.trust-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; }
@media (max-width: 860px) { .trust-cols { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.points { width: 100%; border-collapse: collapse; font-size: .92rem; }
.points td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.points tr:last-child td { border-bottom: 0; }
.points td:last-child { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.points small { display: block; color: var(--muted); font-size: .8rem; }
.calc { display: grid; gap: 8px; }
.calc label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 400; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.calc label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.calc input { width: 17px; height: 17px; accent-color: var(--accent-deep); }
.calc .pt { margin-left: auto; font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.meter { display: grid; gap: 8px; }
.meter-top { display: flex; align-items: center; gap: 12px; }
.meter-top .lv { width: 44px; height: 44px; }
.meter-top b { font-family: var(--font-display); font-size: 1.3rem; }
.meter-top span { color: var(--muted); font-size: .88rem; }
.bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s ease; }

/* 슈퍼이웃 */
.super-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .super-layout { grid-template-columns: 1fr; } }
.goal { display: grid; gap: 12px; }
.goal-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: .92rem; }
.goal-row .bar { grid-column: 1 / -1; }
.goal-row .st { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.goal-row .st.done { color: var(--ok); }
.rules { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--muted); font-size: .94rem; }
.rules b { color: var(--ink); font-weight: 600; }
.super-head { display: flex; gap: 14px; align-items: center; }
.super-head .lv { width: 52px; height: 52px; }

/* 약속 기록 */
.promise { margin-top: 32px; background: var(--surface); color: var(--ink); border-radius: 18px; overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 860px) { .promise { grid-template-columns: 1fr; } }
.promise-main { padding: 24px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.promise-side { padding: 24px; background: var(--soft); display: grid; gap: 16px; align-content: start; min-width: 0; }
.promise .k { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: var(--muted); }
.promise h3 { font-size: 1.15rem; }
.terms { display: grid; gap: 0; margin: 0; }
.terms div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.terms div:last-child { border-bottom: 0; }
.terms dt { color: var(--muted); }
.terms dd { margin: 0; font-weight: 500; }
.signed { display: flex; flex-wrap: wrap; gap: 8px; }
.signed span { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.signed time, .stamp-line time { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.stamp-line { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; font-size: .9rem; }
.thumbs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumbs i { aspect-ratio: 1; border-radius: 8px; background: linear-gradient(135deg, var(--tc1), var(--tc2)); opacity: .7; }
.ask { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; font-size: .92rem; }
.ask .options span { font-size: .85rem; padding: 5px 12px; }

footer { padding-block: 40px; color: var(--muted); font-size: .88rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }

.start .actions { display: flex; flex-wrap: wrap; gap: 12px; }

[hidden] { display: none !important; }

.fit { display: flex; flex-wrap: wrap; gap: 6px; }
.fit span { font-size: .78rem; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c-yuzu) 35%, var(--surface)); font-weight: 500; }
.inline-hint { font-weight: 400; font-size: .78rem; opacity: .75; margin-left: 4px; }

/* =========================================================
   애플 스타일 층: 카드, 버튼, 고르기 버튼, 전환 버튼, 스위치
   ========================================================= */

/* 카드 (스와이프 카드) */
.pcard { position: absolute; inset: 0; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; touch-action: pan-y; user-select: none; cursor: grab; transition: transform .3s ease, opacity .3s ease; }
.cover { position: relative; flex: none; height: 200px; background: linear-gradient(160deg, color-mix(in srgb, var(--tint, var(--c-matcha)) 92%, #fff), color-mix(in srgb, var(--tint, var(--c-matcha)) 42%, #fff)); background-size: cover; background-position: center; }
.cover.photo { background-color: var(--soft); }
.glass { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; padding: 9px 14px; border-radius: 16px; background: rgba(255, 255, 255, .58); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); color: #1d1d1f; }
.glass small { display: block; font-size: .72rem; font-weight: 600; color: rgba(0, 0, 0, .55); }
.glass b { display: block; font-family: var(--font-display); font-size: 1rem; font-weight: 700; line-height: 1.35; }
.pcard-body { padding: 16px 20px 20px; display: grid; gap: 12px; align-content: start; min-height: 0; }
.who-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.who-text { min-width: 0; }
.avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: #1d1d1f; overflow: hidden; background: var(--tint, var(--c-matcha)); background-size: cover; background-position: center; }
.who-row .nick { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.who-row .meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.who-row .meta .lvname { color: var(--accent-deep); font-weight: 600; }
.verifs { font-size: .74rem; color: var(--muted); }
.fit { display: flex; flex-wrap: wrap; gap: 6px; }
.fit span { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--tint, var(--c-yuzu)) 24%, var(--surface)); }
.pcard-body .intro { font-size: .95rem; line-height: 1.6; margin: 0; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { padding: 9px 0; display: grid; gap: 1px; min-width: 0; }
.facts div + div { padding-left: 10px; border-left: 1px solid var(--line); }
.facts small { font-size: .7rem; color: var(--muted); }
.facts b { font-size: .82rem; font-weight: 600; line-height: 1.35; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .8rem; color: var(--muted); background: var(--fill); padding: 3px 10px; border-radius: 999px; }
.deck { height: 600px; }

/* 버튼 */
.btn { background: var(--ink); color: var(--bg); }
.btn.ghost { background: var(--fill); color: var(--ink); border: 0; }
.btn:hover { transform: none; opacity: .88; }

/* 고르기 버튼 (나라, 도시, 달, 키워드) */
.pill, .opt span { border: 0; background: var(--fill); color: var(--ink); }
.pill:hover { border-color: transparent; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.pill[aria-pressed="true"], .opt input:checked + span { background: var(--ink); color: var(--bg); }
.pill.city-pill[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.opt.tagopt input:checked + span { background: var(--ink); color: var(--bg); border: 0; }
.space-opts .opt input:checked + span small { color: inherit; opacity: .75; }

/* 상자들: 테두리 대신 옅은 그림자 */
.feature, .panel, .box, details, .board, .level, .ticket, .roadmap, .person, .where-to, .promise, .trust-item, .post-article, .comment, .match-item, .mini-profile, .messages {
  border-color: transparent; box-shadow: var(--shadow);
}
.feature, .panel, .box, .board, .where-to, .post-article { border-radius: 22px; }

/* iOS 전환 버튼 */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 10px; padding: 2px; justify-self: start; max-width: 100%; }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; font-size: .88rem; font-weight: 500; padding: 7px 14px; border-radius: 8px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #636366; } }

/* iOS 스위치 */
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.switch-row .hint { display: block; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--fill); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i { background: #34c759; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 동그란 색 고르기 */
.color-dots { display: flex; flex-wrap: wrap; gap: 12px; }
.color-dot { position: relative; width: 36px; height: 36px; }
.color-dot input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.color-dot i { position: absolute; inset: 0; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.color-dot input:checked + i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.color-dot input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 4px; }

/* 날짜 입력 */
.date-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.date-pair > span { color: var(--muted); padding-bottom: 12px; }
input[type="date"] { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: var(--fill); border: 0; border-radius: 12px; padding: 11px 12px; }
.stagger { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea { background: var(--fill); border-color: transparent; border-radius: 12px; }

/* 소개 페이지의 '언제, 어디로' 패널 */
.where-to .x-group { display: grid; gap: 12px; }
.stack { display: grid; gap: 14px; }
.date-pair .field label { font-size: .8rem; font-weight: 500; color: var(--muted); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* 좁은 화면: 메뉴를 숨기지 않고 로고 아래 한 줄로, 옆으로 밀어서 보기 */
@media (max-width: 1080px) {
  .top .wrap { height: auto; flex-wrap: wrap; padding-block: 10px 6px; row-gap: 4px; }
  .top .nav { display: flex; order: 3; width: 100%; gap: 18px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-block: 4px; font-size: .88rem; }
  .top .nav::-webkit-scrollbar { display: none; }
  .top .nav a { flex: none; }
}

/* 카드: 더 알아보기 */
.pcard-body { overflow-y: auto; overscroll-behavior: contain; }
.more-btn { justify-self: start; border: 0; background: var(--fill); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.more { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.more-group { display: grid; gap: 6px; }
.more-group small { color: var(--muted); font-size: .74rem; font-weight: 600; letter-spacing: .02em; }
.more-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.more-chips span { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--tint, var(--c-matcha)) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tint, var(--c-matcha)) 40%, transparent); }
.more-bio { margin: 0; font-size: .9rem; line-height: 1.6; white-space: pre-wrap; }

.features { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .features { grid-template-columns: 1fr; } }

/* 위쪽 로그인 · 가입하기 */
.top-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.top-login { font-size: .92rem; color: var(--ink); text-decoration: none; }
.top-login:hover { text-decoration: underline; }

/* 첫 화면 제목에 긴 닉네임이 들어가면: 글자를 조금 줄이고, 그래도 넘치면 줄바꿈 */
.hero .wrap > div { min-width: 0; }
#hero-who { overflow-wrap: anywhere; }
.hero h1.long-name { font-size: clamp(1.7rem, 4.6vw, 3rem); }

/* 집 둘러보기로 가는 버튼 */
.swipe-go { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* 넘기기 버튼 아래 이름표 + 처음 한 번 카드가 살짝 흔들려요 */
.deck-actions { padding-bottom: 22px; }
.deck-actions .round { position: relative; }
.deck-actions .round[data-label]::after { content: attr(data-label); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: .74rem; color: var(--muted); white-space: nowrap; pointer-events: none; }
.round.undo { width: 46px; height: 46px; font-size: 1.15rem; color: var(--muted); align-self: center; }
@keyframes card-nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-26px) rotate(-2deg); } 60% { transform: translateX(22px) rotate(1.6deg); } }
.card-nudge { animation: card-nudge 1.1s ease-in-out 1; }
@media (prefers-reduced-motion: reduce) { .card-nudge { animation: none; } }

/* ← 이전 카드 · ♥ 좋아요 · 다음 카드 → */
.round.nav { color: var(--ink); }
.round.nav:disabled { opacity: .3; }
.deck-actions .round.like { width: 66px; height: 66px; font-size: 1.6rem; }
.deck-actions { align-items: center; }
/* 버튼 크기가 달라도 이름표 높이를 맞춰요 (가운데 정렬 기준 58px 버튼에 맞춤) */
.deck-actions .round.like[data-label]::after { top: calc(100% + 2px); }
/* 도장 글자가 한글(함께해요 · 다음)이라 조금 작고 촘촘하게 */
.stamp { font-family: var(--font-body, inherit); font-weight: 700; font-size: .95rem; letter-spacing: 0; padding: 3px 10px; }
.stamp.like { right: 22px; top: 22px; }
.stamp.pass { left: 22px; top: 22px; }

/* 로고송 알림 (왼쪽 아래 작은 칩) */
.song-chip { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.18); animation: song-in .35s ease-out; transition: opacity .35s, transform .35s; }
.song-chip.out { opacity: 0; transform: translateY(10px); }
.song-chip button { border: 0; background: none; font: inherit; cursor: pointer; border-radius: 999px; }
.song-play { padding: 6px 12px; font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--accent) 18%, transparent) !important; }
.song-off { padding: 6px 10px; font-size: .8rem; color: var(--muted); }
.song-off:hover { color: var(--ink); text-decoration: underline; }
@keyframes song-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .song-chip { animation: none; } }

/* 저장(책갈피) 버튼: 소개 페이지와 앱 공통 */
.deck-actions .round.save { width: 46px; height: 46px; color: var(--ink); }
.deck-actions .round.save[data-label]::after { top: calc(100% + 12px); }
.round.save.on { color: var(--accent-deep); }
.round.save.on svg { fill: currentColor; }

/* 카드 저장(책갈피): 이름 줄 오른쪽 끝 */
.card-save { margin-left: auto; align-self: flex-start; flex: none; display: grid; justify-items: center; gap: 1px; min-width: 40px; padding: 4px 2px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.card-save:hover { color: var(--accent-deep); }
.card-save.on { color: var(--accent-deep); }
.card-save.on svg { fill: currentColor; }

/* 카드 안에서 아래로 내려 보기 */
.scroll-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; font-size: .78rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); color: var(--muted); pointer-events: none; transition: opacity .25s; }
.scroll-hint.gone { opacity: 0; }


/* 카드 속 받은 후기 */
.rv { display: grid; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.rv-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: .78rem; color: var(--muted); }
.rv-stars { color: #d4a017; letter-spacing: 1px; font-size: .85rem; }
.rv-text { margin: 0; font-size: .88rem; line-height: 1.55; }
.rv-reply { margin: 0; font-size: .82rem; color: var(--muted); padding-left: 8px; border-left: 2px solid var(--line); }
.rv-report { justify-self: end; border: 0; background: none; font: inherit; font-size: .74rem; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }

/* 저장했을 때 잠깐 뜨는 말풍선 */
.card-save { position: relative; }
.save-bubble { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; white-space: nowrap; font-size: .8rem; font-weight: 600; padding: 7px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: 0 6px 18px rgba(0,0,0,.2); animation: bubble-in .2s ease-out; transition: opacity .3s; pointer-events: none; }
.save-bubble::before { content: ""; position: absolute; right: 16px; top: -5px; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
.save-bubble.out { opacity: 0; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* 카드 뒷면: 받은 후기 (카드를 뒤집듯이) */
.deck { perspective: 1400px; }
.pcard-back { display: none; flex-direction: column; gap: 12px; padding: 20px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; background: color-mix(in srgb, var(--tint, var(--c-matcha)) 10%, var(--surface)); }
.pcard.show-back > .cover, .pcard.show-back > .pcard-body, .pcard.show-back > .scroll-hint { display: none; }
.pcard.show-back > .pcard-back { display: flex; }
.back-head { display: grid; gap: 2px; }
.back-head b { font-family: var(--font-display); font-size: 1.2rem; }
.back-head span { color: #d4a017; font-weight: 700; font-size: .9rem; }
.back-list { display: grid; gap: 10px; }
.flip-btn { justify-self: start; margin-top: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.flip-btn:hover { border-color: var(--accent); }
.back-flip { align-self: center; margin-top: auto; font-size: .85rem; padding: 8px 16px; }
.pcard.flipping { animation: card-flip .36s ease-in-out; }
@keyframes card-flip { 0% { transform: rotateY(0); } 47% { transform: rotateY(90deg); } 53% { transform: rotateY(-90deg); } 100% { transform: rotateY(0); } }
@media (prefers-reduced-motion: reduce) { .pcard.flipping { animation: none; } }

/* 우리 집 사진 (카드 안) */
.home-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.home-thumb { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--fill); }
.home-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.extra-note { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: .84rem; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.extra-note svg { flex: none; margin-top: 2px; }
.extra-note b { color: var(--ink); font-weight: 600; }

/* 개인 책임보험(본인 확인) 방패 */
.ins-badge { display: inline-flex; align-items: center; margin-left: 2px; color: var(--c-matcha); }
.ins-badge svg { display: block; }
