:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --ink: #17181c;
  --sub: #6b6f7b;
  --line: #e6e6e2;
  --brand: #ff5a36;
  --brand-ink: #ffffff;
  --good: #108a52;
  --bad: #d13a2f;
  --warn: #b26b00;
  --soft: #fff1ec;
  --radius: 14px;
  --tab: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111215; --card: #1b1c21; --ink: #f1f1f3; --sub: #a0a4af; --line: #2b2d34; --soft: #2a1b16;
    --good: #3ccf8a; --bad: #ff6b5e; --warn: #f2b34b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom));
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2 { line-height: 1.3; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.testbar { background: #222; color: #ffd27a; text-align: center; font-size: 13px; padding: 4px 8px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 20px; color: var(--brand); text-decoration: none; letter-spacing: -0.5px; white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.topnav a { text-decoration: none; white-space: nowrap; }
.bell b { display: inline-block; min-width: 18px; margin-left: 3px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 12px; text-align: center; }
.flash { max-width: 1080px; margin: 12px auto 0; padding: 12px 16px; border-radius: var(--radius); background: #e8f6ee; color: #0b5d37; width: calc(100% - 32px); }
.flash.err { background: #fdecea; color: #a52a20; }
.flash.warn { background: #fff4e0; color: #7a4a00; }
@media (prefers-color-scheme: dark) {
  .flash { background: #133626; color: #b8f0d2; }
  .flash.err { background: #3d1a17; color: #ffc6c0; }
  .flash.warn { background: #3a2a10; color: #ffe0a8; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.big { min-height: 52px; font-size: 17px; }
.btn.block { display: flex; width: 100%; }
input, select, textarea { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 48px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
label.sel { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
label.sel select { width: auto; flex: 1; min-width: 0; }
.hint { color: var(--sub); font-size: 14px; margin: 6px 0; }
.err { color: var(--bad); }
.warnline { color: var(--warn); }
.center { text-align: center; }
.hero { padding: 28px 20px; border-radius: 20px; background: linear-gradient(135deg, var(--brand), #ff8a3d); color: #fff; }
.hero h1 { margin: 0 0 8px; font-size: clamp(22px, 5vw, 32px); }
.hero p { margin: 0 0 16px; opacity: .95; }
.herobtns { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn { background: #fff; color: var(--brand); }
.hero .btn.ghost { background: transparent; color: #fff; border-color: #ffffffaa; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; padding: 7px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 14px; white-space: nowrap; }
.sec { margin-top: 20px; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; }
.sechead h2 { margin: 0 0 10px; font-size: 19px; }
.sechead a { color: var(--sub); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: block; background: var(--card); border-radius: var(--radius); overflow: hidden; text-decoration: none; border: 1px solid var(--line); min-width: 0; }
.thumb { aspect-ratio: 1; background: var(--line); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { color: var(--sub); font-size: 13px; }
.noimg.big { aspect-ratio: 1; display: grid; place-items: center; background: var(--line); border-radius: var(--radius); }
.cbody { padding: 10px 12px 12px; }
.ctitle { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.cprice { font-weight: 800; font-size: 17px; margin-top: 4px; }
.cmeta { display: flex; justify-content: space-between; gap: 6px; color: var(--sub); font-size: 13px; margin-top: 2px; }
.left.soon { color: var(--bad); font-weight: 700; }
.empty { text-align: center; padding: 40px 16px; color: var(--sub); }
.empty h1 { color: var(--ink); font-size: 20px; }
.searchbar { display: flex; gap: 8px; }
.searchbar input { flex: 1; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.filters .sel { flex: 1 1 220px; }
.sorts { display: flex; gap: 4px; flex-wrap: wrap; }
.sorts a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--sub); font-size: 14px; }
.sorts a.on { background: var(--ink); color: var(--bg); }
.pager { display: flex; justify-content: center; gap: 8px; margin: 20px 0; }
.ptitle { font-size: 22px; margin: 4px 0 14px; }
.detail { display: grid; gap: 16px; }
@media (min-width: 860px) { .detail { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .detail .desc { grid-column: 1 / -1; } }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); }
.gallery img { flex: none; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: start; border-radius: var(--radius); background: var(--line); }
.dinfo h1 { margin: 4px 0 12px; font-size: 22px; }
.catlink { color: var(--sub); font-size: 14px; }
.pricebox { display: grid; grid-template-columns: 1.4fr 1.2fr .7fr; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.pricebox div { display: flex; flex-direction: column; min-width: 0; }
.pricebox strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pricebox div:first-child strong { color: var(--brand); font-size: 20px; }
.lbl { color: var(--sub); font-size: 12px; }
.bidbox { margin: 12px 0; padding: 14px; background: var(--soft); border-radius: var(--radius); }
.bidbox label { font-weight: 700; display: block; margin-bottom: 8px; }
.bidrow { display: flex; gap: 8px; }
.bidrow input { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; }
.bidrow .btn { flex: none; }
@media (max-width: 380px) { .bidrow { flex-direction: column; } }
.lead { color: var(--good); font-weight: 700; margin: 0 0 8px; }
.msg { min-height: 1.2em; margin: 6px 0 0; font-weight: 600; }
.msg.ok { color: var(--good); }
.msg.err { color: var(--bad); }
.note { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; }
.note form.inline { display: inline; margin-left: 6px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; }
.facts dt { color: var(--sub); }
.facts dd { margin: 0; min-width: 0; }
.facts.small { font-size: 14px; }
.seller { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.seller .nick { font-weight: 700; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; vertical-align: middle; }
.badge.biz { background: #e7efff; color: #2346a8; }
@media (prefers-color-scheme: dark) { .badge.biz { background: #1d2a4d; color: #b7c8ff; } }
.desc h2 { font-size: 17px; margin: 8px 0; }
.pre { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.bids { list-style: none; padding: 0; margin: 0; }
.bids li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.steps h2 { font-size: 16px; margin: 0; }
.photopick { display: grid; place-items: center; min-height: 96px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--sub); cursor: pointer; text-align: center; padding: 10px; }
.photopick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.previews figure { position: relative; margin: 0; aspect-ratio: 1; }
.previews img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.previews button { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 13px; border: 0; background: #000a; color: #fff; cursor: pointer; }
.previews figure:first-child::after { content: "대표"; position: absolute; left: 4px; bottom: 4px; background: var(--brand); color: #fff; font-size: 11px; padding: 0 5px; border-radius: 5px; }
.money { display: flex; align-items: center; gap: 8px; }
.money input { flex: 1; min-width: 0; font-weight: 700; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { flex: 1 1 0; min-width: 64px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; justify-content: center; align-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; white-space: nowrap; padding: 0 8px; }
.seg input:checked + span { border-color: var(--brand); background: var(--soft); color: var(--brand); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.seg.two label { flex-basis: 45%; }
.more { margin: 14px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.more summary { cursor: pointer; font-weight: 600; }
.more > label, .more form { display: grid; gap: 6px; margin-top: 10px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; display: grid; gap: 10px; background: var(--card); min-width: 0; }
legend { font-weight: 700; padding: 0 4px; }
.sell > .btn { margin-top: 16px; }
.rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rows li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.rows li > a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; text-decoration: none; width: 100%; }
.rows li.unread { border-color: var(--brand); }
.rtitle { font-weight: 700; flex: 1 1 100%; min-width: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--line); font-size: 12px; font-weight: 700; }
.tag.good { background: #e3f6ec; color: var(--good); }
.tag.bad { background: #fde8e6; color: var(--bad); }
@media (prefers-color-scheme: dark) { .tag.good { background: #12301f; } .tag.bad { background: #3a1714; } }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--sub); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--brand); font-weight: 700; }
.authbox { max-width: 420px; margin: 8px auto; }
.authbox h1 { font-size: 24px; }
.stack { display: grid; gap: 10px; margin: 12px 0; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--brand); }
.bizfields { display: none; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.bizfields.on { display: grid; }
.box .bizfields, .more .bizfields { display: grid; }
.devcode { padding: 10px 12px; border-radius: 10px; background: #fff4e0; color: #7a4a00; }
@media (prefers-color-scheme: dark) { .devcode { background: #3a2a10; color: #ffe0a8; } }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.box h2 { font-size: 17px; margin: 0 0 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stats > * { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; display: grid; }
.stats b { font-size: 26px; }
.tradehead { display: flex; justify-content: space-between; gap: 10px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; margin: 16px 0 8px; counter-reset: s; }
.progress li { text-align: center; font-size: 13px; color: var(--sub); position: relative; padding-top: 30px; }
.progress li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 12px; background: var(--line); color: var(--sub); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.progress li.done::before { content: "✓"; background: var(--good); color: #fff; }
.progress li.now { color: var(--ink); font-weight: 700; }
.progress li.now::before { background: var(--brand); color: #fff; }
.status { font-weight: 600; }
.act { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; margin: 12px 0; }
.act form { display: grid; gap: 10px; }
.total { display: flex; flex-direction: column; margin: 0; }
.total strong { font-size: 26px; color: var(--brand); }
.shipto { background: var(--soft); padding: 10px 12px; border-radius: 10px; }
.doc { max-width: 720px; }
.doc h2 { font-size: 17px; margin-top: 20px; }
.inline { display: inline; }
.foot { max-width: 1080px; margin: 24px auto 0; padding: 16px; color: var(--sub); font-size: 13px; text-align: center; }
.foot div { margin-top: 6px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: 12px; color: var(--sub); }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a.on { color: var(--brand); font-weight: 700; }
@media (min-width: 720px) {
  .tabbar { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; }
}
@media (max-width: 380px) {
  .pricebox { grid-template-columns: 1fr auto; }
  .pricebox div:first-child { grid-column: 1 / -1; }
}
