/* 봉황장터 — 봉황 백과의 한지(밝음)·먹(어두움) 톤을 이어받음. 모바일 먼저. */
:root {
  --bg: #f6f2ea; --bg-2: #efe9dd; --card: #fffdf8; --line: #e3dbcc; --line-2: #d4c9b5;
  --ink: #1d1b17; --ink-2: #4a453c; --muted: #8a8172;
  --accent: #c8402a; --accent-ink: #a9321f; --accent-soft: #f6e1d8; --gold: #a87a1f;
  --up: #d8323c; --down: #2f6bd8; --cheap: #1d8f5a; --warn-bg: #fff4dc; --warn-line: #f0c46a; --warn-ink: #8a5300;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 8px 24px rgba(60, 45, 20, .06);
  --shadow-pop: 0 2px 6px rgba(40, 30, 10, .10), 0 24px 48px rgba(40, 30, 10, .16);
  --radius: 14px; --radius-s: 9px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --tabbar-h: 58px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #13120f; --bg-2: #1b1a16; --card: #1e1d19; --line: #2e2c26; --line-2: #3d3a32;
  --ink: #ede8dd; --ink-2: #c9c2b4; --muted: #8f877a;
  --accent: #f06a4c; --accent-ink: #ff8a6e; --accent-soft: #3a211a; --gold: #d6a84a;
  --up: #ff5a5f; --down: #5b97ff; --cheap: #3fc489; --warn-bg: #3a2c10; --warn-line: #8a6420; --warn-ink: #ffd27a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .45), 0 24px 48px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #13120f; --bg-2: #1b1a16; --card: #1e1d19; --line: #2e2c26; --line-2: #3d3a32;
    --ink: #ede8dd; --ink-2: #c9c2b4; --muted: #8f877a;
    --accent: #f06a4c; --accent-ink: #ff8a6e; --accent-soft: #3a211a; --gold: #d6a84a;
    --up: #ff5a5f; --down: #5b97ff; --cheap: #3fc489; --warn-bg: #3a2c10; --warn-line: #8a6420; --warn-ink: #ffd27a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .45), 0 24px 48px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.5; letter-spacing: -0.01em; font-feature-settings: "tnum" 1;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 8px 12px; background: var(--ink); color: var(--bg); border-radius: 8px; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }

/* ---------- 머리줄 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 8px max(14px, env(safe-area-inset-left)) 8px max(14px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-left { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 850; font-size: 18px; letter-spacing: -0.04em; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.tb-title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { width: 34px; height: 38px; margin-left: -8px; border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; color: var(--ink-2); flex: none; }
.topnav, .tb-search, .brand.desk { display: none; }
.tb-right { display: flex; align-items: center; gap: 8px; flex: none; }
.tb-user { display: flex; align-items: center; gap: 6px; }
.tb-ico { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.tb-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tb-ico .dot { position: absolute; top: 1px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 10.5px/17px var(--font); text-align: center; font-style: normal; }
.tb-me { display: grid; }
.theme { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; flex: none; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; fill: var(--ink-2); stroke: none; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme .sun { display: none; }
  :root[data-theme="auto"] .theme .moon { display: block; fill: var(--ink-2); stroke: none; }
}
@media (max-width: 420px) { .topbar .theme { display: none; } }

/* ---------- 아래 탭(모바일) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current] { color: var(--ink); }
.tabbar a[aria-current] svg { stroke-width: 2.3; }
.tabbar .badge-n { position: absolute; top: 5px; left: calc(50% + 6px); }
.badge-n { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 11px/18px var(--font); text-align: center; font-style: normal; }
body.in-room .tabbar, body.in-room .foot { display: none; }
body.in-room { padding-bottom: 0; }

/* ---------- 본문 공통 ---------- */
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 14px 28px; outline: none; }
.loading, .empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 14px 16px; }
section { margin-top: 22px; }
main > section:first-child, main > .seg:first-child { margin-top: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 9px; }
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.sec-head a { font-size: 13px; color: var(--muted); font-weight: 600; }
.sec-head .cnt { color: var(--muted); font-weight: 700; font-size: 14px; margin-left: 2px; }
.more-link { display: block; text-align: center; padding: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.sm-link { font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.src-note { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }
.stale { color: var(--up); font-weight: 700; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.h3 { margin: 0 0 10px; font-size: 15px; }
.foot { max-width: 760px; width: 100%; margin: 0 auto; padding: 18px 16px 24px; color: var(--muted); font-size: 12px; text-align: center; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }
.foot a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 버튼·입력 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; text-align: center;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.big { height: 50px; width: 100%; font-size: 16px; border-radius: 13px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, var(--line)); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.icon { width: 42px; padding: 0; font-size: 18px; flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns.right { justify-content: flex-end; margin-top: 10px; }
.cta2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); white-space: nowrap; cursor: pointer;
}
.chip.solid { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
input[type=search], input:not([type]), input[type=number], select, textarea, .pinput input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font-size: 16px; outline: none;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }

/* 세그먼트 탭(팝니다·삽니다…) */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 12px; }
.seg > a, .seg > button, .seg > label { flex: 1; position: relative; display: grid; place-items: center; height: 38px; border: 0; border-radius: 9px; background: none; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg > label > input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg [aria-selected="true"], .seg > label:has(input:checked) { background: var(--ink); color: var(--bg); }
.seg > label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.seg > label:has(input:disabled) { cursor: default; opacity: .6; }
.seg .n { font-size: 12px; opacity: .7; margin-left: 3px; }
.seg.mini { margin: 0; padding: 2px; border-radius: 10px; }
.seg.mini > a, .seg.mini > button { height: 30px; padding: 0 12px; font-size: 13px; }
.seg.full { margin-top: 10px; }

/* ---------- 아이콘·아바타 ---------- */
.ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.ic img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.ic b { color: var(--muted); font-size: 17px; }
.ic.sm { width: 30px; height: 30px; border-radius: 8px; } .ic.sm img { width: 26px; height: 26px; } .ic.sm b { font-size: 13px; }
.ic.xl { width: 68px; height: 68px; border-radius: 16px; box-shadow: var(--shadow); } .ic.xl img { width: 60px; height: 60px; } .ic.xl b { font-size: 26px; }
.ic.dotori { background: linear-gradient(140deg, #c98a3b, #8a5a22); border: 0; } .ic.dotori b { color: #fff; }
.av { width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--bg-2); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av b { color: #fff; font-size: 16px; }
.av.sm { width: 28px; height: 28px; } .av.sm b { font-size: 12px; }
.av.lg { width: 56px; height: 56px; } .av.lg b { font-size: 22px; }

/* ---------- 검색 ---------- */
.search { position: relative; }
.search input { padding-left: 40px; }
.search-ico { position: absolute; left: 13px; top: 22px; translate: 0 -50%; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; z-index: 1; }
.search.big input { min-height: 50px; border-radius: 14px; box-shadow: var(--shadow); }
.search.big .search-ico { top: 25px; }
#tw-item, #tw-want { padding-left: 12px; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 5px; max-height: min(60dvh, 460px); overflow: auto; overscroll-behavior: contain; }
.sg-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.sg-item .ic { width: 30px; height: 30px; border-radius: 8px; } .sg-item .ic img { width: 26px; height: 26px; }
.sg-item[aria-selected="true"], .sg-item:hover { background: var(--accent-soft); }
.sg-item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-item .sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sg-more { display: flex; justify-content: space-between; margin-top: 4px; padding: 10px 11px; border-top: 1px solid var(--line); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.sg-more[aria-selected="true"], .sg-more:hover { background: var(--accent-soft); }
.sg-empty { padding: 16px 12px; color: var(--muted); text-align: center; }

/* ---------- 첫 화면 ---------- */
.home-search { margin-top: 2px; }
.quick { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.mcards { display: flex; gap: 9px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 6px; margin: 0 -14px; padding-inline: 14px; scrollbar-width: none; }
.mcards::-webkit-scrollbar, .quick::-webkit-scrollbar { display: none; }
.mcard { flex: 0 0 132px; height: 128px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.mcard.sk { background: var(--bg-2); }
.mcard-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mcard .nm { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard > b { font-size: 18px; letter-spacing: -0.03em; margin-top: 4px; }
.mcard .spark { margin-top: auto; }
.chg { font-size: 12px; font-weight: 700; color: var(--muted); }
.chg.up { color: var(--up); } .chg.down { color: var(--down); }
.spark { width: 100%; height: 26px; display: block; }
.spark polyline { stroke: var(--muted); stroke-width: 1.6; }
.spark.up polyline { stroke: var(--up); } .spark.down polyline { stroke: var(--down); }
.dline { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.wtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wtile { display: flex; align-items: center; gap: 8px; padding: 11px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.wb { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; flex: none; }
.w-i { background: #c8402a; } .w-m { background: #6b4fa0; } .w-p { background: #2f7a5f; } .w-x { background: #a0702e; } .w-y { background: #c0663a; } .w-q { background: #b06d12; }

/* ---------- 거래글 줄 ---------- */
.plist { overflow: hidden; }
.prow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 13px; }
.prow + .prow, .brow + .brow, .orow + .orow, .rrow + .rrow, .nrow + .nrow, .wrow + .wrow, .mrow + .mrow { border-top: 1px solid var(--line); }
.prow:hover, .brow:hover, .rrow:hover, .mrow:hover, .orow:hover { background: var(--bg-2); }
.prow.done { opacity: .6; }
.prow-main { min-width: 0; display: flex; flex-direction: column; }
.prow-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-sub, .prow-sub2 { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow-end { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.price { font-size: 15.5px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.prow-end .t { font-size: 11.5px; }
.enh { color: var(--gold); font-weight: 800; }
.qty { color: var(--ink-2); font-weight: 700; }
.kd, .st { display: inline-block; margin-right: 5px; padding: 1px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.kd-sell { background: var(--ink); color: var(--bg); } .kd-buy { border: 1px solid var(--ink-2); color: var(--ink-2); }
.kd-swap { background: var(--bg-2); color: var(--ink-2); } .kd-dotori { background: #b27a2f; color: #fff; }
.st-open { background: var(--accent-soft); color: var(--accent-ink); } .st-reserved { background: #e9e1f7; color: #5b3fa0; } .st-done { background: var(--bg-2); color: var(--muted); } .st-hidden { background: var(--bg-2); color: var(--muted); }
:root[data-theme="dark"] .st-reserved { background: #2e2540; color: #c3aef0; }
.vs { font-size: 12px; font-weight: 700; white-space: nowrap; }
.vs.cheap, b.cheap { color: var(--cheap); } .vs.dear, b.dear { color: var(--up); } .vs.flat { color: var(--muted); }
.vbadge { display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px solid var(--cheap); color: var(--cheap); font-size: 11px; font-weight: 700; margin-right: 4px; }

/* 시세판 줄 */
.mrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 64px auto; gap: 10px; align-items: center; padding: 10px 13px; }
.mrow-main { min-width: 0; display: flex; flex-direction: column; }
.mrow .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow-end { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; }
.inline-search { display: flex; gap: 8px; margin-bottom: 8px; } .inline-search .btn { flex: none; }
@media (max-width: 380px) { .mrow { grid-template-columns: 44px minmax(0, 1fr) auto; } .mrow .spark { display: none; } }

/* 게시판 줄 */
.brow { display: flex; flex-direction: column; padding: 11px 14px; }
.brow .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .pv { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brow .sub { font-size: 12px; color: var(--muted); }
.cc { color: var(--accent-ink); font-weight: 700; font-size: 13px; }

/* 거래 목록 거르기 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input[type=search] { flex: 1 1 160px; min-height: 40px; }
.filters select { width: auto; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.pager { display: flex; justify-content: center; margin-top: 12px; }

/* ---------- 아이템 화면 ---------- */
.ihead, .phead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.phead { grid-template-columns: auto minmax(0, 1fr); }
.ihead h2 { margin: 0; font-size: 22px; letter-spacing: -0.04em; }
.ihead p, .phead p { margin: 2px 0; font-size: 13px; }
.watch { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-size: 22px; color: var(--gold); cursor: pointer; }
.watch[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 16%, var(--card)); border-color: var(--gold); }
.mbox { padding: 14px 14px 12px; margin-top: 14px; }
.mstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.mstats > div { padding: 8px 10px; border-radius: 10px; background: var(--bg-2); min-width: 0; }
.mstats small { display: block; font-size: 11.5px; color: var(--muted); }
.mstats b { font-size: 17px; letter-spacing: -0.03em; white-space: nowrap; }
.chart { width: 100%; height: auto; display: block; aspect-ratio: 340 / 170; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.cd line { stroke-width: 1.2; } .cd rect { stroke: none; }
.cd.up line { stroke: var(--up); } .cd.up rect { fill: var(--up); }
.cd.down line { stroke: var(--down); } .cd.down rect { fill: var(--down); }
.cd.flat line { stroke: var(--muted); } .cd.flat rect { fill: var(--muted); }
.ln { fill: none; stroke-width: 2; } .ln.up { stroke: var(--up); } .ln.down { stroke: var(--down); }
.chart-empty { padding: 30px 0; text-align: center; color: var(--muted); font-size: 13px; }
.olist .orow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; }
.o-who { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.orow b { font-size: 15px; white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin: 10px 0 0; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }
.card.pad > p:first-child { margin-top: 0; }

/* ---------- 거래글 보기 ---------- */
.pname { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.pricebox { margin-top: 14px; }
.pb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pb-top .big { font-size: 26px; letter-spacing: -0.04em; }
.rbar { position: relative; height: 8px; margin: 18px 4px 4px; border-radius: 4px; background: var(--bg-2); }
.rbar-band { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.rbar-med, .rbar-me { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 2px; background: var(--ink-2); }
.rbar-me { background: var(--accent); width: 4px; top: -6px; height: 20px; }
.rbar-lbl { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.want { margin-top: 12px; }
.ucard { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ucard > span:not(.av) { display: flex; flex-direction: column; min-width: 0; }
.ucard .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard.big .nm { font-size: 17px; }
.ucard.big { margin-bottom: 12px; }
.trust { font-size: 12.5px; color: var(--muted); }
.then { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); font-size: 14px; border: 0; }
.owner { margin-top: 18px; }
.owner .lbl { color: var(--muted); }
.owner .btns .btn { flex: 1 1 30%; }
.deal { margin-top: 14px; border-color: var(--accent); }
.deal p { margin: 0 0 10px; font-size: 14px; }
.report-line { text-align: right; margin-top: 18px; }

/* ---------- 글쓰기 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form .seg { margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picked { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); }
.picked b { flex: 1; }
.pinput { display: flex; gap: 6px; }
.pinput input { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; }
.units { display: flex; gap: 4px; flex: none; }
.units label { position: relative; }
.units input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.units span { display: grid; place-items: center; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.units input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.units input:focus-visible + span { outline: 2px solid var(--accent); }
.hint { margin: 7px 2px 0; padding: 8px 10px; border-radius: 9px; background: color-mix(in srgb, var(--cheap) 9%, var(--card)); font-size: 13px; min-height: 36px; }
.hint:empty { background: none; padding: 0; min-height: 0; }
.warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 13.5px; font-weight: 600; }
.notice { padding: 11px 13px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 13px; line-height: 1.55; }
.notice b { font-weight: 800; }
.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); padding-top: 4px; }
.radios { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.radios label { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.radios input { width: 18px; height: 18px; accent-color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.tag input { position: absolute; opacity: 0; }
.tag span { display: inline-block; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.tag input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.tag input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- 채팅 ---------- */
.rrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 30px; gap: 10px; align-items: center; padding: 11px 13px; }
.rmain { min-width: 0; display: flex; flex-direction: column; }
.rmain .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmain .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rend { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rend .t { font-size: 11.5px; }
body.in-room main { padding: 0; max-width: 760px; display: flex; }
.room { display: flex; flex-direction: column; width: 100%; height: calc(100dvh - 55px); }
.pin { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.pin-post { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 14px; font-weight: 600; }
.pin-post > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-btns { display: flex; gap: 6px; flex: none; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; } .menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 140px; display: flex; flex-direction: column; padding: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); }
.menu-list a, .menu-list button { padding: 9px 11px; border: 0; background: none; text-align: left; border-radius: 8px; font-size: 14px; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--bg-2); }
.msgs { flex: 1; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.day { align-self: center; margin: 8px 0 2px; font-size: 11.5px; color: var(--muted); }
.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 82%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.bub { padding: 8px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.msg.me .bub { background: var(--accent); border-color: var(--accent); color: #fff; }
.msg .meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.msg.you .meta { align-items: flex-start; }
.rd { color: var(--accent-ink); font-weight: 700; }
.offer { display: flex; flex-direction: column; min-width: 120px; }
.offer small { font-size: 11.5px; opacity: .85; }
.offer b { font-size: 19px; letter-spacing: -0.03em; }
.offer span { font-size: 13px; }
.sys { align-self: center; max-width: 90%; padding: 5px 11px; border-radius: 10px; background: var(--bg-2); color: var(--ink-2); font-size: 12.5px; text-align: center; }
.sys-warn { align-self: center; width: min(100%, 460px); display: flex; gap: 9px; align-items: flex-start; margin: 6px 0; padding: 11px 13px; border-radius: 12px; background: var(--warn-bg); border: 1.5px solid var(--warn-line); color: var(--warn-ink); font-size: 13px; line-height: 1.5; }
.sys-warn .w-ico { font-size: 18px; line-height: 1.2; flex: none; }
.sys-warn p { margin: 0; font-weight: 600; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.composer textarea { min-height: 42px; max-height: 120px; resize: none; padding: 9px 12px; border-radius: 21px; }
.composer .btn.primary { flex: none; border-radius: 21px; }

/* ---------- 게시판 글 ---------- */
.post .ptitle { margin: 0 0 10px; font-size: 21px; letter-spacing: -0.03em; line-height: 1.3; }
.pmeta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.byline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-width: 0; }
.byline .then { display: inline; }
.pbody { padding: 16px 2px; font-size: 15.5px; line-height: 1.7; }
.pbody a, .cbody a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.pact { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pact .sp { flex: 1; }
.vote[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.cmts { list-style: none; margin: 0; padding: 0; }
.cmt { padding: 11px 2px; border-bottom: 1px solid var(--line); }
.cmt.reply { padding-left: 26px; position: relative; background: color-mix(in srgb, var(--bg-2) 50%, transparent); }
.cmt.reply::before { content: "└"; position: absolute; left: 8px; top: 12px; color: var(--muted); }
.cbody { margin: 5px 0 4px 36px; font-size: 14.5px; }
.cmeta { margin-left: 36px; display: flex; gap: 12px; align-items: center; font-size: 12px; }
.cform { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cform .btn { align-self: flex-end; }
.replying { font-size: 13px; color: var(--accent-ink); font-weight: 600; }

/* ---------- 내 정보·알림·운영자 ---------- */
.wrow { display: flex; align-items: center; gap: 10px; padding: 11px 14px; }
.wrow a { flex: 1; font-weight: 700; }
.links-list { display: flex; flex-direction: column; overflow: hidden; }
.links-list a, .links-list button { padding: 13px 16px; text-align: left; border: 0; background: none; font-size: 15px; font-weight: 600; cursor: pointer; }
.links-list > * + * { border-top: 1px solid var(--line); }
.nrow { display: flex; flex-direction: column; padding: 11px 14px; }
.nrow.unread { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.nrow .nm { font-weight: 700; } .nrow .sub { font-size: 13.5px; color: var(--ink-2); } .nrow .t { font-size: 11.5px; }
.rep { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.rep + .rep { border-top: 1px solid var(--line); }
.rep p { margin: 4px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.tbl tr + tr td { border-top: 1px solid var(--line); }
.doc { line-height: 1.7; font-size: 15px; }
.doc h2 { font-size: 17px; margin: 22px 0 6px; }
.doc ul { padding-left: 20px; }

/* ---------- 토스트·시트·설치 배너 ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); translate: -50% 0; z-index: 60; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 11px 15px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop); transition: opacity .3s, translate .3s; }
.toast.err { background: #b3261e; color: #fff; }
.toast.out { opacity: 0; translate: 0 8px; }
.sheet { border: 0; padding: 0; width: min(100%, 480px); max-height: 88dvh; margin: auto auto 0; border-radius: 18px 18px 0 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow-pop); }
.sheet::backdrop { background: rgba(0, 0, 0, .45); }
.sheet form { padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); }
.sheet h2 { margin: 0 0 12px; font-size: 18px; }
.sheet-body { overflow: auto; }
.sheet-body p { margin: 0 0 12px; font-size: 14px; }
.sheet-body .pfield { margin-bottom: 12px; }
.sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pick-user { padding: 6px 0; }
.install { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); max-width: 520px; margin: 0 auto; }
.install > span { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.install small { color: var(--muted); font-size: 12.5px; }
.install .x { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; width: 30px; height: 30px; }
body.in-room .install { display: none; }

/* ---------- 데스크톱: 위 메뉴, 아래 탭 숨김 ---------- */
@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  :root { --tabbar-h: 0px; }
  .topbar { gap: 18px; padding-inline: 24px; }
  .tb-left { display: none; }
  .brand.desk { display: flex; }
  .topnav { display: flex; gap: 2px; }
  .topnav a { position: relative; padding: 7px 11px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink-2); }
  .topnav a:hover { background: var(--bg-2); }
  .topnav a[aria-current] { color: var(--accent-ink); background: var(--accent-soft); }
  .topnav .badge-n { margin-left: 4px; vertical-align: 1px; }
  .tb-search { display: block; flex: 1; max-width: 320px; margin-left: auto; }
  .tb-search input { min-height: 38px; padding-block: 6px; font-size: 14px; }
  .tb-search .search-ico { top: 19px; }
  main { padding: 24px 24px 40px; }
  .mcards { margin: 0; padding-inline: 2px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
  body.is-home .tb-search { visibility: hidden; }
  .wtiles { grid-template-columns: repeat(6, 1fr); }
  .room { height: calc(100dvh - 55px); border-inline: 1px solid var(--line); }
  .sheet { margin: auto; border-radius: 18px; }
  .install { bottom: 16px; }
  .sticky-cta { position: static; }
}
.links-list .danger-link { color: var(--up); }

/* ---- 배너: 머리줄 아래 고정 제휴 카드 줄 + 광고 자리 ---- */
.pcards { width: 100%; max-width: 760px; margin: 12px auto 0; padding: 0 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.in-room .pcards { display: none; }
.pcards-bottom { margin: 4px auto 14px; }
.bslot.pcard { aspect-ratio: 12 / 5; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.bslot.pcard > a, .bslot.pcard > div { display: block; width: 100%; height: 100%; text-decoration: none; }
.bslot.pcard img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bslot.pcard.vacant > a, .bslot.pcard.vacant > div { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card, var(--bg-2)); color: var(--ink); text-align: center; padding: 6px; }
.bslot.pcard.vacant > a:hover { border-color: var(--accent); }
.bs-no { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 800; color: var(--muted); }
.bs-brand { color: var(--accent); font-size: 13px; font-weight: 900; letter-spacing: -.02em; }
.bs-t { font-size: 12px; font-weight: 700; }
.bs-s { font-size: 11px; color: var(--muted); }
.adslot { margin: 14px 0; min-height: 90px; }
.ad-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.rail { display: none; }
@media (min-width: 1300px) {
  .rail { display: block; position: fixed; top: 70px; width: 160px; }
  .rail-l { left: calc(50% - 380px - 190px); } .rail-r { right: calc(50% - 380px - 190px); }
  .rail .adslot { margin: 0; min-height: 600px; }
}
.bn-slots { display: grid; gap: 12px; margin-top: 16px; }
.bn-slot { border-top: 1px solid var(--line); padding-top: 12px; }
.bn-prev { max-width: 100%; max-height: 120px; border-radius: 8px; display: block; margin: 6px 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.qtag { color: var(--accent); font-weight: 700; }

/* ---- 팝업 제휴 배너 ---- */
.pop-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; animation: popfade .15s ease-out; }
@keyframes popfade { from { opacity: 0; } }
.pop { position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.pop-img { display: block; min-height: 0; overflow: hidden; }
.pop-img img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 110px); object-fit: contain; background: #000; }
.pop-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; z-index: 1; }
.pop-x:hover, .pop-x:focus-visible { background: rgba(0,0,0,.85); outline: 2px solid #fff; }
.pop-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.pop-foot button { flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.pop-foot .pop-close { background: var(--ink); color: var(--card); border-color: var(--ink); }

.dl-main { display: inline-flex; align-items: center; gap: 8px; }
.dl-ic { width: 28px; height: 28px; image-rendering: pixelated; border-radius: 6px; background: var(--bg-2); }

/* 첫 화면 위쪽 간격 정리: 도토리 줄 · 검색 · 최근 검색 */
#h-dotori { margin: 4px 0 14px; }
.home-search { margin-top: 0; }
.recent { display: flex; align-items: center; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.recent::-webkit-scrollbar { display: none; }
.rc-lbl { font-size: 12px; color: var(--muted); flex: none; margin-right: 2px; }
.chip.rc { display: inline-flex; align-items: center; gap: 2px; padding-right: 4px; flex: none; }
.chip.rc a { color: inherit; text-decoration: none; }
.rc-x { border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; }
.rc-x:hover { background: var(--bg-2); color: var(--ink); }
.rc-clear { flex: none; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }

.mc-range { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
