/* 거래소: 게임 거래소 시세 + 회원 거래 (삽니다·팝니다). 홈 화면도 .ex 안에서 .ex-cat · .g-*/.t-* · .xt-list/.xt-row 를 쓴다 */
.ex { --sell: #2563c9; --buy: #c8443b; --fresh: #1a8549; --warm: #b86e0c; --star: #e0a526; }
[data-theme="dark"] .ex { --sell: #6fa2f2; --buy: #ee7a6e; --fresh: #4ec383; --warm: #f0a640; --star: #f0b941; }

/* 위쪽 탭: 시세 · 회원 거래 · 글쓰기 */
.xt-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.xt-tabs::-webkit-scrollbar { display: none; }
.xt-tabs > a:not(.btn) { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 650; font-size: 14.5px; white-space: nowrap; text-decoration: none; transition: color .12s, border-color .12s; }
.xt-tabs > a:not(.btn) svg { width: 16px; height: 16px; }
.xt-tabs > a:not(.btn):hover { color: var(--text); }
.xt-tabs > a.on { color: var(--text); border-bottom-color: var(--accent); }
.xt-tabs > a.on svg { color: var(--accent); }
.xt-gap { flex: 1; min-width: 12px; }
.xt-tabs .btn { flex: 0 0 auto; margin: 4px 0 6px; }

/* 시세를 어떻게 모으는지: 업데이트 주기 · 영웅 장비 · 전설·신화 장비 · 재료·스킬북·소모품 */
.ex-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.ex-info-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-width: 0; }
.ex-info-card > svg { width: 18px; height: 18px; flex: 0 0 auto; padding: 7px; box-sizing: content-box; border-radius: 9px; color: var(--accent); background: var(--accent-soft); }
.ex-info-card > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-info-card .l { font-size: 12px; color: var(--faint); font-weight: 600; }
.ex-info-card .l b { font-weight: 700; }
.ex-info-card > div > b { font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.ex-info-card small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.ex-info-card:first-child { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), transparent 75%), var(--surface); }

/* 'N시 기준 · 다음 업데이트': 모든 서버를 모아 정각에 한꺼번에 올린다 */
.ex-basis-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px !important; font-size: 13.5px; color: var(--muted); }
.ex-basis { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); color: var(--text); font-size: 13px; }
.ex-basis svg { width: 14px; height: 14px; color: var(--accent); }
.ex-basis b { color: var(--accent-strong); font-weight: 700; }
/* 원화 환산 기준 (공식 다이아 1개 4.5원) */
.ex-won-note { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; white-space: nowrap; cursor: help; }
.ex-won-note svg { width: 13px; height: 13px; color: var(--faint); }
.xd-won { margin: -6px 0 14px; }

/* 찾기 한 줄: 찾기 · 서버 · 분류 · 등급 · 정렬 · 즐겨찾기 · 매물 있는 것만 */
.ex-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.ex-filter-row select { width: auto; min-height: 40px; padding: 8px 30px 8px 11px; font-size: 14px; }
.ex-filter-row #exServer { max-width: 170px; }
.ex-search { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 200px; }
.ex-search svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.ex-search input { width: 100%; min-height: 40px; padding: 8px 12px 8px 38px; font-size: 14.5px; }
.ex-has { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px; color: var(--muted); white-space: nowrap; cursor: pointer; user-select: none; transition: border-color .12s, background .12s; }
.ex-has:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); color: var(--text); }
.ex-has:has(input:checked) { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: var(--accent-soft); font-weight: 650; }
.ex-has input { margin: 0; }

/* 즐겨찾기: 목록 줄 앞 별, 거르기 단추, 아이템 화면 제목 옆 별 */
.ex-fav-only { font: inherit; font-size: 14px; }
.ex-fav-only svg { width: 15px; height: 15px; }
.ex-fav-only b { font-weight: 650; color: var(--faint); font-variant-numeric: tabular-nums; }
.ex-fav-only.on { color: var(--text); border-color: color-mix(in srgb, var(--star) 70%, var(--border)); background: color-mix(in srgb, var(--star) 13%, var(--surface)); font-weight: 650; }
.ex-fav-only.on svg { fill: var(--star); stroke: var(--star); }
.ex-fav-only.on b { color: var(--muted); }
.ex-star { flex: 0 0 auto; display: inline-flex; padding: 5px; margin: 0 -5px; border-radius: 7px; color: var(--border-strong); cursor: pointer; }
.ex-star svg { width: 16px; height: 16px; }
.ex-star:hover { color: var(--star); background: var(--surface-2); }
.ex-star.on { color: var(--star); }
.ex-star.on svg { fill: currentColor; }
.xi-fav { display: inline-flex; padding: 6px; border: 0; border-radius: 8px; background: none; color: var(--faint); cursor: pointer; }
.xi-fav svg { width: 22px; height: 22px; }
.xi-fav:hover { color: var(--star); background: var(--surface-2); }
.xi-fav.on { color: var(--star); }
.xi-fav.on svg { fill: currentColor; }
.ex-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--faint); font-size: 11px; font-weight: 650; line-height: 17px; vertical-align: 1px; white-space: nowrap; }
.ex-tag.detail { color: #9a5d08; border-color: color-mix(in srgb, #c97a12 40%, var(--border)); background: color-mix(in srgb, #c97a12 8%, transparent); }
[data-theme="dark"] .ex-tag.detail { color: #f0a640; }
.ex-none { color: var(--faint); font-size: 13px; }

/* 등급 색 (게임 이름 색과 같은 계열: 전설은 금빛 주황, 신화는 붉은 주황) */
.g-hero { color: var(--violet); }
.g-legend { color: #a87409; }
.g-myth { color: #cc4818; }
.g-rare { color: var(--blue); }
.g-advanced { color: var(--green); }
[data-theme="dark"] .g-legend { color: #e2b23c; }
[data-theme="dark"] .g-myth { color: #ff7a45; }

/* 시세 목록: 값마다 칸 (아이템 · 최저가 · 평균 대비 · 서버 평균 · 7일 평균 · 가장 싼 서버 · 서버 · 매물), 숫자는 오른쪽 맞춤 */
.ex-list { overflow: hidden; }
.ex-head, .ex-item { display: grid; grid-template-columns: minmax(200px, 1fr) 118px 72px 84px 84px minmax(84px, 112px) 52px 60px; gap: 12px; align-items: center; padding: 10px 18px; }
.ex-head { min-height: 40px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.ex-head > span { overflow: hidden; text-overflow: ellipsis; }
.ex-head .num, .ex-item .num { text-align: right; font-variant-numeric: tabular-nums; }
.ex-item { min-height: 58px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); text-decoration: none; transition: background .1s; }
.ex-item:last-child { border-bottom: 0; }
.ex-item:hover { background: var(--surface-2); color: var(--text); }
.ex-item.none .ex-diff, .ex-item.none .ex-best, .ex-item.none .ex-cnt { color: var(--faint); }
.ex-diff em { font-style: normal; font-weight: 700; font-size: 13.5px; }
.ex-diff em.down, td.down { color: var(--green); }
.ex-diff em.up, td.up { color: var(--red); }
.ex-diff.nil, .ex-cnt.nil, .ex-avg.nil { color: var(--faint); }
.ex-avg, .ex-cnt { color: var(--muted); font-size: 13.5px; }
.ex-best { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-name { min-width: 0; display: flex; align-items: center; gap: 11px; }
.ex-name-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ex-name b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-name small { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-price b { display: flex; justify-content: flex-end; align-items: center; font-weight: 750; font-size: 15px; }
/* 값은 같은 폭 칸에 오른쪽 맞춤: 다이아 표시가 줄마다 같은 자리에 선다 */
.ex-price b span { display: inline-block; min-width: 8ch; text-align: right; font-variant-numeric: tabular-nums; }
.ex-price small { display: block; color: var(--faint); font-size: 12px; font-weight: 400; white-space: nowrap; }
#exRows > .btn-block { min-height: 46px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--surface); color: var(--accent-strong); }
#exRows > .btn-block:hover { background: var(--surface-2); }
.ex-list .empty-note { padding: 44px 20px; }
.ex-foot { margin: 14px 2px 0; font-size: 12.5px; color: var(--faint); line-height: 1.65; }

/* 분류 아이콘 (무기 검 · 보조 무기 방패 · 방어구 옷 · 장신구 목걸이 · 재료 보석 · 스킬북 책 · 소모품 물약), 칸 색은 등급 */
.ex-cat { --c: var(--muted); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px;
  color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 24%, var(--border)); }
.ex-cat svg { width: 17px; height: 17px; }
.ex-cat.t-hero { --c: var(--violet); }
.ex-cat.t-legend { --c: #a87409; }
.ex-cat.t-myth { --c: #cc4818; }
.ex-cat.t-rare { --c: var(--blue); }
.ex-cat.t-advanced { --c: var(--green); }
[data-theme="dark"] .ex-cat.t-legend { --c: #e2b23c; }
[data-theme="dark"] .ex-cat.t-myth { --c: #ff7a45; }
.ex-item.none .ex-cat { opacity: .5; }

/* 가격 주의: 매물이 적은데 다른 서버들보다 3배 넘게 비싼 값 (평균에서 뺐다) */
em.odd { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 4px; margin-left: 6px; cursor: help; color: #9a5d08; background: color-mix(in srgb, #c97a12 11%, transparent); border: 1px solid color-mix(in srgb, #c97a12 32%, var(--border)); }
[data-theme="dark"] em.odd { color: #f0a640; }

.ex-scroll { max-height: 400px; overflow: auto; overscroll-behavior: contain; }
.ex-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-filter select, .ex-filter input { width: auto; min-height: 34px; padding: 5px 9px; font-size: 13px; }
.ex-filter select { padding-right: 26px; }
.ex-filter input { min-width: 190px; }
.ex-opt { color: var(--muted); }
.ex-enh { font-weight: 750; color: var(--accent-strong); }

/* 아이템 화면 */
.xi-back { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; margin: 0 0 14px; padding: 0 14px 0 10px; border: 1px solid var(--border); border-radius: 99px;
  background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: border-color .12s, color .12s; }
.xi-back svg { width: 16px; height: 16px; transition: transform .15s; }
.xi-back:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-strong); }
.xi-back:hover svg { transform: translateX(-2px); }
.xi-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }
.xi-title .ex-cat { width: 42px; height: 42px; border-radius: 11px; }
.xi-title .ex-cat svg { width: 22px; height: 22px; }
.xi-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.xi-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 16px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.xi-card { background: var(--surface); padding: 15px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.xi-card .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.xi-card b { font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.xi-card small { color: var(--faint); font-size: 12.5px; line-height: 1.5; }
.xi-card.best { background: linear-gradient(180deg, var(--accent-soft), transparent 80%), var(--surface); }
.xi-card.best b { color: var(--accent-strong); }
.xi-cards .empty-note { grid-column: 1 / -1; margin: 0; background: var(--surface); }

.xi-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.xi-grid > .card { min-width: 0; }
.xi-trend { padding: 16px 18px 14px; }
.xi-trend svg { width: 100%; height: 180px; display: block; overflow: visible; }
.xi-trend path.line { fill: none; stroke: var(--accent); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.xi-trend path.area { fill: var(--accent-soft); stroke: none; }
.xi-trend circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.xi-trend .axis { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--faint); margin-top: 8px; font-variant-numeric: tabular-nums; }

/* 표 (아이템 화면) */
.xi-servers table, .xi-equip table, .xi-enh table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.xi-servers th, .xi-equip th, .xi-enh th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.xi-servers td, .xi-equip td, .xi-enh td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.xi-servers tbody tr:last-child td, .xi-equip tbody tr:last-child td, .xi-enh tbody tr:last-child td { border-bottom: 0; }
.xi-servers .num, .xi-equip .num, .xi-enh .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xi-servers tr.best td { color: var(--accent-strong); font-weight: 650; }
.xi-servers tr.best td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.xi-servers tr.odd td { color: var(--faint); }
.xi-servers tbody tr:hover td, .xi-equip tbody tr:hover td { background: var(--surface-2); }

.xi-equip { margin-bottom: 16px; }
.xi-equip .card-head { flex-wrap: wrap; row-gap: 10px; }
.xi-equip-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.xi-equip-body > .ex-scroll { max-height: 480px; border-right: 1px solid var(--border); }
.xi-equip td.num small { display: block; }
.xi-enh { padding: 14px 16px; min-width: 0; }
.xi-enh h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 700; }
.xi-enh table { border: 1px solid var(--border); border-radius: var(--radius-sm); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.xi-enh th, .xi-enh td { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.xt-opt { display: inline-block; padding: 1px 7px; margin: 1px 3px 1px 0; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 12px; white-space: nowrap; }
.xt-opt.max { color: var(--warm, #b86e0c); border-color: color-mix(in srgb, #c97a12 40%, var(--border)); }

/* 장비 매물 세공: 공격(붉은)·방어(푸른)·기타, 값은 굵게, MAX는 금빛 */
.xi-opts { display: flex; flex-wrap: wrap; gap: 5px; }
.xi-opt { --c: var(--muted); display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border-radius: 7px; white-space: nowrap;
  font: inherit; font-size: 13px; color: var(--text); background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 28%, var(--border)); border-left: 3px solid var(--c); }
.xi-opt b { font-size: 14px; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; }
.xi-opt.atk { --c: var(--red); }
.xi-opt.def { --c: var(--blue); }
.xi-opt.max b { padding: 0 6px; border-radius: 5px; background: #c97a12; color: #fff; font-size: 11.5px; letter-spacing: .02em; }
.xi-optchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.xi-optchips:empty { display: none; }
.xi-optchips button { min-height: 30px; align-items: center; cursor: pointer; font-size: 13px; }
.xi-optchips button small { color: var(--faint); font-size: 11.5px; }
.xi-optchips button.max { --c: #c97a12; }
.xi-optchips button:hover { background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.xi-optchips button.on { background: var(--c); color: #fff; }
.xi-optchips button.on small, .xi-optchips button.on b { color: #fff; }
.xd-note { margin: 0; padding: 18px 16px; font-size: 13px; }
.xi-trend .xd-note { padding: 40px 0; text-align: center; }

/* 회원 거래: 전체·팝니다·삽니다·내 글 */
.xt-seg { display: inline-flex; gap: 2px; padding: 3px; margin: -4px 0 14px; border-radius: calc(var(--radius-sm) + 3px); background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.xt-seg::-webkit-scrollbar { display: none; }
.xt-seg a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 15px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.xt-seg a:hover { color: var(--text); }
.xt-seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(24, 22, 16, .08), 0 0 0 1px var(--border); }
[data-theme="dark"] .xt-seg a.on { background: var(--surface-3); box-shadow: none; }
.xt-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.xt-filter .ex-search { flex: 1 1 240px; }
.xt-filter .ex-search input { font-size: 14px; }
.xt-filter select { width: auto; min-height: 40px; padding: 8px 30px 8px 11px; font-size: 14px; }
.xt-check { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 4px; font-size: 13.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.xt-check input { margin: 0; }

/* 회원 거래 목록: 한 글 한 줄 (구분 · 물품 · 가격 · 상태) */
.xt-list { overflow: hidden; }
.xt-list .empty-note { padding: 40px 20px; }
.xt-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 150px 64px; gap: 12px; align-items: center; min-height: 60px; padding: 10px 18px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; transition: background .1s; }
a.xt-row:hover { background: var(--surface-2); color: var(--text); }
.xt-row:last-child { border-bottom: 0; }
.xt-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.xt-row.done { opacity: .55; }
.xt-kind { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; letter-spacing: -.01em; }
.xt-kind.sell { background: var(--sell); } .xt-kind.buy { background: var(--buy); }
[data-theme="dark"] .xt-kind { color: #111; }
.xt-what { min-width: 0; display: flex; align-items: center; gap: 11px; }
.xt-what-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xt-what b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xt-what b small { color: var(--muted); font-weight: 500; }
.xt-enh { font-style: normal; color: var(--accent-strong); font-weight: 800; margin-right: 5px; }
.xt-meta { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xt-meta .xt-opt { margin-left: 4px; }
.xt-price b { display: block; font-weight: 750; font-size: 15px; }
.xt-price small { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.xt-nego { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.xt-status { display: inline-flex; align-items: center; justify-content: center; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; border: 1px solid transparent; white-space: nowrap; }
.xt-status.open { color: var(--fresh); background: color-mix(in srgb, var(--fresh) 11%, transparent); }
.xt-status.reserved { color: var(--warm); background: color-mix(in srgb, var(--warm) 13%, transparent); }
.xt-status.done, .xt-status.expired { color: var(--faint); background: var(--surface-2); }
.xt-list.compact .xt-row { grid-template-columns: 54px minmax(0, 1fr) 110px; min-height: 0; padding: 9px 14px; font-size: 13.5px; }
.xt-list.compact .xt-status { display: none; }
.xd-opts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: -8px 0 16px; }
.xd-opts small { margin-left: 4px; font-size: 12px; }
.xt-empty-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.xt-safety { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--warm) 24%, var(--border)); background: color-mix(in srgb, var(--warm) 5%, var(--surface)); }
.xt-safety svg { width: 18px; height: 18px; color: var(--warm); flex: 0 0 auto; margin-top: 2px; }
.xt-safety b { font-size: 13.5px; }
.xt-safety p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }

/* 글 화면 */
.xd { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.xd-main, .xd-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.xd-side .xt-safety { margin-top: 0; }
.xd-head { padding: 22px 24px; }
.xd-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.xd-badges .pill svg { width: 13px; height: 13px; }
.xd-head h1 { margin: 0; font-size: 24px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.xd-head h1 small { font-size: 17px; color: var(--muted); font-weight: 600; }
.xd-sub { margin: 6px 0 18px; color: var(--faint); font-size: 13px; }
.xd-price { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.xd-price > div { flex: 1 1 200px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.xd-price > div:first-child { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), transparent 80%), var(--surface); }
.xd-price .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.xd-price b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.xd-price small { color: var(--faint); font-size: 13px; }
.xd-content { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); line-height: 1.75; font-size: 14.5px; overflow-wrap: anywhere; }
.xd-contact-body, .xd-owner-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.xd-contact-body > p { margin: 0; font-size: 13.5px; }
.xd-kakao { background: #fee500; border-color: #fee500; color: #191600; }
.xd-kakao:hover { background: #f5dc00; border-color: #f5dc00; color: #191600; }
.xd-line { display: flex; align-items: baseline; gap: 8px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-2); }
.xd-line span { color: var(--faint); font-size: 12.5px; flex: 0 0 auto; }
.xd-line b { overflow-wrap: anywhere; user-select: all; }
.xd-line small { margin-left: auto; color: var(--faint); font-size: 12px; }
.xd-refs { margin: 0; padding: 4px 16px 0; }
.xd-refs > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.xd-refs > div:last-child { border-bottom: 0; }
.xd-refs dt { color: var(--muted); font-size: 13px; }
.xd-refs dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.xd-refs dd small { display: block; font-weight: 400; color: var(--faint); font-size: 11.5px; }
.xd-vs { margin: 6px 16px 0; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 13px; }
.xd-vs b { color: var(--accent-strong); }
.xd-ref > .xd-note, .xd-ref #xfRefBody > .xd-note { padding: 14px 16px 16px; }
.xd-refs + .xd-note, .xd-vs + .xd-note { padding-top: 8px; }
.xd-ref .xd-vs:last-child, .xd-ref .xd-refs:last-child { margin-bottom: 14px; }
.xd-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.xd-status button { min-height: 36px; cursor: pointer; padding: 0; border-color: var(--border); background: var(--surface); color: var(--muted); border-radius: var(--radius-sm); }
.xd-status button.on { box-shadow: 0 0 0 1.5px currentColor inset; }
.xd-status button.open.on { color: var(--fresh); background: color-mix(in srgb, var(--fresh) 11%, transparent); }
.xd-status button.reserved.on { color: var(--warm); background: color-mix(in srgb, var(--warm) 13%, transparent); }
.xd-status button.done.on { color: var(--text); background: var(--surface-3); }
.xd-status button:disabled { cursor: default; }
.xd-status button:disabled:not(.on), .xd-owner-body .btn:disabled { opacity: .5; cursor: not-allowed; }
.xd-owner-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.xd-owner-row form, .xd-owner-row .btn, .xd-owner-row button { width: 100%; }
.xd-owner-row .btn { white-space: nowrap; text-align: center; }
.xd-owner .xd-note, .xd-contact .xd-note { margin: 0; padding: 0; font-size: 12.5px; line-height: 1.6; }
.xd-owner .xd-bump-wait { display: flex; align-items: flex-start; gap: 6px; margin-top: -4px; }
.xd-bump-wait svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 3px; }
.xd-bump-wait b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 글쓰기 */
.xf { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; max-width: 1100px; }
.xf-card { padding: 20px 22px 22px; min-width: 0; }
.xf-side { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.xf-side .xt-safety { margin-top: 0; }
.xf-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.xf-kind-opt { position: relative; cursor: pointer; }
.xf-kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.xf-kind-opt span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 12px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface);
  font-weight: 700; font-size: 16px; color: var(--muted); transition: border-color .12s, color .12s, background .12s; }
.xf-kind-opt:hover span { border-color: var(--border-strong); color: var(--text); }
.xf-kind-opt span svg { width: 18px; height: 18px; }
.xf-kind-opt.sell.on span { border-color: var(--sell); color: var(--sell); background: color-mix(in srgb, var(--sell) 8%, var(--surface)); }
.xf-kind-opt.buy.on span { border-color: var(--buy); color: var(--buy); background: color-mix(in srgb, var(--buy) 8%, var(--surface)); }
.xf-kind-opt input:focus-visible + span { box-shadow: var(--focus); }
.xf-step { display: flex; align-items: center; gap: 9px; margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 15px; font-weight: 700; }
.xf-step b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 800; }
.xf-row { display: grid; gap: 0 12px; }
.xf-row .field, .xf-card > .field { margin-bottom: 12px; }
.xf-what { grid-template-columns: 180px minmax(0, 1fr); }
.xf-equip { grid-template-columns: 150px minmax(0, 1fr); }
.xf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xf-price { grid-template-columns: minmax(0, 1fr) 140px; }
.xf-price-input { display: flex; gap: 8px; align-items: center; }
.xf-price-input input { flex: 1; min-width: 0; font-size: 16px; font-weight: 650; }
.xf-price-input .btn { white-space: nowrap; flex: 0 0 auto; }
.xf-contact { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
.xf-cat { max-width: 260px; }
.xf-card label small { color: var(--faint); font-weight: 400; font-size: 11.5px; margin-left: 2px; }
.xf-picked { min-height: 18px; margin-top: 6px; font-size: 12.5px; color: var(--faint); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.xf-picked.ok { color: var(--muted); }
.xf-picked svg { width: 14px; height: 14px; color: var(--fresh); }
.xf-picked .ex-tag { margin-left: 4px; }
.xf-contact-sum { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; margin-bottom: 12px; }
.xf-contact-sum > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.xf-kakao { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #fee500; color: #191600; font-size: 12.5px; font-weight: 700; }
.xf-note { margin-top: 6px; }
.xf-note textarea { min-height: 0; resize: vertical; }
.xf-agree { display: flex; gap: 9px; align-items: flex-start; margin-top: 4px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--muted); line-height: 1.6; cursor: pointer; }
.xf-agree input { margin-top: 2px; flex: 0 0 auto; }
.xf-hint { display: block; margin-top: 5px; color: var(--faint); font-size: 12px; line-height: 1.5; }
.xf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.xf-actions .btn { min-width: 110px; min-height: 42px; }
.xf-submit { min-width: 180px !important; font-size: 15px; }
.xf.buy .xf-submit { background: var(--buy); border-color: var(--buy); }
.xf:not(.buy) .xf-submit { background: var(--sell); border-color: var(--sell); }
.xf .xf-submit:hover { filter: brightness(1.06); }
[data-theme="dark"] .xf-submit { color: #111; }

/* 좁아지는 순서: 콘텐츠 폭(화면 − 왼쪽 메뉴 248px − 여백)에 맞춰 칸을 줄인다 */
@media (max-width: 1279px) {
  .xi-equip-body { grid-template-columns: minmax(0, 1fr); }
  .xi-equip-body > .ex-scroll { border-right: 0; border-bottom: 1px solid var(--border); }
  .ex-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  .ex-head, .ex-item { grid-template-columns: minmax(180px, 1fr) 112px 68px 80px minmax(76px, 100px) 56px; padding-left: 16px; padding-right: 16px; }
  .ex-head > :nth-child(5), .ex-item > :nth-child(5), .ex-head > :nth-child(7), .ex-item > :nth-child(7) { display: none; }
  .xd, .xf { grid-template-columns: minmax(0, 1fr); }
  .xf-side { position: static; }
  .xi-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .xt-tabs { margin-bottom: 14px; }
  .xt-tabs > a:not(.btn) { padding: 0 10px; }
  /* 소개 카드는 옆으로 밀어 보는 한 줄 */
  .ex-info { display: flex; gap: 8px; margin-bottom: 14px; padding-bottom: 2px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ex-info::-webkit-scrollbar { display: none; }
  .ex-info-card { flex: 0 0 min(78%, 270px); scroll-snap-align: start; padding: 12px 14px; }
  .ex-filter-row, .xt-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-filter-row .ex-search, .xt-filter .ex-search { grid-column: 1 / -1; min-width: 0; }
  .ex-filter-row select, .xt-filter select, .ex-filter-row #exServer { width: 100%; max-width: none; min-width: 0; }
  .ex-has { padding: 0 10px; }
  /* 시세 목록은 두 줄: [별·아이콘·이름 / 분류·등급] … [최저가 / 평균 대비 · 매물] */
  .ex-head { display: none; }
  .ex-item { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name price price" "name diff cnt"; column-gap: 8px; row-gap: 1px; min-height: 62px; padding: 10px 14px; }
  .ex-item > .ex-name { grid-area: name; gap: 10px; }
  .ex-item > .ex-price { grid-area: price; align-self: end; }
  .ex-item > .ex-diff { grid-area: diff; align-self: start; }
  .ex-item > :nth-child(8) { grid-area: cnt; align-self: start; }
  .ex-item > :nth-child(n+4):nth-child(-n+7) { display: none; }
  .ex-item > .ex-diff, .ex-item > :nth-child(8) { font-size: 12px; line-height: 1.5; }
  .ex-item > :nth-child(8)::before { content: "매물 "; color: var(--faint); }
  .ex-item > .ex-diff em { font-size: 12px; }
  .ex-item > .nil, .ex-item.none > .ex-diff, .ex-item.none > :nth-child(8) { display: none; }
  .ex-price b { font-size: 14.5px; }
  .ex-price b span { min-width: 0; }
  .ex-price small { display: none; }
  .ex-cat { width: 30px; height: 30px; border-radius: 8px; }
  .ex-cat svg { width: 16px; height: 16px; }
  .xi-cards { grid-template-columns: minmax(0, 1fr); }
  .xi-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; padding: 12px 16px; }
  .xi-card .l { flex: 0 0 72px; }
  .xi-card b { font-size: 20px; }
  .xi-card small { flex: 1 1 100%; }
  .xi-title { gap: 10px; }
  .xi-title .ex-cat { width: 36px; height: 36px; }
  .xi-trend svg { height: 150px; }
  .ex-filter { width: 100%; }
  .ex-filter select { flex: 1 1 calc(50% - 3px); min-height: 38px; }
  .ex-filter input { flex: 1 1 100%; min-width: 0; min-height: 38px; }
  .xi-servers th, .xi-equip th, .xi-enh th, .xi-servers td, .xi-equip td, .xi-enh td { padding-left: 10px; padding-right: 10px; }
  .xi-equip td.ex-enh { white-space: nowrap; }
  .xi-opts .xi-opt { white-space: normal; }
  .xt-seg { display: flex; }
  .xt-seg a { flex: 1 0 auto; justify-content: center; min-height: 36px; padding: 0 12px; }
  .xt-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "kind what price" "kind what status"; column-gap: 10px; row-gap: 4px; padding: 11px 14px; }
  .xt-row .xt-kind { grid-area: kind; align-self: start; margin-top: 2px; min-width: 42px; padding: 2px 6px; }
  .xt-row .xt-what { grid-area: what; gap: 9px; }
  .xt-row .xt-what .ex-cat { display: none; }
  .xt-row .xt-price { grid-area: price; align-self: end; }
  .xt-row .xt-status { grid-area: status; justify-self: end; align-self: start; padding: 0 8px; }
  .xt-list.compact .xt-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .xd-head { padding: 18px 16px; }
  .xd-head h1 { font-size: 21px; }
  .xd-price b { font-size: 23px; }
  .xf-card { padding: 16px; }
  .xf-what, .xf-equip, .xf-contact { grid-template-columns: minmax(0, 1fr); }
  .xf-price { grid-template-columns: minmax(0, 1fr) 96px; }
  .xf-price-input { flex-wrap: wrap; }
  .xf-price-input .btn { flex: 1 1 100%; white-space: normal; min-height: 36px; }
  .xf-actions .btn { flex: 0 0 auto; min-width: 0; }
  .xf-actions .xf-submit { flex: 1 1 auto; min-width: 0 !important; }
}
@media (max-width: 479px) {
  .ex-won-note { white-space: normal; }
}
@media (max-width: 400px) {
  .xf-price { grid-template-columns: minmax(0, 1fr); }
  .xd-owner-row { grid-template-columns: minmax(0, 1fr); }
}
