:root {
  color-scheme: light;
  --ink: #20201e;
  --muted: #787772;
  --faint: #a3a19b;
  --line: #e8e7e3;
  --soft: #f6f6f4;
  --paper: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  height: 72px;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -0.02em; }
.brand-mark { width: 28px; height: 28px; border-radius: 5px; display: grid; place-items: center; background: var(--ink); color: white; font-family: Georgia, serif; font-size: 18px; }
.currency-switch { display: grid; grid-template-columns: repeat(2, 1fr); padding: 3px; border: 1px solid #dcdbd7; border-radius: 6px; background: var(--soft); }
.currency-switch button { min-width: 52px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); padding: 6px 9px; font-size: 11px; }
.currency-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.09); font-weight: 650; }
.currency-switch button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

main { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.hero { padding: 38px 0 30px; max-width: 760px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .14em; margin-bottom: 16px; }
h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.08; letter-spacing: -.04em; font-weight: 550; margin: 0 0 16px; }
.hero p { color: var(--muted); max-width: 570px; font-size: 17px; line-height: 1.65; margin: 0; }

.search-panel { border: 1px solid var(--line); border-radius: 8px; background: #fafaf9; padding: 22px; }
.search-row { display: flex; align-items: flex-end; gap: 10px; }
.filters { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 1.1fr .95fr .8fr .9fr 1.5fr; gap: 12px; }
.filters label, .listing-type-filter, .price-options { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.filters label > span, .listing-type-filter > span, .price-options > span { font-size: 11px; color: var(--muted); }
select { width: 100%; appearance: none; border: 1px solid #dcdbd7; border-radius: 6px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23787772' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; color: var(--ink); padding: 12px 30px 12px 11px; font-size: 13px; text-overflow: ellipsis; }
select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.listing-type-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: 43px; padding: 3px; border: 1px solid #dcdbd7; border-radius: 6px; background: #efefec; }
.listing-type-switch button { min-width: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; }
.listing-type-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.09); font-weight: 600; }
.listing-type-switch button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.price-inputs { display: flex; align-items: center; gap: 6px; min-width: 0; }
.price-inputs label { flex: 1; }
.price-inputs > span { color: var(--muted); font-size: 12px; }
.price-inputs input { width: 100%; min-width: 0; height: 43px; border: 1px solid #dcdbd7; border-radius: 6px; background: var(--paper); color: var(--ink); padding: 10px 8px; font-size: 12px; }
.price-inputs input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.search-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.search-actions button { padding: 12px 16px; white-space: nowrap; }
.search-button { border: 1px solid var(--ink); border-radius: 6px; background: var(--ink); color: white; font-size: 13px; font-weight: 600; }
.search-button:hover { background: #3a3a37; }
.amenity-options { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.amenity-options > span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.amenity-checkboxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; }
.amenity-checkboxes label { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.amenity-checkboxes input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }

.listings-section { padding: 34px 0 80px; }
.results-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 22px; }
.results-summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.results-bar h2 { font-size: 15px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.results-range { font-size: 11px; color: var(--muted); }
.link-button { border: 0; background: none; padding: 0; font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--ink); }
.sync-status { font-size: 11px; color: var(--muted); text-align: right; }
.listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 22px; }
.listing-card { min-width: 0; }
.card-photo { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--soft); border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; }
.card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card-photo:hover img { transform: scale(1.025); }
.photo-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); }
.photo-placeholder svg { width: 38px; height: 38px; }
.card-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.card-badge { border-radius: 4px; padding: 5px 8px; background: rgba(255,255,255,.94); color: var(--ink); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.deal-badge { background: var(--ink); color: white; }
.card-body { padding: 14px 2px 0; }
.card-features { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 8px; }
.card-features span + span::before { content: "·"; margin-right: 10px; color: var(--faint); }
.card-kicker { color: var(--muted); font-size: 11px; margin-bottom: 7px; display: flex; gap: 6px; align-items: center; }
.card-kicker span + span::before { content: "·"; margin-right: 6px; }
.card-title { display: block; border: 0; background: transparent; padding: 0; text-align: left; font-size: 15px; font-weight: 550; line-height: 1.45; letter-spacing: -.012em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; }
.card-price { font-size: 14px; font-weight: 650; }
.card-price small { font-size: 11px; color: var(--muted); font-weight: 400; }
.card-date { color: var(--faint); font-size: 10px; white-space: nowrap; }

.skeleton-card { aspect-ratio: .89; border-radius: 8px; background: linear-gradient(100deg, var(--soft) 35%, #efefec 50%, var(--soft) 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.empty-state { text-align: center; padding: 70px 20px 40px; color: var(--muted); }
.empty-state svg { width: 42px; height: 42px; color: var(--faint); }
.empty-state h3 { color: var(--ink); font-size: 18px; font-weight: 550; margin: 18px 0 8px; }
.empty-state p { font-size: 13px; line-height: 1.6; margin: 0 auto 20px; max-width: 380px; }
.secondary-button { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 6px; padding: 9px 15px; font-size: 12px; }
.secondary-button:hover { background: var(--soft); }
.secondary-button:disabled { opacity: .35; cursor: default; background: var(--paper); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 46px; }
.pagination span { min-width: 100px; text-align: center; color: var(--muted); font-size: 12px; }
.pagination button { min-width: 92px; }

footer { max-width: 1240px; margin: 0 auto; border-top: 1px solid var(--line); padding: 28px; display: flex; gap: 50px; align-items: start; font-size: 11px; color: var(--muted); }
footer > span { color: var(--ink); font-weight: 650; white-space: nowrap; }
footer p { margin: 0; max-width: 530px; line-height: 1.6; }
footer .reddit-link { margin-left: auto; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
footer .reddit-link:hover { color: var(--ink); }

dialog { width: min(880px, calc(100vw - 40px)); max-height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: 12px; padding: 0; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px rgba(0,0,0,.18); overflow: auto; }
dialog::backdrop { background: rgba(25,25,23,.45); backdrop-filter: blur(2px); }
.dialog-close { position: absolute; z-index: 2; right: 16px; top: 16px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.95); border-radius: 50%; }
.dialog-close:hover { background: var(--soft); }
.dialog-close svg { width: 17px; height: 17px; }
.dialog-gallery { position: relative; aspect-ratio: 16 / 9; background: var(--soft); }
.dialog-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-button { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.94); font-size: 20px; line-height: 1; }
.gallery-button.previous { left: 14px; }
.gallery-button.next { right: 14px; }
.gallery-count { position: absolute; bottom: 12px; right: 14px; background: rgba(255,255,255,.94); border-radius: 4px; padding: 4px 7px; font-size: 10px; }
.dialog-body { padding: 30px 34px 36px; }
.dialog-kicker { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.dialog-body h2 { font-size: 26px; font-weight: 550; letter-spacing: -.025em; line-height: 1.3; margin: 0 0 14px; padding-right: 25px; }
.dialog-price { font-size: 19px; font-weight: 650; margin-bottom: 25px; }
.dialog-price small { font-size: 12px; color: var(--muted); font-weight: 400; }
.deal-explanation { display: flex; flex-direction: column; gap: 5px; border-left: 3px solid var(--ink); background: var(--soft); padding: 12px 14px; margin: -8px 0 20px; }
.deal-explanation strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.deal-explanation span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.marketplace-link, .share-link { display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; padding: 12px 17px; font-size: 13px; font-weight: 550; }
.marketplace-link { background: var(--ink); color: white; text-decoration: none; }
.marketplace-link:hover { background: #3a3a37; }
.marketplace-link svg, .share-link svg { width: 16px; height: 16px; }
.share-link { border: 1px solid #dcdbd7; background: var(--paper); color: var(--ink); }
.share-link:hover { background: var(--soft); }
.share-url-input { flex: 1 1 220px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--muted); padding: 11px 12px; font-size: 11px; }
.dialog-section { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; }
.dialog-section h3 { font-size: 13px; margin: 0 0 12px; font-weight: 650; }
.dialog-section p { color: #55544f; white-space: pre-line; font-size: 14px; line-height: 1.75; margin: 0; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 7px; margin-top: 26px; }
.fact { padding: 14px; border-right: 1px solid var(--line); }
.fact:nth-child(n+5) { border-top: 1px solid var(--line); }
.fact:nth-child(4n), .fact:last-child { border-right: 0; }
.fact span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.fact strong { font-size: 13px; font-weight: 550; }
.amenities { display: flex; flex-wrap: wrap; gap: 7px; }
.amenity { background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; font-size: 11px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 12px; }

@media (max-width: 900px) {
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-row { flex-direction: column; align-items: stretch; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .search-actions { justify-content: flex-end; }
  .amenity-checkboxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .site-header { height: 62px; padding: 0 18px; }
  main { padding: 0 18px; }
  .hero { padding: 30px 0 24px; }
  .hero p { font-size: 15px; }
  .eyebrow { font-size: 10px; }
  .search-panel { padding: 16px; }
  .filters { gap: 10px; }
  .search-actions button { flex: 1; min-width: 0; }
  .price-options { align-items: flex-start; flex-direction: column; gap: 10px; }
  .price-inputs { width: 100%; }
  .price-inputs label { flex: 1; min-width: 0; }
  .price-inputs input { width: 100%; min-width: 0; }
  .amenity-checkboxes { gap: 12px 8px; }
  .results-bar { align-items: start; }
  .sync-status { max-width: 130px; }
  .listing-grid { grid-template-columns: 1fr; gap: 30px; }
  .listings-section { padding-top: 26px; }
  footer { margin: 0 18px; padding: 24px 0; flex-direction: column; gap: 10px; }
  footer .reddit-link { margin-left: 0; }
  dialog { width: 100vw; max-width: none; max-height: 94dvh; margin: auto 0 0; border-radius: 12px 12px 0 0; }
  .dialog-gallery { aspect-ratio: 4 / 3; }
  .dialog-body { padding: 24px 20px 30px; }
  .dialog-body h2 { font-size: 22px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(even) { border-right: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
