/* Theme follows the Hummingbird UI kit: Figtree, a cool gray scale, a clear blue primary,
   bordered cards with generous corners, pill badges, and a light and a dark mode. */

:root {
  --bg: #ffffff;
  --bg-subtle: #fbfcfe;
  --bg-muted: #eff2f8;
  --bg-highlight: #dfe4ed;
  --text: #1d2025;
  --text-strong: #07080a;
  --text-muted: #505763;
  --text-subtle: #6b7280;
  --border: #c9d0de;
  --border-muted: rgba(201, 208, 222, 0.7);
  --primary: #1e90ff;
  --primary-strong: #0074e6;
  --primary-hover: #0058ad;
  --on-primary: #ffffff;
  --primary-soft: #ebf5ff;
  --primary-soft-text: #0058ad;
  --success-soft: #dffef3;
  --success-text: #026a44;
  --danger: #ce2b3e;
  --danger-soft: #ffeef0;
  --danger-text: #9d202f;
  --warning-soft: #fff5e5;
  --warning-text: #9e6300;
  --photo: #dfe4ed;
  --backdrop: rgba(7, 8, 10, 0.55);
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --radius-card: 16px;
  --gutter: 24px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07080a;
  --bg-subtle: #111317;
  --bg-muted: #1d2025;
  --bg-highlight: #282c32;
  --text: #eff2f8;
  --text-strong: #ffffff;
  --text-muted: #a4abb9;
  --text-subtle: #8a92a0;
  --border: #282c32;
  --border-muted: rgba(80, 87, 99, 0.5);
  --primary: #4da7ff;
  --primary-strong: #4da7ff;
  --primary-hover: #7abeff;
  --on-primary: #000000;
  --primary-soft: rgba(77, 167, 255, 0.14);
  --primary-soft-text: #7abeff;
  --success-soft: rgba(38, 208, 146, 0.14);
  --success-text: #41ebae;
  --danger: #f56b79;
  --danger-soft: rgba(245, 107, 121, 0.14);
  --danger-text: #fc909a;
  --warning-soft: rgba(255, 183, 61, 0.14);
  --warning-text: #ffc86b;
  --photo: #1d2025;
  --backdrop: rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { color: var(--text-strong); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--primary-strong); }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
img { max-width: 100%; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-strong);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}
.brand:hover { color: var(--text-strong); }
.brand svg { width: 28px; height: 28px; flex: none; color: var(--primary); }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-button {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-strong);
  cursor: pointer;
}
.icon-button:hover { background: var(--bg-highlight); }
.icon-button svg { width: 20px; height: 20px; }
.icon-button .moon { display: none; }
:root[data-theme="dark"] .icon-button .sun { display: none; }
:root[data-theme="dark"] .icon-button .moon { display: block; }

/* ---- Buttons and badges ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.button:hover { background: var(--bg-muted); color: var(--text-strong); }
.button:disabled { opacity: 0.6; cursor: default; }
.button.primary { background: var(--primary-strong); border-color: transparent; color: var(--on-primary); }
.button.primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.button.large { min-height: 46px; padding: 10px 22px; font-size: 16px; }
.link-button {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--primary-strong);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.link-button:hover { color: var(--primary-hover); }
.link-button:disabled { color: var(--text-subtle); cursor: default; }
.badge, .tag, .clock {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}
.badge.primary, .tag.new {
  background: var(--primary-soft);
  color: var(--primary-soft-text);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}
.tag.buy-now, .tag.sold {
  background: var(--success-soft);
  color: var(--success-text);
  border-color: color-mix(in srgb, var(--success-text) 35%, transparent);
}
.tag.reserve, .tag.flag {
  background: var(--danger-soft);
  color: var(--danger-text);
  border-color: color-mix(in srgb, var(--danger-text) 35%, transparent);
}

/* ---- Dashboard layout ---- */
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--gutter);
  padding: var(--gutter) var(--gutter) 64px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 30px; }
.page-head p { color: var(--text-muted); font-size: 14px; margin-top: 4px; min-height: 21px; }

/* Filter rail */
.filters {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg);
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
.filters > summary {
  display: none;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
}
.filters-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.filters-head h2 { font-size: 18px; }
fieldset {
  border: 0;
  border-bottom: 1px solid var(--border-muted);
  margin: 0;
  padding: 14px 18px 16px;
  min-width: 0;
}
.filter-fields > fieldset:last-child { border-bottom: 0; }
legend, .field-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
  padding: 0;
  margin-bottom: 8px;
  display: block;
}
legend { float: left; width: 100%; }
legend + * { clear: both; }
input[type="text"], input[type="number"], input[type="search"], input[type="email"], input[type="password"], select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s;
}
input::placeholder { color: var(--text-subtle); }
input:hover, select:hover { border-color: var(--text-subtle); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary-strong); flex: none; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.range span { color: var(--text-muted); font-size: 14px; }
.checklist {
  max-height: 196px;
  overflow-y: auto;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  padding: 4px;
  margin-top: 8px;
}
.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.checklist label:hover { background: var(--bg-muted); }
.checklist .count { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices label { cursor: pointer; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s, border-color 0.15s;
}
.choices label:hover span { background: var(--bg-muted); }
.choices input:checked + span { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-primary); font-weight: 600; }
.choices input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.toggle { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 15px; }
.hint { color: var(--text-muted); font-size: 13px; margin: 8px 0 0; }

/* Results */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.toolbar .tally { font-size: 18px; font-weight: 600; color: var(--text-strong); margin-right: auto; }
.toolbar label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.toolbar select { width: auto; max-width: 100%; }

.lots { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lots.busy { opacity: 0.55; transition: opacity 0.12s; }
.lot {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg);
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 20px 12px 12px;
  transition: border-color 0.15s;
}
.lot:hover { border-color: var(--text-subtle); }
.lot img, .lot .no-photo {
  width: 148px;
  height: 104px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--photo);
  display: block;
}
.lot h3 { font-size: 17px; line-height: 1.3; margin-bottom: 2px; overflow-wrap: anywhere; }
.lot h3 a { color: inherit; text-decoration: none; }
.lot h3 a:hover { color: var(--primary-strong); }
.lot .where { color: var(--text-muted); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { white-space: normal; }
.view-details {
  margin-top: 10px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.view-details:hover { background: var(--bg-muted); }
.money { text-align: right; white-space: nowrap; }
.price { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.price small { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.price-note { display: block; color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.clock { margin-top: 8px; font-variant-numeric: tabular-nums; }
.clock.soon { background: var(--warning-soft); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning-text) 35%, transparent); }
.clock.ended { background: none; border-color: transparent; padding-right: 0; font-weight: 500; }
.ends-on { display: block; color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.empty, .problem {
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  max-width: 62ch;
}
.empty h3, .problem h3 { font-size: 18px; margin-bottom: 6px; }
.empty p, .problem p { color: var(--text-muted); margin-bottom: 16px; }
.more { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--text-muted); font-size: 14px; }

/* ---- Detail panel ---- */
dialog.detail {
  width: min(1000px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--text);
  background: var(--bg);
}
dialog.detail::backdrop { background: var(--backdrop); }
.detail-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px 14px;
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.detail-head h2 { font-size: 21px; overflow-wrap: anywhere; }
.detail-head p { margin-top: 3px; color: var(--text-muted); font-size: 14px; }
.detail-head .button { flex: none; }
.detail-body { padding: 18px 22px 24px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.gallery-main { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--photo); border-radius: 12px; display: block; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; }
.thumbs button { flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; overflow: hidden; }
.thumbs button[aria-current="true"] { border-color: var(--primary); }
.thumbs img { width: 72px; height: 54px; object-fit: cover; display: block; }
.photo-count { color: var(--text-muted); font-size: 13px; }
.detail-money { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 16px; }
.detail-money .clock { margin-top: 0; }
.detail-money .ends-on { margin-top: 0; }
.specs { margin: 0 0 16px; display: grid; grid-template-columns: auto 1fr; font-size: 15px; }
.specs dt, .specs dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--border-muted); }
.specs dt { color: var(--text-muted); padding-right: 18px; }
.specs dd { font-weight: 500; color: var(--text-strong); overflow-wrap: anywhere; }
.detail h3 { font-size: 15px; margin-bottom: 8px; }
.description { white-space: pre-line; max-width: 70ch; overflow-wrap: anywhere; color: var(--text); }
.detail-description { padding: 0 22px 26px; }
.detail-note { color: var(--text-muted); font-size: 14px; margin-bottom: 14px; }
.detail-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

/* Bid history: a step line, because a bid holds until the next one lands */
.history { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--border-muted); border-radius: 12px; background: var(--bg-subtle); }
.history svg { display: block; width: 100%; height: 72px; overflow: visible; }
.history .line { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.history .floor { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.history p { margin-top: 6px; color: var(--text-muted); font-size: 13px; }
.history .now { color: var(--text-strong); font-weight: 600; }

/* ---- Sign-in ---- */
.signin {
  max-width: 420px;
  margin: 56px auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg);
}
.signin-wrap { padding: 0 16px; }
.signin h2 { font-size: 24px; margin-bottom: 4px; }
.signin > p { color: var(--text-muted); margin-bottom: 18px; }
.signin label { display: block; font-weight: 600; font-size: 14px; color: var(--text-strong); margin: 14px 0 6px; }
.signin .button { width: 100%; margin-top: 20px; min-height: 44px; }
.signin .error { color: var(--danger-text); margin: 14px 0 0; }

/* ---- Homepage ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.hero { padding: 72px 0 56px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.02em; line-height: 1.08; margin: 18px 0 16px; text-wrap: balance; }
.hero .lead { font-size: 19px; color: var(--text-muted); max-width: 54ch; }
.hero .lead strong { color: var(--text-strong); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.sample { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-subtle); padding: 18px; }
.sample-label { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.sample .lot { grid-template-columns: 104px minmax(0, 1fr); padding: 12px; gap: 14px; }
.sample .lot:hover { border-color: var(--border); }
.sample .no-photo { width: 104px; height: 78px; display: grid; place-items: center; color: var(--text-subtle); }
.sample .no-photo svg { width: 44px; height: 44px; }
.sample .money { grid-column: 1 / -1; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sample .clock { margin-top: 0; }
.sample .history { margin: 12px 0 0; background: var(--bg); }
.sample .history h3 { font-size: 14px; margin-bottom: 8px; }
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section > h2 { font-size: 28px; letter-spacing: -0.01em; }
.section > .sub { color: var(--text-muted); margin-top: 6px; max-width: 62ch; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.card { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 22px; background: var(--bg); }
.card .glyph { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary-soft-text); margin-bottom: 14px; }
.card .glyph svg { width: 22px; height: 22px; }
.card h3 { font-size: 17px; margin-bottom: 6px; }
.card p { color: var(--text-muted); font-size: 15px; }
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 22px; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary-strong);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
}
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { color: var(--text-muted); font-size: 15px; }
.notice {
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  background: var(--primary-soft);
  border-radius: var(--radius-card);
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
}
.notice h2 { font-size: 26px; letter-spacing: -0.01em; }
.notice > div > p { color: var(--text); margin-top: 10px; }
.notice ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.notice li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--text); }
.notice li svg { width: 20px; height: 20px; margin-top: 2px; color: var(--primary-soft-text); }
.notice li strong { color: var(--text-strong); font-weight: 600; }
.footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--text-muted); font-size: 14px; }
.footer p + p { margin-top: 6px; }

/* ---- Tablet ---- */
@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .filters { position: static; max-height: none; overflow: visible; }
  .filters > summary { display: block; }
  .filters[open] > summary { border-bottom: 1px solid var(--border); }
  .filters-head h2 { display: none; }
  .filters-head { justify-content: flex-end; padding: 8px 18px; border-bottom: 1px solid var(--border-muted); }
  .filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-fields > #facetFilters { display: contents; }
  .filter-fields fieldset { border-bottom: 1px solid var(--border-muted); }
  .hero { grid-template-columns: 1fr; padding: 48px 0 40px; gap: 32px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice { grid-template-columns: 1fr; }
}

/* ---- Phone ---- */
@media (max-width: 639px) {
  :root { --gutter: 16px; }
  .topbar { padding: 10px var(--gutter); gap: 8px; }
  .brand { font-size: 16px; }
  .topbar .button { padding: 8px 12px; }
  .layout { padding-top: 16px; }
  .page-head h1 { font-size: 24px; }
  .filter-fields { grid-template-columns: 1fr; }
  .toolbar .tally { flex-basis: 100%; }
  .toolbar label { flex: 1 1 auto; }
  .toolbar label select { flex: 1; min-width: 0; }
  .lot { grid-template-columns: 104px minmax(0, 1fr); padding: 12px; gap: 12px 14px; align-items: start; }
  .lot img, .lot .no-photo { width: 104px; height: 78px; }
  .lot h3 { font-size: 16px; }
  .money { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
  .price { font-size: 24px; }
  .clock, .ends-on, .price-note { margin-top: 0; }
  .ends-on, .price-note { display: inline; }
  dialog.detail { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .detail-head { padding: 14px 16px 12px; }
  .detail-head h2 { font-size: 18px; }
  .detail-body { grid-template-columns: 1fr; padding: 16px; gap: 18px; }
  .detail-description { padding: 0 16px 24px; }
  .signin { margin: 32px auto; padding: 22px; }
  .hero { padding: 36px 0 32px; }
  .hero .lead { font-size: 17px; }
  .actions .button { flex: 1 1 100%; }
  .section { padding: 40px 0; }
  .section > h2, .notice h2 { font-size: 23px; }
  .cards, .steps { grid-template-columns: 1fr; }
  .notice { padding: 20px; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .steps { grid-template-columns: 1fr; }
  .detail-body { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
