:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #66707d;
  --line: #e3e7ec;
  --accent: #b4552d;
  --accent-ink: #fff;
  --ok: #2e7d4f;
  --warn: #b26a00;
  --chip: #eef1f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 4px 14px rgba(20, 30, 40, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 58px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1100;
}
.brand { font-size: 20px; font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.brand b { color: var(--accent); }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a { color: var(--muted); font-weight: 500; padding: 6px 2px; }
.topbar nav a.active { color: var(--ink); border-bottom: 2px solid var(--accent); }
.topbar nav a:hover { text-decoration: none; color: var(--ink); }

main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; min-height: 70vh; }

/* ---------- filters ---------- */
.filters {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end;
}
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
.filters input, .filters select {
  font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); min-width: 110px;
}
.filters input:focus, .filters select:focus { outline: 2px solid #d8b29e; border-color: var(--accent); }
.filters .grow { flex: 1 1 160px; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: none;
  background: var(--accent); color: var(--accent-ink);
  padding: 9px 18px; border-radius: 8px;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--chip); color: var(--ink); }

.class-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.class-tabs button {
  font: inherit; cursor: pointer; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 600;
}
.class-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.result-info { color: var(--muted); font-size: 14px; margin: 4px 2px 14px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(20,30,40,.12); }
.card .thumb {
  height: 150px; background: linear-gradient(135deg, #eceff3, #dde3ea);
  display: flex; align-items: center; justify-content: center; font-size: 44px;
  background-size: cover; background-position: center; position: relative;
}
.card .thumb .status {
  position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; color: #fff; background: var(--ok);
}
.card .thumb .status.upcoming { background: var(--warn); }
.card .thumb .status.finished { background: #8a8f98; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.35; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .loc { color: var(--muted); font-size: 13px; }
.card .price { font-size: 18px; font-weight: 700; margin-top: auto; }
.card .price small { color: var(--muted); font-weight: 400; font-size: 12px; }
.card .deadline { font-size: 12.5px; color: var(--muted); }
.card .deadline.soon { color: #b3261e; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { background: var(--chip); color: #4a5462; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; }
.chip.origin { background: #e7efe9; color: #245c3d; }

.pager { display: flex; gap: 8px; justify-content: center; margin: 26px 0 0; align-items: center; }
.pager span { color: var(--muted); font-size: 14px; }

/* ---------- lot detail ---------- */
.lot-view { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; }
.lot-view .back { display: inline-block; margin-bottom: 12px; color: var(--muted); }
.lot-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.lot-head h1 { font-size: 22px; margin: 0; flex: 1 1 320px; }
.lot-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; margin-top: 18px; }
@media (max-width: 900px) { .lot-grid { grid-template-columns: 1fr; } }

.gallery { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.gallery img { width: 160px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }

table.props { width: 100%; border-collapse: collapse; font-size: 14px; }
table.props th { text-align: left; color: var(--muted); font-weight: 500; padding: 7px 10px 7px 0;
  vertical-align: top; width: 42%; border-bottom: 1px solid var(--line); }
table.props td { padding: 7px 0; border-bottom: 1px solid var(--line); }

.panel { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 8px; font-size: 15px; }
.money-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.money-row b { font-size: 15px; }
.countdown { font-size: 13px; color: var(--warn); font-weight: 600; }

#map { height: 320px; border-radius: 10px; border: 1px solid var(--line); z-index: 1; }
.geo-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

.boe-link { display: inline-block; margin-top: 10px; font-weight: 600; }

/* ---------- faq ---------- */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 32px; max-width: 900px; margin: 0 auto; }
.prose h1 { font-size: 26px; margin-top: 0; }
.prose h2 { font-size: 19px; margin-top: 28px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.prose li { margin: 6px 0; }
.prose .warn-box { background: #fdf3e7; border: 1px solid #ecd3b3; border-radius: 10px; padding: 12px 16px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
.prose table th, .prose table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.prose table th { background: var(--chip); }

.footer { max-width: 1200px; margin: 0 auto; padding: 18px 24px 34px; color: var(--muted); font-size: 12.5px; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }
.spinner { text-align: center; color: var(--muted); padding: 60px 0; }

.lightbox { position: fixed; inset: 0; background: rgba(10,14,18,.85); display: flex;
  align-items: center; justify-content: center; z-index: 2000; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
