:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-2: #f7f5f1;
  --ink: #1f1d1a;
  --ink-2: #6b665e;
  --line: #e6e1d8;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --accent-soft: #ffe9e2;
  --good: #15803d;
  --warn: #b45309;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 29, 26, .06), 0 4px 16px rgba(31, 29, 26, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110; --surface: #1c1b19; --surface-2: #252320; --ink: #f2efe9; --ink-2: #a39d93;
    --line: #34312c; --accent-soft: #3a1f17; --shadow: none; --good: #4ade80; --warn: #f59e0b;
  }
}
:root[data-theme="dark"] {
  --bg: #121110; --surface: #1c1b19; --surface-2: #252320; --ink: #f2efe9; --ink-2: #a39d93;
  --line: #34312c; --accent-soft: #3a1f17; --shadow: none; --good: #4ade80; --warn: #f59e0b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Noto Sans KR", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }

.phone {
  max-width: 440px; min-height: 100%; margin: 0 auto; background: var(--bg);
  display: flex; flex-direction: column; position: relative;
}
@media (min-width: 520px) {
  body { padding: 24px 0; }
  .phone { min-height: calc(100vh - 48px); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
}

.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
}
.brand { font-weight: 500; letter-spacing: -.01em; font-size: 17px; }
.brand b { color: var(--accent); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn:hover { background: var(--surface-2); }

main { flex: 1; padding: 4px 16px 96px; }

/* ── 공통 ── */
h1 { font-size: 24px; line-height: 1.3; margin: 12px 0 6px; letter-spacing: -.02em; }
.sub { color: var(--ink-2); margin: 0 0 20px; }
.step { color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 8px; }
.progress { display: flex; gap: 6px; margin: 8px 0 4px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.progress i.on { background: var(--accent); }

.btn {
  display: block; width: 100%; padding: 14px; border-radius: 14px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px;
}
.btn:disabled { opacity: .35; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.sticky-cta { position: sticky; bottom: 16px; margin-top: 24px; }
.has-tabs .sticky-cta { bottom: 80px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.options { display: grid; gap: 10px; }
.option {
  text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); display: flex; gap: 12px; align-items: center;
}
.option .radio { flex: 0 0 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); }
.option[aria-pressed="true"] .radio { border: 5px solid var(--accent); }
.option strong { display: block; }
.option small { color: var(--ink-2); }
.option[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }

.ai-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); vertical-align: 2px;
}

/* ── 크리에이터 ── */
.creator-list { display: grid; gap: 12px; }
.creator {
  background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line); display: grid; grid-template-columns: 56px 1fr; gap: 12px;
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  border: 2px solid var(--c);
}
.avatar.sm { width: 36px; height: 36px; font-size: 18px; border-width: 1.5px; }
.avatar { position: relative; overflow: hidden; flex: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.creator h3 { margin: 0; font-size: 16px; }
.creator .handle { color: var(--ink-2); font-size: 13px; }
.creator p { margin: 6px 0 8px; font-size: 14px; }
.creator .tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink-2); }
.creator .tags span { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }
.creator .row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.match { font-weight: 700; color: var(--good); font-size: 14px; }
.meter { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.follow {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; font-weight: 700; font-size: 13px;
}
.follow[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ── 피드 ── */
.feed-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tabs .chip { white-space: nowrap; }
.source-note { font-size: 12px; color: var(--ink-2); margin: -4px 0 12px; }
.cards { display: grid; gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card .by { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0; font-size: 13px; }
.card .by b { font-weight: 700; }
.card .by .by-tags { margin-left: auto; display: flex; gap: 4px; }
.ad-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--ink-2); color: var(--ink-2); vertical-align: 1px;
}
.card .reason { padding: 8px 14px 10px; margin: 0; font-size: 15px; }
.thumb {
  height: 150px; display: grid; place-items: center; position: relative; color: color-mix(in srgb, var(--c) 70%, var(--ink));
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--surface)), var(--surface-2));
}
.thumb .ph { width: 44px; height: 44px; stroke-width: 1.25; opacity: .7; }
.mini .thumb .ph { width: 26px; height: 26px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb .cat { position: absolute; left: 10px; bottom: 8px; font-size: 12px; background: var(--surface); padding: 2px 8px; border-radius: 6px; color: var(--ink-2); }
.card .info { padding: 12px 14px 4px; }
.card .name { font-size: 15px; margin: 0 0 4px; }
.card .price { font-size: 18px; font-weight: 700; }
.card .meta { font-size: 13px; color: var(--ink-2); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.badge.hot { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.card .actions { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; padding: 12px 14px 14px; align-items: center; }
.act { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: 14px; display: grid; place-items: center; }
.act .ic { width: 18px; height: 18px; }
.act[data-act="like"][aria-pressed="true"] .ic { fill: var(--accent); stroke: var(--accent); }
.act[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.act.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.act.link { text-decoration: none; color: var(--ink); text-align: center; }
.ad-note { font-size: 11px; color: var(--ink-2); text-align: center; margin: 16px 0 0; }

/* ── 채팅 ── */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.chat-head select { margin-left: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.msgs { display: flex; flex-direction: column; gap: 10px; padding: 14px 0 150px; }
.bubble { max-width: 84%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.typing { color: var(--ink-2); }
.bubble.bot { position: relative; padding-right: 40px; }
.listen {
  position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center;
}
.listen .ic { width: 16px; height: 16px; }
.listen:hover { color: var(--accent); }
.mode { font-size: 11px; color: var(--ink-2); margin: -6px 0 0 4px; }
.mini-cards { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
.mini {
  flex: 0 0 150px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: left; padding: 0;
  color: var(--ink); text-decoration: none;
}
.mini .thumb { height: 72px; }
.mini div { padding: 8px 10px; font-size: 12px; }
.mini b { display: block; font-size: 14px; }
.composer {
  position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); width: min(440px, 100%);
  padding: 8px 16px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
}
.suggest { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.suggest .chip { white-space: nowrap; padding: 6px 12px; font-size: 13px; }
.composer form { display: flex; gap: 8px; }
.composer input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}
.composer form button { border: 0; border-radius: 999px; padding: 0 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.focus-chip { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.focus-chip button { border: 0; background: none; color: var(--ink-2); padding: 0 4px; display: grid; }
.focus-chip .ic { width: 14px; height: 14px; }
.dash-link { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 0; font-size: 13px; color: var(--ink-2); }

/* ── 탭바 / 토스트 ── */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(440px, 100%);
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { border: 0; background: none; padding: 8px 0 10px; display: grid; justify-items: center; gap: 2px; color: var(--ink-2); }
.tab .ic { width: 22px; height: 22px; }
.tab span { font-size: 11px; }
.tab.on { color: var(--accent); }
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; font-size: 13px; transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; color: var(--ink-2); padding: 40px 0; }
.error { background: var(--accent-soft); color: var(--accent); padding: 12px; border-radius: 12px; font-size: 14px; }

/* ── 스와이프 취향 테스트, 선택 정보, 내 정보 ── */
.swipe-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  touch-action: pan-y; user-select: none; transition: transform .18s, opacity .18s; }
.swipe-card .thumb { height: 240px; }
.swipe-card .info { padding: 14px 16px 16px; }
.swipe-card .name { margin: 0 0 4px; }
.swipe-card .price { font-size: 18px; font-weight: 700; }
.swipe-card.out-right { transform: translateX(120%) rotate(12deg); opacity: 0; }
.swipe-card.out-left { transform: translateX(-120%) rotate(-12deg); opacity: 0; }
.swipe-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.swipe-btn { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.swipe-btn.like { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.swipe-btn.like .ic { fill: var(--accent); }
.skip { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--ink-2); font-size: 14px; text-decoration: underline; }
.field-label { display: block; font-size: 13px; color: var(--ink-2); margin: 18px 0 8px; }
.select { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.consent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 16px; font-size: 14px; }
.consent b { display: block; margin-bottom: 6px; }
.consent dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 13px; }
.consent dt { color: var(--ink-2); }
.consent dd { margin: 0; }
.consent .agree { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.consent .btn { margin-top: 8px; font-size: 14px; padding: 10px; }
.danger-text { color: var(--accent) !important; }

/* ── 로그인, 가입, 계정 ── */
.auth-form { display: grid; gap: 14px; margin-top: 8px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.field input {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; width: 100%;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field small { font-size: 12px; }
.form-error { color: var(--accent); font-size: 13px; margin: 0; min-height: 1em; }

/* 새 비밀번호 강도, 확인 일치 */
.pw-meter { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); margin-top: -6px; }
.pw-meter .bars { display: flex; gap: 4px; }
.pw-meter .bars i { width: 32px; height: 4px; border-radius: 2px; background: var(--line); transition: background .15s; }
.pw-meter[data-level="0"] .bars i:first-child { background: var(--accent); }
.pw-meter[data-level="1"] .bars i:first-child { background: var(--warn); }
.pw-meter[data-level="2"] .bars i:nth-child(-n+2) { background: var(--good); }
.pw-meter[data-level="3"] .bars i { background: var(--good); }
.pw-meter[data-level="0"] .pw-label { color: var(--accent); font-weight: 700; }
.pw-meter[data-level="1"] .pw-label { color: var(--warn); font-weight: 700; }
.pw-meter[data-level="2"] .pw-label, .pw-meter[data-level="3"] .pw-label { color: var(--good); font-weight: 700; }
.pw-tip, .pw-match { font-size: 12px; margin: -6px 0 0; min-height: 1em; color: var(--ink-2); }
.pw-tip.bad, .pw-match.bad { color: var(--accent); }
.pw-match.ok { color: var(--good); }
.auth-switch { text-align: center; font-size: 14px; color: var(--ink-2); margin-top: 16px; }
.auth-switch button { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 4px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-actions .btn { width: auto; flex: 1 1 auto; margin-top: 0; }
.consent .auth-form { margin-top: 12px; }
.topbar .right { display: flex; gap: 2px; }
.brand-ko { font-size: 12px; color: var(--ink-2); margin-left: 4px; font-weight: 400; }
.foot-links { display: grid; gap: 4px; margin-top: 8px; }
button.dash-link { border: 0; background: none; width: 100%; }
.context-note { display: flex; gap: 6px; align-items: center; font-size: 13px; margin: -4px 0 6px; color: var(--ink); }
.context-note .ic { width: 16px; height: 16px; color: var(--accent); }

/* ── 가입 필수 확인 ── */
.agree-box { display: grid; gap: 10px; margin: 4px 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check em { font-style: normal; color: var(--ink-2); font-size: 12px; }
.check a, .agree-note a { color: var(--accent); }
.agree-note { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.5; }

/* ── 사업자 정보 푸터 (site-footer.js) ── */
.site-footer { padding: 20px 16px 28px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.7; color: var(--ink-2); }
.has-tabs .site-footer { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; font-size: 12.5px; }
.site-footer .links a { color: var(--ink); text-decoration: none; }
.site-footer .links a.strong { font-weight: 700; }
.site-footer .biz { margin: 0; }
.site-footer .biz span { display: inline-block; margin-right: 10px; }
.site-footer .biz a { color: var(--ink-2); }
.site-footer .copy { margin: 8px 0 0; }

/* 운영자 비밀번호 변경: 현재 비밀번호 실시간 확인 (ops.js) */
.pw-current { margin: -6px 0 8px; font-size: 12.5px; color: var(--ink-2); min-height: 1em; }
.pw-current.ok { color: var(--good); }
.pw-current.bad { color: var(--accent); }
.narrow-panel { max-width: 560px; }

/* ── 소셜 로그인 버튼 (카카오 디자인 가이드: #FEE500 배경, 검은 심볼, 85% 검정 글자) ── */
.or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--ink-2); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.kakao-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px;
  border: 0; border-radius: 12px; background: #FEE500; color: rgba(0, 0, 0, .85); font-weight: 500; font-size: 15px; }
.kakao-btn.small { width: auto; height: 40px; padding: 0 14px; font-size: 14px; }
.kakao-btn:disabled { opacity: .6; }
.kakao-symbol { width: 18px; height: 18px; fill: #000; }
