:root {
  --ink: #1b1612;
  --muted: #6d645c;
  --paper: #f4efe8;
  --card: #fffdfb;
  --line: #e7dfd4;
  --accent: #ff4d1a;
  --good: #0c7a45;
  --danger: #b42318;
  --shadow: 0 12px 40px rgba(48, 28, 10, 0.08);
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
}
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.shell {
  width: min(480px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--card);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 253, 251, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.logo span { color: var(--accent); }
.pill, .button, .button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.pill {
  background: var(--ink);
  color: white;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
}
.button {
  width: 100%;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 17px;
  padding: 14px 18px;
  border-radius: 16px;
}
.button.secondary {
  background: var(--ink);
}
.button.danger { background: var(--danger); }
.button:disabled { opacity: 0.55; }

.pad { padding: 22px 18px 40px; }
.hero { padding: 28px 18px 8px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 13px;
}
h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.045em;
}
h2 { margin: 0 0 12px; font-size: 18px; }
.lede, .story, .hint, .heat, .muted { color: var(--muted); line-height: 1.5; }
.lede { font-size: 16px; }
.hero .button { margin-top: 8px; }

.section { padding: 8px 18px 18px; }
.list { display: grid; gap: 12px; }
.item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  background: white;
}
.item img, .ph {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--paper);
}
.item strong { display: block; margin: 4px 0; }
.item p { margin: 0; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 12px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex: 0 0 auto; text-decoration: none; white-space: nowrap; }
.filters .chip.on { background: var(--ink); color: white; border-color: var(--ink); }
.item-top, .timer-row, .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.badge.live { background: #ffe8e1; color: #c4320d; }
.empty, .foot { color: var(--muted); }
.foot { padding: 8px 18px 28px; font-size: 13px; line-height: 1.5; }
.pad > .foot, .auction-main > .foot { padding-left: 0; padding-right: 0; }
.foot p { margin: 0 0 6px; }
.foot .foot-lead { margin-bottom: 22px; }
.foot a, .policy a, .scenario a { font-weight: 700; }
.policy h1, .scenario h1 { font-size: 28px; margin-bottom: 8px; }
.policy h2 { margin-top: 22px; }
.policy ul, .policy p, .scenario p { line-height: 1.55; }
.policy li { margin: 0 0 8px; }
.reason, .steps {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
.reason p { margin: 0 0 8px; }
.reason p:last-child { margin: 0; }
.steps { list-style: none; display: grid; gap: 10px; padding: 12px 14px; }
.steps li { display: grid; gap: 2px; }
.steps b { font-size: 15px; }
.steps span { color: var(--muted); line-height: 1.45; }
.nowrap { white-space: nowrap; }

.form, .identity { display: grid; gap: 14px; }
.form label, .identity label, .copy {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 500;
}
textarea { resize: vertical; }
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
legend { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--ink); color: white; border-color: var(--ink); }
.photos input { margin-top: 6px; font-weight: 500; }
.previews { display: flex; gap: 8px; }
.previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.error { color: var(--danger); font-weight: 700; margin: 0; }
.banner {
  background: #ffe8e1;
  color: #9a2d0c;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
}
.hint { font-size: 13px; margin: 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.check input { width: auto; }

.gallery-wrap { position: relative; background: #111; }
.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: #111;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 42vh;
  object-fit: cover;
  object-position: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  cursor: zoom-in;
}
.viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
}
.viewer-strip {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.viewer-strip::-webkit-scrollbar { display: none; }
.viewer-strip img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}
.viewer-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 1;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  cursor: pointer;
}
.dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}
.dots button {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
}
.dots button.on { background: white; width: 16px; }

.auction-main { padding: 16px 18px var(--dock-space, 340px); }
.timer {
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 6px 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.price {
  margin: 8px 0;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.heat { margin: 0; }
.feed { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.feed li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: 12px;
  font-size: 15px;
}
.feed li.mine { outline: 2px solid var(--accent); }
.feed b { font-variant-numeric: tabular-nums; }
#result { margin-top: 18px; }
#result .button { margin-top: 8px; }

.dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  z-index: 6;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.identity { grid-template-columns: 1fr 1.2fr; gap: 8px; }
.dock .identity label { font-size: 12px; gap: 4px; }
.dock input { padding: 10px 12px; }
#bid-actions { display: grid; gap: 8px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick .button:only-child { grid-column: 1 / -1; }
.custom { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.custom .button { width: auto; padding-inline: 14px; }

.manage .cover { width: 100%; border-radius: 18px; aspect-ratio: 1; object-fit: cover; margin: 12px 0; }
.panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.panel ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.row { margin: 10px 0; }
.row .button { width: auto; flex: 1; }
.copy input { font-weight: 600; }
.qr {
  display: flex;
  justify-content: center;
  margin: 12px 0 4px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.qr svg { width: 180px; height: 180px; }
.panel > .button { margin-top: 4px; }
.panel .error { margin-top: 8px; }

[hidden] { display: none !important; }
