/* Shared by the home page and the sub pages (매물, 동네 이야기, 묻고 답하기): tokens, top menu, section heads, story and
   question cards. Page-specific layout stays in each page. */
:root {
  --white: #ffffff;
  --light: #f7f4f2;
  --pill: #f3efec;
  --line: #ebe5df;
  --ink: #282420;
  --ink-2: #18181b;
  --muted: #6f675f;
  --sub: #8a8178;
  --yellow: #f4e75a;
  --cream: #feffd9;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --track: -0.045em;
  --wrap: 1320px;
  --gnb-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.4; word-break: keep-all; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- top menu ---------- */
.gnb { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.86); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.gnb.scrolled { border-bottom-color: var(--line); background: rgba(255,255,255,.94); }
.gnb-in { max-width: 1440px; margin: 0 auto; height: var(--gnb-h); padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.gnb .brand { font-size: 17px; font-weight: 600; letter-spacing: -0.04em; white-space: nowrap; margin-right: auto; display: inline-flex; align-items: center; gap: 9px; }
.gnb .brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px rgba(244,231,90,.35); }
.gnb-links { display: flex; gap: 4px; }
.gnb-links a { position: relative; padding: 9px 13px; border-radius: 999px; font-size: 15px; font-weight: 500; letter-spacing: -0.02em; color: #4a443e; white-space: nowrap; transition: background .15s, color .15s; }
.gnb-links a:hover { background: var(--pill); color: var(--ink); }
.gnb-links a.on { color: var(--ink); font-weight: 650; }
.gnb-links a.on::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--ink); }
.gnb-r { display: flex; gap: 6px; }
.gnb .btn { padding: 11px 18px; font-size: 14px; font-weight: 600; }
.gnb .btn.make { background: var(--ink); color: #fff; }
.gnb .btn .d { display: none; }
@media (max-width: 899px) {
  .gnb-in { flex-wrap: wrap; height: auto; padding: 10px 16px 0; row-gap: 6px; }
  .gnb-links { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 2px 10px 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .gnb-links::-webkit-scrollbar { display: none; }
  .gnb-links a { padding: 9px 10px 11px; font-size: 15px; border-radius: 8px; }
  .gnb-links a:hover { background: transparent; }
  .gnb-links a.on::after { left: 10px; right: 10px; bottom: 2px; }
  .gnb .btn { padding: 9px 14px; font-size: 13px; }
}
@media (max-width: 380px) { .gnb .btn.make { display: none; } }
@media (min-width: 900px) {
  .gnb-in { padding: 0 40px; height: 72px; }
  .gnb .brand { font-size: 18px; }
  .gnb .btn .d { display: inline; }
}
@media (min-width: 900px) and (max-width: 1120px) { .gnb .btn.make { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 22px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; background: var(--pill); color: var(--ink); white-space: nowrap; border: 0; cursor: pointer; transition: transform .15s var(--ease), background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.y { background: var(--yellow); }
.btn.y:hover { box-shadow: 0 6px 18px rgba(196,180,30,.28); }
.btn.dark { background: var(--ink); color: #fff; }
.more { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; color: var(--ink); padding: 6px 0; border-bottom: 1.5px solid var(--ink); }
.more::after { content: "→"; transition: transform .2s var(--ease); }
.more:hover::after { transform: translateX(4px); }
.on-dark .more { color: #fff; border-bottom-color: rgba(255,255,255,.6); }

/* ---------- section head: eyebrow + title + lead | link ---------- */
.band { padding: 72px 16px; }
.band > .in { max-width: var(--wrap); margin: 0 auto; }
.band.light { background: var(--light); }
.sh { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; margin-bottom: 32px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 1px rgba(40,36,32,.18); }
.on-dark .eyebrow { color: rgba(255,255,255,.66); }
.sh h2 { margin: 14px 0 0; font-size: 32px; line-height: 1.18; font-weight: 600; letter-spacing: var(--track); color: var(--ink-2); }
.on-dark .sh h2 { color: #fff; }
.sh .lead { margin: 12px 0 0; max-width: 560px; font-size: 16px; line-height: 1.6; color: var(--muted); }
@media (min-width: 900px) {
  .band { padding: 112px 60px; }
  .sh { margin-bottom: 44px; }
  .sh h2 { font-size: 46px; }
  .sh .lead { font-size: 17px; }
}

/* ---------- story cards (동네 이야기) ---------- */
.scards { display: grid; gap: 14px; }
.scard { display: flex; flex-direction: column; background: var(--white); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.scard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(40,36,32,.28); }
.scard .ph { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #efe9e3, #e4ddd5); overflow: hidden; }
.scard .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.scard:hover .ph img { transform: scale(1.04); }
.scard .ph.none { display: flex; align-items: flex-end; padding: 18px 20px; background: radial-gradient(120% 90% at 85% 10%, rgba(244,231,90,.32), transparent 55%), var(--ink); }
.scard .ph.none span { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: var(--cream); opacity: .85; display: inline-flex; align-items: center; gap: 8px; }
.scard .ph.none span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.scard .tx { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.scard time { font-size: 13px; color: var(--sub); }
.scard h3 { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 600; letter-spacing: -0.035em; color: var(--ink-2); }
.scard p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* phones: first card full, the rest as compact rows */
@media (max-width: 899px) {
  .scards .scard:not(:first-child) { flex-direction: row; }
  .scards .scard:not(:first-child) .ph { aspect-ratio: auto; width: 116px; flex: none; }
  .scards .scard:not(:first-child) .ph.none span { display: none; }
  .scards .scard:not(:first-child) .tx { padding: 14px 16px; gap: 4px; }
  .scards .scard:not(:first-child) h3 { font-size: 16px; }
  .scards .scard:not(:first-child) p { -webkit-line-clamp: 1; font-size: 14px; }
}
/* first card large on wide screens */
@media (min-width: 900px) {
  .scards { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .scards.lead1 { grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; }
  .scards.lead1 .scard:first-child { grid-row: span 2; }
  .scards.lead1 .scard:first-child .ph { aspect-ratio: 4 / 3; }
  .scards.lead1 .scard:first-child h3 { font-size: 26px; }
  .scards.lead1 .scard:not(:first-child) { flex-direction: row; }
  .scards.lead1 .scard:not(:first-child) .ph { aspect-ratio: auto; width: 42%; flex: none; }
}

/* ---------- questions (묻고 답하기) ---------- */
.qa-list { display: grid; gap: 12px; }
.qa { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 22px 22px 20px; }
.qa .q { display: flex; gap: 12px; }
.qa .q b, .qa .a b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.qa .q b { background: var(--ink); color: #fff; }
.qa .a b { background: var(--yellow); color: var(--ink); }
.qa .q p { margin: 3px 0 0; font-size: 16px; line-height: 1.55; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-2); white-space: pre-line; }
.qa .who { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--sub); }
.qa .a { display: flex; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.qa .a p { margin: 3px 0 0; font-size: 15px; line-height: 1.65; color: #4b443d; white-space: pre-line; }
.qa.clamp .a p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field textarea { font: inherit; font-size: 16px; font-weight: 400; padding: 13px 15px; border-radius: 12px; border: 1px solid #ddd5cd; background: #fff; color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 130px; line-height: 1.55; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(244,231,90,.45); }
.field small { font-weight: 400; color: var(--sub); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- sub pages ---------- */
.sub-main { max-width: var(--wrap); min-height: calc(100vh - 260px); margin: 0 auto; padding: 44px 16px 96px; }
.sub-head h1 { margin: 14px 0 0; font-size: 36px; line-height: 1.15; font-weight: 600; letter-spacing: var(--track); color: var(--ink-2); }
.sub-head p { margin: 12px 0 0; max-width: 560px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.sub-foot { border-top: 1px solid var(--line); background: var(--light); padding: 32px 16px 40px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.sub-foot > div { max-width: var(--wrap); margin: 0 auto; }
.sub-foot b { color: var(--ink); }
@media (min-width: 900px) {
  .sub-main { padding: 72px 60px 120px; }
  .sub-head h1 { font-size: 52px; }
  .sub-foot { padding: 40px 60px 48px; }
}

/* phones: bottom tab bar (added by nav.js). Every item: same 32px icon slot + one label line, so labels share a baseline. */
.tabbar { display: none; }
@media (max-width: 899px) {
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); padding: 7px 4px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: -0.03em; color: var(--sub); text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
  .tabbar i { display: grid; place-items: center; width: 52px; height: 32px; border-radius: 16px; transition: background .15s; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabbar a[aria-current="page"] i { background: var(--light); }
  .tabbar a.call { color: var(--ink); font-weight: 600; }
  .tabbar a.call i { background: var(--yellow); }
}

/* consultation widget (chat.js): round launcher + panel */
.chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 70; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; box-shadow: 0 8px 24px rgba(40,36,32,.22), 0 2px 6px rgba(40,36,32,.12); transition: transform .18s var(--ease), box-shadow .18s; -webkit-tap-highlight-color: transparent; }
.chat-fab img { display: block; width: 64px; height: 64px; border-radius: 50%; }
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(40,36,32,.26), 0 3px 8px rgba(40,36,32,.14); }
.chat-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.chat-panel { position: fixed; right: 24px; bottom: 100px; z-index: 71; width: 380px; max-height: min(620px, calc(100vh - 140px)); display: flex; flex-direction: column; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 24px 60px rgba(40,36,32,.22), 0 4px 14px rgba(40,36,32,.1); }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head img { width: 40px; height: 40px; border-radius: 50%; }
.chat-head div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.chat-head b { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.chat-head span { font-size: 12.5px; color: var(--sub); }
.chat-x { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.chat-x:hover { background: var(--light); }
.chat-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chat-log { position: relative; flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 8px; background: var(--light); overscroll-behavior: contain; }
.msg { margin: 0; max-width: 84%; padding: 11px 14px; font-size: 15px; line-height: 1.5; letter-spacing: -0.02em; border-radius: 18px; }
.msg.bot { align-self: flex-start; background: #fff; color: var(--ink); border-top-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-top-right-radius: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.opt { padding: 10px 14px; border: 1px solid #e3ddd7; border-radius: 999px; background: #fff; font: inherit; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--ink); }
.opt.go { background: var(--yellow); border-color: var(--yellow); font-weight: 600; }
.chat-head a.chat-x { color: var(--ink); }
.chat-head a.chat-x svg { width: 20px; height: 20px; stroke-linejoin: round; }
.msg.typing { display: flex; gap: 4px; padding: 15px 16px; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--sub); animation: chatdot 1s infinite ease-in-out; }
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chatdot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-foot { padding: 10px 12px 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-in { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid #e3ddd7; border-radius: 22px; transition: border-color .15s; }
.chat-in:focus-within { border-color: var(--ink); }
.chat-in textarea { flex: 1; min-width: 0; height: 30px; max-height: 120px; padding: 5px 0; border: 0; outline: 0; resize: none; background: none; font: inherit; font-size: 16px; line-height: 20px; letter-spacing: -0.02em; color: var(--ink); }
.chat-in textarea::placeholder { color: var(--sub); }
.chat-send { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; }
.chat-send:disabled { opacity: .35; cursor: default; }
.chat-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-note { margin: 7px 4px 0; font-size: 11.5px; line-height: 1.45; color: var(--sub); letter-spacing: -0.02em; }
.rq { align-self: stretch; display: grid; gap: 8px; margin: 2px 0 4px; padding: 14px; background: #fff; border-radius: 16px; font-size: 14px; letter-spacing: -0.02em; }
.rq p { margin: 0; line-height: 1.5; }
.rq-t { font-size: 15px; font-weight: 600; }
.rq-deal { display: flex; flex-wrap: wrap; gap: 6px; }
.rq-chip { padding: 7px 12px; border: 1px solid #e3ddd7; border-radius: 999px; background: #fff; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.rq-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.rq-f { display: grid; gap: 4px; }
.rq-f span { font-size: 12.5px; color: var(--muted); }
.rq-f input, .rq-f textarea { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid #e3ddd7; border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; resize: vertical; }
.rq-f input:focus, .rq-f textarea:focus { outline: 0; border-color: var(--ink); }
.rq .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rq-c { padding: 10px 11px; background: var(--light); border-radius: 10px; font-size: 12.5px; color: var(--muted); }
.rq-ck { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--ink); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.rq-ck input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.rq-err { color: #b3261e; font-size: 13px; }
.rq-err:empty { display: none; }
.rq-go { padding: 12px; border: 0; border-radius: 12px; background: var(--yellow); font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
.rq-go:disabled { opacity: .5; }
@media (max-width: 899px) {
  .chat-fab { right: 16px; bottom: calc(68px + 16px + env(safe-area-inset-bottom)); width: 58px; height: 58px; }
  .chat-fab img { width: 58px; height: 58px; }
  .chat-panel { left: 0; right: 0; top: 0; bottom: 0; width: auto; max-height: none; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  .chat-open, .chat-open body { overflow: hidden; }
  .chat-open .chat-fab { display: none; }
}
a.pp-link { font-weight: 700; color: var(--ink); }
.chat-note a, .rq-c a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lc-row { display: grid; gap: 8px; align-self: stretch; margin: 2px 0 4px; }
.lc { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 8px; background: #fff; border-radius: 14px; color: var(--ink); text-decoration: none; border: 1px solid transparent; transition: border-color .15s; }
.lc:hover { border-color: var(--ink); }
.lc-ph { width: 76px; height: 64px; border-radius: 10px; background: var(--pill); overflow: hidden; }
.lc-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-b { display: grid; gap: 2px; min-width: 0; letter-spacing: -0.02em; }
.lc-b b { font-size: 15px; font-weight: 600; }
.lc-b span { font-size: 13px; color: var(--muted); }
.lc-b small { font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-sub { font-size: 12.5px; color: var(--muted); }
