:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e4e0d6;
  --accent: #ffd400;
  --accent-ink: #16181d;
  --blue: #0b5cd5;
  --ok: #0f7b4f;
  --err: #b42318;
  --warn: #8a5a00;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; padding-top: 20px; padding-bottom: 48px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 28px 0 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.muted { color: var(--muted); }
.hide { display: none !important; }
.inline { display: inline; }

/* header */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 2px 7px; font-size: 15px; }
.search { flex: 1; display: flex; min-width: 200px; }
.search input { flex: 1; min-width: 0; border: 0; padding: 10px 12px; border-radius: 10px 0 0 10px; font: inherit; }
.search button { border: 0; background: #2a2e37; color: #fff; padding: 0 14px; border-radius: 0 10px 10px 0; font: inherit; cursor: pointer; }
.nav { display: flex; align-items: center; gap: 14px; }
.nav a, .nav .link { color: #fff; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* buttons */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.btn-lg { padding: 13px 20px; font-size: 17px; }
.btn-sm { padding: 5px 10px; font-size: 14px; }
.btn-block { display: block; width: 100%; }

/* flash */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; background: #e7f6ee; color: var(--ok); font-weight: 600; }
.flash-err { background: #fdecea; color: var(--err); }
.flash-warn { background: #fff4d6; color: var(--warn); }
.flash ul { margin: 0; padding-left: 18px; }

/* home */
.hero { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 32px 24px; margin-bottom: 20px; }
.hero h1 { font-size: 34px; margin-bottom: 6px; }
.hero p { margin: 0 0 18px; color: #c9cdd6; max-width: 46ch; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; background: var(--card); border: 1px solid var(--line); color: var(--ink); padding: 7px 13px; border-radius: 999px; font-size: 14px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 0 12px; }
.bar h2 { margin: 0; }
.bar small { color: var(--muted); font-weight: 400; }
.sorts { display: flex; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.sorts a { color: var(--muted); }
.sorts a.on { color: var(--ink); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; }
.card:hover { text-decoration: none; border-color: #c9c3b4; }
.card-img { aspect-ratio: 1 / 1; background: #ece9e1; display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { color: var(--muted); font-size: 14px; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 14px; line-height: 1.3; height: 2.6em; overflow: hidden; }
.card-price { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.card-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; color: var(--ink); }
.timer.soon { color: var(--err); font-weight: 700; }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px; }

/* lot */
.lot { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; }
.gallery-main { background: #ece9e1; border-radius: var(--radius); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumb { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 64px; height: 64px; flex: none; cursor: pointer; background: none; }
.thumb.on { border-color: var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pricebox { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.label { font-size: 13px; color: var(--muted); }
.price { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.pricemeta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 6px 0 12px; }
.leadnote { background: #e7f6ee; color: var(--ok); font-weight: 700; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.bidform label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.bidrow { display: flex; gap: 8px; }
.bidrow input { flex: 1; min-width: 0; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.note { background: #f1eee6; border-radius: 10px; padding: 10px 12px; font-size: 15px; margin: 10px 0; }
.seller { margin-top: 12px; font-size: 14px; color: var(--muted); }
.lot-desc, .lot-bids, .report { grid-column: 1 / -1; }
.lot-desc p { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.report summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.report form { margin-top: 10px; display: grid; gap: 8px; max-width: 480px; }

/* forms and tables */
input, select, textarea {
  font: inherit; color: inherit; background: #fff; border: 1px solid #cfcabd; border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #9cc2ff; outline-offset: 1px; }
input[type=checkbox] { width: auto; }
input[type=file] { padding: 8px; }
.formpage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 760px; margin: 0 auto; }
.formpage.narrow { max-width: 440px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tbl { border-collapse: collapse; width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tbl.wide { max-width: none; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.badge { background: var(--accent); padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* footer */
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }

@media (max-width: 760px) {
  h1 { font-size: 23px; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 26px; }
  .search { order: 3; flex-basis: 100%; }
  .nav { margin-left: auto; gap: 12px; font-size: 15px; }
  .nav .btn { padding: 7px 10px; }
  .lot { grid-template-columns: 1fr; gap: 16px; }
  .price { font-size: 30px; }
  .row2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .formpage { padding: 16px; }
  .tbl td { padding: 8px; font-size: 14px; }
}
