:root {
  --red: #e8271b;
  --red-soft: #fdecea;
  --ink: #111;
  --text: #1f1f1f;
  --sub: #666;
  --mute: #9a9a9a;
  --line: #ececec;
  --bg: #fff;
  --bg-soft: #f6f6f7;
  --green: #0a8f4d;
  --blue: #1b64da;
  --radius: 10px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #f1f1f2; color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

#app { max-width: 760px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }
#view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); min-height: 100dvh; }
body.no-tab #view { padding-bottom: 0; }
body.no-tab #tabbar { display: none; }

/* 하단 탭바 */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 760px; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; border-top: 1px solid var(--line);
}
#tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--mute); font-weight: 500; }
#tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
#tabbar a.on { color: var(--ink); font-weight: 700; }
#tabbar a.on svg { stroke-width: 2.1; }
.badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal; line-height: 17px; text-align: center; }

/* 상단 헤더 */
.top { position: sticky; top: 0; z-index: 20; background: #fff; }
.top-row { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 6px; font-size: 21px; font-weight: 900; letter-spacing: -0.04em; color: var(--ink); }
.logo b { color: var(--red); font-weight: 900; }
.logo img { height: 24px; width: auto; }
.top-row .sp { flex: 1; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .badge { top: 2px; left: 20px; }
.back-title { font-size: 17px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top.line { border-bottom: 1px solid var(--line); }

.search { margin: 0 16px 10px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: var(--bg-soft); border-radius: 8px; }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--mute); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--mute); }

/* 카테고리 */
.cats { display: flex; gap: 4px; padding: 6px 10px 14px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.cat i { width: 52px; height: 52px; border-radius: 18px; background: var(--bg-soft); display: grid; place-items: center; font-style: normal; font-size: 25px; transition: background .15s; }
.cat i .ci { width: 42px; height: 42px; object-fit: contain; }
.thumb .ph .ci, .gallery .ph .ci { width: 58%; height: 58%; object-fit: contain; }
.chips span .ci { width: 22px; height: 22px; object-fit: contain; margin-right: 5px; }
.cat.on { color: var(--ink); font-weight: 700; }
.cat.on i { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red); }

.banner { margin: 0 16px 16px; padding: 18px 20px; border-radius: 14px; background: linear-gradient(120deg, #18181b 0%, #3a1512 100%); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.banner h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; }
.banner p { font-size: 12.5px; color: #c9c9c9; margin-top: 4px; }
.banner .bolt { font-size: 40px; }

.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; border-top: 8px solid var(--bg-soft); padding-top: 16px; }
.sec-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.sec-head select { border: 0; background: none; font-size: 13px; color: var(--sub); outline: none; }
.seg { display: flex; gap: 6px; padding: 0 16px 12px; }
.seg button { height: 32px; padding: 0 13px; border-radius: 16px; border: 1px solid var(--line); font-size: 13px; color: var(--sub); background: #fff; }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

/* 지금 핫한 매물 (가로 스크롤) */
.hot-row { display: flex; gap: 10px; padding: 0 16px 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hot-row::-webkit-scrollbar { display: none; }
.hot-row .card { flex: none; width: 38%; max-width: 200px; scroll-snap-align: start; }
@media (min-width: 600px) { .hot-row .card { width: 26%; } }
.rank { position: absolute; top: 0; left: 0; z-index: 1; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px 0 8px 0; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; line-height: 26px; text-align: center; }
.hot-row .card:nth-child(-n+3) .rank { background: var(--red); }

/* 상품 그리드 */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 10px; padding: 0 16px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; display: block; min-width: 0; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 52px; background: linear-gradient(135deg, #f3f3f4, #e6e6e9); }
.thumb .time { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 5px; background: rgba(0,0,0,.72); color: #fff; font-size: 11.5px; font-weight: 600; }
.thumb .time.hot { background: var(--red); }
.thumb .dim { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.heart { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; display: grid; place-items: center; z-index: 2; }
.heart svg { width: 23px; height: 23px; fill: rgba(0,0,0,.28); stroke: #fff; stroke-width: 1.8; }
.heart.on svg { fill: var(--red); stroke: var(--red); }
.card h3 { margin-top: 9px; font-size: 14px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .price { font-size: 16.5px; font-weight: 800; letter-spacing: -0.02em; margin-top: 1px; }
.card .price small { font-size: 11.5px; font-weight: 500; color: var(--mute); margin-right: 4px; }
.card .meta { font-size: 12px; color: var(--mute); margin-top: 1px; display: flex; gap: 5px; align-items: center; }
.card .meta b { color: var(--red); font-weight: 600; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: var(--bg-soft); color: var(--sub); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: #e7f6ee; color: var(--green); }
.tag.blue { background: #e8f0fd; color: var(--blue); }
.tag.dark { background: var(--ink); color: #fff; }

.empty { padding: 70px 20px; text-align: center; color: var(--mute); font-size: 14px; }
.empty .em { font-size: 44px; margin-bottom: 10px; }
.more { display: block; width: calc(100% - 32px); margin: 20px 16px 0; height: 46px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; color: var(--sub); }
.loading { padding: 80px 0; text-align: center; color: var(--mute); }

/* 버튼 · 폼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 50px; padding: 0 20px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 700; font-size: 16px; width: 100%; }
.btn:disabled { background: #d4d4d4; cursor: default; }
.btn.dark { background: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #d5d5d5; }
.btn.sm { height: 38px; font-size: 14px; width: auto; padding: 0 14px; border-radius: 6px; }
.form { padding: 18px 16px 30px; display: flex; flex-direction: column; gap: 18px; }
.field label, .label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 7px; }
.field label em { color: var(--red); font-style: normal; }
.field .hint { font-size: 12px; color: var(--mute); margin-top: 5px; }
.input, .field input, .field select, .field textarea {
  width: 100%; height: 48px; padding: 0 13px; border: 1px solid #dcdcdc; border-radius: 8px; background: #fff; outline: none; font-size: 15px;
}
.field textarea { height: 130px; padding: 12px 13px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.row > .fit { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips label { margin: 0; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border: 1px solid #dcdcdc; border-radius: 19px; font-size: 13.5px; font-weight: 500; color: var(--sub); cursor: pointer; }
.chips input:checked + span { border-color: var(--red); background: var(--red-soft); color: var(--red); font-weight: 700; }
.chips input:focus-visible + span { outline: 2px solid var(--ink); }
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.days label { margin: 0; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 62px; border: 1px solid #dcdcdc; border-radius: 10px; cursor: pointer; }
.days b { font-size: 16px; font-weight: 800; }
.days small { font-size: 11.5px; color: var(--mute); font-weight: 600; }
.days input:checked + span { border-color: var(--red); background: var(--red-soft); }
.days input:checked + span b, .days input:checked + span small { color: var(--red); }
.days input:focus-visible + span { outline: 2px solid var(--ink); }
.photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.photos .add, .photos .ph-item { flex: none; width: 84px; height: 84px; border-radius: 8px; position: relative; overflow: hidden; }
.photos .add { border: 1px dashed #c8c8c8; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--mute); cursor: pointer; background: var(--bg-soft); }
.photos .add b { font-size: 22px; font-weight: 400; line-height: 1; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.notice { padding: 13px 14px; border-radius: 8px; background: var(--bg-soft); font-size: 13px; color: var(--sub); line-height: 1.6; }
.notice.warn { background: #fff7e6; color: #8a5a00; }
.notice b { color: var(--ink); }
.auth-head { padding: 34px 16px 4px; }
.auth-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.35; }
.auth-head p { color: var(--sub); margin-top: 6px; font-size: 14px; }
.link-row { text-align: center; font-size: 14px; color: var(--sub); }
.link-row a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* 상세 */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--bg-soft); }
.gallery::-webkit-scrollbar { display: none; }
.gallery > * { flex: none; width: 100%; aspect-ratio: 1; scroll-snap-align: start; max-height: min(520px, 62dvh); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .ph { display: grid; place-items: center; font-size: 110px; background: linear-gradient(135deg, #f3f3f4, #e2e2e6); }
.g-wrap { position: relative; }
.g-count { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; }
.d-pad { padding: 18px 16px; }
.d-price { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; }
.d-price small { font-size: 13px; font-weight: 600; color: var(--sub); display: block; margin-bottom: 2px; letter-spacing: 0; }
.d-title { font-size: 18px; font-weight: 500; margin-top: 8px; line-height: 1.4; }
.d-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--mute); margin-top: 8px; }
.timer { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.timer span { font-size: 13px; color: #bdbdbd; }
.timer b { font-size: 20px; font-weight: 800; }
.timer.hot { background: var(--red); }
.timer.hot span { color: #ffd6d2; }
.timer.end { background: var(--bg-soft); color: var(--sub); }
.timer.end span { color: var(--mute); }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 9px 8px; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; font-weight: 500; }
.block { border-top: 8px solid var(--bg-soft); padding: 20px 16px; }
.block h2 { font-size: 16px; font-weight: 800; margin-bottom: 13px; display: flex; align-items: center; gap: 6px; }
.block h2 small { font-weight: 500; color: var(--mute); font-size: 13px; }
.desc { white-space: pre-wrap; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.bid-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.bid-row:last-child { border-bottom: 0; }
.bid-row .who { color: var(--sub); display: flex; gap: 6px; align-items: center; }
.bid-row .amt { font-weight: 700; }
.bid-row:first-child .amt { color: var(--red); }
.bid-row time { font-size: 12px; color: var(--mute); margin-left: 8px; font-weight: 400; }
.seller-card { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.seller-card b { display: block; font-size: 15px; }
.seller-card span { font-size: 12.5px; color: var(--mute); }
.state-box { margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; background: var(--red-soft); color: var(--red); }
.state-box.ok { background: #e7f6ee; color: var(--green); }
.state-box.gray { background: var(--bg-soft); color: var(--sub); }

.bottom-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 760px; z-index: 25; display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.bottom-bar .fav-btn { width: 48px; height: 50px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--sub); }
.bottom-bar .fav-btn svg { width: 25px; height: 25px; fill: none; stroke: var(--sub); stroke-width: 1.7; }
.bottom-bar .fav-btn.on svg { fill: var(--red); stroke: var(--red); }
.bottom-bar .btn { flex: 1; padding: 0 8px; }
.has-bar { padding-bottom: 86px; }

/* 시트(모달) */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 760px; background: #fff; border-radius: 18px 18px 0 0; padding: 22px 16px calc(18px + var(--safe-b)); max-height: 90dvh; overflow-y: auto; animation: up .2s ease-out; }
.sheet h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.sheet .sub { font-size: 13px; color: var(--sub); margin-bottom: 16px; }
.sheet .gap { display: flex; flex-direction: column; gap: 14px; }
.big-input { display: flex; align-items: center; gap: 6px; border-bottom: 2px solid var(--ink); padding: 6px 0; }
.big-input input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; text-align: right; background: none; }
.big-input span { font-size: 20px; font-weight: 700; }
.quick { display: flex; gap: 6px; }
.quick button { flex: 1; height: 38px; border-radius: 6px; background: var(--bg-soft); font-size: 13px; font-weight: 600; }
.pay-opt { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid #dcdcdc; border-radius: 8px; cursor: pointer; font-weight: 600; }
.pay-opt:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.pay-opt input { accent-color: var(--red); width: 18px; height: 18px; }
.sum { display: flex; justify-content: space-between; font-size: 15px; padding: 4px 0; }
.sum.total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.sum.total b { color: var(--red); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }

/* 리스트형 */
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.row-item .thumb { width: 72px; height: 72px; flex: none; border-radius: 6px; }
.row-item .thumb .ph { font-size: 30px; }
.row-item .body { flex: 1; min-width: 0; }
.row-item h3 { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .p { font-size: 15.5px; font-weight: 800; margin-top: 2px; }
.row-item .m { font-size: 12.5px; color: var(--mute); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-item .right { flex: none; text-align: right; font-size: 12px; color: var(--mute); }
.dot { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; margin-top: 4px; }
.noti { display: block; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.noti.unread { background: #fff8f7; }
.noti b { display: block; font-size: 14.5px; }
.noti p { font-size: 13.5px; color: var(--sub); margin-top: 2px; }
.noti time { font-size: 12px; color: var(--mute); }

/* 마이 */
.profile { display: flex; align-items: center; gap: 14px; padding: 22px 16px; }
.profile .avatar { width: 60px; height: 60px; font-size: 28px; }
.profile h2 { font-size: 19px; font-weight: 800; }
.profile p { font-size: 13px; color: var(--mute); }
.quick-menu { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 16px 18px; padding: 16px 0; border-radius: 12px; background: var(--bg-soft); }
.quick-menu a { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.quick-menu i { font-style: normal; font-size: 24px; }
.menu { border-top: 8px solid var(--bg-soft); }
.menu a, .menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 16px; font-size: 15px; border-bottom: 1px solid var(--line); text-align: left; }
.menu .chev { color: var(--mute); font-size: 13px; }

/* 거래 */
.steps { display: flex; padding: 20px 10px 6px; }
.step { flex: 1; text-align: center; font-size: 11.5px; color: var(--mute); position: relative; }
.step i { display: block; width: 26px; height: 26px; margin: 0 auto 6px; border-radius: 50%; background: #e3e3e3; color: #fff; font-style: normal; font-weight: 700; font-size: 13px; line-height: 26px; position: relative; z-index: 1; }
.step::before { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: #e3e3e3; }
.step:first-child::before { display: none; }
.step.done i, .step.now i { background: var(--red); }
.step.done::before, .step.now::before { background: var(--red); }
.step.now { color: var(--ink); font-weight: 700; }
.step.done { color: var(--sub); }
.o-card { margin: 14px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.o-card h2 { font-size: 15.5px; font-weight: 800; margin-bottom: 10px; }
.o-card .gap { display: flex; flex-direction: column; gap: 10px; }
.o-card p.t { font-size: 14px; color: var(--sub); line-height: 1.6; }

/* 낙찰 화면 */
.won-hero { position: relative; overflow: hidden; margin: 0; padding: 30px 20px 22px; text-align: center; color: #fff;
  background: radial-gradient(120% 90% at 50% 0%, #ff4a3d 0%, #e8271b 45%, #a3130b 100%); }
.won-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; background: rgba(255,255,255,.18); font-size: 11.5px; font-weight: 800; letter-spacing: .12em; }
.won-hero h1 { font-size: 27px; font-weight: 900; letter-spacing: -0.03em; margin-top: 10px; }
.won-item { display: flex; align-items: center; gap: 14px; margin: 20px auto 0; max-width: 460px; padding: 12px; border-radius: 14px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.won-thumb { width: 76px; height: 76px; flex: none; border-radius: 10px; overflow: hidden; background: var(--bg-soft); }
.won-thumb img { width: 100%; height: 100%; object-fit: cover; }
.won-thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 34px; }
.won-thumb .ph .ci { width: 70%; height: 70%; object-fit: contain; }
.won-title { font-size: 14px; color: var(--sub); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.won-price { font-size: 23px; font-weight: 900; letter-spacing: -0.03em; margin-top: 2px; }
.won-price small { font-size: 12px; font-weight: 700; color: var(--red); margin-right: 6px; letter-spacing: 0; }
.won-deadline { margin-top: 14px; font-size: 13px; color: #ffe1de; }
.won-deadline b { color: #fff; }
.won-burst { position: absolute; inset: 0; pointer-events: none; }
.won-burst i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; background: #ffd84d; opacity: .9; animation: fall 2.6s ease-in forwards; }
.won-burst i:nth-child(3n) { background: #fff; width: 6px; height: 10px; }
.won-burst i:nth-child(3n+1) { background: #ffb3ad; }
.won-burst i:nth-child(1) { left: 6%; animation-delay: .0s; } .won-burst i:nth-child(2) { left: 14%; animation-delay: .25s; }
.won-burst i:nth-child(3) { left: 22%; animation-delay: .1s; } .won-burst i:nth-child(4) { left: 30%; animation-delay: .45s; }
.won-burst i:nth-child(5) { left: 38%; animation-delay: .2s; } .won-burst i:nth-child(6) { left: 46%; animation-delay: .6s; }
.won-burst i:nth-child(7) { left: 54%; animation-delay: .05s; } .won-burst i:nth-child(8) { left: 62%; animation-delay: .35s; }
.won-burst i:nth-child(9) { left: 70%; animation-delay: .15s; } .won-burst i:nth-child(10) { left: 78%; animation-delay: .5s; }
.won-burst i:nth-child(11) { left: 86%; animation-delay: .3s; } .won-burst i:nth-child(12) { left: 94%; animation-delay: .1s; }
.won-burst i:nth-child(13) { left: 10%; animation-delay: .7s; } .won-burst i:nth-child(14) { left: 90%; animation-delay: .8s; }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(260px) rotate(540deg); opacity: 0; } }
.dv-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid #dcdcdc; border-radius: 10px; cursor: pointer; }
.dv-opt:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.dv-opt input { accent-color: var(--red); width: 19px; height: 19px; margin: 2px 0 0; flex: none; }
.dv-body b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.dv-body small { display: block; font-size: 13px; color: var(--sub); margin-top: 2px; line-height: 1.5; }
.inst-form { padding: 4px 2px 0; }
.quote { padding: 14px; border-radius: 10px; background: var(--bg-soft); }
.quote .sum { font-size: 13.5px; }
.quote .sum span:first-child { color: var(--sub); padding-right: 10px; }
.quote .sum.total { font-size: 16px; }
.quote .sum.total span:first-child { color: var(--ink); }
.q-head { font-weight: 800; margin-bottom: 6px; }
.q-head small { font-weight: 500; color: var(--mute); font-size: 12px; margin-left: 4px; }
.q-empty { color: var(--mute); font-size: 13.5px; text-align: center; padding: 6px 0; }
.q-note { font-size: 12px; color: var(--mute); margin-top: 8px; line-height: 1.55; }

/* 채팅 */
.chat { display: flex; flex-direction: column; height: 100dvh; }
.chat-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; background: #fff; }
.chat-item .thumb { width: 44px; height: 44px; border-radius: 6px; flex: none; }
.chat-item .thumb .ph { font-size: 20px; }
.chat-item .body { flex: 1; min-width: 0; font-size: 13.5px; }
.chat-item .body div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 7px; }
.msg { max-width: 76%; padding: 9px 12px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; align-self: flex-start; border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--red); color: #fff; border-radius: 16px; border-top-right-radius: 4px; }
.msg.system { align-self: center; max-width: 90%; background: #e7e7ea; color: var(--sub); font-size: 12.5px; border-radius: 12px; text-align: center; }
.msg-time { font-size: 10.5px; color: var(--mute); align-self: flex-start; margin: -3px 4px 2px; }
.msg-time.me { align-self: flex-end; }
.composer { display: flex; gap: 8px; padding: 9px 12px calc(9px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: var(--bg-soft); border-radius: 22px; padding: 0 16px; }
.composer button { width: 44px; height: 44px; border-radius: 50%; background: var(--red); display: grid; place-items: center; flex: none; }
.composer svg { width: 20px; height: 20px; fill: #fff; }

/* 하단 사업자정보 */
.site-footer { margin-top: 36px; padding: 24px 16px 28px; background: var(--bg-soft); color: var(--sub); font-size: 12px; line-height: 1.7; }
.site-footer p { margin-top: 10px; }
.site-footer a { text-decoration: underline; text-underline-offset: 2px; }
.f-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink); }
.f-links a { text-decoration: none; }
.f-cs b { color: var(--ink); }
.f-note { color: var(--mute); }
.f-copy { color: var(--mute); }
/* 약관 · 정책 */
.legal { padding: 20px 16px 10px; font-size: 14px; line-height: 1.75; color: var(--text); }
.legal h1 { font-size: 21px; font-weight: 800; }
.legal-meta { color: var(--mute); font-size: 13px; margin-top: 4px !important; }
.legal h2 { font-size: 15.5px; font-weight: 800; margin: 24px 0 6px; }
.legal p { margin-top: 6px; }
.legal ul, .legal ol { padding-left: 20px; margin: 6px 0; }
.legal li { margin: 3px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.legal th { background: var(--bg-soft); font-weight: 700; }
/* 가입 동의 */
.agree { display: flex; flex-direction: column; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.agree label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; cursor: pointer; }
.agree label:first-child { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.agree input { width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.agree a { text-decoration: underline; text-underline-offset: 2px; }
#stage-bar { position: sticky; top: 0; z-index: 40; max-width: 760px; margin: 0 auto; padding: 5px 12px; background: #ffd400; color: #111; font-size: 12.5px; font-weight: 800; text-align: center; letter-spacing: .02em; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 26px); transform: translate(-50%, 20px); z-index: 99; max-width: min(88vw, 420px); padding: 12px 18px; border-radius: 10px; background: rgba(20,20,20,.94); color: #fff; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───────── PC 최적화 (1024px 이상) ───────── */
.tb-logo { display: none !important; }
@media (min-width: 1024px) {
  body { background: #fff; }
  #app { max-width: 1200px; display: flex; flex-direction: column; }
  #view { padding-bottom: 40px; }
  body.no-tab #view { padding-bottom: 0; }

  /* 하단 탭바 → 상단 글로벌 메뉴 */
  #tabbar, body.no-tab #tabbar {
    order: -1; display: flex; align-items: center; gap: 2px;
    position: sticky; top: 0; bottom: auto; left: auto; transform: none;
    width: 100%; max-width: none; height: 64px; padding: 0 24px;
    border-top: 0; border-bottom: 1px solid var(--line); background: #fff; z-index: 35;
  }
  #tabbar .tb-logo { display: flex !important; margin-right: auto; padding: 0; height: auto; }
  #tabbar .tb-logo img { height: 26px; width: auto; }
  #tabbar a { flex-direction: row; gap: 6px; height: 40px; padding: 0 14px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--sub); }
  #tabbar a:hover { background: var(--bg-soft); color: var(--ink); }
  #tabbar a.on { color: var(--ink); background: var(--bg-soft); }
  #tabbar a[data-tab="sell"] { background: var(--red); color: #fff; margin-left: 6px; }
  #tabbar a[data-tab="sell"]:hover { background: #c91f14; color: #fff; }
  #tabbar svg { width: 20px; height: 20px; }
  #tabbar .badge { position: static; margin-left: 2px; }
  .top { top: 64px; }
  .top-row .logo { display: none; }
  /* 홈: 알림 종을 검색창 오른쪽으로 올려 빈 줄 제거 */
  .top:has(.search) .top-row { position: absolute; right: 24px; top: 4px; height: 50px; padding: 0; }
  .top:has(.search) .search { margin-top: 4px; margin-right: 84px; }
  #stage-bar { max-width: 1200px; }

  /* 홈 */
  .top-row { padding: 0 24px; }
  .search { margin: 4px 24px 14px; height: 50px; }
  .cats { padding: 8px 24px 18px; gap: 10px; }
  .cat { width: 84px; font-size: 13px; }
  .cat i { width: 64px; height: 64px; border-radius: 20px; }
  .cat i .ci { width: 50px; height: 50px; }
  .banner { margin: 0 24px 22px; padding: 28px 32px; }
  .banner h2 { font-size: 22px; }
  .sec-head, .seg { padding-left: 24px; padding-right: 24px; }
  .hot-row { padding: 0 24px 26px; gap: 16px; }
  .hot-row .card { width: calc((100% - 64px) / 5); max-width: none; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 30px 16px; padding: 0 24px; }
  .card h3 { font-size: 15px; }
  .card:hover .thumb img { transform: scale(1.03); }
  .thumb img { transition: transform .25s; }
  .more { width: 240px; margin: 28px auto 0; }

  /* 매물 상세: 왼쪽 사진 / 오른쪽 정보 */
  .detail-page { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: 40px; padding: 24px 24px 110px; align-items: start; }
  .detail-page > .g-wrap { grid-column: 1; grid-row: 1 / span 8; position: sticky; top: 140px; border-radius: 14px; overflow: hidden; }
  .detail-page .gallery > * { max-height: none; }
  .detail-page > .d-pad { grid-column: 2; padding: 0 0 18px; }
  .detail-page > .block { grid-column: 2; border-top: 1px solid var(--line); padding: 20px 0; }
  .d-price { font-size: 32px; }
  .d-title { font-size: 20px; }
  .bottom-bar { max-width: 1200px; padding: 12px 24px; justify-content: flex-end; }
  .bottom-bar .fav-btn { margin-left: auto; }
  .bottom-bar .btn { flex: 0 1 220px; }

  /* 폼 · 목록 · 거래 화면은 가운데 정렬 */
  .form, .auth-head, .legal { max-width: 640px; margin-left: auto; margin-right: auto; }
  .rows, .steps, .profile, .quick-menu, .menu, #rows, .o-card, .won-item { max-width: 760px; margin-left: auto; margin-right: auto; }
  .o-card { margin-top: 16px; margin-bottom: 16px; }
  .row-item:hover, .noti:hover { background: var(--bg-soft); }
  .won-hero { padding: 40px 24px 30px; }
  .won-hero h1 { font-size: 32px; }
  .chat { height: calc(100dvh - 64px); max-width: 860px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

  /* 시트 → 가운데 팝업 */
  .sheet-bg { align-items: center; }
  .sheet { max-width: 480px; border-radius: 16px; padding-bottom: 22px; animation: fade .15s; }

  .site-footer { padding: 28px 24px 34px; }
  #toast { bottom: 36px; }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
